/*! For license information please see background.js.LICENSE.txt */
(() => {
  var __webpack_modules__ = {
    5307(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __webpack_unused_export__;
      __webpack_unused_export__ = validate10;
      const schema11 = {
        type: "object",
        required: [],
        additionalProperties: {
          type: "object",
          properties: {
            last_updated_at: {
              type: "number"
            }
          },
          required: [ "last_updated_at" ],
          additionalProperties: {
            type: "number",
            nullable: true
          },
          nullable: true
        }
      };
      function validate10(data, {instancePath = "", parentData, parentDataProperty, rootData = data} = {}) {
        let vErrors = null;
        let errors = 0;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          for (const key0 in data) {
            let data0 = data[key0];
            if (!(data0 && typeof data0 == "object" && !Array.isArray(data0)) && data0 !== null) {
              const err0 = {
                instancePath: instancePath + "/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"),
                schemaPath: "#/additionalProperties/type",
                keyword: "type",
                params: {
                  type: "object"
                },
                message: "must be object"
              };
              if (vErrors === null) {
                vErrors = [ err0 ];
              } else {
                vErrors.push(err0);
              }
              errors++;
            }
            if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
              if (data0.last_updated_at === undefined) {
                const err1 = {
                  instancePath: instancePath + "/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"),
                  schemaPath: "#/additionalProperties/required",
                  keyword: "required",
                  params: {
                    missingProperty: "last_updated_at"
                  },
                  message: "must have required property '" + "last_updated_at" + "'"
                };
                if (vErrors === null) {
                  vErrors = [ err1 ];
                } else {
                  vErrors.push(err1);
                }
                errors++;
              }
              for (const key1 in data0) {
                if (!(key1 === "last_updated_at")) {
                  let data1 = data0[key1];
                  if (!(typeof data1 == "number" && isFinite(data1)) && data1 !== null) {
                    const err2 = {
                      instancePath: instancePath + "/" + key0.replace(/~/g, "~0").replace(/\//g, "~1") + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
                      schemaPath: "#/additionalProperties/additionalProperties/type",
                      keyword: "type",
                      params: {
                        type: "number"
                      },
                      message: "must be number"
                    };
                    if (vErrors === null) {
                      vErrors = [ err2 ];
                    } else {
                      vErrors.push(err2);
                    }
                    errors++;
                  }
                }
              }
              if (data0.last_updated_at !== undefined) {
                let data2 = data0.last_updated_at;
                if (!(typeof data2 == "number" && isFinite(data2))) {
                  const err3 = {
                    instancePath: instancePath + "/" + key0.replace(/~/g, "~0").replace(/\//g, "~1") + "/last_updated_at",
                    schemaPath: "#/additionalProperties/properties/last_updated_at/type",
                    keyword: "type",
                    params: {
                      type: "number"
                    },
                    message: "must be number"
                  };
                  if (vErrors === null) {
                    vErrors = [ err3 ];
                  } else {
                    vErrors.push(err3);
                  }
                  errors++;
                }
              }
            }
          }
        } else {
          const err4 = {
            instancePath,
            schemaPath: "#/type",
            keyword: "type",
            params: {
              type: "object"
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err4 ];
          } else {
            vErrors.push(err4);
          }
          errors++;
        }
        validate10.errors = vErrors;
        return errors === 0;
      }
      __webpack_unused_export__ = validate11;
      const schema12 = {
        $schema: "http://json-schema.org/draft-07/schema#",
        $id: "https://uniswap.org/tokenlist.schema.json",
        title: "Uniswap Token List",
        description: "Schema for lists of tokens compatible with the Uniswap Interface",
        definitions: {
          Version: {
            type: "object",
            description: "The version of the list, used in change detection",
            examples: [ {
              major: 1,
              minor: 0,
              patch: 0
            } ],
            additionalProperties: false,
            properties: {
              major: {
                type: "integer",
                description: "The major version of the list. Must be incremented when tokens are removed from the list or token addresses are changed.",
                minimum: 0,
                examples: [ 1, 2 ]
              },
              minor: {
                type: "integer",
                description: "The minor version of the list. Must be incremented when tokens are added to the list.",
                minimum: 0,
                examples: [ 0, 1 ]
              },
              patch: {
                type: "integer",
                description: "The patch version of the list. Must be incremented for any changes to the list.",
                minimum: 0,
                examples: [ 0, 1 ]
              }
            },
            required: [ "major", "minor", "patch" ]
          },
          TagIdentifier: {
            type: "string",
            description: "The unique identifier of a tag",
            minLength: 1,
            maxLength: 10,
            pattern: "^[\\w]+$",
            examples: [ "compound", "stablecoin" ]
          },
          ExtensionIdentifier: {
            type: "string",
            description: "The name of a token extension property",
            minLength: 1,
            maxLength: 40,
            pattern: "^[\\w]+$",
            examples: [ "color", "is_fee_on_transfer", "aliases" ]
          },
          ExtensionMap: {
            type: "object",
            description: "An object containing any arbitrary or vendor-specific token metadata",
            maxProperties: 10,
            propertyNames: {
              $ref: "#/definitions/ExtensionIdentifier"
            },
            additionalProperties: {
              $ref: "#/definitions/ExtensionValue"
            },
            examples: [ {
              color: "#000000",
              is_verified_by_me: true
            }, {
              "x-bridged-addresses-by-chain": {
                1: {
                  bridgeAddress: "0x4200000000000000000000000000000000000010",
                  tokenAddress: "0x4200000000000000000000000000000000000010"
                }
              }
            } ]
          },
          ExtensionPrimitiveValue: {
            anyOf: [ {
              type: "string",
              minLength: 1,
              maxLength: 42,
              examples: [ "#00000" ]
            }, {
              type: "boolean",
              examples: [ true ]
            }, {
              type: "number",
              examples: [ 15 ]
            }, {
              type: "null"
            } ]
          },
          ExtensionValue: {
            anyOf: [ {
              $ref: "#/definitions/ExtensionPrimitiveValue"
            }, {
              type: "object",
              maxProperties: 10,
              propertyNames: {
                $ref: "#/definitions/ExtensionIdentifier"
              },
              additionalProperties: {
                $ref: "#/definitions/ExtensionValueInner0"
              }
            } ]
          },
          ExtensionValueInner0: {
            anyOf: [ {
              $ref: "#/definitions/ExtensionPrimitiveValue"
            }, {
              type: "object",
              maxProperties: 10,
              propertyNames: {
                $ref: "#/definitions/ExtensionIdentifier"
              },
              additionalProperties: {
                $ref: "#/definitions/ExtensionValueInner1"
              }
            } ]
          },
          ExtensionValueInner1: {
            anyOf: [ {
              $ref: "#/definitions/ExtensionPrimitiveValue"
            } ]
          },
          TagDefinition: {
            type: "object",
            description: "Definition of a tag that can be associated with a token via its identifier",
            additionalProperties: false,
            properties: {
              name: {
                type: "string",
                description: "The name of the tag",
                pattern: "^[ \\w]+$",
                minLength: 1,
                maxLength: 20
              },
              description: {
                type: "string",
                description: "A user-friendly description of the tag",
                pattern: "^[ \\w\\.,:]+$",
                minLength: 1,
                maxLength: 200
              }
            },
            required: [ "name", "description" ],
            examples: [ {
              name: "Stablecoin",
              description: "A token with value pegged to another asset"
            } ]
          },
          TokenInfo: {
            type: "object",
            description: "Metadata for a single token in a token list",
            additionalProperties: false,
            properties: {
              chainId: {
                type: "integer",
                description: "The chain ID of the Ethereum network where this token is deployed",
                minimum: 1,
                examples: [ 1, 42 ]
              },
              address: {
                type: "string",
                description: "The checksummed address of the token on the specified chain ID",
                pattern: "^0x[a-fA-F0-9]{40}$",
                examples: [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ]
              },
              decimals: {
                type: "integer",
                description: "The number of decimals for the token balance",
                minimum: 0,
                maximum: 255,
                examples: [ 18 ]
              },
              name: {
                type: "string",
                description: "The name of the token",
                minLength: 1,
                maxLength: 40,
                pattern: "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ:&\\[\\]\\(\\)]+$",
                examples: [ "USD Coin" ]
              },
              symbol: {
                type: "string",
                description: "The symbol for the token; must be alphanumeric",
                pattern: "^[a-zA-Z0-9+\\-%/$.]+$",
                minLength: 1,
                maxLength: 20,
                examples: [ "USDC" ]
              },
              logoURI: {
                type: "string",
                description: "A URI to the token logo asset; if not set, interface will attempt to find a logo based on the token address; suggest SVG or PNG of size 64x64",
                format: "uri",
                examples: [ "ipfs://QmXfzKRvjZz3u5JRgC4v5mGVbm9ahrUiB4DgzHBsnWbTMM" ]
              },
              tags: {
                type: "array",
                description: "An array of tag identifiers associated with the token; tags are defined at the list level",
                items: {
                  $ref: "#/definitions/TagIdentifier"
                },
                maxItems: 10,
                examples: [ "stablecoin", "compound" ]
              },
              extensions: {
                $ref: "#/definitions/ExtensionMap"
              }
            },
            required: [ "chainId", "address", "decimals", "name", "symbol" ]
          }
        },
        type: "object",
        additionalProperties: false,
        properties: {
          name: {
            type: "string",
            description: "The name of the token list",
            minLength: 1,
            maxLength: 30,
            pattern: "^[\\w ]+$",
            examples: [ "My Token List" ]
          },
          timestamp: {
            type: "string",
            format: "date-time",
            description: "The timestamp of this list version; i.e. when this immutable version of the list was created"
          },
          version: {
            $ref: "#/definitions/Version"
          },
          tokens: {
            type: "array",
            description: "The list of tokens included in the list",
            items: {
              $ref: "#/definitions/TokenInfo"
            },
            minItems: 1,
            maxItems: 1e4
          },
          keywords: {
            type: "array",
            description: "Keywords associated with the contents of the list; may be used in list discoverability",
            items: {
              type: "string",
              description: "A keyword to describe the contents of the list",
              minLength: 1,
              maxLength: 20,
              pattern: "^[\\w ]+$",
              examples: [ "compound", "lending", "personal tokens" ]
            },
            maxItems: 20,
            uniqueItems: true
          },
          tags: {
            type: "object",
            description: "A mapping of tag identifiers to their name and description",
            propertyNames: {
              $ref: "#/definitions/TagIdentifier"
            },
            additionalProperties: {
              $ref: "#/definitions/TagDefinition"
            },
            maxProperties: 20,
            examples: [ {
              stablecoin: {
                name: "Stablecoin",
                description: "A token with value pegged to another asset"
              }
            } ]
          },
          logoURI: {
            type: "string",
            description: "A URI for the logo of the token list; prefer SVG or PNG of size 256x256",
            format: "uri",
            examples: [ "ipfs://QmXfzKRvjZz3u5JRgC4v5mGVbm9ahrUiB4DgzHBsnWbTMM" ]
          }
        },
        required: [ "name", "timestamp", "version", "tokens" ]
      };
      const schema13 = {
        type: "object",
        description: "The version of the list, used in change detection",
        examples: [ {
          major: 1,
          minor: 0,
          patch: 0
        } ],
        additionalProperties: false,
        properties: {
          major: {
            type: "integer",
            description: "The major version of the list. Must be incremented when tokens are removed from the list or token addresses are changed.",
            minimum: 0,
            examples: [ 1, 2 ]
          },
          minor: {
            type: "integer",
            description: "The minor version of the list. Must be incremented when tokens are added to the list.",
            minimum: 0,
            examples: [ 0, 1 ]
          },
          patch: {
            type: "integer",
            description: "The patch version of the list. Must be incremented for any changes to the list.",
            minimum: 0,
            examples: [ 0, 1 ]
          }
        },
        required: [ "major", "minor", "patch" ]
      };
      const schema15 = {
        type: "string",
        description: "The unique identifier of a tag",
        minLength: 1,
        maxLength: 10,
        pattern: "^[\\w]+$",
        examples: [ "compound", "stablecoin" ]
      };
      const schema27 = {
        type: "object",
        description: "Definition of a tag that can be associated with a token via its identifier",
        additionalProperties: false,
        properties: {
          name: {
            type: "string",
            description: "The name of the tag",
            pattern: "^[ \\w]+$",
            minLength: 1,
            maxLength: 20
          },
          description: {
            type: "string",
            description: "A user-friendly description of the tag",
            pattern: "^[ \\w\\.,:]+$",
            minLength: 1,
            maxLength: 200
          }
        },
        required: [ "name", "description" ],
        examples: [ {
          name: "Stablecoin",
          description: "A token with value pegged to another asset"
        } ]
      };
      const func4 = __webpack_require__(3853).A;
      const pattern0 = new RegExp("^[\\w ]+$", "u");
      const pattern4 = new RegExp("^[\\w]+$", "u");
      const pattern10 = new RegExp("^[ \\w]+$", "u");
      const pattern11 = new RegExp("^[ \\w\\.,:]+$", "u");
      const schema14 = {
        type: "object",
        description: "Metadata for a single token in a token list",
        additionalProperties: false,
        properties: {
          chainId: {
            type: "integer",
            description: "The chain ID of the Ethereum network where this token is deployed",
            minimum: 1,
            examples: [ 1, 42 ]
          },
          address: {
            type: "string",
            description: "The checksummed address of the token on the specified chain ID",
            pattern: "^0x[a-fA-F0-9]{40}$",
            examples: [ "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ]
          },
          decimals: {
            type: "integer",
            description: "The number of decimals for the token balance",
            minimum: 0,
            maximum: 255,
            examples: [ 18 ]
          },
          name: {
            type: "string",
            description: "The name of the token",
            minLength: 1,
            maxLength: 40,
            pattern: "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ:&\\[\\]\\(\\)]+$",
            examples: [ "USD Coin" ]
          },
          symbol: {
            type: "string",
            description: "The symbol for the token; must be alphanumeric",
            pattern: "^[a-zA-Z0-9+\\-%/$.]+$",
            minLength: 1,
            maxLength: 20,
            examples: [ "USDC" ]
          },
          logoURI: {
            type: "string",
            description: "A URI to the token logo asset; if not set, interface will attempt to find a logo based on the token address; suggest SVG or PNG of size 64x64",
            format: "uri",
            examples: [ "ipfs://QmXfzKRvjZz3u5JRgC4v5mGVbm9ahrUiB4DgzHBsnWbTMM" ]
          },
          tags: {
            type: "array",
            description: "An array of tag identifiers associated with the token; tags are defined at the list level",
            items: {
              $ref: "#/definitions/TagIdentifier"
            },
            maxItems: 10,
            examples: [ "stablecoin", "compound" ]
          },
          extensions: {
            $ref: "#/definitions/ExtensionMap"
          }
        },
        required: [ "chainId", "address", "decimals", "name", "symbol" ]
      };
      const pattern1 = new RegExp("^0x[a-fA-F0-9]{40}$", "u");
      const pattern2 = new RegExp("^[ \\w.'+\\-%/À-ÖØ-öø-ÿ:&\\[\\]\\(\\)]+$", "u");
      const pattern3 = new RegExp("^[a-zA-Z0-9+\\-%/$.]+$", "u");
      const schema16 = {
        type: "object",
        description: "An object containing any arbitrary or vendor-specific token metadata",
        maxProperties: 10,
        propertyNames: {
          $ref: "#/definitions/ExtensionIdentifier"
        },
        additionalProperties: {
          $ref: "#/definitions/ExtensionValue"
        },
        examples: [ {
          color: "#000000",
          is_verified_by_me: true
        }, {
          "x-bridged-addresses-by-chain": {
            1: {
              bridgeAddress: "0x4200000000000000000000000000000000000010",
              tokenAddress: "0x4200000000000000000000000000000000000010"
            }
          }
        } ]
      };
      const schema17 = {
        type: "string",
        description: "The name of a token extension property",
        minLength: 1,
        maxLength: 40,
        pattern: "^[\\w]+$",
        examples: [ "color", "is_fee_on_transfer", "aliases" ]
      };
      const schema18 = {
        anyOf: [ {
          $ref: "#/definitions/ExtensionPrimitiveValue"
        }, {
          type: "object",
          maxProperties: 10,
          propertyNames: {
            $ref: "#/definitions/ExtensionIdentifier"
          },
          additionalProperties: {
            $ref: "#/definitions/ExtensionValueInner0"
          }
        } ]
      };
      const schema19 = {
        anyOf: [ {
          type: "string",
          minLength: 1,
          maxLength: 42,
          examples: [ "#00000" ]
        }, {
          type: "boolean",
          examples: [ true ]
        }, {
          type: "number",
          examples: [ 15 ]
        }, {
          type: "null"
        } ]
      };
      const schema21 = {
        anyOf: [ {
          $ref: "#/definitions/ExtensionPrimitiveValue"
        }, {
          type: "object",
          maxProperties: 10,
          propertyNames: {
            $ref: "#/definitions/ExtensionIdentifier"
          },
          additionalProperties: {
            $ref: "#/definitions/ExtensionValueInner1"
          }
        } ]
      };
      const schema24 = {
        anyOf: [ {
          $ref: "#/definitions/ExtensionPrimitiveValue"
        } ]
      };
      function validate16(data, {instancePath = "", parentData, parentDataProperty, rootData = data} = {}) {
        let vErrors = null;
        let errors = 0;
        const _errs0 = errors;
        let valid0 = false;
        const _errs1 = errors;
        const _errs3 = errors;
        let valid2 = false;
        const _errs4 = errors;
        if (typeof data === "string") {
          if (func4(data) > 42) {
            const err0 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/maxLength",
              keyword: "maxLength",
              params: {
                limit: 42
              },
              message: "must NOT have more than 42 characters"
            };
            if (vErrors === null) {
              vErrors = [ err0 ];
            } else {
              vErrors.push(err0);
            }
            errors++;
          }
          if (func4(data) < 1) {
            const err1 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/minLength",
              keyword: "minLength",
              params: {
                limit: 1
              },
              message: "must NOT have fewer than 1 characters"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
        } else {
          const err2 = {
            instancePath,
            schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/type",
            keyword: "type",
            params: {
              type: "string"
            },
            message: "must be string"
          };
          if (vErrors === null) {
            vErrors = [ err2 ];
          } else {
            vErrors.push(err2);
          }
          errors++;
        }
        var _valid1 = _errs4 === errors;
        valid2 = valid2 || _valid1;
        if (!valid2) {
          const _errs6 = errors;
          if (typeof data !== "boolean") {
            const err3 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/1/type",
              keyword: "type",
              params: {
                type: "boolean"
              },
              message: "must be boolean"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          var _valid1 = _errs6 === errors;
          valid2 = valid2 || _valid1;
          if (!valid2) {
            const _errs8 = errors;
            if (!(typeof data == "number" && isFinite(data))) {
              const err4 = {
                instancePath,
                schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/2/type",
                keyword: "type",
                params: {
                  type: "number"
                },
                message: "must be number"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
            var _valid1 = _errs8 === errors;
            valid2 = valid2 || _valid1;
            if (!valid2) {
              const _errs10 = errors;
              if (data !== null) {
                const err5 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/3/type",
                  keyword: "type",
                  params: {
                    type: "null"
                  },
                  message: "must be null"
                };
                if (vErrors === null) {
                  vErrors = [ err5 ];
                } else {
                  vErrors.push(err5);
                }
                errors++;
              }
              var _valid1 = _errs10 === errors;
              valid2 = valid2 || _valid1;
            }
          }
        }
        if (!valid2) {
          const err6 = {
            instancePath,
            schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf",
            keyword: "anyOf",
            params: {},
            message: "must match a schema in anyOf"
          };
          if (vErrors === null) {
            vErrors = [ err6 ];
          } else {
            vErrors.push(err6);
          }
          errors++;
        } else {
          errors = _errs3;
          if (vErrors !== null) {
            if (_errs3) {
              vErrors.length = _errs3;
            } else {
              vErrors = null;
            }
          }
        }
        var _valid0 = _errs1 === errors;
        valid0 = valid0 || _valid0;
        if (!valid0) {
          const err7 = {
            instancePath,
            schemaPath: "#/anyOf",
            keyword: "anyOf",
            params: {},
            message: "must match a schema in anyOf"
          };
          if (vErrors === null) {
            vErrors = [ err7 ];
          } else {
            vErrors.push(err7);
          }
          errors++;
        } else {
          errors = _errs0;
          if (vErrors !== null) {
            if (_errs0) {
              vErrors.length = _errs0;
            } else {
              vErrors = null;
            }
          }
        }
        validate16.errors = vErrors;
        return errors === 0;
      }
      function validate15(data, {instancePath = "", parentData, parentDataProperty, rootData = data} = {}) {
        let vErrors = null;
        let errors = 0;
        const _errs0 = errors;
        let valid0 = false;
        const _errs1 = errors;
        const _errs3 = errors;
        let valid2 = false;
        const _errs4 = errors;
        if (typeof data === "string") {
          if (func4(data) > 42) {
            const err0 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/maxLength",
              keyword: "maxLength",
              params: {
                limit: 42
              },
              message: "must NOT have more than 42 characters"
            };
            if (vErrors === null) {
              vErrors = [ err0 ];
            } else {
              vErrors.push(err0);
            }
            errors++;
          }
          if (func4(data) < 1) {
            const err1 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/minLength",
              keyword: "minLength",
              params: {
                limit: 1
              },
              message: "must NOT have fewer than 1 characters"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
        } else {
          const err2 = {
            instancePath,
            schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/type",
            keyword: "type",
            params: {
              type: "string"
            },
            message: "must be string"
          };
          if (vErrors === null) {
            vErrors = [ err2 ];
          } else {
            vErrors.push(err2);
          }
          errors++;
        }
        var _valid1 = _errs4 === errors;
        valid2 = valid2 || _valid1;
        if (!valid2) {
          const _errs6 = errors;
          if (typeof data !== "boolean") {
            const err3 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/1/type",
              keyword: "type",
              params: {
                type: "boolean"
              },
              message: "must be boolean"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          var _valid1 = _errs6 === errors;
          valid2 = valid2 || _valid1;
          if (!valid2) {
            const _errs8 = errors;
            if (!(typeof data == "number" && isFinite(data))) {
              const err4 = {
                instancePath,
                schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/2/type",
                keyword: "type",
                params: {
                  type: "number"
                },
                message: "must be number"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
            var _valid1 = _errs8 === errors;
            valid2 = valid2 || _valid1;
            if (!valid2) {
              const _errs10 = errors;
              if (data !== null) {
                const err5 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/3/type",
                  keyword: "type",
                  params: {
                    type: "null"
                  },
                  message: "must be null"
                };
                if (vErrors === null) {
                  vErrors = [ err5 ];
                } else {
                  vErrors.push(err5);
                }
                errors++;
              }
              var _valid1 = _errs10 === errors;
              valid2 = valid2 || _valid1;
            }
          }
        }
        if (!valid2) {
          const err6 = {
            instancePath,
            schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf",
            keyword: "anyOf",
            params: {},
            message: "must match a schema in anyOf"
          };
          if (vErrors === null) {
            vErrors = [ err6 ];
          } else {
            vErrors.push(err6);
          }
          errors++;
        } else {
          errors = _errs3;
          if (vErrors !== null) {
            if (_errs3) {
              vErrors.length = _errs3;
            } else {
              vErrors = null;
            }
          }
        }
        var _valid0 = _errs1 === errors;
        valid0 = valid0 || _valid0;
        if (!valid0) {
          const _errs12 = errors;
          if (data && typeof data == "object" && !Array.isArray(data)) {
            if (Object.keys(data).length > 10) {
              const err7 = {
                instancePath,
                schemaPath: "#/anyOf/1/maxProperties",
                keyword: "maxProperties",
                params: {
                  limit: 10
                },
                message: "must NOT have more than 10 items"
              };
              if (vErrors === null) {
                vErrors = [ err7 ];
              } else {
                vErrors.push(err7);
              }
              errors++;
            }
            for (const key0 in data) {
              const _errs14 = errors;
              if (typeof key0 === "string") {
                if (func4(key0) > 40) {
                  const err8 = {
                    instancePath,
                    schemaPath: "#/definitions/ExtensionIdentifier/maxLength",
                    keyword: "maxLength",
                    params: {
                      limit: 40
                    },
                    message: "must NOT have more than 40 characters",
                    propertyName: key0
                  };
                  if (vErrors === null) {
                    vErrors = [ err8 ];
                  } else {
                    vErrors.push(err8);
                  }
                  errors++;
                }
                if (func4(key0) < 1) {
                  const err9 = {
                    instancePath,
                    schemaPath: "#/definitions/ExtensionIdentifier/minLength",
                    keyword: "minLength",
                    params: {
                      limit: 1
                    },
                    message: "must NOT have fewer than 1 characters",
                    propertyName: key0
                  };
                  if (vErrors === null) {
                    vErrors = [ err9 ];
                  } else {
                    vErrors.push(err9);
                  }
                  errors++;
                }
                if (!pattern4.test(key0)) {
                  const err10 = {
                    instancePath,
                    schemaPath: "#/definitions/ExtensionIdentifier/pattern",
                    keyword: "pattern",
                    params: {
                      pattern: "^[\\w]+$"
                    },
                    message: 'must match pattern "' + "^[\\w]+$" + '"',
                    propertyName: key0
                  };
                  if (vErrors === null) {
                    vErrors = [ err10 ];
                  } else {
                    vErrors.push(err10);
                  }
                  errors++;
                }
              } else {
                const err11 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionIdentifier/type",
                  keyword: "type",
                  params: {
                    type: "string"
                  },
                  message: "must be string",
                  propertyName: key0
                };
                if (vErrors === null) {
                  vErrors = [ err11 ];
                } else {
                  vErrors.push(err11);
                }
                errors++;
              }
              var valid3 = _errs14 === errors;
              if (!valid3) {
                const err12 = {
                  instancePath,
                  schemaPath: "#/anyOf/1/propertyNames",
                  keyword: "propertyNames",
                  params: {
                    propertyName: key0
                  },
                  message: "property name must be valid"
                };
                if (vErrors === null) {
                  vErrors = [ err12 ];
                } else {
                  vErrors.push(err12);
                }
                errors++;
              }
            }
            for (const key1 in data) {
              if (!validate16(data[key1], {
                instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
                parentData: data,
                parentDataProperty: key1,
                rootData
              })) {
                vErrors = vErrors === null ? validate16.errors : vErrors.concat(validate16.errors);
                errors = vErrors.length;
              }
            }
          } else {
            const err13 = {
              instancePath,
              schemaPath: "#/anyOf/1/type",
              keyword: "type",
              params: {
                type: "object"
              },
              message: "must be object"
            };
            if (vErrors === null) {
              vErrors = [ err13 ];
            } else {
              vErrors.push(err13);
            }
            errors++;
          }
          var _valid0 = _errs12 === errors;
          valid0 = valid0 || _valid0;
        }
        if (!valid0) {
          const err14 = {
            instancePath,
            schemaPath: "#/anyOf",
            keyword: "anyOf",
            params: {},
            message: "must match a schema in anyOf"
          };
          if (vErrors === null) {
            vErrors = [ err14 ];
          } else {
            vErrors.push(err14);
          }
          errors++;
        } else {
          errors = _errs0;
          if (vErrors !== null) {
            if (_errs0) {
              vErrors.length = _errs0;
            } else {
              vErrors = null;
            }
          }
        }
        validate15.errors = vErrors;
        return errors === 0;
      }
      function validate14(data, {instancePath = "", parentData, parentDataProperty, rootData = data} = {}) {
        let vErrors = null;
        let errors = 0;
        const _errs0 = errors;
        let valid0 = false;
        const _errs1 = errors;
        const _errs3 = errors;
        let valid2 = false;
        const _errs4 = errors;
        if (typeof data === "string") {
          if (func4(data) > 42) {
            const err0 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/maxLength",
              keyword: "maxLength",
              params: {
                limit: 42
              },
              message: "must NOT have more than 42 characters"
            };
            if (vErrors === null) {
              vErrors = [ err0 ];
            } else {
              vErrors.push(err0);
            }
            errors++;
          }
          if (func4(data) < 1) {
            const err1 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/minLength",
              keyword: "minLength",
              params: {
                limit: 1
              },
              message: "must NOT have fewer than 1 characters"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
        } else {
          const err2 = {
            instancePath,
            schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/0/type",
            keyword: "type",
            params: {
              type: "string"
            },
            message: "must be string"
          };
          if (vErrors === null) {
            vErrors = [ err2 ];
          } else {
            vErrors.push(err2);
          }
          errors++;
        }
        var _valid1 = _errs4 === errors;
        valid2 = valid2 || _valid1;
        if (!valid2) {
          const _errs6 = errors;
          if (typeof data !== "boolean") {
            const err3 = {
              instancePath,
              schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/1/type",
              keyword: "type",
              params: {
                type: "boolean"
              },
              message: "must be boolean"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          var _valid1 = _errs6 === errors;
          valid2 = valid2 || _valid1;
          if (!valid2) {
            const _errs8 = errors;
            if (!(typeof data == "number" && isFinite(data))) {
              const err4 = {
                instancePath,
                schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/2/type",
                keyword: "type",
                params: {
                  type: "number"
                },
                message: "must be number"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
            var _valid1 = _errs8 === errors;
            valid2 = valid2 || _valid1;
            if (!valid2) {
              const _errs10 = errors;
              if (data !== null) {
                const err5 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf/3/type",
                  keyword: "type",
                  params: {
                    type: "null"
                  },
                  message: "must be null"
                };
                if (vErrors === null) {
                  vErrors = [ err5 ];
                } else {
                  vErrors.push(err5);
                }
                errors++;
              }
              var _valid1 = _errs10 === errors;
              valid2 = valid2 || _valid1;
            }
          }
        }
        if (!valid2) {
          const err6 = {
            instancePath,
            schemaPath: "#/definitions/ExtensionPrimitiveValue/anyOf",
            keyword: "anyOf",
            params: {},
            message: "must match a schema in anyOf"
          };
          if (vErrors === null) {
            vErrors = [ err6 ];
          } else {
            vErrors.push(err6);
          }
          errors++;
        } else {
          errors = _errs3;
          if (vErrors !== null) {
            if (_errs3) {
              vErrors.length = _errs3;
            } else {
              vErrors = null;
            }
          }
        }
        var _valid0 = _errs1 === errors;
        valid0 = valid0 || _valid0;
        if (!valid0) {
          const _errs12 = errors;
          if (data && typeof data == "object" && !Array.isArray(data)) {
            if (Object.keys(data).length > 10) {
              const err7 = {
                instancePath,
                schemaPath: "#/anyOf/1/maxProperties",
                keyword: "maxProperties",
                params: {
                  limit: 10
                },
                message: "must NOT have more than 10 items"
              };
              if (vErrors === null) {
                vErrors = [ err7 ];
              } else {
                vErrors.push(err7);
              }
              errors++;
            }
            for (const key0 in data) {
              const _errs14 = errors;
              if (typeof key0 === "string") {
                if (func4(key0) > 40) {
                  const err8 = {
                    instancePath,
                    schemaPath: "#/definitions/ExtensionIdentifier/maxLength",
                    keyword: "maxLength",
                    params: {
                      limit: 40
                    },
                    message: "must NOT have more than 40 characters",
                    propertyName: key0
                  };
                  if (vErrors === null) {
                    vErrors = [ err8 ];
                  } else {
                    vErrors.push(err8);
                  }
                  errors++;
                }
                if (func4(key0) < 1) {
                  const err9 = {
                    instancePath,
                    schemaPath: "#/definitions/ExtensionIdentifier/minLength",
                    keyword: "minLength",
                    params: {
                      limit: 1
                    },
                    message: "must NOT have fewer than 1 characters",
                    propertyName: key0
                  };
                  if (vErrors === null) {
                    vErrors = [ err9 ];
                  } else {
                    vErrors.push(err9);
                  }
                  errors++;
                }
                if (!pattern4.test(key0)) {
                  const err10 = {
                    instancePath,
                    schemaPath: "#/definitions/ExtensionIdentifier/pattern",
                    keyword: "pattern",
                    params: {
                      pattern: "^[\\w]+$"
                    },
                    message: 'must match pattern "' + "^[\\w]+$" + '"',
                    propertyName: key0
                  };
                  if (vErrors === null) {
                    vErrors = [ err10 ];
                  } else {
                    vErrors.push(err10);
                  }
                  errors++;
                }
              } else {
                const err11 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionIdentifier/type",
                  keyword: "type",
                  params: {
                    type: "string"
                  },
                  message: "must be string",
                  propertyName: key0
                };
                if (vErrors === null) {
                  vErrors = [ err11 ];
                } else {
                  vErrors.push(err11);
                }
                errors++;
              }
              var valid3 = _errs14 === errors;
              if (!valid3) {
                const err12 = {
                  instancePath,
                  schemaPath: "#/anyOf/1/propertyNames",
                  keyword: "propertyNames",
                  params: {
                    propertyName: key0
                  },
                  message: "property name must be valid"
                };
                if (vErrors === null) {
                  vErrors = [ err12 ];
                } else {
                  vErrors.push(err12);
                }
                errors++;
              }
            }
            for (const key1 in data) {
              if (!validate15(data[key1], {
                instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
                parentData: data,
                parentDataProperty: key1,
                rootData
              })) {
                vErrors = vErrors === null ? validate15.errors : vErrors.concat(validate15.errors);
                errors = vErrors.length;
              }
            }
          } else {
            const err13 = {
              instancePath,
              schemaPath: "#/anyOf/1/type",
              keyword: "type",
              params: {
                type: "object"
              },
              message: "must be object"
            };
            if (vErrors === null) {
              vErrors = [ err13 ];
            } else {
              vErrors.push(err13);
            }
            errors++;
          }
          var _valid0 = _errs12 === errors;
          valid0 = valid0 || _valid0;
        }
        if (!valid0) {
          const err14 = {
            instancePath,
            schemaPath: "#/anyOf",
            keyword: "anyOf",
            params: {},
            message: "must match a schema in anyOf"
          };
          if (vErrors === null) {
            vErrors = [ err14 ];
          } else {
            vErrors.push(err14);
          }
          errors++;
        } else {
          errors = _errs0;
          if (vErrors !== null) {
            if (_errs0) {
              vErrors.length = _errs0;
            } else {
              vErrors = null;
            }
          }
        }
        validate14.errors = vErrors;
        return errors === 0;
      }
      function validate13(data, {instancePath = "", parentData, parentDataProperty, rootData = data} = {}) {
        let vErrors = null;
        let errors = 0;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          if (Object.keys(data).length > 10) {
            const err0 = {
              instancePath,
              schemaPath: "#/maxProperties",
              keyword: "maxProperties",
              params: {
                limit: 10
              },
              message: "must NOT have more than 10 items"
            };
            if (vErrors === null) {
              vErrors = [ err0 ];
            } else {
              vErrors.push(err0);
            }
            errors++;
          }
          for (const key0 in data) {
            const _errs1 = errors;
            if (typeof key0 === "string") {
              if (func4(key0) > 40) {
                const err1 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionIdentifier/maxLength",
                  keyword: "maxLength",
                  params: {
                    limit: 40
                  },
                  message: "must NOT have more than 40 characters",
                  propertyName: key0
                };
                if (vErrors === null) {
                  vErrors = [ err1 ];
                } else {
                  vErrors.push(err1);
                }
                errors++;
              }
              if (func4(key0) < 1) {
                const err2 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionIdentifier/minLength",
                  keyword: "minLength",
                  params: {
                    limit: 1
                  },
                  message: "must NOT have fewer than 1 characters",
                  propertyName: key0
                };
                if (vErrors === null) {
                  vErrors = [ err2 ];
                } else {
                  vErrors.push(err2);
                }
                errors++;
              }
              if (!pattern4.test(key0)) {
                const err3 = {
                  instancePath,
                  schemaPath: "#/definitions/ExtensionIdentifier/pattern",
                  keyword: "pattern",
                  params: {
                    pattern: "^[\\w]+$"
                  },
                  message: 'must match pattern "' + "^[\\w]+$" + '"',
                  propertyName: key0
                };
                if (vErrors === null) {
                  vErrors = [ err3 ];
                } else {
                  vErrors.push(err3);
                }
                errors++;
              }
            } else {
              const err4 = {
                instancePath,
                schemaPath: "#/definitions/ExtensionIdentifier/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string",
                propertyName: key0
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
            var valid0 = _errs1 === errors;
            if (!valid0) {
              const err5 = {
                instancePath,
                schemaPath: "#/propertyNames",
                keyword: "propertyNames",
                params: {
                  propertyName: key0
                },
                message: "property name must be valid"
              };
              if (vErrors === null) {
                vErrors = [ err5 ];
              } else {
                vErrors.push(err5);
              }
              errors++;
            }
          }
          for (const key1 in data) {
            if (!validate14(data[key1], {
              instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
              parentData: data,
              parentDataProperty: key1,
              rootData
            })) {
              vErrors = vErrors === null ? validate14.errors : vErrors.concat(validate14.errors);
              errors = vErrors.length;
            }
          }
        } else {
          const err6 = {
            instancePath,
            schemaPath: "#/type",
            keyword: "type",
            params: {
              type: "object"
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err6 ];
          } else {
            vErrors.push(err6);
          }
          errors++;
        }
        validate13.errors = vErrors;
        return errors === 0;
      }
      function validate12(data, {instancePath = "", parentData, parentDataProperty, rootData = data} = {}) {
        let vErrors = null;
        let errors = 0;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          if (data.chainId === undefined) {
            const err0 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "chainId"
              },
              message: "must have required property '" + "chainId" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err0 ];
            } else {
              vErrors.push(err0);
            }
            errors++;
          }
          if (data.address === undefined) {
            const err1 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "address"
              },
              message: "must have required property '" + "address" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
          if (data.decimals === undefined) {
            const err2 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "decimals"
              },
              message: "must have required property '" + "decimals" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err2 ];
            } else {
              vErrors.push(err2);
            }
            errors++;
          }
          if (data.name === undefined) {
            const err3 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "name"
              },
              message: "must have required property '" + "name" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          if (data.symbol === undefined) {
            const err4 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "symbol"
              },
              message: "must have required property '" + "symbol" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err4 ];
            } else {
              vErrors.push(err4);
            }
            errors++;
          }
          for (const key0 in data) {
            if (!(key0 === "chainId" || key0 === "address" || key0 === "decimals" || key0 === "name" || key0 === "symbol" || key0 === "logoURI" || key0 === "tags" || key0 === "extensions")) {
              const err5 = {
                instancePath,
                schemaPath: "#/additionalProperties",
                keyword: "additionalProperties",
                params: {
                  additionalProperty: key0
                },
                message: "must NOT have additional properties"
              };
              if (vErrors === null) {
                vErrors = [ err5 ];
              } else {
                vErrors.push(err5);
              }
              errors++;
            }
          }
          if (data.chainId !== undefined) {
            let data0 = data.chainId;
            if (!(typeof data0 == "number" && (!(data0 % 1) && !isNaN(data0)) && isFinite(data0))) {
              const err6 = {
                instancePath: instancePath + "/chainId",
                schemaPath: "#/properties/chainId/type",
                keyword: "type",
                params: {
                  type: "integer"
                },
                message: "must be integer"
              };
              if (vErrors === null) {
                vErrors = [ err6 ];
              } else {
                vErrors.push(err6);
              }
              errors++;
            }
            if (typeof data0 == "number" && isFinite(data0)) {
              if (data0 < 1 || isNaN(data0)) {
                const err7 = {
                  instancePath: instancePath + "/chainId",
                  schemaPath: "#/properties/chainId/minimum",
                  keyword: "minimum",
                  params: {
                    comparison: ">=",
                    limit: 1
                  },
                  message: "must be >= 1"
                };
                if (vErrors === null) {
                  vErrors = [ err7 ];
                } else {
                  vErrors.push(err7);
                }
                errors++;
              }
            }
          }
          if (data.address !== undefined) {
            let data1 = data.address;
            if (typeof data1 === "string") {
              if (!pattern1.test(data1)) {
                const err8 = {
                  instancePath: instancePath + "/address",
                  schemaPath: "#/properties/address/pattern",
                  keyword: "pattern",
                  params: {
                    pattern: "^0x[a-fA-F0-9]{40}$"
                  },
                  message: 'must match pattern "' + "^0x[a-fA-F0-9]{40}$" + '"'
                };
                if (vErrors === null) {
                  vErrors = [ err8 ];
                } else {
                  vErrors.push(err8);
                }
                errors++;
              }
            } else {
              const err9 = {
                instancePath: instancePath + "/address",
                schemaPath: "#/properties/address/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err9 ];
              } else {
                vErrors.push(err9);
              }
              errors++;
            }
          }
          if (data.decimals !== undefined) {
            let data2 = data.decimals;
            if (!(typeof data2 == "number" && (!(data2 % 1) && !isNaN(data2)) && isFinite(data2))) {
              const err10 = {
                instancePath: instancePath + "/decimals",
                schemaPath: "#/properties/decimals/type",
                keyword: "type",
                params: {
                  type: "integer"
                },
                message: "must be integer"
              };
              if (vErrors === null) {
                vErrors = [ err10 ];
              } else {
                vErrors.push(err10);
              }
              errors++;
            }
            if (typeof data2 == "number" && isFinite(data2)) {
              if (data2 > 255 || isNaN(data2)) {
                const err11 = {
                  instancePath: instancePath + "/decimals",
                  schemaPath: "#/properties/decimals/maximum",
                  keyword: "maximum",
                  params: {
                    comparison: "<=",
                    limit: 255
                  },
                  message: "must be <= 255"
                };
                if (vErrors === null) {
                  vErrors = [ err11 ];
                } else {
                  vErrors.push(err11);
                }
                errors++;
              }
              if (data2 < 0 || isNaN(data2)) {
                const err12 = {
                  instancePath: instancePath + "/decimals",
                  schemaPath: "#/properties/decimals/minimum",
                  keyword: "minimum",
                  params: {
                    comparison: ">=",
                    limit: 0
                  },
                  message: "must be >= 0"
                };
                if (vErrors === null) {
                  vErrors = [ err12 ];
                } else {
                  vErrors.push(err12);
                }
                errors++;
              }
            }
          }
          if (data.name !== undefined) {
            let data3 = data.name;
            if (typeof data3 === "string") {
              if (func4(data3) > 40) {
                const err13 = {
                  instancePath: instancePath + "/name",
                  schemaPath: "#/properties/name/maxLength",
                  keyword: "maxLength",
                  params: {
                    limit: 40
                  },
                  message: "must NOT have more than 40 characters"
                };
                if (vErrors === null) {
                  vErrors = [ err13 ];
                } else {
                  vErrors.push(err13);
                }
                errors++;
              }
              if (func4(data3) < 1) {
                const err14 = {
                  instancePath: instancePath + "/name",
                  schemaPath: "#/properties/name/minLength",
                  keyword: "minLength",
                  params: {
                    limit: 1
                  },
                  message: "must NOT have fewer than 1 characters"
                };
                if (vErrors === null) {
                  vErrors = [ err14 ];
                } else {
                  vErrors.push(err14);
                }
                errors++;
              }
              if (!pattern2.test(data3)) {
                const err15 = {
                  instancePath: instancePath + "/name",
                  schemaPath: "#/properties/name/pattern",
                  keyword: "pattern",
                  params: {
                    pattern: "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ:&\\[\\]\\(\\)]+$"
                  },
                  message: 'must match pattern "' + "^[ \\w.'+\\-%/À-ÖØ-öø-ÿ:&\\[\\]\\(\\)]+$" + '"'
                };
                if (vErrors === null) {
                  vErrors = [ err15 ];
                } else {
                  vErrors.push(err15);
                }
                errors++;
              }
            } else {
              const err16 = {
                instancePath: instancePath + "/name",
                schemaPath: "#/properties/name/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err16 ];
              } else {
                vErrors.push(err16);
              }
              errors++;
            }
          }
          if (data.symbol !== undefined) {
            let data4 = data.symbol;
            if (typeof data4 === "string") {
              if (func4(data4) > 20) {
                const err17 = {
                  instancePath: instancePath + "/symbol",
                  schemaPath: "#/properties/symbol/maxLength",
                  keyword: "maxLength",
                  params: {
                    limit: 20
                  },
                  message: "must NOT have more than 20 characters"
                };
                if (vErrors === null) {
                  vErrors = [ err17 ];
                } else {
                  vErrors.push(err17);
                }
                errors++;
              }
              if (func4(data4) < 1) {
                const err18 = {
                  instancePath: instancePath + "/symbol",
                  schemaPath: "#/properties/symbol/minLength",
                  keyword: "minLength",
                  params: {
                    limit: 1
                  },
                  message: "must NOT have fewer than 1 characters"
                };
                if (vErrors === null) {
                  vErrors = [ err18 ];
                } else {
                  vErrors.push(err18);
                }
                errors++;
              }
              if (!pattern3.test(data4)) {
                const err19 = {
                  instancePath: instancePath + "/symbol",
                  schemaPath: "#/properties/symbol/pattern",
                  keyword: "pattern",
                  params: {
                    pattern: "^[a-zA-Z0-9+\\-%/$.]+$"
                  },
                  message: 'must match pattern "' + "^[a-zA-Z0-9+\\-%/$.]+$" + '"'
                };
                if (vErrors === null) {
                  vErrors = [ err19 ];
                } else {
                  vErrors.push(err19);
                }
                errors++;
              }
            } else {
              const err20 = {
                instancePath: instancePath + "/symbol",
                schemaPath: "#/properties/symbol/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err20 ];
              } else {
                vErrors.push(err20);
              }
              errors++;
            }
          }
          if (data.logoURI !== undefined) {
            if (!(typeof data.logoURI === "string")) {
              const err21 = {
                instancePath: instancePath + "/logoURI",
                schemaPath: "#/properties/logoURI/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err21 ];
              } else {
                vErrors.push(err21);
              }
              errors++;
            }
          }
          if (data.tags !== undefined) {
            let data6 = data.tags;
            if (Array.isArray(data6)) {
              if (data6.length > 10) {
                const err22 = {
                  instancePath: instancePath + "/tags",
                  schemaPath: "#/properties/tags/maxItems",
                  keyword: "maxItems",
                  params: {
                    limit: 10
                  },
                  message: "must NOT have more than 10 items"
                };
                if (vErrors === null) {
                  vErrors = [ err22 ];
                } else {
                  vErrors.push(err22);
                }
                errors++;
              }
              const len0 = data6.length;
              for (let i0 = 0; i0 < len0; i0++) {
                let data7 = data6[i0];
                if (typeof data7 === "string") {
                  if (func4(data7) > 10) {
                    const err23 = {
                      instancePath: instancePath + "/tags/" + i0,
                      schemaPath: "#/definitions/TagIdentifier/maxLength",
                      keyword: "maxLength",
                      params: {
                        limit: 10
                      },
                      message: "must NOT have more than 10 characters"
                    };
                    if (vErrors === null) {
                      vErrors = [ err23 ];
                    } else {
                      vErrors.push(err23);
                    }
                    errors++;
                  }
                  if (func4(data7) < 1) {
                    const err24 = {
                      instancePath: instancePath + "/tags/" + i0,
                      schemaPath: "#/definitions/TagIdentifier/minLength",
                      keyword: "minLength",
                      params: {
                        limit: 1
                      },
                      message: "must NOT have fewer than 1 characters"
                    };
                    if (vErrors === null) {
                      vErrors = [ err24 ];
                    } else {
                      vErrors.push(err24);
                    }
                    errors++;
                  }
                  if (!pattern4.test(data7)) {
                    const err25 = {
                      instancePath: instancePath + "/tags/" + i0,
                      schemaPath: "#/definitions/TagIdentifier/pattern",
                      keyword: "pattern",
                      params: {
                        pattern: "^[\\w]+$"
                      },
                      message: 'must match pattern "' + "^[\\w]+$" + '"'
                    };
                    if (vErrors === null) {
                      vErrors = [ err25 ];
                    } else {
                      vErrors.push(err25);
                    }
                    errors++;
                  }
                } else {
                  const err26 = {
                    instancePath: instancePath + "/tags/" + i0,
                    schemaPath: "#/definitions/TagIdentifier/type",
                    keyword: "type",
                    params: {
                      type: "string"
                    },
                    message: "must be string"
                  };
                  if (vErrors === null) {
                    vErrors = [ err26 ];
                  } else {
                    vErrors.push(err26);
                  }
                  errors++;
                }
              }
            } else {
              const err27 = {
                instancePath: instancePath + "/tags",
                schemaPath: "#/properties/tags/type",
                keyword: "type",
                params: {
                  type: "array"
                },
                message: "must be array"
              };
              if (vErrors === null) {
                vErrors = [ err27 ];
              } else {
                vErrors.push(err27);
              }
              errors++;
            }
          }
          if (data.extensions !== undefined) {
            if (!validate13(data.extensions, {
              instancePath: instancePath + "/extensions",
              parentData: data,
              parentDataProperty: "extensions",
              rootData
            })) {
              vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
              errors = vErrors.length;
            }
          }
        } else {
          const err28 = {
            instancePath,
            schemaPath: "#/type",
            keyword: "type",
            params: {
              type: "object"
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err28 ];
          } else {
            vErrors.push(err28);
          }
          errors++;
        }
        validate12.errors = vErrors;
        return errors === 0;
      }
      function validate11(data, {instancePath = "", parentData, parentDataProperty, rootData = data} = {}) {
        let vErrors = null;
        let errors = 0;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          if (data.name === undefined) {
            const err0 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "name"
              },
              message: "must have required property '" + "name" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err0 ];
            } else {
              vErrors.push(err0);
            }
            errors++;
          }
          if (data.timestamp === undefined) {
            const err1 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "timestamp"
              },
              message: "must have required property '" + "timestamp" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
          if (data.version === undefined) {
            const err2 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "version"
              },
              message: "must have required property '" + "version" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err2 ];
            } else {
              vErrors.push(err2);
            }
            errors++;
          }
          if (data.tokens === undefined) {
            const err3 = {
              instancePath,
              schemaPath: "#/required",
              keyword: "required",
              params: {
                missingProperty: "tokens"
              },
              message: "must have required property '" + "tokens" + "'"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          for (const key0 in data) {
            if (!(key0 === "name" || key0 === "timestamp" || key0 === "version" || key0 === "tokens" || key0 === "keywords" || key0 === "tags" || key0 === "logoURI")) {
              const err4 = {
                instancePath,
                schemaPath: "#/additionalProperties",
                keyword: "additionalProperties",
                params: {
                  additionalProperty: key0
                },
                message: "must NOT have additional properties"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
          }
          if (data.name !== undefined) {
            let data0 = data.name;
            if (typeof data0 === "string") {
              if (func4(data0) > 30) {
                const err5 = {
                  instancePath: instancePath + "/name",
                  schemaPath: "#/properties/name/maxLength",
                  keyword: "maxLength",
                  params: {
                    limit: 30
                  },
                  message: "must NOT have more than 30 characters"
                };
                if (vErrors === null) {
                  vErrors = [ err5 ];
                } else {
                  vErrors.push(err5);
                }
                errors++;
              }
              if (func4(data0) < 1) {
                const err6 = {
                  instancePath: instancePath + "/name",
                  schemaPath: "#/properties/name/minLength",
                  keyword: "minLength",
                  params: {
                    limit: 1
                  },
                  message: "must NOT have fewer than 1 characters"
                };
                if (vErrors === null) {
                  vErrors = [ err6 ];
                } else {
                  vErrors.push(err6);
                }
                errors++;
              }
              if (!pattern0.test(data0)) {
                const err7 = {
                  instancePath: instancePath + "/name",
                  schemaPath: "#/properties/name/pattern",
                  keyword: "pattern",
                  params: {
                    pattern: "^[\\w ]+$"
                  },
                  message: 'must match pattern "' + "^[\\w ]+$" + '"'
                };
                if (vErrors === null) {
                  vErrors = [ err7 ];
                } else {
                  vErrors.push(err7);
                }
                errors++;
              }
            } else {
              const err8 = {
                instancePath: instancePath + "/name",
                schemaPath: "#/properties/name/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err8 ];
              } else {
                vErrors.push(err8);
              }
              errors++;
            }
          }
          if (data.timestamp !== undefined) {
            if (!(typeof data.timestamp === "string")) {
              const err9 = {
                instancePath: instancePath + "/timestamp",
                schemaPath: "#/properties/timestamp/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err9 ];
              } else {
                vErrors.push(err9);
              }
              errors++;
            }
          }
          if (data.version !== undefined) {
            let data2 = data.version;
            if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
              if (data2.major === undefined) {
                const err10 = {
                  instancePath: instancePath + "/version",
                  schemaPath: "#/definitions/Version/required",
                  keyword: "required",
                  params: {
                    missingProperty: "major"
                  },
                  message: "must have required property '" + "major" + "'"
                };
                if (vErrors === null) {
                  vErrors = [ err10 ];
                } else {
                  vErrors.push(err10);
                }
                errors++;
              }
              if (data2.minor === undefined) {
                const err11 = {
                  instancePath: instancePath + "/version",
                  schemaPath: "#/definitions/Version/required",
                  keyword: "required",
                  params: {
                    missingProperty: "minor"
                  },
                  message: "must have required property '" + "minor" + "'"
                };
                if (vErrors === null) {
                  vErrors = [ err11 ];
                } else {
                  vErrors.push(err11);
                }
                errors++;
              }
              if (data2.patch === undefined) {
                const err12 = {
                  instancePath: instancePath + "/version",
                  schemaPath: "#/definitions/Version/required",
                  keyword: "required",
                  params: {
                    missingProperty: "patch"
                  },
                  message: "must have required property '" + "patch" + "'"
                };
                if (vErrors === null) {
                  vErrors = [ err12 ];
                } else {
                  vErrors.push(err12);
                }
                errors++;
              }
              for (const key1 in data2) {
                if (!(key1 === "major" || key1 === "minor" || key1 === "patch")) {
                  const err13 = {
                    instancePath: instancePath + "/version",
                    schemaPath: "#/definitions/Version/additionalProperties",
                    keyword: "additionalProperties",
                    params: {
                      additionalProperty: key1
                    },
                    message: "must NOT have additional properties"
                  };
                  if (vErrors === null) {
                    vErrors = [ err13 ];
                  } else {
                    vErrors.push(err13);
                  }
                  errors++;
                }
              }
              if (data2.major !== undefined) {
                let data3 = data2.major;
                if (!(typeof data3 == "number" && (!(data3 % 1) && !isNaN(data3)) && isFinite(data3))) {
                  const err14 = {
                    instancePath: instancePath + "/version/major",
                    schemaPath: "#/definitions/Version/properties/major/type",
                    keyword: "type",
                    params: {
                      type: "integer"
                    },
                    message: "must be integer"
                  };
                  if (vErrors === null) {
                    vErrors = [ err14 ];
                  } else {
                    vErrors.push(err14);
                  }
                  errors++;
                }
                if (typeof data3 == "number" && isFinite(data3)) {
                  if (data3 < 0 || isNaN(data3)) {
                    const err15 = {
                      instancePath: instancePath + "/version/major",
                      schemaPath: "#/definitions/Version/properties/major/minimum",
                      keyword: "minimum",
                      params: {
                        comparison: ">=",
                        limit: 0
                      },
                      message: "must be >= 0"
                    };
                    if (vErrors === null) {
                      vErrors = [ err15 ];
                    } else {
                      vErrors.push(err15);
                    }
                    errors++;
                  }
                }
              }
              if (data2.minor !== undefined) {
                let data4 = data2.minor;
                if (!(typeof data4 == "number" && (!(data4 % 1) && !isNaN(data4)) && isFinite(data4))) {
                  const err16 = {
                    instancePath: instancePath + "/version/minor",
                    schemaPath: "#/definitions/Version/properties/minor/type",
                    keyword: "type",
                    params: {
                      type: "integer"
                    },
                    message: "must be integer"
                  };
                  if (vErrors === null) {
                    vErrors = [ err16 ];
                  } else {
                    vErrors.push(err16);
                  }
                  errors++;
                }
                if (typeof data4 == "number" && isFinite(data4)) {
                  if (data4 < 0 || isNaN(data4)) {
                    const err17 = {
                      instancePath: instancePath + "/version/minor",
                      schemaPath: "#/definitions/Version/properties/minor/minimum",
                      keyword: "minimum",
                      params: {
                        comparison: ">=",
                        limit: 0
                      },
                      message: "must be >= 0"
                    };
                    if (vErrors === null) {
                      vErrors = [ err17 ];
                    } else {
                      vErrors.push(err17);
                    }
                    errors++;
                  }
                }
              }
              if (data2.patch !== undefined) {
                let data5 = data2.patch;
                if (!(typeof data5 == "number" && (!(data5 % 1) && !isNaN(data5)) && isFinite(data5))) {
                  const err18 = {
                    instancePath: instancePath + "/version/patch",
                    schemaPath: "#/definitions/Version/properties/patch/type",
                    keyword: "type",
                    params: {
                      type: "integer"
                    },
                    message: "must be integer"
                  };
                  if (vErrors === null) {
                    vErrors = [ err18 ];
                  } else {
                    vErrors.push(err18);
                  }
                  errors++;
                }
                if (typeof data5 == "number" && isFinite(data5)) {
                  if (data5 < 0 || isNaN(data5)) {
                    const err19 = {
                      instancePath: instancePath + "/version/patch",
                      schemaPath: "#/definitions/Version/properties/patch/minimum",
                      keyword: "minimum",
                      params: {
                        comparison: ">=",
                        limit: 0
                      },
                      message: "must be >= 0"
                    };
                    if (vErrors === null) {
                      vErrors = [ err19 ];
                    } else {
                      vErrors.push(err19);
                    }
                    errors++;
                  }
                }
              }
            } else {
              const err20 = {
                instancePath: instancePath + "/version",
                schemaPath: "#/definitions/Version/type",
                keyword: "type",
                params: {
                  type: "object"
                },
                message: "must be object"
              };
              if (vErrors === null) {
                vErrors = [ err20 ];
              } else {
                vErrors.push(err20);
              }
              errors++;
            }
          }
          if (data.tokens !== undefined) {
            let data6 = data.tokens;
            if (Array.isArray(data6)) {
              if (data6.length > 1e4) {
                const err21 = {
                  instancePath: instancePath + "/tokens",
                  schemaPath: "#/properties/tokens/maxItems",
                  keyword: "maxItems",
                  params: {
                    limit: 1e4
                  },
                  message: "must NOT have more than 10000 items"
                };
                if (vErrors === null) {
                  vErrors = [ err21 ];
                } else {
                  vErrors.push(err21);
                }
                errors++;
              }
              if (data6.length < 1) {
                const err22 = {
                  instancePath: instancePath + "/tokens",
                  schemaPath: "#/properties/tokens/minItems",
                  keyword: "minItems",
                  params: {
                    limit: 1
                  },
                  message: "must NOT have fewer than 1 items"
                };
                if (vErrors === null) {
                  vErrors = [ err22 ];
                } else {
                  vErrors.push(err22);
                }
                errors++;
              }
              const len0 = data6.length;
              for (let i0 = 0; i0 < len0; i0++) {
                if (!validate12(data6[i0], {
                  instancePath: instancePath + "/tokens/" + i0,
                  parentData: data6,
                  parentDataProperty: i0,
                  rootData
                })) {
                  vErrors = vErrors === null ? validate12.errors : vErrors.concat(validate12.errors);
                  errors = vErrors.length;
                }
              }
            } else {
              const err23 = {
                instancePath: instancePath + "/tokens",
                schemaPath: "#/properties/tokens/type",
                keyword: "type",
                params: {
                  type: "array"
                },
                message: "must be array"
              };
              if (vErrors === null) {
                vErrors = [ err23 ];
              } else {
                vErrors.push(err23);
              }
              errors++;
            }
          }
          if (data.keywords !== undefined) {
            let data8 = data.keywords;
            if (Array.isArray(data8)) {
              if (data8.length > 20) {
                const err24 = {
                  instancePath: instancePath + "/keywords",
                  schemaPath: "#/properties/keywords/maxItems",
                  keyword: "maxItems",
                  params: {
                    limit: 20
                  },
                  message: "must NOT have more than 20 items"
                };
                if (vErrors === null) {
                  vErrors = [ err24 ];
                } else {
                  vErrors.push(err24);
                }
                errors++;
              }
              const len1 = data8.length;
              for (let i1 = 0; i1 < len1; i1++) {
                let data9 = data8[i1];
                if (typeof data9 === "string") {
                  if (func4(data9) > 20) {
                    const err25 = {
                      instancePath: instancePath + "/keywords/" + i1,
                      schemaPath: "#/properties/keywords/items/maxLength",
                      keyword: "maxLength",
                      params: {
                        limit: 20
                      },
                      message: "must NOT have more than 20 characters"
                    };
                    if (vErrors === null) {
                      vErrors = [ err25 ];
                    } else {
                      vErrors.push(err25);
                    }
                    errors++;
                  }
                  if (func4(data9) < 1) {
                    const err26 = {
                      instancePath: instancePath + "/keywords/" + i1,
                      schemaPath: "#/properties/keywords/items/minLength",
                      keyword: "minLength",
                      params: {
                        limit: 1
                      },
                      message: "must NOT have fewer than 1 characters"
                    };
                    if (vErrors === null) {
                      vErrors = [ err26 ];
                    } else {
                      vErrors.push(err26);
                    }
                    errors++;
                  }
                  if (!pattern0.test(data9)) {
                    const err27 = {
                      instancePath: instancePath + "/keywords/" + i1,
                      schemaPath: "#/properties/keywords/items/pattern",
                      keyword: "pattern",
                      params: {
                        pattern: "^[\\w ]+$"
                      },
                      message: 'must match pattern "' + "^[\\w ]+$" + '"'
                    };
                    if (vErrors === null) {
                      vErrors = [ err27 ];
                    } else {
                      vErrors.push(err27);
                    }
                    errors++;
                  }
                } else {
                  const err28 = {
                    instancePath: instancePath + "/keywords/" + i1,
                    schemaPath: "#/properties/keywords/items/type",
                    keyword: "type",
                    params: {
                      type: "string"
                    },
                    message: "must be string"
                  };
                  if (vErrors === null) {
                    vErrors = [ err28 ];
                  } else {
                    vErrors.push(err28);
                  }
                  errors++;
                }
              }
              let i2 = data8.length;
              let j0;
              if (i2 > 1) {
                const indices0 = {};
                for (;i2--; ) {
                  let item0 = data8[i2];
                  if (typeof item0 !== "string") {
                    continue;
                  }
                  if (typeof indices0[item0] == "number") {
                    j0 = indices0[item0];
                    const err29 = {
                      instancePath: instancePath + "/keywords",
                      schemaPath: "#/properties/keywords/uniqueItems",
                      keyword: "uniqueItems",
                      params: {
                        i: i2,
                        j: j0
                      },
                      message: "must NOT have duplicate items (items ## " + j0 + " and " + i2 + " are identical)"
                    };
                    if (vErrors === null) {
                      vErrors = [ err29 ];
                    } else {
                      vErrors.push(err29);
                    }
                    errors++;
                    break;
                  }
                  indices0[item0] = i2;
                }
              }
            } else {
              const err30 = {
                instancePath: instancePath + "/keywords",
                schemaPath: "#/properties/keywords/type",
                keyword: "type",
                params: {
                  type: "array"
                },
                message: "must be array"
              };
              if (vErrors === null) {
                vErrors = [ err30 ];
              } else {
                vErrors.push(err30);
              }
              errors++;
            }
          }
          if (data.tags !== undefined) {
            let data10 = data.tags;
            if (data10 && typeof data10 == "object" && !Array.isArray(data10)) {
              if (Object.keys(data10).length > 20) {
                const err31 = {
                  instancePath: instancePath + "/tags",
                  schemaPath: "#/properties/tags/maxProperties",
                  keyword: "maxProperties",
                  params: {
                    limit: 20
                  },
                  message: "must NOT have more than 20 items"
                };
                if (vErrors === null) {
                  vErrors = [ err31 ];
                } else {
                  vErrors.push(err31);
                }
                errors++;
              }
              for (const key2 in data10) {
                const _errs25 = errors;
                if (typeof key2 === "string") {
                  if (func4(key2) > 10) {
                    const err32 = {
                      instancePath: instancePath + "/tags",
                      schemaPath: "#/definitions/TagIdentifier/maxLength",
                      keyword: "maxLength",
                      params: {
                        limit: 10
                      },
                      message: "must NOT have more than 10 characters",
                      propertyName: key2
                    };
                    if (vErrors === null) {
                      vErrors = [ err32 ];
                    } else {
                      vErrors.push(err32);
                    }
                    errors++;
                  }
                  if (func4(key2) < 1) {
                    const err33 = {
                      instancePath: instancePath + "/tags",
                      schemaPath: "#/definitions/TagIdentifier/minLength",
                      keyword: "minLength",
                      params: {
                        limit: 1
                      },
                      message: "must NOT have fewer than 1 characters",
                      propertyName: key2
                    };
                    if (vErrors === null) {
                      vErrors = [ err33 ];
                    } else {
                      vErrors.push(err33);
                    }
                    errors++;
                  }
                  if (!pattern4.test(key2)) {
                    const err34 = {
                      instancePath: instancePath + "/tags",
                      schemaPath: "#/definitions/TagIdentifier/pattern",
                      keyword: "pattern",
                      params: {
                        pattern: "^[\\w]+$"
                      },
                      message: 'must match pattern "' + "^[\\w]+$" + '"',
                      propertyName: key2
                    };
                    if (vErrors === null) {
                      vErrors = [ err34 ];
                    } else {
                      vErrors.push(err34);
                    }
                    errors++;
                  }
                } else {
                  const err35 = {
                    instancePath: instancePath + "/tags",
                    schemaPath: "#/definitions/TagIdentifier/type",
                    keyword: "type",
                    params: {
                      type: "string"
                    },
                    message: "must be string",
                    propertyName: key2
                  };
                  if (vErrors === null) {
                    vErrors = [ err35 ];
                  } else {
                    vErrors.push(err35);
                  }
                  errors++;
                }
                var valid8 = _errs25 === errors;
                if (!valid8) {
                  const err36 = {
                    instancePath: instancePath + "/tags",
                    schemaPath: "#/properties/tags/propertyNames",
                    keyword: "propertyNames",
                    params: {
                      propertyName: key2
                    },
                    message: "property name must be valid"
                  };
                  if (vErrors === null) {
                    vErrors = [ err36 ];
                  } else {
                    vErrors.push(err36);
                  }
                  errors++;
                }
              }
              for (const key3 in data10) {
                let data11 = data10[key3];
                if (data11 && typeof data11 == "object" && !Array.isArray(data11)) {
                  if (data11.name === undefined) {
                    const err37 = {
                      instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),
                      schemaPath: "#/definitions/TagDefinition/required",
                      keyword: "required",
                      params: {
                        missingProperty: "name"
                      },
                      message: "must have required property '" + "name" + "'"
                    };
                    if (vErrors === null) {
                      vErrors = [ err37 ];
                    } else {
                      vErrors.push(err37);
                    }
                    errors++;
                  }
                  if (data11.description === undefined) {
                    const err38 = {
                      instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),
                      schemaPath: "#/definitions/TagDefinition/required",
                      keyword: "required",
                      params: {
                        missingProperty: "description"
                      },
                      message: "must have required property '" + "description" + "'"
                    };
                    if (vErrors === null) {
                      vErrors = [ err38 ];
                    } else {
                      vErrors.push(err38);
                    }
                    errors++;
                  }
                  for (const key4 in data11) {
                    if (!(key4 === "name" || key4 === "description")) {
                      const err39 = {
                        instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),
                        schemaPath: "#/definitions/TagDefinition/additionalProperties",
                        keyword: "additionalProperties",
                        params: {
                          additionalProperty: key4
                        },
                        message: "must NOT have additional properties"
                      };
                      if (vErrors === null) {
                        vErrors = [ err39 ];
                      } else {
                        vErrors.push(err39);
                      }
                      errors++;
                    }
                  }
                  if (data11.name !== undefined) {
                    let data12 = data11.name;
                    if (typeof data12 === "string") {
                      if (func4(data12) > 20) {
                        const err40 = {
                          instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/name",
                          schemaPath: "#/definitions/TagDefinition/properties/name/maxLength",
                          keyword: "maxLength",
                          params: {
                            limit: 20
                          },
                          message: "must NOT have more than 20 characters"
                        };
                        if (vErrors === null) {
                          vErrors = [ err40 ];
                        } else {
                          vErrors.push(err40);
                        }
                        errors++;
                      }
                      if (func4(data12) < 1) {
                        const err41 = {
                          instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/name",
                          schemaPath: "#/definitions/TagDefinition/properties/name/minLength",
                          keyword: "minLength",
                          params: {
                            limit: 1
                          },
                          message: "must NOT have fewer than 1 characters"
                        };
                        if (vErrors === null) {
                          vErrors = [ err41 ];
                        } else {
                          vErrors.push(err41);
                        }
                        errors++;
                      }
                      if (!pattern10.test(data12)) {
                        const err42 = {
                          instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/name",
                          schemaPath: "#/definitions/TagDefinition/properties/name/pattern",
                          keyword: "pattern",
                          params: {
                            pattern: "^[ \\w]+$"
                          },
                          message: 'must match pattern "' + "^[ \\w]+$" + '"'
                        };
                        if (vErrors === null) {
                          vErrors = [ err42 ];
                        } else {
                          vErrors.push(err42);
                        }
                        errors++;
                      }
                    } else {
                      const err43 = {
                        instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/name",
                        schemaPath: "#/definitions/TagDefinition/properties/name/type",
                        keyword: "type",
                        params: {
                          type: "string"
                        },
                        message: "must be string"
                      };
                      if (vErrors === null) {
                        vErrors = [ err43 ];
                      } else {
                        vErrors.push(err43);
                      }
                      errors++;
                    }
                  }
                  if (data11.description !== undefined) {
                    let data13 = data11.description;
                    if (typeof data13 === "string") {
                      if (func4(data13) > 200) {
                        const err44 = {
                          instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/description",
                          schemaPath: "#/definitions/TagDefinition/properties/description/maxLength",
                          keyword: "maxLength",
                          params: {
                            limit: 200
                          },
                          message: "must NOT have more than 200 characters"
                        };
                        if (vErrors === null) {
                          vErrors = [ err44 ];
                        } else {
                          vErrors.push(err44);
                        }
                        errors++;
                      }
                      if (func4(data13) < 1) {
                        const err45 = {
                          instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/description",
                          schemaPath: "#/definitions/TagDefinition/properties/description/minLength",
                          keyword: "minLength",
                          params: {
                            limit: 1
                          },
                          message: "must NOT have fewer than 1 characters"
                        };
                        if (vErrors === null) {
                          vErrors = [ err45 ];
                        } else {
                          vErrors.push(err45);
                        }
                        errors++;
                      }
                      if (!pattern11.test(data13)) {
                        const err46 = {
                          instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/description",
                          schemaPath: "#/definitions/TagDefinition/properties/description/pattern",
                          keyword: "pattern",
                          params: {
                            pattern: "^[ \\w\\.,:]+$"
                          },
                          message: 'must match pattern "' + "^[ \\w\\.,:]+$" + '"'
                        };
                        if (vErrors === null) {
                          vErrors = [ err46 ];
                        } else {
                          vErrors.push(err46);
                        }
                        errors++;
                      }
                    } else {
                      const err47 = {
                        instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1") + "/description",
                        schemaPath: "#/definitions/TagDefinition/properties/description/type",
                        keyword: "type",
                        params: {
                          type: "string"
                        },
                        message: "must be string"
                      };
                      if (vErrors === null) {
                        vErrors = [ err47 ];
                      } else {
                        vErrors.push(err47);
                      }
                      errors++;
                    }
                  }
                } else {
                  const err48 = {
                    instancePath: instancePath + "/tags/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),
                    schemaPath: "#/definitions/TagDefinition/type",
                    keyword: "type",
                    params: {
                      type: "object"
                    },
                    message: "must be object"
                  };
                  if (vErrors === null) {
                    vErrors = [ err48 ];
                  } else {
                    vErrors.push(err48);
                  }
                  errors++;
                }
              }
            } else {
              const err49 = {
                instancePath: instancePath + "/tags",
                schemaPath: "#/properties/tags/type",
                keyword: "type",
                params: {
                  type: "object"
                },
                message: "must be object"
              };
              if (vErrors === null) {
                vErrors = [ err49 ];
              } else {
                vErrors.push(err49);
              }
              errors++;
            }
          }
          if (data.logoURI !== undefined) {
            if (!(typeof data.logoURI === "string")) {
              const err50 = {
                instancePath: instancePath + "/logoURI",
                schemaPath: "#/properties/logoURI/type",
                keyword: "type",
                params: {
                  type: "string"
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err50 ];
              } else {
                vErrors.push(err50);
              }
              errors++;
            }
          }
        } else {
          const err51 = {
            instancePath,
            schemaPath: "#/type",
            keyword: "type",
            params: {
              type: "object"
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err51 ];
          } else {
            vErrors.push(err51);
          }
          errors++;
        }
        validate11.errors = vErrors;
        return errors === 0;
      }
    },
    1415(__unused_webpack_module, exports) {
      "use strict";
      var __webpack_unused_export__;
      exports.QJ = validate57;
      var schema29 = {
        optionalProperties: {
          name: {
            type: "string"
          },
          description: {
            type: "string"
          },
          image: {
            type: "string"
          },
          title: {
            type: "string"
          },
          external_url: {
            type: "string"
          }
        },
        additionalProperties: true
      };
      function validate57(data, valCxt) {
        "use strict";
        if (valCxt) {
          var instancePath = valCxt.instancePath;
          var parentData = valCxt.parentData;
          var parentDataProperty = valCxt.parentDataProperty;
          var rootData = valCxt.rootData;
        } else {
          var instancePath = "";
          var parentData = undefined;
          var parentDataProperty = undefined;
          var rootData = data;
        }
        var vErrors = null;
        var errors = 0;
        var valid0 = false;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          valid0 = true;
          if (data.name !== undefined) {
            if (!(typeof data.name == "string")) {
              var err0 = {
                instancePath: instancePath + "/name",
                schemaPath: "/optionalProperties/name/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err0 ];
              } else {
                vErrors.push(err0);
              }
              errors++;
            }
          }
          if (data.description !== undefined) {
            if (!(typeof data.description == "string")) {
              var err1 = {
                instancePath: instancePath + "/description",
                schemaPath: "/optionalProperties/description/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err1 ];
              } else {
                vErrors.push(err1);
              }
              errors++;
            }
          }
          if (data.image !== undefined) {
            if (!(typeof data.image == "string")) {
              var err2 = {
                instancePath: instancePath + "/image",
                schemaPath: "/optionalProperties/image/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err2 ];
              } else {
                vErrors.push(err2);
              }
              errors++;
            }
          }
          if (data.title !== undefined) {
            if (!(typeof data.title == "string")) {
              var err3 = {
                instancePath: instancePath + "/title",
                schemaPath: "/optionalProperties/title/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err3 ];
              } else {
                vErrors.push(err3);
              }
              errors++;
            }
          }
          if (data.external_url !== undefined) {
            if (!(typeof data.external_url == "string")) {
              var err4 = {
                instancePath: instancePath + "/external_url",
                schemaPath: "/optionalProperties/external_url/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
          }
        }
        if (!valid0) {
          var err5 = {
            instancePath,
            schemaPath: "/optionalProperties",
            keyword: "optionalProperties",
            params: {
              type: "object",
              nullable: false
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err5 ];
          } else {
            vErrors.push(err5);
          }
          errors++;
        }
        validate57.errors = vErrors;
        return errors === 0;
      }
      __webpack_unused_export__ = validate58;
      var schema30 = {
        properties: {
          transfers: {
            elements: {
              properties: {
                asset: {
                  type: "string",
                  nullable: true
                },
                hash: {
                  type: "string"
                },
                blockNum: {
                  type: "string"
                },
                category: {
                  enum: [ "token", "internal", "external", "erc20", "erc1155" ]
                },
                from: {
                  type: "string",
                  nullable: true
                },
                to: {
                  type: "string",
                  nullable: true
                },
                erc721TokenId: {
                  type: "string",
                  nullable: true
                }
              },
              optionalProperties: {
                rawContract: {
                  properties: {
                    address: {
                      type: "string",
                      nullable: true
                    },
                    decimal: {
                      type: "string",
                      nullable: true
                    },
                    value: {
                      type: "string",
                      nullable: true
                    }
                  }
                }
              },
              additionalProperties: true
            }
          }
        },
        additionalProperties: true
      };
      function validate58(data, valCxt) {
        "use strict";
        if (valCxt) {
          var instancePath = valCxt.instancePath;
          var parentData = valCxt.parentData;
          var parentDataProperty = valCxt.parentDataProperty;
          var rootData = valCxt.rootData;
        } else {
          var instancePath = "";
          var parentData = undefined;
          var parentDataProperty = undefined;
          var rootData = data;
        }
        var vErrors = null;
        var errors = 0;
        var valid0 = false;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          valid0 = true;
          if (data.transfers !== undefined) {
            var data0 = data.transfers;
            var valid2 = false;
            if (!valid2) {
              if (Array.isArray(data0)) {
                var valid4 = true;
                var len0 = data0.length;
                for (var i0 = 0; i0 < len0; i0++) {
                  var data1 = data0[i0];
                  var _errs1 = errors;
                  var valid5 = false;
                  if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
                    valid5 = true;
                    if (data1.asset !== undefined) {
                      var data2 = data1.asset;
                      if (!(data2 === null || typeof data2 == "string")) {
                        var err0 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/asset",
                          schemaPath: "/properties/transfers/elements/properties/asset/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: true
                          },
                          message: "must be string or null"
                        };
                        if (vErrors === null) {
                          vErrors = [ err0 ];
                        } else {
                          vErrors.push(err0);
                        }
                        errors++;
                      }
                    } else {
                      var err1 = {
                        instancePath: instancePath + "/transfers/" + i0,
                        schemaPath: "/properties/transfers/elements/properties/asset",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "asset"
                        },
                        message: "must have property 'asset'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err1 ];
                      } else {
                        vErrors.push(err1);
                      }
                      errors++;
                    }
                    if (data1.hash !== undefined) {
                      if (!(typeof data1.hash == "string")) {
                        var err2 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/hash",
                          schemaPath: "/properties/transfers/elements/properties/hash/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: false
                          },
                          message: "must be string"
                        };
                        if (vErrors === null) {
                          vErrors = [ err2 ];
                        } else {
                          vErrors.push(err2);
                        }
                        errors++;
                      }
                    } else {
                      var err3 = {
                        instancePath: instancePath + "/transfers/" + i0,
                        schemaPath: "/properties/transfers/elements/properties/hash",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "hash"
                        },
                        message: "must have property 'hash'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err3 ];
                      } else {
                        vErrors.push(err3);
                      }
                      errors++;
                    }
                    if (data1.blockNum !== undefined) {
                      if (!(typeof data1.blockNum == "string")) {
                        var err4 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/blockNum",
                          schemaPath: "/properties/transfers/elements/properties/blockNum/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: false
                          },
                          message: "must be string"
                        };
                        if (vErrors === null) {
                          vErrors = [ err4 ];
                        } else {
                          vErrors.push(err4);
                        }
                        errors++;
                      }
                    } else {
                      var err5 = {
                        instancePath: instancePath + "/transfers/" + i0,
                        schemaPath: "/properties/transfers/elements/properties/blockNum",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "blockNum"
                        },
                        message: "must have property 'blockNum'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err5 ];
                      } else {
                        vErrors.push(err5);
                      }
                      errors++;
                    }
                    if (data1.category !== undefined) {
                      var data5 = data1.category;
                      if (!(typeof data5 == "string" && (data5 === "token" || data5 === "internal" || data5 === "external" || data5 === "erc20" || data5 === "erc1155"))) {
                        var err6 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/category",
                          schemaPath: "/properties/transfers/elements/properties/category/enum",
                          keyword: "enum",
                          params: {
                            allowedValues: schema30.properties.transfers.elements.properties.category.enum
                          },
                          message: "must be equal to one of the allowed values"
                        };
                        if (vErrors === null) {
                          vErrors = [ err6 ];
                        } else {
                          vErrors.push(err6);
                        }
                        errors++;
                      }
                    } else {
                      var err7 = {
                        instancePath: instancePath + "/transfers/" + i0,
                        schemaPath: "/properties/transfers/elements/properties/category",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "category"
                        },
                        message: "must have property 'category'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err7 ];
                      } else {
                        vErrors.push(err7);
                      }
                      errors++;
                    }
                    if (data1.from !== undefined) {
                      var data6 = data1.from;
                      if (!(data6 === null || typeof data6 == "string")) {
                        var err8 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/from",
                          schemaPath: "/properties/transfers/elements/properties/from/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: true
                          },
                          message: "must be string or null"
                        };
                        if (vErrors === null) {
                          vErrors = [ err8 ];
                        } else {
                          vErrors.push(err8);
                        }
                        errors++;
                      }
                    } else {
                      var err9 = {
                        instancePath: instancePath + "/transfers/" + i0,
                        schemaPath: "/properties/transfers/elements/properties/from",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "from"
                        },
                        message: "must have property 'from'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err9 ];
                      } else {
                        vErrors.push(err9);
                      }
                      errors++;
                    }
                    if (data1.to !== undefined) {
                      var data7 = data1.to;
                      if (!(data7 === null || typeof data7 == "string")) {
                        var err10 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/to",
                          schemaPath: "/properties/transfers/elements/properties/to/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: true
                          },
                          message: "must be string or null"
                        };
                        if (vErrors === null) {
                          vErrors = [ err10 ];
                        } else {
                          vErrors.push(err10);
                        }
                        errors++;
                      }
                    } else {
                      var err11 = {
                        instancePath: instancePath + "/transfers/" + i0,
                        schemaPath: "/properties/transfers/elements/properties/to",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "to"
                        },
                        message: "must have property 'to'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err11 ];
                      } else {
                        vErrors.push(err11);
                      }
                      errors++;
                    }
                    if (data1.erc721TokenId !== undefined) {
                      var data8 = data1.erc721TokenId;
                      if (!(data8 === null || typeof data8 == "string")) {
                        var err12 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/erc721TokenId",
                          schemaPath: "/properties/transfers/elements/properties/erc721TokenId/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: true
                          },
                          message: "must be string or null"
                        };
                        if (vErrors === null) {
                          vErrors = [ err12 ];
                        } else {
                          vErrors.push(err12);
                        }
                        errors++;
                      }
                    } else {
                      var err13 = {
                        instancePath: instancePath + "/transfers/" + i0,
                        schemaPath: "/properties/transfers/elements/properties/erc721TokenId",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "erc721TokenId"
                        },
                        message: "must have property 'erc721TokenId'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err13 ];
                      } else {
                        vErrors.push(err13);
                      }
                      errors++;
                    }
                    if (data1.rawContract !== undefined) {
                      var data9 = data1.rawContract;
                      var valid8 = false;
                      if (data9 && typeof data9 == "object" && !Array.isArray(data9)) {
                        valid8 = true;
                        if (data9.address !== undefined) {
                          var data10 = data9.address;
                          if (!(data10 === null || typeof data10 == "string")) {
                            var err14 = {
                              instancePath: instancePath + "/transfers/" + i0 + "/rawContract/address",
                              schemaPath: "/properties/transfers/elements/optionalProperties/rawContract/properties/address/type",
                              keyword: "type",
                              params: {
                                type: "string",
                                nullable: true
                              },
                              message: "must be string or null"
                            };
                            if (vErrors === null) {
                              vErrors = [ err14 ];
                            } else {
                              vErrors.push(err14);
                            }
                            errors++;
                          }
                        } else {
                          var err15 = {
                            instancePath: instancePath + "/transfers/" + i0 + "/rawContract",
                            schemaPath: "/properties/transfers/elements/optionalProperties/rawContract/properties/address",
                            keyword: "properties",
                            params: {
                              error: "missing",
                              missingProperty: "address"
                            },
                            message: "must have property 'address'"
                          };
                          if (vErrors === null) {
                            vErrors = [ err15 ];
                          } else {
                            vErrors.push(err15);
                          }
                          errors++;
                        }
                        if (data9.decimal !== undefined) {
                          var data11 = data9.decimal;
                          if (!(data11 === null || typeof data11 == "string")) {
                            var err16 = {
                              instancePath: instancePath + "/transfers/" + i0 + "/rawContract/decimal",
                              schemaPath: "/properties/transfers/elements/optionalProperties/rawContract/properties/decimal/type",
                              keyword: "type",
                              params: {
                                type: "string",
                                nullable: true
                              },
                              message: "must be string or null"
                            };
                            if (vErrors === null) {
                              vErrors = [ err16 ];
                            } else {
                              vErrors.push(err16);
                            }
                            errors++;
                          }
                        } else {
                          var err17 = {
                            instancePath: instancePath + "/transfers/" + i0 + "/rawContract",
                            schemaPath: "/properties/transfers/elements/optionalProperties/rawContract/properties/decimal",
                            keyword: "properties",
                            params: {
                              error: "missing",
                              missingProperty: "decimal"
                            },
                            message: "must have property 'decimal'"
                          };
                          if (vErrors === null) {
                            vErrors = [ err17 ];
                          } else {
                            vErrors.push(err17);
                          }
                          errors++;
                        }
                        if (data9.value !== undefined) {
                          var data12 = data9.value;
                          if (!(data12 === null || typeof data12 == "string")) {
                            var err18 = {
                              instancePath: instancePath + "/transfers/" + i0 + "/rawContract/value",
                              schemaPath: "/properties/transfers/elements/optionalProperties/rawContract/properties/value/type",
                              keyword: "type",
                              params: {
                                type: "string",
                                nullable: true
                              },
                              message: "must be string or null"
                            };
                            if (vErrors === null) {
                              vErrors = [ err18 ];
                            } else {
                              vErrors.push(err18);
                            }
                            errors++;
                          }
                        } else {
                          var err19 = {
                            instancePath: instancePath + "/transfers/" + i0 + "/rawContract",
                            schemaPath: "/properties/transfers/elements/optionalProperties/rawContract/properties/value",
                            keyword: "properties",
                            params: {
                              error: "missing",
                              missingProperty: "value"
                            },
                            message: "must have property 'value'"
                          };
                          if (vErrors === null) {
                            vErrors = [ err19 ];
                          } else {
                            vErrors.push(err19);
                          }
                          errors++;
                        }
                        for (var key0 in data9) {
                          if (key0 !== "address" && key0 !== "decimal" && key0 !== "value") {
                            var err20 = {
                              instancePath: instancePath + "/transfers/" + i0 + "/rawContract/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"),
                              schemaPath: "/properties/transfers/elements/optionalProperties/rawContract",
                              keyword: "properties",
                              params: {
                                error: "additional",
                                additionalProperty: key0
                              },
                              message: "must NOT have additional properties"
                            };
                            if (vErrors === null) {
                              vErrors = [ err20 ];
                            } else {
                              vErrors.push(err20);
                            }
                            errors++;
                          }
                        }
                      }
                      if (!valid8) {
                        var err21 = {
                          instancePath: instancePath + "/transfers/" + i0 + "/rawContract",
                          schemaPath: "/properties/transfers/elements/optionalProperties/rawContract/properties",
                          keyword: "properties",
                          params: {
                            type: "object",
                            nullable: false
                          },
                          message: "must be object"
                        };
                        if (vErrors === null) {
                          vErrors = [ err21 ];
                        } else {
                          vErrors.push(err21);
                        }
                        errors++;
                      }
                    }
                  }
                  if (!valid5) {
                    var err22 = {
                      instancePath: instancePath + "/transfers/" + i0,
                      schemaPath: "/properties/transfers/elements/properties",
                      keyword: "properties",
                      params: {
                        type: "object",
                        nullable: false
                      },
                      message: "must be object"
                    };
                    if (vErrors === null) {
                      vErrors = [ err22 ];
                    } else {
                      vErrors.push(err22);
                    }
                    errors++;
                  }
                  var valid3 = _errs1 === errors;
                  if (!valid3) {
                    valid4 = false;
                  }
                }
                valid2 = valid4;
              } else {
                var err23 = {
                  instancePath: instancePath + "/transfers",
                  schemaPath: "/properties/transfers/elements",
                  keyword: "elements",
                  params: {
                    type: "array",
                    nullable: false
                  },
                  message: "must be array"
                };
                if (vErrors === null) {
                  vErrors = [ err23 ];
                } else {
                  vErrors.push(err23);
                }
                errors++;
              }
            }
          } else {
            var err24 = {
              instancePath,
              schemaPath: "/properties/transfers",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "transfers"
              },
              message: "must have property 'transfers'"
            };
            if (vErrors === null) {
              vErrors = [ err24 ];
            } else {
              vErrors.push(err24);
            }
            errors++;
          }
        }
        if (!valid0) {
          var err25 = {
            instancePath,
            schemaPath: "/properties",
            keyword: "properties",
            params: {
              type: "object",
              nullable: false
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err25 ];
          } else {
            vErrors.push(err25);
          }
          errors++;
        }
        validate58.errors = vErrors;
        return errors === 0;
      }
      __webpack_unused_export__ = validate59;
      var schema31 = {
        properties: {
          address: {
            type: "string"
          },
          tokenBalances: {
            elements: {
              properties: {
                contractAddress: {
                  type: "string"
                },
                error: {}
              },
              optionalProperties: {
                tokenBalance: {
                  type: "string",
                  nullable: true
                }
              }
            }
          }
        },
        optionalProperties: {
          pageKey: {
            type: "string"
          }
        },
        additionalProperties: false
      };
      function validate59(data, valCxt) {
        "use strict";
        if (valCxt) {
          var instancePath = valCxt.instancePath;
          var parentData = valCxt.parentData;
          var parentDataProperty = valCxt.parentDataProperty;
          var rootData = valCxt.rootData;
        } else {
          var instancePath = "";
          var parentData = undefined;
          var parentDataProperty = undefined;
          var rootData = data;
        }
        var vErrors = null;
        var errors = 0;
        var valid0 = false;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          valid0 = true;
          if (data.address !== undefined) {
            if (!(typeof data.address == "string")) {
              var err0 = {
                instancePath: instancePath + "/address",
                schemaPath: "/properties/address/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err0 ];
              } else {
                vErrors.push(err0);
              }
              errors++;
            }
          } else {
            var err1 = {
              instancePath,
              schemaPath: "/properties/address",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "address"
              },
              message: "must have property 'address'"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
          if (data.tokenBalances !== undefined) {
            var data1 = data.tokenBalances;
            var valid2 = false;
            if (!valid2) {
              if (Array.isArray(data1)) {
                var valid4 = true;
                var len0 = data1.length;
                for (var i0 = 0; i0 < len0; i0++) {
                  var data2 = data1[i0];
                  var _errs2 = errors;
                  var valid5 = false;
                  if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
                    valid5 = true;
                    if (data2.contractAddress !== undefined) {
                      if (!(typeof data2.contractAddress == "string")) {
                        var err2 = {
                          instancePath: instancePath + "/tokenBalances/" + i0 + "/contractAddress",
                          schemaPath: "/properties/tokenBalances/elements/properties/contractAddress/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: false
                          },
                          message: "must be string"
                        };
                        if (vErrors === null) {
                          vErrors = [ err2 ];
                        } else {
                          vErrors.push(err2);
                        }
                        errors++;
                      }
                    } else {
                      var err3 = {
                        instancePath: instancePath + "/tokenBalances/" + i0,
                        schemaPath: "/properties/tokenBalances/elements/properties/contractAddress",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "contractAddress"
                        },
                        message: "must have property 'contractAddress'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err3 ];
                      } else {
                        vErrors.push(err3);
                      }
                      errors++;
                    }
                    if (data2.tokenBalance !== undefined) {
                      var data4 = data2.tokenBalance;
                      if (!(data4 === null || typeof data4 == "string")) {
                        var err4 = {
                          instancePath: instancePath + "/tokenBalances/" + i0 + "/tokenBalance",
                          schemaPath: "/properties/tokenBalances/elements/optionalProperties/tokenBalance/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: true
                          },
                          message: "must be string or null"
                        };
                        if (vErrors === null) {
                          vErrors = [ err4 ];
                        } else {
                          vErrors.push(err4);
                        }
                        errors++;
                      }
                    }
                    for (var key0 in data2) {
                      if (key0 !== "contractAddress" && key0 !== "error" && key0 !== "tokenBalance") {
                        var err5 = {
                          instancePath: instancePath + "/tokenBalances/" + i0 + "/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"),
                          schemaPath: "/properties/tokenBalances/elements",
                          keyword: "properties",
                          params: {
                            error: "additional",
                            additionalProperty: key0
                          },
                          message: "must NOT have additional properties"
                        };
                        if (vErrors === null) {
                          vErrors = [ err5 ];
                        } else {
                          vErrors.push(err5);
                        }
                        errors++;
                      }
                    }
                  }
                  if (!valid5) {
                    var err6 = {
                      instancePath: instancePath + "/tokenBalances/" + i0,
                      schemaPath: "/properties/tokenBalances/elements/properties",
                      keyword: "properties",
                      params: {
                        type: "object",
                        nullable: false
                      },
                      message: "must be object"
                    };
                    if (vErrors === null) {
                      vErrors = [ err6 ];
                    } else {
                      vErrors.push(err6);
                    }
                    errors++;
                  }
                  var valid3 = _errs2 === errors;
                  if (!valid3) {
                    valid4 = false;
                  }
                }
                valid2 = valid4;
              } else {
                var err7 = {
                  instancePath: instancePath + "/tokenBalances",
                  schemaPath: "/properties/tokenBalances/elements",
                  keyword: "elements",
                  params: {
                    type: "array",
                    nullable: false
                  },
                  message: "must be array"
                };
                if (vErrors === null) {
                  vErrors = [ err7 ];
                } else {
                  vErrors.push(err7);
                }
                errors++;
              }
            }
          } else {
            var err8 = {
              instancePath,
              schemaPath: "/properties/tokenBalances",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "tokenBalances"
              },
              message: "must have property 'tokenBalances'"
            };
            if (vErrors === null) {
              vErrors = [ err8 ];
            } else {
              vErrors.push(err8);
            }
            errors++;
          }
          if (data.pageKey !== undefined) {
            if (!(typeof data.pageKey == "string")) {
              var err9 = {
                instancePath: instancePath + "/pageKey",
                schemaPath: "/optionalProperties/pageKey/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err9 ];
              } else {
                vErrors.push(err9);
              }
              errors++;
            }
          }
          for (var key1 in data) {
            if (key1 !== "address" && key1 !== "tokenBalances" && key1 !== "pageKey") {
              var err10 = {
                instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"),
                schemaPath: "",
                keyword: "properties",
                params: {
                  error: "additional",
                  additionalProperty: key1
                },
                message: "must NOT have additional properties"
              };
              if (vErrors === null) {
                vErrors = [ err10 ];
              } else {
                vErrors.push(err10);
              }
              errors++;
            }
          }
        }
        if (!valid0) {
          var err11 = {
            instancePath,
            schemaPath: "/properties",
            keyword: "properties",
            params: {
              type: "object",
              nullable: false
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err11 ];
          } else {
            vErrors.push(err11);
          }
          errors++;
        }
        validate59.errors = vErrors;
        return errors === 0;
      }
      __webpack_unused_export__ = validate60;
      var schema32 = {
        properties: {
          decimals: {
            type: "uint32",
            nullable: true
          },
          name: {
            type: "string"
          },
          symbol: {
            type: "string"
          },
          logo: {
            type: "string",
            nullable: true
          }
        },
        additionalProperties: false
      };
      function validate60(data, valCxt) {
        "use strict";
        if (valCxt) {
          var instancePath = valCxt.instancePath;
          var parentData = valCxt.parentData;
          var parentDataProperty = valCxt.parentDataProperty;
          var rootData = valCxt.rootData;
        } else {
          var instancePath = "";
          var parentData = undefined;
          var parentDataProperty = undefined;
          var rootData = data;
        }
        var vErrors = null;
        var errors = 0;
        var valid0 = false;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          valid0 = true;
          if (data.decimals !== undefined) {
            var data0 = data.decimals;
            if (!(data0 === null || typeof data0 == "number" && isFinite(data0) && !(data0 % 1) && data0 >= 0 && data0 <= 4294967295)) {
              var err0 = {
                instancePath: instancePath + "/decimals",
                schemaPath: "/properties/decimals/type",
                keyword: "type",
                params: {
                  type: "uint32",
                  nullable: true
                },
                message: "must be uint32 or null"
              };
              if (vErrors === null) {
                vErrors = [ err0 ];
              } else {
                vErrors.push(err0);
              }
              errors++;
            }
          } else {
            var err1 = {
              instancePath,
              schemaPath: "/properties/decimals",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "decimals"
              },
              message: "must have property 'decimals'"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
          if (data.name !== undefined) {
            if (!(typeof data.name == "string")) {
              var err2 = {
                instancePath: instancePath + "/name",
                schemaPath: "/properties/name/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err2 ];
              } else {
                vErrors.push(err2);
              }
              errors++;
            }
          } else {
            var err3 = {
              instancePath,
              schemaPath: "/properties/name",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "name"
              },
              message: "must have property 'name'"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          if (data.symbol !== undefined) {
            if (!(typeof data.symbol == "string")) {
              var err4 = {
                instancePath: instancePath + "/symbol",
                schemaPath: "/properties/symbol/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
          } else {
            var err5 = {
              instancePath,
              schemaPath: "/properties/symbol",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "symbol"
              },
              message: "must have property 'symbol'"
            };
            if (vErrors === null) {
              vErrors = [ err5 ];
            } else {
              vErrors.push(err5);
            }
            errors++;
          }
          if (data.logo !== undefined) {
            var data3 = data.logo;
            if (!(data3 === null || typeof data3 == "string")) {
              var err6 = {
                instancePath: instancePath + "/logo",
                schemaPath: "/properties/logo/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: true
                },
                message: "must be string or null"
              };
              if (vErrors === null) {
                vErrors = [ err6 ];
              } else {
                vErrors.push(err6);
              }
              errors++;
            }
          } else {
            var err7 = {
              instancePath,
              schemaPath: "/properties/logo",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "logo"
              },
              message: "must have property 'logo'"
            };
            if (vErrors === null) {
              vErrors = [ err7 ];
            } else {
              vErrors.push(err7);
            }
            errors++;
          }
          for (var key0 in data) {
            if (key0 !== "decimals" && key0 !== "name" && key0 !== "symbol" && key0 !== "logo") {
              var err8 = {
                instancePath: instancePath + "/" + key0.replace(/~/g, "~0").replace(/\//g, "~1"),
                schemaPath: "",
                keyword: "properties",
                params: {
                  error: "additional",
                  additionalProperty: key0
                },
                message: "must NOT have additional properties"
              };
              if (vErrors === null) {
                vErrors = [ err8 ];
              } else {
                vErrors.push(err8);
              }
              errors++;
            }
          }
        }
        if (!valid0) {
          var err9 = {
            instancePath,
            schemaPath: "/properties",
            keyword: "properties",
            params: {
              type: "object",
              nullable: false
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err9 ];
          } else {
            vErrors.push(err9);
          }
          errors++;
        }
        validate60.errors = vErrors;
        return errors === 0;
      }
      __webpack_unused_export__ = validate61;
      var schema33 = {
        properties: {
          chainId: {
            type: "uint32"
          },
          price: {
            type: "string"
          },
          value: {
            type: "string"
          },
          gasPrice: {
            type: "string"
          },
          gas: {
            type: "string"
          },
          estimatedGas: {
            type: "string"
          },
          protocolFee: {
            type: "string"
          },
          minimumProtocolFee: {
            type: "string"
          },
          buyTokenAddress: {
            type: "string"
          },
          buyAmount: {
            type: "string"
          },
          sellTokenAddress: {
            type: "string"
          },
          sellAmount: {
            type: "string"
          },
          sources: {
            elements: {
              properties: {
                name: {
                  type: "string"
                },
                proportion: {
                  type: "string"
                }
              },
              additionalProperties: true
            }
          },
          allowanceTarget: {
            type: "string"
          },
          sellTokenToEthRate: {
            type: "string"
          },
          buyTokenToEthRate: {
            type: "string"
          },
          estimatedPriceImpact: {
            type: "string"
          }
        },
        additionalProperties: true
      };
      function validate61(data, valCxt) {
        "use strict";
        if (valCxt) {
          var instancePath = valCxt.instancePath;
          var parentData = valCxt.parentData;
          var parentDataProperty = valCxt.parentDataProperty;
          var rootData = valCxt.rootData;
        } else {
          var instancePath = "";
          var parentData = undefined;
          var parentDataProperty = undefined;
          var rootData = data;
        }
        var vErrors = null;
        var errors = 0;
        var valid0 = false;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          valid0 = true;
          if (data.chainId !== undefined) {
            var data0 = data.chainId;
            if (!(typeof data0 == "number" && isFinite(data0) && !(data0 % 1) && data0 >= 0 && data0 <= 4294967295)) {
              var err0 = {
                instancePath: instancePath + "/chainId",
                schemaPath: "/properties/chainId/type",
                keyword: "type",
                params: {
                  type: "uint32",
                  nullable: false
                },
                message: "must be uint32"
              };
              if (vErrors === null) {
                vErrors = [ err0 ];
              } else {
                vErrors.push(err0);
              }
              errors++;
            }
          } else {
            var err1 = {
              instancePath,
              schemaPath: "/properties/chainId",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "chainId"
              },
              message: "must have property 'chainId'"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
          if (data.price !== undefined) {
            if (!(typeof data.price == "string")) {
              var err2 = {
                instancePath: instancePath + "/price",
                schemaPath: "/properties/price/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err2 ];
              } else {
                vErrors.push(err2);
              }
              errors++;
            }
          } else {
            var err3 = {
              instancePath,
              schemaPath: "/properties/price",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "price"
              },
              message: "must have property 'price'"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          if (data.value !== undefined) {
            if (!(typeof data.value == "string")) {
              var err4 = {
                instancePath: instancePath + "/value",
                schemaPath: "/properties/value/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
          } else {
            var err5 = {
              instancePath,
              schemaPath: "/properties/value",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "value"
              },
              message: "must have property 'value'"
            };
            if (vErrors === null) {
              vErrors = [ err5 ];
            } else {
              vErrors.push(err5);
            }
            errors++;
          }
          if (data.gasPrice !== undefined) {
            if (!(typeof data.gasPrice == "string")) {
              var err6 = {
                instancePath: instancePath + "/gasPrice",
                schemaPath: "/properties/gasPrice/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err6 ];
              } else {
                vErrors.push(err6);
              }
              errors++;
            }
          } else {
            var err7 = {
              instancePath,
              schemaPath: "/properties/gasPrice",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "gasPrice"
              },
              message: "must have property 'gasPrice'"
            };
            if (vErrors === null) {
              vErrors = [ err7 ];
            } else {
              vErrors.push(err7);
            }
            errors++;
          }
          if (data.gas !== undefined) {
            if (!(typeof data.gas == "string")) {
              var err8 = {
                instancePath: instancePath + "/gas",
                schemaPath: "/properties/gas/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err8 ];
              } else {
                vErrors.push(err8);
              }
              errors++;
            }
          } else {
            var err9 = {
              instancePath,
              schemaPath: "/properties/gas",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "gas"
              },
              message: "must have property 'gas'"
            };
            if (vErrors === null) {
              vErrors = [ err9 ];
            } else {
              vErrors.push(err9);
            }
            errors++;
          }
          if (data.estimatedGas !== undefined) {
            if (!(typeof data.estimatedGas == "string")) {
              var err10 = {
                instancePath: instancePath + "/estimatedGas",
                schemaPath: "/properties/estimatedGas/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err10 ];
              } else {
                vErrors.push(err10);
              }
              errors++;
            }
          } else {
            var err11 = {
              instancePath,
              schemaPath: "/properties/estimatedGas",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "estimatedGas"
              },
              message: "must have property 'estimatedGas'"
            };
            if (vErrors === null) {
              vErrors = [ err11 ];
            } else {
              vErrors.push(err11);
            }
            errors++;
          }
          if (data.protocolFee !== undefined) {
            if (!(typeof data.protocolFee == "string")) {
              var err12 = {
                instancePath: instancePath + "/protocolFee",
                schemaPath: "/properties/protocolFee/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err12 ];
              } else {
                vErrors.push(err12);
              }
              errors++;
            }
          } else {
            var err13 = {
              instancePath,
              schemaPath: "/properties/protocolFee",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "protocolFee"
              },
              message: "must have property 'protocolFee'"
            };
            if (vErrors === null) {
              vErrors = [ err13 ];
            } else {
              vErrors.push(err13);
            }
            errors++;
          }
          if (data.minimumProtocolFee !== undefined) {
            if (!(typeof data.minimumProtocolFee == "string")) {
              var err14 = {
                instancePath: instancePath + "/minimumProtocolFee",
                schemaPath: "/properties/minimumProtocolFee/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err14 ];
              } else {
                vErrors.push(err14);
              }
              errors++;
            }
          } else {
            var err15 = {
              instancePath,
              schemaPath: "/properties/minimumProtocolFee",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "minimumProtocolFee"
              },
              message: "must have property 'minimumProtocolFee'"
            };
            if (vErrors === null) {
              vErrors = [ err15 ];
            } else {
              vErrors.push(err15);
            }
            errors++;
          }
          if (data.buyTokenAddress !== undefined) {
            if (!(typeof data.buyTokenAddress == "string")) {
              var err16 = {
                instancePath: instancePath + "/buyTokenAddress",
                schemaPath: "/properties/buyTokenAddress/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err16 ];
              } else {
                vErrors.push(err16);
              }
              errors++;
            }
          } else {
            var err17 = {
              instancePath,
              schemaPath: "/properties/buyTokenAddress",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "buyTokenAddress"
              },
              message: "must have property 'buyTokenAddress'"
            };
            if (vErrors === null) {
              vErrors = [ err17 ];
            } else {
              vErrors.push(err17);
            }
            errors++;
          }
          if (data.buyAmount !== undefined) {
            if (!(typeof data.buyAmount == "string")) {
              var err18 = {
                instancePath: instancePath + "/buyAmount",
                schemaPath: "/properties/buyAmount/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err18 ];
              } else {
                vErrors.push(err18);
              }
              errors++;
            }
          } else {
            var err19 = {
              instancePath,
              schemaPath: "/properties/buyAmount",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "buyAmount"
              },
              message: "must have property 'buyAmount'"
            };
            if (vErrors === null) {
              vErrors = [ err19 ];
            } else {
              vErrors.push(err19);
            }
            errors++;
          }
          if (data.sellTokenAddress !== undefined) {
            if (!(typeof data.sellTokenAddress == "string")) {
              var err20 = {
                instancePath: instancePath + "/sellTokenAddress",
                schemaPath: "/properties/sellTokenAddress/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err20 ];
              } else {
                vErrors.push(err20);
              }
              errors++;
            }
          } else {
            var err21 = {
              instancePath,
              schemaPath: "/properties/sellTokenAddress",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sellTokenAddress"
              },
              message: "must have property 'sellTokenAddress'"
            };
            if (vErrors === null) {
              vErrors = [ err21 ];
            } else {
              vErrors.push(err21);
            }
            errors++;
          }
          if (data.sellAmount !== undefined) {
            if (!(typeof data.sellAmount == "string")) {
              var err22 = {
                instancePath: instancePath + "/sellAmount",
                schemaPath: "/properties/sellAmount/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err22 ];
              } else {
                vErrors.push(err22);
              }
              errors++;
            }
          } else {
            var err23 = {
              instancePath,
              schemaPath: "/properties/sellAmount",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sellAmount"
              },
              message: "must have property 'sellAmount'"
            };
            if (vErrors === null) {
              vErrors = [ err23 ];
            } else {
              vErrors.push(err23);
            }
            errors++;
          }
          if (data.sources !== undefined) {
            var data12 = data.sources;
            var valid2 = false;
            if (!valid2) {
              if (Array.isArray(data12)) {
                var valid4 = true;
                var len0 = data12.length;
                for (var i0 = 0; i0 < len0; i0++) {
                  var data13 = data12[i0];
                  var _errs13 = errors;
                  var valid5 = false;
                  if (data13 && typeof data13 == "object" && !Array.isArray(data13)) {
                    valid5 = true;
                    if (data13.name !== undefined) {
                      if (!(typeof data13.name == "string")) {
                        var err24 = {
                          instancePath: instancePath + "/sources/" + i0 + "/name",
                          schemaPath: "/properties/sources/elements/properties/name/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: false
                          },
                          message: "must be string"
                        };
                        if (vErrors === null) {
                          vErrors = [ err24 ];
                        } else {
                          vErrors.push(err24);
                        }
                        errors++;
                      }
                    } else {
                      var err25 = {
                        instancePath: instancePath + "/sources/" + i0,
                        schemaPath: "/properties/sources/elements/properties/name",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "name"
                        },
                        message: "must have property 'name'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err25 ];
                      } else {
                        vErrors.push(err25);
                      }
                      errors++;
                    }
                    if (data13.proportion !== undefined) {
                      if (!(typeof data13.proportion == "string")) {
                        var err26 = {
                          instancePath: instancePath + "/sources/" + i0 + "/proportion",
                          schemaPath: "/properties/sources/elements/properties/proportion/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: false
                          },
                          message: "must be string"
                        };
                        if (vErrors === null) {
                          vErrors = [ err26 ];
                        } else {
                          vErrors.push(err26);
                        }
                        errors++;
                      }
                    } else {
                      var err27 = {
                        instancePath: instancePath + "/sources/" + i0,
                        schemaPath: "/properties/sources/elements/properties/proportion",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "proportion"
                        },
                        message: "must have property 'proportion'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err27 ];
                      } else {
                        vErrors.push(err27);
                      }
                      errors++;
                    }
                  }
                  if (!valid5) {
                    var err28 = {
                      instancePath: instancePath + "/sources/" + i0,
                      schemaPath: "/properties/sources/elements/properties",
                      keyword: "properties",
                      params: {
                        type: "object",
                        nullable: false
                      },
                      message: "must be object"
                    };
                    if (vErrors === null) {
                      vErrors = [ err28 ];
                    } else {
                      vErrors.push(err28);
                    }
                    errors++;
                  }
                  var valid3 = _errs13 === errors;
                  if (!valid3) {
                    valid4 = false;
                  }
                }
                valid2 = valid4;
              } else {
                var err29 = {
                  instancePath: instancePath + "/sources",
                  schemaPath: "/properties/sources/elements",
                  keyword: "elements",
                  params: {
                    type: "array",
                    nullable: false
                  },
                  message: "must be array"
                };
                if (vErrors === null) {
                  vErrors = [ err29 ];
                } else {
                  vErrors.push(err29);
                }
                errors++;
              }
            }
          } else {
            var err30 = {
              instancePath,
              schemaPath: "/properties/sources",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sources"
              },
              message: "must have property 'sources'"
            };
            if (vErrors === null) {
              vErrors = [ err30 ];
            } else {
              vErrors.push(err30);
            }
            errors++;
          }
          if (data.allowanceTarget !== undefined) {
            if (!(typeof data.allowanceTarget == "string")) {
              var err31 = {
                instancePath: instancePath + "/allowanceTarget",
                schemaPath: "/properties/allowanceTarget/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err31 ];
              } else {
                vErrors.push(err31);
              }
              errors++;
            }
          } else {
            var err32 = {
              instancePath,
              schemaPath: "/properties/allowanceTarget",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "allowanceTarget"
              },
              message: "must have property 'allowanceTarget'"
            };
            if (vErrors === null) {
              vErrors = [ err32 ];
            } else {
              vErrors.push(err32);
            }
            errors++;
          }
          if (data.sellTokenToEthRate !== undefined) {
            if (!(typeof data.sellTokenToEthRate == "string")) {
              var err33 = {
                instancePath: instancePath + "/sellTokenToEthRate",
                schemaPath: "/properties/sellTokenToEthRate/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err33 ];
              } else {
                vErrors.push(err33);
              }
              errors++;
            }
          } else {
            var err34 = {
              instancePath,
              schemaPath: "/properties/sellTokenToEthRate",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sellTokenToEthRate"
              },
              message: "must have property 'sellTokenToEthRate'"
            };
            if (vErrors === null) {
              vErrors = [ err34 ];
            } else {
              vErrors.push(err34);
            }
            errors++;
          }
          if (data.buyTokenToEthRate !== undefined) {
            if (!(typeof data.buyTokenToEthRate == "string")) {
              var err35 = {
                instancePath: instancePath + "/buyTokenToEthRate",
                schemaPath: "/properties/buyTokenToEthRate/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err35 ];
              } else {
                vErrors.push(err35);
              }
              errors++;
            }
          } else {
            var err36 = {
              instancePath,
              schemaPath: "/properties/buyTokenToEthRate",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "buyTokenToEthRate"
              },
              message: "must have property 'buyTokenToEthRate'"
            };
            if (vErrors === null) {
              vErrors = [ err36 ];
            } else {
              vErrors.push(err36);
            }
            errors++;
          }
          if (data.estimatedPriceImpact !== undefined) {
            if (!(typeof data.estimatedPriceImpact == "string")) {
              var err37 = {
                instancePath: instancePath + "/estimatedPriceImpact",
                schemaPath: "/properties/estimatedPriceImpact/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err37 ];
              } else {
                vErrors.push(err37);
              }
              errors++;
            }
          } else {
            var err38 = {
              instancePath,
              schemaPath: "/properties/estimatedPriceImpact",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "estimatedPriceImpact"
              },
              message: "must have property 'estimatedPriceImpact'"
            };
            if (vErrors === null) {
              vErrors = [ err38 ];
            } else {
              vErrors.push(err38);
            }
            errors++;
          }
        }
        if (!valid0) {
          var err39 = {
            instancePath,
            schemaPath: "/properties",
            keyword: "properties",
            params: {
              type: "object",
              nullable: false
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err39 ];
          } else {
            vErrors.push(err39);
          }
          errors++;
        }
        validate61.errors = vErrors;
        return errors === 0;
      }
      __webpack_unused_export__ = validate62;
      var schema34 = {
        properties: {
          chainId: {
            type: "uint32"
          },
          price: {
            type: "string"
          },
          value: {
            type: "string"
          },
          gasPrice: {
            type: "string"
          },
          gas: {
            type: "string"
          },
          estimatedGas: {
            type: "string"
          },
          protocolFee: {
            type: "string"
          },
          minimumProtocolFee: {
            type: "string"
          },
          buyTokenAddress: {
            type: "string"
          },
          buyAmount: {
            type: "string"
          },
          sellTokenAddress: {
            type: "string"
          },
          sellAmount: {
            type: "string"
          },
          sources: {
            elements: {
              properties: {
                name: {
                  type: "string"
                },
                proportion: {
                  type: "string"
                }
              },
              additionalProperties: true
            }
          },
          allowanceTarget: {
            type: "string"
          },
          sellTokenToEthRate: {
            type: "string"
          },
          buyTokenToEthRate: {
            type: "string"
          },
          estimatedPriceImpact: {
            type: "string"
          },
          data: {
            type: "string"
          },
          guaranteedPrice: {
            type: "string"
          },
          to: {
            type: "string"
          }
        },
        optionalProperties: {
          from: {
            type: "string"
          }
        },
        additionalProperties: true
      };
      function validate62(data, valCxt) {
        "use strict";
        if (valCxt) {
          var instancePath = valCxt.instancePath;
          var parentData = valCxt.parentData;
          var parentDataProperty = valCxt.parentDataProperty;
          var rootData = valCxt.rootData;
        } else {
          var instancePath = "";
          var parentData = undefined;
          var parentDataProperty = undefined;
          var rootData = data;
        }
        var vErrors = null;
        var errors = 0;
        var valid0 = false;
        if (data && typeof data == "object" && !Array.isArray(data)) {
          valid0 = true;
          if (data.chainId !== undefined) {
            var data0 = data.chainId;
            if (!(typeof data0 == "number" && isFinite(data0) && !(data0 % 1) && data0 >= 0 && data0 <= 4294967295)) {
              var err0 = {
                instancePath: instancePath + "/chainId",
                schemaPath: "/properties/chainId/type",
                keyword: "type",
                params: {
                  type: "uint32",
                  nullable: false
                },
                message: "must be uint32"
              };
              if (vErrors === null) {
                vErrors = [ err0 ];
              } else {
                vErrors.push(err0);
              }
              errors++;
            }
          } else {
            var err1 = {
              instancePath,
              schemaPath: "/properties/chainId",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "chainId"
              },
              message: "must have property 'chainId'"
            };
            if (vErrors === null) {
              vErrors = [ err1 ];
            } else {
              vErrors.push(err1);
            }
            errors++;
          }
          if (data.price !== undefined) {
            if (!(typeof data.price == "string")) {
              var err2 = {
                instancePath: instancePath + "/price",
                schemaPath: "/properties/price/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err2 ];
              } else {
                vErrors.push(err2);
              }
              errors++;
            }
          } else {
            var err3 = {
              instancePath,
              schemaPath: "/properties/price",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "price"
              },
              message: "must have property 'price'"
            };
            if (vErrors === null) {
              vErrors = [ err3 ];
            } else {
              vErrors.push(err3);
            }
            errors++;
          }
          if (data.value !== undefined) {
            if (!(typeof data.value == "string")) {
              var err4 = {
                instancePath: instancePath + "/value",
                schemaPath: "/properties/value/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err4 ];
              } else {
                vErrors.push(err4);
              }
              errors++;
            }
          } else {
            var err5 = {
              instancePath,
              schemaPath: "/properties/value",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "value"
              },
              message: "must have property 'value'"
            };
            if (vErrors === null) {
              vErrors = [ err5 ];
            } else {
              vErrors.push(err5);
            }
            errors++;
          }
          if (data.gasPrice !== undefined) {
            if (!(typeof data.gasPrice == "string")) {
              var err6 = {
                instancePath: instancePath + "/gasPrice",
                schemaPath: "/properties/gasPrice/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err6 ];
              } else {
                vErrors.push(err6);
              }
              errors++;
            }
          } else {
            var err7 = {
              instancePath,
              schemaPath: "/properties/gasPrice",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "gasPrice"
              },
              message: "must have property 'gasPrice'"
            };
            if (vErrors === null) {
              vErrors = [ err7 ];
            } else {
              vErrors.push(err7);
            }
            errors++;
          }
          if (data.gas !== undefined) {
            if (!(typeof data.gas == "string")) {
              var err8 = {
                instancePath: instancePath + "/gas",
                schemaPath: "/properties/gas/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err8 ];
              } else {
                vErrors.push(err8);
              }
              errors++;
            }
          } else {
            var err9 = {
              instancePath,
              schemaPath: "/properties/gas",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "gas"
              },
              message: "must have property 'gas'"
            };
            if (vErrors === null) {
              vErrors = [ err9 ];
            } else {
              vErrors.push(err9);
            }
            errors++;
          }
          if (data.estimatedGas !== undefined) {
            if (!(typeof data.estimatedGas == "string")) {
              var err10 = {
                instancePath: instancePath + "/estimatedGas",
                schemaPath: "/properties/estimatedGas/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err10 ];
              } else {
                vErrors.push(err10);
              }
              errors++;
            }
          } else {
            var err11 = {
              instancePath,
              schemaPath: "/properties/estimatedGas",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "estimatedGas"
              },
              message: "must have property 'estimatedGas'"
            };
            if (vErrors === null) {
              vErrors = [ err11 ];
            } else {
              vErrors.push(err11);
            }
            errors++;
          }
          if (data.protocolFee !== undefined) {
            if (!(typeof data.protocolFee == "string")) {
              var err12 = {
                instancePath: instancePath + "/protocolFee",
                schemaPath: "/properties/protocolFee/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err12 ];
              } else {
                vErrors.push(err12);
              }
              errors++;
            }
          } else {
            var err13 = {
              instancePath,
              schemaPath: "/properties/protocolFee",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "protocolFee"
              },
              message: "must have property 'protocolFee'"
            };
            if (vErrors === null) {
              vErrors = [ err13 ];
            } else {
              vErrors.push(err13);
            }
            errors++;
          }
          if (data.minimumProtocolFee !== undefined) {
            if (!(typeof data.minimumProtocolFee == "string")) {
              var err14 = {
                instancePath: instancePath + "/minimumProtocolFee",
                schemaPath: "/properties/minimumProtocolFee/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err14 ];
              } else {
                vErrors.push(err14);
              }
              errors++;
            }
          } else {
            var err15 = {
              instancePath,
              schemaPath: "/properties/minimumProtocolFee",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "minimumProtocolFee"
              },
              message: "must have property 'minimumProtocolFee'"
            };
            if (vErrors === null) {
              vErrors = [ err15 ];
            } else {
              vErrors.push(err15);
            }
            errors++;
          }
          if (data.buyTokenAddress !== undefined) {
            if (!(typeof data.buyTokenAddress == "string")) {
              var err16 = {
                instancePath: instancePath + "/buyTokenAddress",
                schemaPath: "/properties/buyTokenAddress/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err16 ];
              } else {
                vErrors.push(err16);
              }
              errors++;
            }
          } else {
            var err17 = {
              instancePath,
              schemaPath: "/properties/buyTokenAddress",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "buyTokenAddress"
              },
              message: "must have property 'buyTokenAddress'"
            };
            if (vErrors === null) {
              vErrors = [ err17 ];
            } else {
              vErrors.push(err17);
            }
            errors++;
          }
          if (data.buyAmount !== undefined) {
            if (!(typeof data.buyAmount == "string")) {
              var err18 = {
                instancePath: instancePath + "/buyAmount",
                schemaPath: "/properties/buyAmount/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err18 ];
              } else {
                vErrors.push(err18);
              }
              errors++;
            }
          } else {
            var err19 = {
              instancePath,
              schemaPath: "/properties/buyAmount",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "buyAmount"
              },
              message: "must have property 'buyAmount'"
            };
            if (vErrors === null) {
              vErrors = [ err19 ];
            } else {
              vErrors.push(err19);
            }
            errors++;
          }
          if (data.sellTokenAddress !== undefined) {
            if (!(typeof data.sellTokenAddress == "string")) {
              var err20 = {
                instancePath: instancePath + "/sellTokenAddress",
                schemaPath: "/properties/sellTokenAddress/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err20 ];
              } else {
                vErrors.push(err20);
              }
              errors++;
            }
          } else {
            var err21 = {
              instancePath,
              schemaPath: "/properties/sellTokenAddress",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sellTokenAddress"
              },
              message: "must have property 'sellTokenAddress'"
            };
            if (vErrors === null) {
              vErrors = [ err21 ];
            } else {
              vErrors.push(err21);
            }
            errors++;
          }
          if (data.sellAmount !== undefined) {
            if (!(typeof data.sellAmount == "string")) {
              var err22 = {
                instancePath: instancePath + "/sellAmount",
                schemaPath: "/properties/sellAmount/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err22 ];
              } else {
                vErrors.push(err22);
              }
              errors++;
            }
          } else {
            var err23 = {
              instancePath,
              schemaPath: "/properties/sellAmount",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sellAmount"
              },
              message: "must have property 'sellAmount'"
            };
            if (vErrors === null) {
              vErrors = [ err23 ];
            } else {
              vErrors.push(err23);
            }
            errors++;
          }
          if (data.sources !== undefined) {
            var data12 = data.sources;
            var valid2 = false;
            if (!valid2) {
              if (Array.isArray(data12)) {
                var valid4 = true;
                var len0 = data12.length;
                for (var i0 = 0; i0 < len0; i0++) {
                  var data13 = data12[i0];
                  var _errs13 = errors;
                  var valid5 = false;
                  if (data13 && typeof data13 == "object" && !Array.isArray(data13)) {
                    valid5 = true;
                    if (data13.name !== undefined) {
                      if (!(typeof data13.name == "string")) {
                        var err24 = {
                          instancePath: instancePath + "/sources/" + i0 + "/name",
                          schemaPath: "/properties/sources/elements/properties/name/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: false
                          },
                          message: "must be string"
                        };
                        if (vErrors === null) {
                          vErrors = [ err24 ];
                        } else {
                          vErrors.push(err24);
                        }
                        errors++;
                      }
                    } else {
                      var err25 = {
                        instancePath: instancePath + "/sources/" + i0,
                        schemaPath: "/properties/sources/elements/properties/name",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "name"
                        },
                        message: "must have property 'name'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err25 ];
                      } else {
                        vErrors.push(err25);
                      }
                      errors++;
                    }
                    if (data13.proportion !== undefined) {
                      if (!(typeof data13.proportion == "string")) {
                        var err26 = {
                          instancePath: instancePath + "/sources/" + i0 + "/proportion",
                          schemaPath: "/properties/sources/elements/properties/proportion/type",
                          keyword: "type",
                          params: {
                            type: "string",
                            nullable: false
                          },
                          message: "must be string"
                        };
                        if (vErrors === null) {
                          vErrors = [ err26 ];
                        } else {
                          vErrors.push(err26);
                        }
                        errors++;
                      }
                    } else {
                      var err27 = {
                        instancePath: instancePath + "/sources/" + i0,
                        schemaPath: "/properties/sources/elements/properties/proportion",
                        keyword: "properties",
                        params: {
                          error: "missing",
                          missingProperty: "proportion"
                        },
                        message: "must have property 'proportion'"
                      };
                      if (vErrors === null) {
                        vErrors = [ err27 ];
                      } else {
                        vErrors.push(err27);
                      }
                      errors++;
                    }
                  }
                  if (!valid5) {
                    var err28 = {
                      instancePath: instancePath + "/sources/" + i0,
                      schemaPath: "/properties/sources/elements/properties",
                      keyword: "properties",
                      params: {
                        type: "object",
                        nullable: false
                      },
                      message: "must be object"
                    };
                    if (vErrors === null) {
                      vErrors = [ err28 ];
                    } else {
                      vErrors.push(err28);
                    }
                    errors++;
                  }
                  var valid3 = _errs13 === errors;
                  if (!valid3) {
                    valid4 = false;
                  }
                }
                valid2 = valid4;
              } else {
                var err29 = {
                  instancePath: instancePath + "/sources",
                  schemaPath: "/properties/sources/elements",
                  keyword: "elements",
                  params: {
                    type: "array",
                    nullable: false
                  },
                  message: "must be array"
                };
                if (vErrors === null) {
                  vErrors = [ err29 ];
                } else {
                  vErrors.push(err29);
                }
                errors++;
              }
            }
          } else {
            var err30 = {
              instancePath,
              schemaPath: "/properties/sources",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sources"
              },
              message: "must have property 'sources'"
            };
            if (vErrors === null) {
              vErrors = [ err30 ];
            } else {
              vErrors.push(err30);
            }
            errors++;
          }
          if (data.allowanceTarget !== undefined) {
            if (!(typeof data.allowanceTarget == "string")) {
              var err31 = {
                instancePath: instancePath + "/allowanceTarget",
                schemaPath: "/properties/allowanceTarget/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err31 ];
              } else {
                vErrors.push(err31);
              }
              errors++;
            }
          } else {
            var err32 = {
              instancePath,
              schemaPath: "/properties/allowanceTarget",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "allowanceTarget"
              },
              message: "must have property 'allowanceTarget'"
            };
            if (vErrors === null) {
              vErrors = [ err32 ];
            } else {
              vErrors.push(err32);
            }
            errors++;
          }
          if (data.sellTokenToEthRate !== undefined) {
            if (!(typeof data.sellTokenToEthRate == "string")) {
              var err33 = {
                instancePath: instancePath + "/sellTokenToEthRate",
                schemaPath: "/properties/sellTokenToEthRate/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err33 ];
              } else {
                vErrors.push(err33);
              }
              errors++;
            }
          } else {
            var err34 = {
              instancePath,
              schemaPath: "/properties/sellTokenToEthRate",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "sellTokenToEthRate"
              },
              message: "must have property 'sellTokenToEthRate'"
            };
            if (vErrors === null) {
              vErrors = [ err34 ];
            } else {
              vErrors.push(err34);
            }
            errors++;
          }
          if (data.buyTokenToEthRate !== undefined) {
            if (!(typeof data.buyTokenToEthRate == "string")) {
              var err35 = {
                instancePath: instancePath + "/buyTokenToEthRate",
                schemaPath: "/properties/buyTokenToEthRate/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err35 ];
              } else {
                vErrors.push(err35);
              }
              errors++;
            }
          } else {
            var err36 = {
              instancePath,
              schemaPath: "/properties/buyTokenToEthRate",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "buyTokenToEthRate"
              },
              message: "must have property 'buyTokenToEthRate'"
            };
            if (vErrors === null) {
              vErrors = [ err36 ];
            } else {
              vErrors.push(err36);
            }
            errors++;
          }
          if (data.estimatedPriceImpact !== undefined) {
            if (!(typeof data.estimatedPriceImpact == "string")) {
              var err37 = {
                instancePath: instancePath + "/estimatedPriceImpact",
                schemaPath: "/properties/estimatedPriceImpact/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err37 ];
              } else {
                vErrors.push(err37);
              }
              errors++;
            }
          } else {
            var err38 = {
              instancePath,
              schemaPath: "/properties/estimatedPriceImpact",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "estimatedPriceImpact"
              },
              message: "must have property 'estimatedPriceImpact'"
            };
            if (vErrors === null) {
              vErrors = [ err38 ];
            } else {
              vErrors.push(err38);
            }
            errors++;
          }
          if (data.data !== undefined) {
            if (!(typeof data.data == "string")) {
              var err39 = {
                instancePath: instancePath + "/data",
                schemaPath: "/properties/data/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err39 ];
              } else {
                vErrors.push(err39);
              }
              errors++;
            }
          } else {
            var err40 = {
              instancePath,
              schemaPath: "/properties/data",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "data"
              },
              message: "must have property 'data'"
            };
            if (vErrors === null) {
              vErrors = [ err40 ];
            } else {
              vErrors.push(err40);
            }
            errors++;
          }
          if (data.guaranteedPrice !== undefined) {
            if (!(typeof data.guaranteedPrice == "string")) {
              var err41 = {
                instancePath: instancePath + "/guaranteedPrice",
                schemaPath: "/properties/guaranteedPrice/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err41 ];
              } else {
                vErrors.push(err41);
              }
              errors++;
            }
          } else {
            var err42 = {
              instancePath,
              schemaPath: "/properties/guaranteedPrice",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "guaranteedPrice"
              },
              message: "must have property 'guaranteedPrice'"
            };
            if (vErrors === null) {
              vErrors = [ err42 ];
            } else {
              vErrors.push(err42);
            }
            errors++;
          }
          if (data.to !== undefined) {
            if (!(typeof data.to == "string")) {
              var err43 = {
                instancePath: instancePath + "/to",
                schemaPath: "/properties/to/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err43 ];
              } else {
                vErrors.push(err43);
              }
              errors++;
            }
          } else {
            var err44 = {
              instancePath,
              schemaPath: "/properties/to",
              keyword: "properties",
              params: {
                error: "missing",
                missingProperty: "to"
              },
              message: "must have property 'to'"
            };
            if (vErrors === null) {
              vErrors = [ err44 ];
            } else {
              vErrors.push(err44);
            }
            errors++;
          }
          if (data.from !== undefined) {
            if (!(typeof data.from == "string")) {
              var err45 = {
                instancePath: instancePath + "/from",
                schemaPath: "/optionalProperties/from/type",
                keyword: "type",
                params: {
                  type: "string",
                  nullable: false
                },
                message: "must be string"
              };
              if (vErrors === null) {
                vErrors = [ err45 ];
              } else {
                vErrors.push(err45);
              }
              errors++;
            }
          }
        }
        if (!valid0) {
          var err46 = {
            instancePath,
            schemaPath: "/properties",
            keyword: "properties",
            params: {
              type: "object",
              nullable: false
            },
            message: "must be object"
          };
          if (vErrors === null) {
            vErrors = [ err46 ];
          } else {
            vErrors.push(err46);
          }
          errors++;
        }
        validate62.errors = vErrors;
        return errors === 0;
      }
    },
    6827(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      const anyMap = new WeakMap;
      const eventsMap = new WeakMap;
      const producersMap = new WeakMap;
      const anyProducer = Symbol("anyProducer");
      const resolvedPromise = Promise.resolve();
      const listenerAdded = Symbol("listenerAdded");
      const listenerRemoved = Symbol("listenerRemoved");
      let isGlobalDebugEnabled = false;
      function assertEventName(eventName) {
        if (typeof eventName !== "string" && typeof eventName !== "symbol") {
          throw new TypeError("eventName must be a string or a symbol");
        }
      }
      function assertListener(listener) {
        if (typeof listener !== "function") {
          throw new TypeError("listener must be a function");
        }
      }
      function getListeners(instance, eventName) {
        const events = eventsMap.get(instance);
        if (!events.has(eventName)) {
          events.set(eventName, new Set);
        }
        return events.get(eventName);
      }
      function getEventProducers(instance, eventName) {
        const key = typeof eventName === "string" || typeof eventName === "symbol" ? eventName : anyProducer;
        const producers = producersMap.get(instance);
        if (!producers.has(key)) {
          producers.set(key, new Set);
        }
        return producers.get(key);
      }
      function enqueueProducers(instance, eventName, eventData) {
        const producers = producersMap.get(instance);
        if (producers.has(eventName)) {
          for (const producer of producers.get(eventName)) {
            producer.enqueue(eventData);
          }
        }
        if (producers.has(anyProducer)) {
          const item = Promise.all([ eventName, eventData ]);
          for (const producer of producers.get(anyProducer)) {
            producer.enqueue(item);
          }
        }
      }
      function iterator(instance, eventNames) {
        eventNames = Array.isArray(eventNames) ? eventNames : [ eventNames ];
        let isFinished = false;
        let flush = () => {};
        let queue = [];
        const producer = {
          enqueue(item) {
            queue.push(item);
            flush();
          },
          finish() {
            isFinished = true;
            flush();
          }
        };
        for (const eventName of eventNames) {
          getEventProducers(instance, eventName).add(producer);
        }
        return {
          async next() {
            if (!queue) {
              return {
                done: true
              };
            }
            if (queue.length === 0) {
              if (isFinished) {
                queue = undefined;
                return this.next();
              }
              await new Promise((resolve => {
                flush = resolve;
              }));
              return this.next();
            }
            return {
              done: false,
              value: await queue.shift()
            };
          },
          async return(value) {
            queue = undefined;
            for (const eventName of eventNames) {
              getEventProducers(instance, eventName).delete(producer);
            }
            flush();
            return arguments.length > 0 ? {
              done: true,
              value: await value
            } : {
              done: true
            };
          },
          [Symbol.asyncIterator]() {
            return this;
          }
        };
      }
      function defaultMethodNamesOrAssert(methodNames) {
        if (methodNames === undefined) {
          return allEmitteryMethods;
        }
        if (!Array.isArray(methodNames)) {
          throw new TypeError("`methodNames` must be an array of strings");
        }
        for (const methodName of methodNames) {
          if (!allEmitteryMethods.includes(methodName)) {
            if (typeof methodName !== "string") {
              throw new TypeError("`methodNames` element must be a string");
            }
            throw new Error(`${methodName} is not Emittery method`);
          }
        }
        return methodNames;
      }
      const isListenerSymbol = symbol => symbol === listenerAdded || symbol === listenerRemoved;
      class Emittery {
        static mixin(emitteryPropertyName, methodNames) {
          methodNames = defaultMethodNamesOrAssert(methodNames);
          return target => {
            if (typeof target !== "function") {
              throw new TypeError("`target` must be function");
            }
            for (const methodName of methodNames) {
              if (target.prototype[methodName] !== undefined) {
                throw new Error(`The property \`${methodName}\` already exists on \`target\``);
              }
            }
            function getEmitteryProperty() {
              Object.defineProperty(this, emitteryPropertyName, {
                enumerable: false,
                value: new Emittery
              });
              return this[emitteryPropertyName];
            }
            Object.defineProperty(target.prototype, emitteryPropertyName, {
              enumerable: false,
              get: getEmitteryProperty
            });
            const emitteryMethodCaller = methodName => function(...args) {
              return this[emitteryPropertyName][methodName](...args);
            };
            for (const methodName of methodNames) {
              Object.defineProperty(target.prototype, methodName, {
                enumerable: false,
                value: emitteryMethodCaller(methodName)
              });
            }
            return target;
          };
        }
        static get isDebugEnabled() {
          if (typeof process !== "object") {
            return isGlobalDebugEnabled;
          }
          const {env} = process || {
            env: {}
          };
          return env.DEBUG === "emittery" || env.DEBUG === "*" || isGlobalDebugEnabled;
        }
        static set isDebugEnabled(newValue) {
          isGlobalDebugEnabled = newValue;
        }
        constructor(options = {}) {
          anyMap.set(this, new Set);
          eventsMap.set(this, new Map);
          producersMap.set(this, new Map);
          this.debug = options.debug || {};
          if (this.debug.enabled === undefined) {
            this.debug.enabled = false;
          }
          if (!this.debug.logger) {
            this.debug.logger = (type, debugName, eventName, eventData) => {
              eventData = JSON.stringify(eventData);
              if (typeof eventName === "symbol") {
                eventName = eventName.toString();
              }
              const currentTime = new Date;
              const logTime = `${currentTime.getHours()}:${currentTime.getMinutes()}:${currentTime.getSeconds()}.${currentTime.getMilliseconds()}`;
              console.log(`[${logTime}][emittery:${type}][${debugName}] Event Name: ${eventName}\n\tdata: ${eventData}`);
            };
          }
        }
        logIfDebugEnabled(type, eventName, eventData) {
          if (Emittery.isDebugEnabled || this.debug.enabled) {
            this.debug.logger(type, this.debug.name, eventName, eventData);
          }
        }
        on(eventNames, listener) {
          assertListener(listener);
          eventNames = Array.isArray(eventNames) ? eventNames : [ eventNames ];
          for (const eventName of eventNames) {
            assertEventName(eventName);
            getListeners(this, eventName).add(listener);
            this.logIfDebugEnabled("subscribe", eventName, undefined);
            if (!isListenerSymbol(eventName)) {
              this.emit(listenerAdded, {
                eventName,
                listener
              });
            }
          }
          return this.off.bind(this, eventNames, listener);
        }
        off(eventNames, listener) {
          assertListener(listener);
          eventNames = Array.isArray(eventNames) ? eventNames : [ eventNames ];
          for (const eventName of eventNames) {
            assertEventName(eventName);
            getListeners(this, eventName).delete(listener);
            this.logIfDebugEnabled("unsubscribe", eventName, undefined);
            if (!isListenerSymbol(eventName)) {
              this.emit(listenerRemoved, {
                eventName,
                listener
              });
            }
          }
        }
        once(eventNames) {
          return new Promise((resolve => {
            const off = this.on(eventNames, (data => {
              off();
              resolve(data);
            }));
          }));
        }
        events(eventNames) {
          eventNames = Array.isArray(eventNames) ? eventNames : [ eventNames ];
          for (const eventName of eventNames) {
            assertEventName(eventName);
          }
          return iterator(this, eventNames);
        }
        async emit(eventName, eventData) {
          assertEventName(eventName);
          this.logIfDebugEnabled("emit", eventName, eventData);
          enqueueProducers(this, eventName, eventData);
          const listeners = getListeners(this, eventName);
          const anyListeners = anyMap.get(this);
          const staticListeners = [ ...listeners ];
          const staticAnyListeners = isListenerSymbol(eventName) ? [] : [ ...anyListeners ];
          await resolvedPromise;
          await Promise.all([ ...staticListeners.map((async listener => {
            if (listeners.has(listener)) {
              return listener(eventData);
            }
          })), ...staticAnyListeners.map((async listener => {
            if (anyListeners.has(listener)) {
              return listener(eventName, eventData);
            }
          })) ]);
        }
        async emitSerial(eventName, eventData) {
          assertEventName(eventName);
          this.logIfDebugEnabled("emitSerial", eventName, eventData);
          const listeners = getListeners(this, eventName);
          const anyListeners = anyMap.get(this);
          const staticListeners = [ ...listeners ];
          const staticAnyListeners = [ ...anyListeners ];
          await resolvedPromise;
          for (const listener of staticListeners) {
            if (listeners.has(listener)) {
              await listener(eventData);
            }
          }
          for (const listener of staticAnyListeners) {
            if (anyListeners.has(listener)) {
              await listener(eventName, eventData);
            }
          }
        }
        onAny(listener) {
          assertListener(listener);
          this.logIfDebugEnabled("subscribeAny", undefined, undefined);
          anyMap.get(this).add(listener);
          this.emit(listenerAdded, {
            listener
          });
          return this.offAny.bind(this, listener);
        }
        anyEvent() {
          return iterator(this);
        }
        offAny(listener) {
          assertListener(listener);
          this.logIfDebugEnabled("unsubscribeAny", undefined, undefined);
          this.emit(listenerRemoved, {
            listener
          });
          anyMap.get(this).delete(listener);
        }
        clearListeners(eventNames) {
          eventNames = Array.isArray(eventNames) ? eventNames : [ eventNames ];
          for (const eventName of eventNames) {
            this.logIfDebugEnabled("clear", eventName, undefined);
            if (typeof eventName === "string" || typeof eventName === "symbol") {
              getListeners(this, eventName).clear();
              const producers = getEventProducers(this, eventName);
              for (const producer of producers) {
                producer.finish();
              }
              producers.clear();
            } else {
              anyMap.get(this).clear();
              for (const listeners of eventsMap.get(this).values()) {
                listeners.clear();
              }
              for (const producers of producersMap.get(this).values()) {
                for (const producer of producers) {
                  producer.finish();
                }
                producers.clear();
              }
            }
          }
        }
        listenerCount(eventNames) {
          eventNames = Array.isArray(eventNames) ? eventNames : [ eventNames ];
          let count = 0;
          for (const eventName of eventNames) {
            if (typeof eventName === "string") {
              count += anyMap.get(this).size + getListeners(this, eventName).size + getEventProducers(this, eventName).size + getEventProducers(this).size;
              continue;
            }
            if (typeof eventName !== "undefined") {
              assertEventName(eventName);
            }
            count += anyMap.get(this).size;
            for (const value of eventsMap.get(this).values()) {
              count += value.size;
            }
            for (const value of producersMap.get(this).values()) {
              count += value.size;
            }
          }
          return count;
        }
        bindMethods(target, methodNames) {
          if (typeof target !== "object" || target === null) {
            throw new TypeError("`target` must be an object");
          }
          methodNames = defaultMethodNamesOrAssert(methodNames);
          for (const methodName of methodNames) {
            if (target[methodName] !== undefined) {
              throw new Error(`The property \`${methodName}\` already exists on \`target\``);
            }
            Object.defineProperty(target, methodName, {
              enumerable: false,
              value: this[methodName].bind(this)
            });
          }
        }
      }
      const allEmitteryMethods = Object.getOwnPropertyNames(Emittery.prototype).filter((v => v !== "constructor"));
      Object.defineProperty(Emittery, "listenerAdded", {
        value: listenerAdded,
        writable: false,
        enumerable: true,
        configurable: false
      });
      Object.defineProperty(Emittery, "listenerRemoved", {
        value: listenerRemoved,
        writable: false,
        enumerable: true,
        configurable: false
      });
      module.exports = Emittery;
    },
    1446(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "abi/5.7.4";
    },
    2975(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.defaultAbiCoder = exports.AbiCoder = void 0;
      const bytes_1 = __webpack_require__(8380);
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1446);
      const logger = new logger_1.Logger(_version_1.version);
      const abstract_coder_1 = __webpack_require__(7356);
      const address_1 = __webpack_require__(7528);
      const array_1 = __webpack_require__(425);
      const boolean_1 = __webpack_require__(8044);
      const bytes_2 = __webpack_require__(2963);
      const fixed_bytes_1 = __webpack_require__(5332);
      const null_1 = __webpack_require__(9019);
      const number_1 = __webpack_require__(6607);
      const string_1 = __webpack_require__(5807);
      const tuple_1 = __webpack_require__(9314);
      const function_1 = __webpack_require__(2162);
      const fragments_1 = __webpack_require__(5068);
      const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
      const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
      class AbiCoder {
        constructor(coerceFunc) {
          (0, properties_1.defineReadOnly)(this, "coerceFunc", coerceFunc || null);
        }
        _getCoder(param) {
          switch (param.baseType) {
           case "address":
            return new address_1.AddressCoder(param.name);

           case "bool":
            return new boolean_1.BooleanCoder(param.name);

           case "string":
            return new string_1.StringCoder(param.name);

           case "bytes":
            return new bytes_2.BytesCoder(param.name);

           case "array":
            return new array_1.ArrayCoder(this._getCoder(param.arrayChildren), param.arrayLength, param.name);

           case "tuple":
            return new tuple_1.TupleCoder((param.components || []).map((component => this._getCoder(component))), param.name);

           case "function":
            return new function_1.FunctionCoder(param.name);

           case "":
            return new null_1.NullCoder(param.name);
          }
          let match = param.type.match(paramTypeNumber);
          if (match) {
            let size = parseInt(match[2] || "256");
            if (size === 0 || size > 256 || size % 8 !== 0) {
              logger.throwArgumentError("invalid " + match[1] + " bit length", "param", param);
            }
            return new number_1.NumberCoder(size / 8, match[1] === "int", param.name);
          }
          match = param.type.match(paramTypeBytes);
          if (match) {
            let size = parseInt(match[1]);
            if (size === 0 || size > 32) {
              logger.throwArgumentError("invalid bytes length", "param", param);
            }
            return new fixed_bytes_1.FixedBytesCoder(size, param.name);
          }
          return logger.throwArgumentError("invalid type", "type", param.type);
        }
        _getWordSize() {
          return 32;
        }
        _getReader(data, allowLoose) {
          return new abstract_coder_1.Reader(data, this._getWordSize(), this.coerceFunc, allowLoose);
        }
        _getWriter() {
          return new abstract_coder_1.Writer(this._getWordSize());
        }
        getDefaultValue(types) {
          const coders = types.map((type => this._getCoder(fragments_1.ParamType.from(type))));
          const coder = new tuple_1.TupleCoder(coders, "_");
          return coder.defaultValue();
        }
        encode(types, values) {
          if (types.length !== values.length) {
            logger.throwError("types/values length mismatch", logger_1.Logger.errors.INVALID_ARGUMENT, {
              count: {
                types: types.length,
                values: values.length
              },
              value: {
                types,
                values
              }
            });
          }
          const coders = types.map((type => this._getCoder(fragments_1.ParamType.from(type))));
          const coder = new tuple_1.TupleCoder(coders, "_");
          const writer = this._getWriter();
          coder.encode(writer, values);
          return writer.data;
        }
        decode(types, data, loose) {
          const coders = types.map((type => this._getCoder(fragments_1.ParamType.from(type))));
          const coder = new tuple_1.TupleCoder(coders, "_");
          return coder.decode(this._getReader((0, bytes_1.arrayify)(data), loose));
        }
      }
      exports.AbiCoder = AbiCoder;
      exports.defaultAbiCoder = new AbiCoder;
    },
    7356(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Reader = exports.Writer = exports.Coder = exports.checkResultErrors = void 0;
      const bytes_1 = __webpack_require__(8380);
      const bignumber_1 = __webpack_require__(3804);
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1446);
      const logger = new logger_1.Logger(_version_1.version);
      function checkResultErrors(result) {
        const errors = [];
        const checkErrors = function(path, object) {
          if (!Array.isArray(object)) {
            return;
          }
          for (let key in object) {
            const childPath = path.slice();
            childPath.push(key);
            try {
              checkErrors(childPath, object[key]);
            } catch (error) {
              errors.push({
                path: childPath,
                error
              });
            }
          }
        };
        checkErrors([], result);
        return errors;
      }
      exports.checkResultErrors = checkResultErrors;
      class Coder {
        constructor(name, type, localName, dynamic) {
          this.name = name;
          this.type = type;
          this.localName = localName;
          this.dynamic = dynamic;
        }
        _throwError(message, value) {
          logger.throwArgumentError(message, this.localName, value);
        }
      }
      exports.Coder = Coder;
      class Writer {
        constructor(wordSize) {
          (0, properties_1.defineReadOnly)(this, "wordSize", wordSize || 32);
          this._data = [];
          this._dataLength = 0;
          this._padding = new Uint8Array(wordSize);
        }
        get data() {
          return (0, bytes_1.hexConcat)(this._data);
        }
        get length() {
          return this._dataLength;
        }
        _writeData(data) {
          this._data.push(data);
          this._dataLength += data.length;
          return data.length;
        }
        appendWriter(writer) {
          return this._writeData((0, bytes_1.concat)(writer._data));
        }
        writeBytes(value) {
          let bytes = (0, bytes_1.arrayify)(value);
          const paddingOffset = bytes.length % this.wordSize;
          if (paddingOffset) {
            bytes = (0, bytes_1.concat)([ bytes, this._padding.slice(paddingOffset) ]);
          }
          return this._writeData(bytes);
        }
        _getValue(value) {
          let bytes = (0, bytes_1.arrayify)(bignumber_1.BigNumber.from(value));
          if (bytes.length > this.wordSize) {
            logger.throwError("value out-of-bounds", logger_1.Logger.errors.BUFFER_OVERRUN, {
              length: this.wordSize,
              offset: bytes.length
            });
          }
          if (bytes.length % this.wordSize) {
            bytes = (0, bytes_1.concat)([ this._padding.slice(bytes.length % this.wordSize), bytes ]);
          }
          return bytes;
        }
        writeValue(value) {
          return this._writeData(this._getValue(value));
        }
        writeUpdatableValue() {
          const offset = this._data.length;
          this._data.push(this._padding);
          this._dataLength += this.wordSize;
          return value => {
            this._data[offset] = this._getValue(value);
          };
        }
      }
      exports.Writer = Writer;
      class Reader {
        constructor(data, wordSize, coerceFunc, allowLoose) {
          (0, properties_1.defineReadOnly)(this, "_data", (0, bytes_1.arrayify)(data));
          (0, properties_1.defineReadOnly)(this, "wordSize", wordSize || 32);
          (0, properties_1.defineReadOnly)(this, "_coerceFunc", coerceFunc);
          (0, properties_1.defineReadOnly)(this, "allowLoose", allowLoose);
          this._offset = 0;
        }
        get data() {
          return (0, bytes_1.hexlify)(this._data);
        }
        get consumed() {
          return this._offset;
        }
        static coerce(name, value) {
          let match = name.match("^u?int([0-9]+)$");
          if (match && parseInt(match[1]) <= 48) {
            value = value.toNumber();
          }
          return value;
        }
        coerce(name, value) {
          if (this._coerceFunc) {
            return this._coerceFunc(name, value);
          }
          return Reader.coerce(name, value);
        }
        _peekBytes(offset, length, loose) {
          let alignedLength = Math.ceil(length / this.wordSize) * this.wordSize;
          if (this._offset + alignedLength > this._data.length) {
            if (this.allowLoose && loose && this._offset + length <= this._data.length) {
              alignedLength = length;
            } else {
              logger.throwError("data out-of-bounds", logger_1.Logger.errors.BUFFER_OVERRUN, {
                length: this._data.length,
                offset: this._offset + alignedLength
              });
            }
          }
          return this._data.slice(this._offset, this._offset + alignedLength);
        }
        subReader(offset) {
          return new Reader(this._data.slice(this._offset + offset), this.wordSize, this._coerceFunc, this.allowLoose);
        }
        readBytes(length, loose) {
          let bytes = this._peekBytes(0, length, !!loose);
          this._offset += bytes.length;
          return bytes.slice(0, length);
        }
        readValue() {
          return bignumber_1.BigNumber.from(this.readBytes(this.wordSize));
        }
      }
      exports.Reader = Reader;
    },
    7528(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.AddressCoder = void 0;
      const address_1 = __webpack_require__(171);
      const bytes_1 = __webpack_require__(8380);
      const abstract_coder_1 = __webpack_require__(7356);
      class AddressCoder extends abstract_coder_1.Coder {
        constructor(localName) {
          super("address", "address", localName, false);
        }
        defaultValue() {
          return "0x0000000000000000000000000000000000000000000000000000000000000000";
        }
        encode(writer, value) {
          try {
            value = (0, address_1.getAddress)(value);
          } catch (error) {
            this._throwError(error.message, value);
          }
          return writer.writeValue(value);
        }
        decode(reader) {
          return (0, address_1.getAddress)((0, bytes_1.hexZeroPad)(reader.readValue().toHexString(), 32));
        }
      }
      exports.AddressCoder = AddressCoder;
    },
    9921(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.AnonymousCoder = void 0;
      const abstract_coder_1 = __webpack_require__(7356);
      class AnonymousCoder extends abstract_coder_1.Coder {
        constructor(coder) {
          super(coder.name, coder.type, undefined, coder.dynamic);
          this.coder = coder;
        }
        defaultValue() {
          return this.coder.defaultValue();
        }
        encode(writer, value) {
          return this.coder.encode(writer, value);
        }
        decode(reader) {
          return this.coder.decode(reader);
        }
      }
      exports.AnonymousCoder = AnonymousCoder;
    },
    425(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.ArrayCoder = exports.unpack = exports.pack = void 0;
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1446);
      const logger = new logger_1.Logger(_version_1.version);
      const abstract_coder_1 = __webpack_require__(7356);
      const anonymous_1 = __webpack_require__(9921);
      function pack(writer, coders, values) {
        let arrayValues = null;
        if (Array.isArray(values)) {
          arrayValues = values;
        } else if (values && typeof values === "object") {
          let unique = {};
          arrayValues = coders.map((coder => {
            const name = coder.localName;
            if (!name) {
              logger.throwError("cannot encode object for signature with missing names", logger_1.Logger.errors.INVALID_ARGUMENT, {
                argument: "values",
                coder,
                value: values
              });
            }
            if (unique[name]) {
              logger.throwError("cannot encode object for signature with duplicate names", logger_1.Logger.errors.INVALID_ARGUMENT, {
                argument: "values",
                coder,
                value: values
              });
            }
            unique[name] = true;
            return values[name];
          }));
        } else {
          logger.throwArgumentError("invalid tuple value", "tuple", values);
        }
        if (coders.length !== arrayValues.length) {
          logger.throwArgumentError("types/value length mismatch", "tuple", values);
        }
        let staticWriter = new abstract_coder_1.Writer(writer.wordSize);
        let dynamicWriter = new abstract_coder_1.Writer(writer.wordSize);
        let updateFuncs = [];
        coders.forEach(((coder, index) => {
          let value = arrayValues[index];
          if (coder.dynamic) {
            let dynamicOffset = dynamicWriter.length;
            coder.encode(dynamicWriter, value);
            let updateFunc = staticWriter.writeUpdatableValue();
            updateFuncs.push((baseOffset => {
              updateFunc(baseOffset + dynamicOffset);
            }));
          } else {
            coder.encode(staticWriter, value);
          }
        }));
        updateFuncs.forEach((func => {
          func(staticWriter.length);
        }));
        let length = writer.appendWriter(staticWriter);
        length += writer.appendWriter(dynamicWriter);
        return length;
      }
      exports.pack = pack;
      function unpack(reader, coders) {
        let values = [];
        let baseReader = reader.subReader(0);
        coders.forEach((coder => {
          let value = null;
          if (coder.dynamic) {
            let offset = reader.readValue();
            let offsetReader = baseReader.subReader(offset.toNumber());
            try {
              value = coder.decode(offsetReader);
            } catch (error) {
              if (error.code === logger_1.Logger.errors.BUFFER_OVERRUN) {
                throw error;
              }
              value = error;
              value.baseType = coder.name;
              value.name = coder.localName;
              value.type = coder.type;
            }
          } else {
            try {
              value = coder.decode(reader);
            } catch (error) {
              if (error.code === logger_1.Logger.errors.BUFFER_OVERRUN) {
                throw error;
              }
              value = error;
              value.baseType = coder.name;
              value.name = coder.localName;
              value.type = coder.type;
            }
          }
          if (value != undefined) {
            values.push(value);
          }
        }));
        const uniqueNames = coders.reduce(((accum, coder) => {
          const name = coder.localName;
          if (name) {
            if (!accum[name]) {
              accum[name] = 0;
            }
            accum[name]++;
          }
          return accum;
        }), {});
        coders.forEach(((coder, index) => {
          let name = coder.localName;
          if (!name || uniqueNames[name] !== 1) {
            return;
          }
          if (name === "length") {
            name = "_length";
          }
          if (values[name] != null) {
            return;
          }
          const value = values[index];
          if (value instanceof Error) {
            Object.defineProperty(values, name, {
              enumerable: true,
              get: () => {
                throw value;
              }
            });
          } else {
            values[name] = value;
          }
        }));
        for (let i = 0; i < values.length; i++) {
          const value = values[i];
          if (value instanceof Error) {
            Object.defineProperty(values, i, {
              enumerable: true,
              get: () => {
                throw value;
              }
            });
          }
        }
        return Object.freeze(values);
      }
      exports.unpack = unpack;
      class ArrayCoder extends abstract_coder_1.Coder {
        constructor(coder, length, localName) {
          const type = coder.type + "[" + (length >= 0 ? length : "") + "]";
          const dynamic = length === -1 || coder.dynamic;
          super("array", type, localName, dynamic);
          this.coder = coder;
          this.length = length;
        }
        defaultValue() {
          const defaultChild = this.coder.defaultValue();
          const result = [];
          for (let i = 0; i < this.length; i++) {
            result.push(defaultChild);
          }
          return result;
        }
        encode(writer, value) {
          if (!Array.isArray(value)) {
            this._throwError("expected array value", value);
          }
          let count = this.length;
          if (count === -1) {
            count = value.length;
            writer.writeValue(value.length);
          }
          logger.checkArgumentCount(value.length, count, "coder array" + (this.localName ? " " + this.localName : ""));
          let coders = [];
          for (let i = 0; i < value.length; i++) {
            coders.push(this.coder);
          }
          return pack(writer, coders, value);
        }
        decode(reader) {
          let count = this.length;
          if (count === -1) {
            count = reader.readValue().toNumber();
            if (count * 32 > reader._data.length) {
              logger.throwError("insufficient data length", logger_1.Logger.errors.BUFFER_OVERRUN, {
                length: reader._data.length,
                count
              });
            }
          }
          let coders = [];
          for (let i = 0; i < count; i++) {
            coders.push(new anonymous_1.AnonymousCoder(this.coder));
          }
          return reader.coerce(this.name, unpack(reader, coders));
        }
      }
      exports.ArrayCoder = ArrayCoder;
    },
    8044(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.BooleanCoder = void 0;
      const abstract_coder_1 = __webpack_require__(7356);
      class BooleanCoder extends abstract_coder_1.Coder {
        constructor(localName) {
          super("bool", "bool", localName, false);
        }
        defaultValue() {
          return false;
        }
        encode(writer, value) {
          return writer.writeValue(value ? 1 : 0);
        }
        decode(reader) {
          return reader.coerce(this.type, !reader.readValue().isZero());
        }
      }
      exports.BooleanCoder = BooleanCoder;
    },
    2963(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.BytesCoder = exports.DynamicBytesCoder = void 0;
      const bytes_1 = __webpack_require__(8380);
      const abstract_coder_1 = __webpack_require__(7356);
      class DynamicBytesCoder extends abstract_coder_1.Coder {
        constructor(type, localName) {
          super(type, type, localName, true);
        }
        defaultValue() {
          return "0x";
        }
        encode(writer, value) {
          value = (0, bytes_1.arrayify)(value);
          let length = writer.writeValue(value.length);
          length += writer.writeBytes(value);
          return length;
        }
        decode(reader) {
          return reader.readBytes(reader.readValue().toNumber(), true);
        }
      }
      exports.DynamicBytesCoder = DynamicBytesCoder;
      class BytesCoder extends DynamicBytesCoder {
        constructor(localName) {
          super("bytes", localName);
        }
        decode(reader) {
          return reader.coerce(this.name, (0, bytes_1.hexlify)(super.decode(reader)));
        }
      }
      exports.BytesCoder = BytesCoder;
    },
    5332(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.FixedBytesCoder = void 0;
      const bytes_1 = __webpack_require__(8380);
      const abstract_coder_1 = __webpack_require__(7356);
      class FixedBytesCoder extends abstract_coder_1.Coder {
        constructor(size, localName) {
          let name = "bytes" + String(size);
          super(name, name, localName, false);
          this.size = size;
        }
        defaultValue() {
          return "0x0000000000000000000000000000000000000000000000000000000000000000".substring(0, 2 + this.size * 2);
        }
        encode(writer, value) {
          let data = (0, bytes_1.arrayify)(value);
          if (data.length !== this.size) {
            this._throwError("incorrect data length", value);
          }
          return writer.writeBytes(data);
        }
        decode(reader) {
          return reader.coerce(this.name, (0, bytes_1.hexlify)(reader.readBytes(this.size)));
        }
      }
      exports.FixedBytesCoder = FixedBytesCoder;
    },
    2162(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.FunctionCoder = void 0;
      const bytes_1 = __webpack_require__(8380);
      const address_1 = __webpack_require__(171);
      const abstract_coder_1 = __webpack_require__(7356);
      class FunctionCoder extends abstract_coder_1.Coder {
        constructor(localName) {
          super("function", "function", localName, false);
        }
        defaultValue() {
          return "0x" + "00".repeat(32) + "00000000";
        }
        encode(writer, value) {
          let hex = value;
          if (hex.startsWith("0x")) {
            hex = hex.substring(2);
          }
          if (hex.length !== 72) {
            this._throwError("invalid function value (expected 72 hex chars after 0x)", value);
          }
          const addressHex = "0x" + hex.substring(0, 64);
          const selectorHex = "0x" + hex.substring(64, 72);
          (0, address_1.getAddress)(addressHex);
          writer.writeValue(addressHex);
          writer.writeValue(selectorHex);
          return writer.length;
        }
        decode(reader) {
          const addressValue = reader.readValue();
          const selectorValue = reader.readValue();
          const addressHex = (0, bytes_1.hexZeroPad)(addressValue.toHexString(), 32).substring(2);
          const selectorHex = (0, bytes_1.hexZeroPad)(selectorValue.mask(32).toHexString(), 4).substring(2);
          return reader.coerce(this.name, "0x" + addressHex + selectorHex);
        }
      }
      exports.FunctionCoder = FunctionCoder;
    },
    9019(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.NullCoder = void 0;
      const abstract_coder_1 = __webpack_require__(7356);
      class NullCoder extends abstract_coder_1.Coder {
        constructor(localName) {
          super("null", "", localName, false);
        }
        defaultValue() {
          return null;
        }
        encode(writer, value) {
          if (value != null) {
            this._throwError("not null", value);
          }
          return writer.writeBytes([]);
        }
        decode(reader) {
          reader.readBytes(0);
          return reader.coerce(this.name, null);
        }
      }
      exports.NullCoder = NullCoder;
    },
    6607(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.NumberCoder = void 0;
      const bignumber_1 = __webpack_require__(3804);
      const constants_1 = __webpack_require__(846);
      const abstract_coder_1 = __webpack_require__(7356);
      class NumberCoder extends abstract_coder_1.Coder {
        constructor(size, signed, localName) {
          const name = (signed ? "int" : "uint") + size * 8;
          super(name, name, localName, false);
          this.size = size;
          this.signed = signed;
        }
        defaultValue() {
          return 0;
        }
        encode(writer, value) {
          let v = bignumber_1.BigNumber.from(value);
          let maxUintValue = constants_1.MaxUint256.mask(writer.wordSize * 8);
          if (this.signed) {
            let bounds = maxUintValue.mask(this.size * 8 - 1);
            if (v.gt(bounds) || v.lt(bounds.add(constants_1.One).mul(constants_1.NegativeOne))) {
              this._throwError("value out-of-bounds", value);
            }
          } else if (v.lt(constants_1.Zero) || v.gt(maxUintValue.mask(this.size * 8))) {
            this._throwError("value out-of-bounds", value);
          }
          v = v.toTwos(this.size * 8).mask(this.size * 8);
          if (this.signed) {
            v = v.fromTwos(this.size * 8).toTwos(8 * writer.wordSize);
          }
          return writer.writeValue(v);
        }
        decode(reader) {
          let value = reader.readValue().mask(this.size * 8);
          if (this.signed) {
            value = value.fromTwos(this.size * 8);
          }
          return reader.coerce(this.name, value);
        }
      }
      exports.NumberCoder = NumberCoder;
    },
    5807(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.StringCoder = void 0;
      const strings_1 = __webpack_require__(2509);
      const bytes_1 = __webpack_require__(2963);
      class StringCoder extends bytes_1.DynamicBytesCoder {
        constructor(localName) {
          super("string", localName);
        }
        defaultValue() {
          return "";
        }
        encode(writer, value) {
          return super.encode(writer, (0, strings_1.toUtf8Bytes)(value));
        }
        decode(reader) {
          return (0, strings_1.toUtf8String)(super.decode(reader));
        }
      }
      exports.StringCoder = StringCoder;
    },
    9314(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.TupleCoder = void 0;
      const abstract_coder_1 = __webpack_require__(7356);
      const array_1 = __webpack_require__(425);
      class TupleCoder extends abstract_coder_1.Coder {
        constructor(coders, localName) {
          let dynamic = false;
          const types = [];
          coders.forEach((coder => {
            if (coder.dynamic) {
              dynamic = true;
            }
            types.push(coder.type);
          }));
          const type = "tuple(" + types.join(",") + ")";
          super("tuple", type, localName, dynamic);
          this.coders = coders;
        }
        defaultValue() {
          const values = [];
          this.coders.forEach((coder => {
            values.push(coder.defaultValue());
          }));
          const uniqueNames = this.coders.reduce(((accum, coder) => {
            const name = coder.localName;
            if (name) {
              if (!accum[name]) {
                accum[name] = 0;
              }
              accum[name]++;
            }
            return accum;
          }), {});
          this.coders.forEach(((coder, index) => {
            let name = coder.localName;
            if (!name || uniqueNames[name] !== 1) {
              return;
            }
            if (name === "length") {
              name = "_length";
            }
            if (values[name] != null) {
              return;
            }
            values[name] = values[index];
          }));
          return Object.freeze(values);
        }
        encode(writer, value) {
          return (0, array_1.pack)(writer, this.coders, value);
        }
        decode(reader) {
          return reader.coerce(this.name, (0, array_1.unpack)(reader, this.coders));
        }
      }
      exports.TupleCoder = TupleCoder;
    },
    5068(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.ErrorFragment = exports.FunctionFragment = exports.ConstructorFragment = exports.EventFragment = exports.Fragment = exports.ParamType = exports.FormatTypes = void 0;
      const bignumber_1 = __webpack_require__(3804);
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1446);
      const logger = new logger_1.Logger(_version_1.version);
      const _constructorGuard = {};
      let ModifiersBytes = {
        calldata: true,
        memory: true,
        storage: true
      };
      let ModifiersNest = {
        calldata: true,
        memory: true
      };
      function checkModifier(type, name) {
        if (type === "bytes" || type === "string") {
          if (ModifiersBytes[name]) {
            return true;
          }
        } else if (type === "address") {
          if (name === "payable") {
            return true;
          }
        } else if (type.indexOf("[") >= 0 || type === "tuple") {
          if (ModifiersNest[name]) {
            return true;
          }
        }
        if (ModifiersBytes[name] || name === "payable") {
          logger.throwArgumentError("invalid modifier", "name", name);
        }
        return false;
      }
      function parseParamType(param, allowIndexed) {
        let originalParam = param;
        function throwError(i) {
          logger.throwArgumentError(`unexpected character at position ${i}`, "param", param);
        }
        param = param.replace(/\s/g, " ");
        function newNode(parent) {
          let node = {
            type: "",
            name: "",
            parent,
            state: {
              allowType: true
            }
          };
          if (allowIndexed) {
            node.indexed = false;
          }
          return node;
        }
        let parent = {
          type: "",
          name: "",
          state: {
            allowType: true
          }
        };
        let node = parent;
        for (let i = 0; i < param.length; i++) {
          let c = param[i];
          switch (c) {
           case "(":
            if (node.state.allowType && node.type === "") {
              node.type = "tuple";
            } else if (!node.state.allowParams) {
              throwError(i);
            }
            node.state.allowType = false;
            node.type = verifyType(node.type);
            node.components = [ newNode(node) ];
            node = node.components[0];
            break;

           case ")":
            delete node.state;
            if (node.name === "indexed") {
              if (!allowIndexed) {
                throwError(i);
              }
              node.indexed = true;
              node.name = "";
            }
            if (checkModifier(node.type, node.name)) {
              node.name = "";
            }
            node.type = verifyType(node.type);
            let child = node;
            node = node.parent;
            if (!node) {
              throwError(i);
            }
            delete child.parent;
            node.state.allowParams = false;
            node.state.allowName = true;
            node.state.allowArray = true;
            break;

           case ",":
            delete node.state;
            if (node.name === "indexed") {
              if (!allowIndexed) {
                throwError(i);
              }
              node.indexed = true;
              node.name = "";
            }
            if (checkModifier(node.type, node.name)) {
              node.name = "";
            }
            node.type = verifyType(node.type);
            let sibling = newNode(node.parent);
            node.parent.components.push(sibling);
            delete node.parent;
            node = sibling;
            break;

           case " ":
            if (node.state.allowType) {
              if (node.type !== "") {
                node.type = verifyType(node.type);
                delete node.state.allowType;
                node.state.allowName = true;
                node.state.allowParams = true;
              }
            }
            if (node.state.allowName) {
              if (node.name !== "") {
                if (node.name === "indexed") {
                  if (!allowIndexed) {
                    throwError(i);
                  }
                  if (node.indexed) {
                    throwError(i);
                  }
                  node.indexed = true;
                  node.name = "";
                } else if (checkModifier(node.type, node.name)) {
                  node.name = "";
                } else {
                  node.state.allowName = false;
                }
              }
            }
            break;

           case "[":
            if (!node.state.allowArray) {
              throwError(i);
            }
            node.type += c;
            node.state.allowArray = false;
            node.state.allowName = false;
            node.state.readArray = true;
            break;

           case "]":
            if (!node.state.readArray) {
              throwError(i);
            }
            node.type += c;
            node.state.readArray = false;
            node.state.allowArray = true;
            node.state.allowName = true;
            break;

           default:
            if (node.state.allowType) {
              node.type += c;
              node.state.allowParams = true;
              node.state.allowArray = true;
            } else if (node.state.allowName) {
              node.name += c;
              delete node.state.allowArray;
            } else if (node.state.readArray) {
              node.type += c;
            } else {
              throwError(i);
            }
          }
        }
        if (node.parent) {
          logger.throwArgumentError("unexpected eof", "param", param);
        }
        delete parent.state;
        if (node.name === "indexed") {
          if (!allowIndexed) {
            throwError(originalParam.length - 7);
          }
          if (node.indexed) {
            throwError(originalParam.length - 7);
          }
          node.indexed = true;
          node.name = "";
        } else if (checkModifier(node.type, node.name)) {
          node.name = "";
        }
        parent.type = verifyType(parent.type);
        return parent;
      }
      function populate(object, params) {
        for (let key in params) {
          (0, properties_1.defineReadOnly)(object, key, params[key]);
        }
      }
      exports.FormatTypes = Object.freeze({
        sighash: "sighash",
        minimal: "minimal",
        full: "full",
        json: "json"
      });
      const paramTypeArray = new RegExp(/^(.*)\[([0-9]*)\]$/);
      class ParamType {
        constructor(constructorGuard, params) {
          if (constructorGuard !== _constructorGuard) {
            logger.throwError("use fromString", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "new ParamType()"
            });
          }
          populate(this, params);
          let match = this.type.match(paramTypeArray);
          if (match) {
            populate(this, {
              arrayLength: parseInt(match[2] || "-1"),
              arrayChildren: ParamType.fromObject({
                type: match[1],
                components: this.components
              }),
              baseType: "array"
            });
          } else {
            populate(this, {
              arrayLength: null,
              arrayChildren: null,
              baseType: this.components != null ? "tuple" : this.type
            });
          }
          this._isParamType = true;
          Object.freeze(this);
        }
        format(format) {
          if (!format) {
            format = exports.FormatTypes.sighash;
          }
          if (!exports.FormatTypes[format]) {
            logger.throwArgumentError("invalid format type", "format", format);
          }
          if (format === exports.FormatTypes.json) {
            let result = {
              type: this.baseType === "tuple" ? "tuple" : this.type,
              name: this.name || undefined
            };
            if (typeof this.indexed === "boolean") {
              result.indexed = this.indexed;
            }
            if (this.components) {
              result.components = this.components.map((comp => JSON.parse(comp.format(format))));
            }
            return JSON.stringify(result);
          }
          let result = "";
          if (this.baseType === "array") {
            result += this.arrayChildren.format(format);
            result += "[" + (this.arrayLength < 0 ? "" : String(this.arrayLength)) + "]";
          } else {
            if (this.baseType === "tuple") {
              if (format !== exports.FormatTypes.sighash) {
                result += this.type;
              }
              result += "(" + this.components.map((comp => comp.format(format))).join(format === exports.FormatTypes.full ? ", " : ",") + ")";
            } else {
              result += this.type;
            }
          }
          if (format !== exports.FormatTypes.sighash) {
            if (this.indexed === true) {
              result += " indexed";
            }
            if (format === exports.FormatTypes.full && this.name) {
              result += " " + this.name;
            }
          }
          return result;
        }
        static from(value, allowIndexed) {
          if (typeof value === "string") {
            return ParamType.fromString(value, allowIndexed);
          }
          return ParamType.fromObject(value);
        }
        static fromObject(value) {
          if (ParamType.isParamType(value)) {
            return value;
          }
          return new ParamType(_constructorGuard, {
            name: value.name || null,
            type: verifyType(value.type),
            indexed: value.indexed == null ? null : !!value.indexed,
            components: value.components ? value.components.map(ParamType.fromObject) : null
          });
        }
        static fromString(value, allowIndexed) {
          function ParamTypify(node) {
            return ParamType.fromObject({
              name: node.name,
              type: node.type,
              indexed: node.indexed,
              components: node.components
            });
          }
          return ParamTypify(parseParamType(value, !!allowIndexed));
        }
        static isParamType(value) {
          return !!(value != null && value._isParamType);
        }
      }
      exports.ParamType = ParamType;
      function parseParams(value, allowIndex) {
        return splitNesting(value).map((param => ParamType.fromString(param, allowIndex)));
      }
      class Fragment {
        constructor(constructorGuard, params) {
          if (constructorGuard !== _constructorGuard) {
            logger.throwError("use a static from method", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "new Fragment()"
            });
          }
          populate(this, params);
          this._isFragment = true;
          Object.freeze(this);
        }
        static from(value) {
          if (Fragment.isFragment(value)) {
            return value;
          }
          if (typeof value === "string") {
            return Fragment.fromString(value);
          }
          return Fragment.fromObject(value);
        }
        static fromObject(value) {
          if (Fragment.isFragment(value)) {
            return value;
          }
          switch (value.type) {
           case "function":
            return FunctionFragment.fromObject(value);

           case "event":
            return EventFragment.fromObject(value);

           case "constructor":
            return ConstructorFragment.fromObject(value);

           case "error":
            return ErrorFragment.fromObject(value);

           case "fallback":
           case "receive":
            return null;
          }
          return logger.throwArgumentError("invalid fragment object", "value", value);
        }
        static fromString(value) {
          value = value.replace(/\s/g, " ");
          value = value.replace(/\(/g, " (").replace(/\)/g, ") ").replace(/\s+/g, " ");
          value = value.trim();
          if (value.split(" ")[0] === "event") {
            return EventFragment.fromString(value.substring(5).trim());
          } else if (value.split(" ")[0] === "function") {
            return FunctionFragment.fromString(value.substring(8).trim());
          } else if (value.split("(")[0].trim() === "constructor") {
            return ConstructorFragment.fromString(value.trim());
          } else if (value.split(" ")[0] === "error") {
            return ErrorFragment.fromString(value.substring(5).trim());
          }
          return logger.throwArgumentError("unsupported fragment", "value", value);
        }
        static isFragment(value) {
          return !!(value && value._isFragment);
        }
      }
      exports.Fragment = Fragment;
      class EventFragment extends Fragment {
        format(format) {
          if (!format) {
            format = exports.FormatTypes.sighash;
          }
          if (!exports.FormatTypes[format]) {
            logger.throwArgumentError("invalid format type", "format", format);
          }
          if (format === exports.FormatTypes.json) {
            return JSON.stringify({
              type: "event",
              anonymous: this.anonymous,
              name: this.name,
              inputs: this.inputs.map((input => JSON.parse(input.format(format))))
            });
          }
          let result = "";
          if (format !== exports.FormatTypes.sighash) {
            result += "event ";
          }
          result += this.name + "(" + this.inputs.map((input => input.format(format))).join(format === exports.FormatTypes.full ? ", " : ",") + ") ";
          if (format !== exports.FormatTypes.sighash) {
            if (this.anonymous) {
              result += "anonymous ";
            }
          }
          return result.trim();
        }
        static from(value) {
          if (typeof value === "string") {
            return EventFragment.fromString(value);
          }
          return EventFragment.fromObject(value);
        }
        static fromObject(value) {
          if (EventFragment.isEventFragment(value)) {
            return value;
          }
          if (value.type !== "event") {
            logger.throwArgumentError("invalid event object", "value", value);
          }
          const params = {
            name: verifyIdentifier(value.name),
            anonymous: value.anonymous,
            inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : [],
            type: "event"
          };
          return new EventFragment(_constructorGuard, params);
        }
        static fromString(value) {
          let match = value.match(regexParen);
          if (!match) {
            logger.throwArgumentError("invalid event string", "value", value);
          }
          let anonymous = false;
          match[3].split(" ").forEach((modifier => {
            switch (modifier.trim()) {
             case "anonymous":
              anonymous = true;
              break;

             case "":
              break;

             default:
              logger.warn("unknown modifier: " + modifier);
            }
          }));
          return EventFragment.fromObject({
            name: match[1].trim(),
            anonymous,
            inputs: parseParams(match[2], true),
            type: "event"
          });
        }
        static isEventFragment(value) {
          return value && value._isFragment && value.type === "event";
        }
      }
      exports.EventFragment = EventFragment;
      function parseGas(value, params) {
        params.gas = null;
        let comps = value.split("@");
        if (comps.length !== 1) {
          if (comps.length > 2) {
            logger.throwArgumentError("invalid human-readable ABI signature", "value", value);
          }
          if (!comps[1].match(/^[0-9]+$/)) {
            logger.throwArgumentError("invalid human-readable ABI signature gas", "value", value);
          }
          params.gas = bignumber_1.BigNumber.from(comps[1]);
          return comps[0];
        }
        return value;
      }
      function parseModifiers(value, params) {
        params.constant = false;
        params.payable = false;
        params.stateMutability = "nonpayable";
        value.split(" ").forEach((modifier => {
          switch (modifier.trim()) {
           case "constant":
            params.constant = true;
            break;

           case "payable":
            params.payable = true;
            params.stateMutability = "payable";
            break;

           case "nonpayable":
            params.payable = false;
            params.stateMutability = "nonpayable";
            break;

           case "pure":
            params.constant = true;
            params.stateMutability = "pure";
            break;

           case "view":
            params.constant = true;
            params.stateMutability = "view";
            break;

           case "external":
           case "public":
           case "":
            break;

           default:
            console.log("unknown modifier: " + modifier);
          }
        }));
      }
      function verifyState(value) {
        let result = {
          constant: false,
          payable: true,
          stateMutability: "payable"
        };
        if (value.stateMutability != null) {
          result.stateMutability = value.stateMutability;
          result.constant = result.stateMutability === "view" || result.stateMutability === "pure";
          if (value.constant != null) {
            if (!!value.constant !== result.constant) {
              logger.throwArgumentError("cannot have constant function with mutability " + result.stateMutability, "value", value);
            }
          }
          result.payable = result.stateMutability === "payable";
          if (value.payable != null) {
            if (!!value.payable !== result.payable) {
              logger.throwArgumentError("cannot have payable function with mutability " + result.stateMutability, "value", value);
            }
          }
        } else if (value.payable != null) {
          result.payable = !!value.payable;
          if (value.constant == null && !result.payable && value.type !== "constructor") {
            logger.throwArgumentError("unable to determine stateMutability", "value", value);
          }
          result.constant = !!value.constant;
          if (result.constant) {
            result.stateMutability = "view";
          } else {
            result.stateMutability = result.payable ? "payable" : "nonpayable";
          }
          if (result.payable && result.constant) {
            logger.throwArgumentError("cannot have constant payable function", "value", value);
          }
        } else if (value.constant != null) {
          result.constant = !!value.constant;
          result.payable = !result.constant;
          result.stateMutability = result.constant ? "view" : "payable";
        } else if (value.type !== "constructor") {
          logger.throwArgumentError("unable to determine stateMutability", "value", value);
        }
        return result;
      }
      class ConstructorFragment extends Fragment {
        format(format) {
          if (!format) {
            format = exports.FormatTypes.sighash;
          }
          if (!exports.FormatTypes[format]) {
            logger.throwArgumentError("invalid format type", "format", format);
          }
          if (format === exports.FormatTypes.json) {
            return JSON.stringify({
              type: "constructor",
              stateMutability: this.stateMutability !== "nonpayable" ? this.stateMutability : undefined,
              payable: this.payable,
              gas: this.gas ? this.gas.toNumber() : undefined,
              inputs: this.inputs.map((input => JSON.parse(input.format(format))))
            });
          }
          if (format === exports.FormatTypes.sighash) {
            logger.throwError("cannot format a constructor for sighash", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "format(sighash)"
            });
          }
          let result = "constructor(" + this.inputs.map((input => input.format(format))).join(format === exports.FormatTypes.full ? ", " : ",") + ") ";
          if (this.stateMutability && this.stateMutability !== "nonpayable") {
            result += this.stateMutability + " ";
          }
          return result.trim();
        }
        static from(value) {
          if (typeof value === "string") {
            return ConstructorFragment.fromString(value);
          }
          return ConstructorFragment.fromObject(value);
        }
        static fromObject(value) {
          if (ConstructorFragment.isConstructorFragment(value)) {
            return value;
          }
          if (value.type !== "constructor") {
            logger.throwArgumentError("invalid constructor object", "value", value);
          }
          let state = verifyState(value);
          if (state.constant) {
            logger.throwArgumentError("constructor cannot be constant", "value", value);
          }
          const params = {
            name: null,
            type: value.type,
            inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : [],
            payable: state.payable,
            stateMutability: state.stateMutability,
            gas: value.gas ? bignumber_1.BigNumber.from(value.gas) : null
          };
          return new ConstructorFragment(_constructorGuard, params);
        }
        static fromString(value) {
          let params = {
            type: "constructor"
          };
          value = parseGas(value, params);
          let parens = value.match(regexParen);
          if (!parens || parens[1].trim() !== "constructor") {
            logger.throwArgumentError("invalid constructor string", "value", value);
          }
          params.inputs = parseParams(parens[2].trim(), false);
          parseModifiers(parens[3].trim(), params);
          return ConstructorFragment.fromObject(params);
        }
        static isConstructorFragment(value) {
          return value && value._isFragment && value.type === "constructor";
        }
      }
      exports.ConstructorFragment = ConstructorFragment;
      class FunctionFragment extends ConstructorFragment {
        format(format) {
          if (!format) {
            format = exports.FormatTypes.sighash;
          }
          if (!exports.FormatTypes[format]) {
            logger.throwArgumentError("invalid format type", "format", format);
          }
          if (format === exports.FormatTypes.json) {
            return JSON.stringify({
              type: "function",
              name: this.name,
              constant: this.constant,
              stateMutability: this.stateMutability !== "nonpayable" ? this.stateMutability : undefined,
              payable: this.payable,
              gas: this.gas ? this.gas.toNumber() : undefined,
              inputs: this.inputs.map((input => JSON.parse(input.format(format)))),
              outputs: this.outputs.map((output => JSON.parse(output.format(format))))
            });
          }
          let result = "";
          if (format !== exports.FormatTypes.sighash) {
            result += "function ";
          }
          result += this.name + "(" + this.inputs.map((input => input.format(format))).join(format === exports.FormatTypes.full ? ", " : ",") + ") ";
          if (format !== exports.FormatTypes.sighash) {
            if (this.stateMutability) {
              if (this.stateMutability !== "nonpayable") {
                result += this.stateMutability + " ";
              }
            } else if (this.constant) {
              result += "view ";
            }
            if (this.outputs && this.outputs.length) {
              result += "returns (" + this.outputs.map((output => output.format(format))).join(", ") + ") ";
            }
            if (this.gas != null) {
              result += "@" + this.gas.toString() + " ";
            }
          }
          return result.trim();
        }
        static from(value) {
          if (typeof value === "string") {
            return FunctionFragment.fromString(value);
          }
          return FunctionFragment.fromObject(value);
        }
        static fromObject(value) {
          if (FunctionFragment.isFunctionFragment(value)) {
            return value;
          }
          if (value.type !== "function") {
            logger.throwArgumentError("invalid function object", "value", value);
          }
          let state = verifyState(value);
          const params = {
            type: value.type,
            name: verifyIdentifier(value.name),
            constant: state.constant,
            inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : [],
            outputs: value.outputs ? value.outputs.map(ParamType.fromObject) : [],
            payable: state.payable,
            stateMutability: state.stateMutability,
            gas: value.gas ? bignumber_1.BigNumber.from(value.gas) : null
          };
          return new FunctionFragment(_constructorGuard, params);
        }
        static fromString(value) {
          let params = {
            type: "function"
          };
          value = parseGas(value, params);
          let comps = value.split(" returns ");
          if (comps.length > 2) {
            logger.throwArgumentError("invalid function string", "value", value);
          }
          let parens = comps[0].match(regexParen);
          if (!parens) {
            logger.throwArgumentError("invalid function signature", "value", value);
          }
          params.name = parens[1].trim();
          if (params.name) {
            verifyIdentifier(params.name);
          }
          params.inputs = parseParams(parens[2], false);
          parseModifiers(parens[3].trim(), params);
          if (comps.length > 1) {
            let returns = comps[1].match(regexParen);
            if (returns[1].trim() != "" || returns[3].trim() != "") {
              logger.throwArgumentError("unexpected tokens", "value", value);
            }
            params.outputs = parseParams(returns[2], false);
          } else {
            params.outputs = [];
          }
          return FunctionFragment.fromObject(params);
        }
        static isFunctionFragment(value) {
          return value && value._isFragment && value.type === "function";
        }
      }
      exports.FunctionFragment = FunctionFragment;
      function checkForbidden(fragment) {
        const sig = fragment.format();
        if (sig === "Error(string)" || sig === "Panic(uint256)") {
          logger.throwArgumentError(`cannot specify user defined ${sig} error`, "fragment", fragment);
        }
        return fragment;
      }
      class ErrorFragment extends Fragment {
        format(format) {
          if (!format) {
            format = exports.FormatTypes.sighash;
          }
          if (!exports.FormatTypes[format]) {
            logger.throwArgumentError("invalid format type", "format", format);
          }
          if (format === exports.FormatTypes.json) {
            return JSON.stringify({
              type: "error",
              name: this.name,
              inputs: this.inputs.map((input => JSON.parse(input.format(format))))
            });
          }
          let result = "";
          if (format !== exports.FormatTypes.sighash) {
            result += "error ";
          }
          result += this.name + "(" + this.inputs.map((input => input.format(format))).join(format === exports.FormatTypes.full ? ", " : ",") + ") ";
          return result.trim();
        }
        static from(value) {
          if (typeof value === "string") {
            return ErrorFragment.fromString(value);
          }
          return ErrorFragment.fromObject(value);
        }
        static fromObject(value) {
          if (ErrorFragment.isErrorFragment(value)) {
            return value;
          }
          if (value.type !== "error") {
            logger.throwArgumentError("invalid error object", "value", value);
          }
          const params = {
            type: value.type,
            name: verifyIdentifier(value.name),
            inputs: value.inputs ? value.inputs.map(ParamType.fromObject) : []
          };
          return checkForbidden(new ErrorFragment(_constructorGuard, params));
        }
        static fromString(value) {
          let params = {
            type: "error"
          };
          let parens = value.match(regexParen);
          if (!parens) {
            logger.throwArgumentError("invalid error signature", "value", value);
          }
          params.name = parens[1].trim();
          if (params.name) {
            verifyIdentifier(params.name);
          }
          params.inputs = parseParams(parens[2], false);
          return checkForbidden(ErrorFragment.fromObject(params));
        }
        static isErrorFragment(value) {
          return value && value._isFragment && value.type === "error";
        }
      }
      exports.ErrorFragment = ErrorFragment;
      function verifyType(type) {
        if (type.match(/^uint($|[^1-9])/)) {
          type = "uint256" + type.substring(4);
        } else if (type.match(/^int($|[^1-9])/)) {
          type = "int256" + type.substring(3);
        }
        return type;
      }
      const regexIdentifier = new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");
      function verifyIdentifier(value) {
        if (!value || !value.match(regexIdentifier)) {
          logger.throwArgumentError(`invalid identifier "${value}"`, "value", value);
        }
        return value;
      }
      const regexParen = new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");
      function splitNesting(value) {
        value = value.trim();
        let result = [];
        let accum = "";
        let depth = 0;
        for (let offset = 0; offset < value.length; offset++) {
          let c = value[offset];
          if (c === "," && depth === 0) {
            result.push(accum);
            accum = "";
          } else {
            accum += c;
            if (c === "(") {
              depth++;
            } else if (c === ")") {
              depth--;
              if (depth === -1) {
                logger.throwArgumentError("unbalanced parenthesis", "value", value);
              }
            }
          }
        }
        if (accum) {
          result.push(accum);
        }
        return result;
      }
    },
    7989(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.TransactionDescription = exports.LogDescription = exports.checkResultErrors = exports.Indexed = exports.Interface = exports.defaultAbiCoder = exports.AbiCoder = exports.FormatTypes = exports.ParamType = exports.FunctionFragment = exports.Fragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = void 0;
      const fragments_1 = __webpack_require__(5068);
      Object.defineProperty(exports, "ConstructorFragment", {
        enumerable: true,
        get: function() {
          return fragments_1.ConstructorFragment;
        }
      });
      Object.defineProperty(exports, "ErrorFragment", {
        enumerable: true,
        get: function() {
          return fragments_1.ErrorFragment;
        }
      });
      Object.defineProperty(exports, "EventFragment", {
        enumerable: true,
        get: function() {
          return fragments_1.EventFragment;
        }
      });
      Object.defineProperty(exports, "FormatTypes", {
        enumerable: true,
        get: function() {
          return fragments_1.FormatTypes;
        }
      });
      Object.defineProperty(exports, "Fragment", {
        enumerable: true,
        get: function() {
          return fragments_1.Fragment;
        }
      });
      Object.defineProperty(exports, "FunctionFragment", {
        enumerable: true,
        get: function() {
          return fragments_1.FunctionFragment;
        }
      });
      Object.defineProperty(exports, "ParamType", {
        enumerable: true,
        get: function() {
          return fragments_1.ParamType;
        }
      });
      const abi_coder_1 = __webpack_require__(2975);
      Object.defineProperty(exports, "AbiCoder", {
        enumerable: true,
        get: function() {
          return abi_coder_1.AbiCoder;
        }
      });
      Object.defineProperty(exports, "defaultAbiCoder", {
        enumerable: true,
        get: function() {
          return abi_coder_1.defaultAbiCoder;
        }
      });
      const interface_1 = __webpack_require__(1590);
      Object.defineProperty(exports, "checkResultErrors", {
        enumerable: true,
        get: function() {
          return interface_1.checkResultErrors;
        }
      });
      Object.defineProperty(exports, "Indexed", {
        enumerable: true,
        get: function() {
          return interface_1.Indexed;
        }
      });
      Object.defineProperty(exports, "Interface", {
        enumerable: true,
        get: function() {
          return interface_1.Interface;
        }
      });
      Object.defineProperty(exports, "LogDescription", {
        enumerable: true,
        get: function() {
          return interface_1.LogDescription;
        }
      });
      Object.defineProperty(exports, "TransactionDescription", {
        enumerable: true,
        get: function() {
          return interface_1.TransactionDescription;
        }
      });
    },
    1590(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Interface = exports.Indexed = exports.ErrorDescription = exports.TransactionDescription = exports.LogDescription = exports.checkResultErrors = void 0;
      const address_1 = __webpack_require__(171);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const hash_1 = __webpack_require__(413);
      const keccak256_1 = __webpack_require__(1136);
      const properties_1 = __webpack_require__(1476);
      const abi_coder_1 = __webpack_require__(2975);
      const abstract_coder_1 = __webpack_require__(7356);
      Object.defineProperty(exports, "checkResultErrors", {
        enumerable: true,
        get: function() {
          return abstract_coder_1.checkResultErrors;
        }
      });
      const fragments_1 = __webpack_require__(5068);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1446);
      const logger = new logger_1.Logger(_version_1.version);
      class LogDescription extends properties_1.Description {}
      exports.LogDescription = LogDescription;
      class TransactionDescription extends properties_1.Description {}
      exports.TransactionDescription = TransactionDescription;
      class ErrorDescription extends properties_1.Description {}
      exports.ErrorDescription = ErrorDescription;
      class Indexed extends properties_1.Description {
        static isIndexed(value) {
          return !!(value && value._isIndexed);
        }
      }
      exports.Indexed = Indexed;
      const BuiltinErrors = {
        "0x08c379a0": {
          signature: "Error(string)",
          name: "Error",
          inputs: [ "string" ],
          reason: true
        },
        "0x4e487b71": {
          signature: "Panic(uint256)",
          name: "Panic",
          inputs: [ "uint256" ]
        }
      };
      function wrapAccessError(property, error) {
        const wrap = new Error(`deferred error during ABI decoding triggered accessing ${property}`);
        wrap.error = error;
        return wrap;
      }
      class Interface {
        constructor(fragments) {
          let abi = [];
          if (typeof fragments === "string") {
            abi = JSON.parse(fragments);
          } else {
            abi = fragments;
          }
          (0, properties_1.defineReadOnly)(this, "fragments", abi.map((fragment => fragments_1.Fragment.from(fragment))).filter((fragment => fragment != null)));
          (0, properties_1.defineReadOnly)(this, "_abiCoder", (0, properties_1.getStatic)(new.target, "getAbiCoder")());
          (0, properties_1.defineReadOnly)(this, "functions", {});
          (0, properties_1.defineReadOnly)(this, "errors", {});
          (0, properties_1.defineReadOnly)(this, "events", {});
          (0, properties_1.defineReadOnly)(this, "structs", {});
          this.fragments.forEach((fragment => {
            let bucket = null;
            switch (fragment.type) {
             case "constructor":
              if (this.deploy) {
                logger.warn("duplicate definition - constructor");
                return;
              }
              (0, properties_1.defineReadOnly)(this, "deploy", fragment);
              return;

             case "function":
              bucket = this.functions;
              break;

             case "event":
              bucket = this.events;
              break;

             case "error":
              bucket = this.errors;
              break;

             default:
              return;
            }
            let signature = fragment.format();
            if (bucket[signature]) {
              logger.warn("duplicate definition - " + signature);
              return;
            }
            bucket[signature] = fragment;
          }));
          if (!this.deploy) {
            (0, properties_1.defineReadOnly)(this, "deploy", fragments_1.ConstructorFragment.from({
              payable: false,
              type: "constructor"
            }));
          }
          (0, properties_1.defineReadOnly)(this, "_isInterface", true);
        }
        format(format) {
          if (!format) {
            format = fragments_1.FormatTypes.full;
          }
          if (format === fragments_1.FormatTypes.sighash) {
            logger.throwArgumentError("interface does not support formatting sighash", "format", format);
          }
          const abi = this.fragments.map((fragment => fragment.format(format)));
          if (format === fragments_1.FormatTypes.json) {
            return JSON.stringify(abi.map((j => JSON.parse(j))));
          }
          return abi;
        }
        static getAbiCoder() {
          return abi_coder_1.defaultAbiCoder;
        }
        static getAddress(address) {
          return (0, address_1.getAddress)(address);
        }
        static getSighash(fragment) {
          return (0, bytes_1.hexDataSlice)((0, hash_1.id)(fragment.format()), 0, 4);
        }
        static getEventTopic(eventFragment) {
          return (0, hash_1.id)(eventFragment.format());
        }
        getFunction(nameOrSignatureOrSighash) {
          if ((0, bytes_1.isHexString)(nameOrSignatureOrSighash)) {
            for (const name in this.functions) {
              if (nameOrSignatureOrSighash === this.getSighash(name)) {
                return this.functions[name];
              }
            }
            logger.throwArgumentError("no matching function", "sighash", nameOrSignatureOrSighash);
          }
          if (nameOrSignatureOrSighash.indexOf("(") === -1) {
            const name = nameOrSignatureOrSighash.trim();
            const matching = Object.keys(this.functions).filter((f => f.split("(")[0] === name));
            if (matching.length === 0) {
              logger.throwArgumentError("no matching function", "name", name);
            } else if (matching.length > 1) {
              logger.throwArgumentError("multiple matching functions", "name", name);
            }
            return this.functions[matching[0]];
          }
          const result = this.functions[fragments_1.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
          if (!result) {
            logger.throwArgumentError("no matching function", "signature", nameOrSignatureOrSighash);
          }
          return result;
        }
        getEvent(nameOrSignatureOrTopic) {
          if ((0, bytes_1.isHexString)(nameOrSignatureOrTopic)) {
            const topichash = nameOrSignatureOrTopic.toLowerCase();
            for (const name in this.events) {
              if (topichash === this.getEventTopic(name)) {
                return this.events[name];
              }
            }
            logger.throwArgumentError("no matching event", "topichash", topichash);
          }
          if (nameOrSignatureOrTopic.indexOf("(") === -1) {
            const name = nameOrSignatureOrTopic.trim();
            const matching = Object.keys(this.events).filter((f => f.split("(")[0] === name));
            if (matching.length === 0) {
              logger.throwArgumentError("no matching event", "name", name);
            } else if (matching.length > 1) {
              logger.throwArgumentError("multiple matching events", "name", name);
            }
            return this.events[matching[0]];
          }
          const result = this.events[fragments_1.EventFragment.fromString(nameOrSignatureOrTopic).format()];
          if (!result) {
            logger.throwArgumentError("no matching event", "signature", nameOrSignatureOrTopic);
          }
          return result;
        }
        getError(nameOrSignatureOrSighash) {
          if ((0, bytes_1.isHexString)(nameOrSignatureOrSighash)) {
            const getSighash = (0, properties_1.getStatic)(this.constructor, "getSighash");
            for (const name in this.errors) {
              const error = this.errors[name];
              if (nameOrSignatureOrSighash === getSighash(error)) {
                return this.errors[name];
              }
            }
            logger.throwArgumentError("no matching error", "sighash", nameOrSignatureOrSighash);
          }
          if (nameOrSignatureOrSighash.indexOf("(") === -1) {
            const name = nameOrSignatureOrSighash.trim();
            const matching = Object.keys(this.errors).filter((f => f.split("(")[0] === name));
            if (matching.length === 0) {
              logger.throwArgumentError("no matching error", "name", name);
            } else if (matching.length > 1) {
              logger.throwArgumentError("multiple matching errors", "name", name);
            }
            return this.errors[matching[0]];
          }
          const result = this.errors[fragments_1.FunctionFragment.fromString(nameOrSignatureOrSighash).format()];
          if (!result) {
            logger.throwArgumentError("no matching error", "signature", nameOrSignatureOrSighash);
          }
          return result;
        }
        getSighash(fragment) {
          if (typeof fragment === "string") {
            try {
              fragment = this.getFunction(fragment);
            } catch (error) {
              try {
                fragment = this.getError(fragment);
              } catch (_) {
                throw error;
              }
            }
          }
          return (0, properties_1.getStatic)(this.constructor, "getSighash")(fragment);
        }
        getEventTopic(eventFragment) {
          if (typeof eventFragment === "string") {
            eventFragment = this.getEvent(eventFragment);
          }
          return (0, properties_1.getStatic)(this.constructor, "getEventTopic")(eventFragment);
        }
        _decodeParams(params, data) {
          return this._abiCoder.decode(params, data);
        }
        _encodeParams(params, values) {
          return this._abiCoder.encode(params, values);
        }
        encodeDeploy(values) {
          return this._encodeParams(this.deploy.inputs, values || []);
        }
        decodeErrorResult(fragment, data) {
          if (typeof fragment === "string") {
            fragment = this.getError(fragment);
          }
          const bytes = (0, bytes_1.arrayify)(data);
          if ((0, bytes_1.hexlify)(bytes.slice(0, 4)) !== this.getSighash(fragment)) {
            logger.throwArgumentError(`data signature does not match error ${fragment.name}.`, "data", (0, 
            bytes_1.hexlify)(bytes));
          }
          return this._decodeParams(fragment.inputs, bytes.slice(4));
        }
        encodeErrorResult(fragment, values) {
          if (typeof fragment === "string") {
            fragment = this.getError(fragment);
          }
          return (0, bytes_1.hexlify)((0, bytes_1.concat)([ this.getSighash(fragment), this._encodeParams(fragment.inputs, values || []) ]));
        }
        decodeFunctionData(functionFragment, data) {
          if (typeof functionFragment === "string") {
            functionFragment = this.getFunction(functionFragment);
          }
          const bytes = (0, bytes_1.arrayify)(data);
          if ((0, bytes_1.hexlify)(bytes.slice(0, 4)) !== this.getSighash(functionFragment)) {
            logger.throwArgumentError(`data signature does not match function ${functionFragment.name}.`, "data", (0, 
            bytes_1.hexlify)(bytes));
          }
          return this._decodeParams(functionFragment.inputs, bytes.slice(4));
        }
        encodeFunctionData(functionFragment, values) {
          if (typeof functionFragment === "string") {
            functionFragment = this.getFunction(functionFragment);
          }
          return (0, bytes_1.hexlify)((0, bytes_1.concat)([ this.getSighash(functionFragment), this._encodeParams(functionFragment.inputs, values || []) ]));
        }
        decodeFunctionResult(functionFragment, data) {
          if (typeof functionFragment === "string") {
            functionFragment = this.getFunction(functionFragment);
          }
          let bytes = (0, bytes_1.arrayify)(data);
          let reason = null;
          let message = "";
          let errorArgs = null;
          let errorName = null;
          let errorSignature = null;
          switch (bytes.length % this._abiCoder._getWordSize()) {
           case 0:
            try {
              return this._abiCoder.decode(functionFragment.outputs, bytes);
            } catch (error) {}
            break;

           case 4:
            {
              const selector = (0, bytes_1.hexlify)(bytes.slice(0, 4));
              const builtin = BuiltinErrors[selector];
              if (builtin) {
                errorArgs = this._abiCoder.decode(builtin.inputs, bytes.slice(4));
                errorName = builtin.name;
                errorSignature = builtin.signature;
                if (builtin.reason) {
                  reason = errorArgs[0];
                }
                if (errorName === "Error") {
                  message = `; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(errorArgs[0])}`;
                } else if (errorName === "Panic") {
                  message = `; VM Exception while processing transaction: reverted with panic code ${errorArgs[0]}`;
                }
              } else {
                try {
                  const error = this.getError(selector);
                  errorArgs = this._abiCoder.decode(error.inputs, bytes.slice(4));
                  errorName = error.name;
                  errorSignature = error.format();
                } catch (error) {}
              }
              break;
            }
          }
          return logger.throwError("call revert exception" + message, logger_1.Logger.errors.CALL_EXCEPTION, {
            method: functionFragment.format(),
            data: (0, bytes_1.hexlify)(data),
            errorArgs,
            errorName,
            errorSignature,
            reason
          });
        }
        encodeFunctionResult(functionFragment, values) {
          if (typeof functionFragment === "string") {
            functionFragment = this.getFunction(functionFragment);
          }
          return (0, bytes_1.hexlify)(this._abiCoder.encode(functionFragment.outputs, values || []));
        }
        encodeFilterTopics(eventFragment, values) {
          if (typeof eventFragment === "string") {
            eventFragment = this.getEvent(eventFragment);
          }
          if (values.length > eventFragment.inputs.length) {
            logger.throwError("too many arguments for " + eventFragment.format(), logger_1.Logger.errors.UNEXPECTED_ARGUMENT, {
              argument: "values",
              value: values
            });
          }
          let topics = [];
          if (!eventFragment.anonymous) {
            topics.push(this.getEventTopic(eventFragment));
          }
          const encodeTopic = (param, value) => {
            if (param.type === "string") {
              return (0, hash_1.id)(value);
            } else if (param.type === "bytes") {
              return (0, keccak256_1.keccak256)((0, bytes_1.hexlify)(value));
            }
            if (param.type === "bool" && typeof value === "boolean") {
              value = value ? "0x01" : "0x00";
            }
            if (param.type.match(/^u?int/)) {
              value = bignumber_1.BigNumber.from(value).toHexString();
            }
            if (param.type === "address") {
              this._abiCoder.encode([ "address" ], [ value ]);
            }
            return (0, bytes_1.hexZeroPad)((0, bytes_1.hexlify)(value), 32);
          };
          values.forEach(((value, index) => {
            let param = eventFragment.inputs[index];
            if (!param.indexed) {
              if (value != null) {
                logger.throwArgumentError("cannot filter non-indexed parameters; must be null", "contract." + param.name, value);
              }
              return;
            }
            if (value == null) {
              topics.push(null);
            } else if (param.baseType === "array" || param.baseType === "tuple") {
              logger.throwArgumentError("filtering with tuples or arrays not supported", "contract." + param.name, value);
            } else if (Array.isArray(value)) {
              topics.push(value.map((value => encodeTopic(param, value))));
            } else {
              topics.push(encodeTopic(param, value));
            }
          }));
          while (topics.length && topics[topics.length - 1] === null) {
            topics.pop();
          }
          return topics;
        }
        encodeEventLog(eventFragment, values) {
          if (typeof eventFragment === "string") {
            eventFragment = this.getEvent(eventFragment);
          }
          const topics = [];
          const dataTypes = [];
          const dataValues = [];
          if (!eventFragment.anonymous) {
            topics.push(this.getEventTopic(eventFragment));
          }
          if (values.length !== eventFragment.inputs.length) {
            logger.throwArgumentError("event arguments/values mismatch", "values", values);
          }
          eventFragment.inputs.forEach(((param, index) => {
            const value = values[index];
            if (param.indexed) {
              if (param.type === "string") {
                topics.push((0, hash_1.id)(value));
              } else if (param.type === "bytes") {
                topics.push((0, keccak256_1.keccak256)(value));
              } else if (param.baseType === "tuple" || param.baseType === "array") {
                throw new Error("not implemented");
              } else {
                topics.push(this._abiCoder.encode([ param.type ], [ value ]));
              }
            } else {
              dataTypes.push(param);
              dataValues.push(value);
            }
          }));
          return {
            data: this._abiCoder.encode(dataTypes, dataValues),
            topics
          };
        }
        decodeEventLog(eventFragment, data, topics) {
          if (typeof eventFragment === "string") {
            eventFragment = this.getEvent(eventFragment);
          }
          if (topics != null && !eventFragment.anonymous) {
            let topicHash = this.getEventTopic(eventFragment);
            if (!(0, bytes_1.isHexString)(topics[0], 32) || topics[0].toLowerCase() !== topicHash) {
              logger.throwError("fragment/topic mismatch", logger_1.Logger.errors.INVALID_ARGUMENT, {
                argument: "topics[0]",
                expected: topicHash,
                value: topics[0]
              });
            }
            topics = topics.slice(1);
          }
          let indexed = [];
          let nonIndexed = [];
          let dynamic = [];
          eventFragment.inputs.forEach(((param, index) => {
            if (param.indexed) {
              if (param.type === "string" || param.type === "bytes" || param.baseType === "tuple" || param.baseType === "array") {
                indexed.push(fragments_1.ParamType.fromObject({
                  type: "bytes32",
                  name: param.name
                }));
                dynamic.push(true);
              } else {
                indexed.push(param);
                dynamic.push(false);
              }
            } else {
              nonIndexed.push(param);
              dynamic.push(false);
            }
          }));
          let resultIndexed = topics != null ? this._abiCoder.decode(indexed, (0, bytes_1.concat)(topics)) : null;
          let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);
          let result = [];
          let nonIndexedIndex = 0, indexedIndex = 0;
          eventFragment.inputs.forEach(((param, index) => {
            if (param.indexed) {
              if (resultIndexed == null) {
                result[index] = new Indexed({
                  _isIndexed: true,
                  hash: null
                });
              } else if (dynamic[index]) {
                result[index] = new Indexed({
                  _isIndexed: true,
                  hash: resultIndexed[indexedIndex++]
                });
              } else {
                try {
                  result[index] = resultIndexed[indexedIndex++];
                } catch (error) {
                  result[index] = error;
                }
              }
            } else {
              try {
                result[index] = resultNonIndexed[nonIndexedIndex++];
              } catch (error) {
                result[index] = error;
              }
            }
            if (param.name && result[param.name] == null) {
              const value = result[index];
              if (value instanceof Error) {
                Object.defineProperty(result, param.name, {
                  enumerable: true,
                  get: () => {
                    throw wrapAccessError(`property ${JSON.stringify(param.name)}`, value);
                  }
                });
              } else {
                result[param.name] = value;
              }
            }
          }));
          for (let i = 0; i < result.length; i++) {
            const value = result[i];
            if (value instanceof Error) {
              Object.defineProperty(result, i, {
                enumerable: true,
                get: () => {
                  throw wrapAccessError(`index ${i}`, value);
                }
              });
            }
          }
          return Object.freeze(result);
        }
        parseTransaction(tx) {
          let fragment = this.getFunction(tx.data.substring(0, 10).toLowerCase());
          if (!fragment) {
            return null;
          }
          return new TransactionDescription({
            args: this._abiCoder.decode(fragment.inputs, "0x" + tx.data.substring(10)),
            functionFragment: fragment,
            name: fragment.name,
            signature: fragment.format(),
            sighash: this.getSighash(fragment),
            value: bignumber_1.BigNumber.from(tx.value || "0")
          });
        }
        parseLog(log) {
          let fragment = this.getEvent(log.topics[0]);
          if (!fragment || fragment.anonymous) {
            return null;
          }
          return new LogDescription({
            eventFragment: fragment,
            name: fragment.name,
            signature: fragment.format(),
            topic: this.getEventTopic(fragment),
            args: this.decodeEventLog(fragment, log.data, log.topics)
          });
        }
        parseError(data) {
          const hexData = (0, bytes_1.hexlify)(data);
          let fragment = this.getError(hexData.substring(0, 10).toLowerCase());
          if (!fragment) {
            return null;
          }
          return new ErrorDescription({
            args: this._abiCoder.decode(fragment.inputs, "0x" + hexData.substring(10)),
            errorFragment: fragment,
            name: fragment.name,
            signature: fragment.format(),
            sighash: this.getSighash(fragment)
          });
        }
        static isInterface(value) {
          return !!(value && value._isInterface);
        }
      }
      exports.Interface = Interface;
    },
    3280(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "abstract-provider/5.7.4";
    },
    103(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Provider = exports.TransactionOrderForkEvent = exports.TransactionForkEvent = exports.BlockForkEvent = exports.ForkEvent = void 0;
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(3280);
      const logger = new logger_1.Logger(_version_1.version);
      class ForkEvent extends properties_1.Description {
        static isForkEvent(value) {
          return !!(value && value._isForkEvent);
        }
      }
      exports.ForkEvent = ForkEvent;
      class BlockForkEvent extends ForkEvent {
        constructor(blockHash, expiry) {
          if (!(0, bytes_1.isHexString)(blockHash, 32)) {
            logger.throwArgumentError("invalid blockHash", "blockHash", blockHash);
          }
          super({
            _isForkEvent: true,
            _isBlockForkEvent: true,
            expiry: expiry || 0,
            blockHash
          });
        }
      }
      exports.BlockForkEvent = BlockForkEvent;
      class TransactionForkEvent extends ForkEvent {
        constructor(hash, expiry) {
          if (!(0, bytes_1.isHexString)(hash, 32)) {
            logger.throwArgumentError("invalid transaction hash", "hash", hash);
          }
          super({
            _isForkEvent: true,
            _isTransactionForkEvent: true,
            expiry: expiry || 0,
            hash
          });
        }
      }
      exports.TransactionForkEvent = TransactionForkEvent;
      class TransactionOrderForkEvent extends ForkEvent {
        constructor(beforeHash, afterHash, expiry) {
          if (!(0, bytes_1.isHexString)(beforeHash, 32)) {
            logger.throwArgumentError("invalid transaction hash", "beforeHash", beforeHash);
          }
          if (!(0, bytes_1.isHexString)(afterHash, 32)) {
            logger.throwArgumentError("invalid transaction hash", "afterHash", afterHash);
          }
          super({
            _isForkEvent: true,
            _isTransactionOrderForkEvent: true,
            expiry: expiry || 0,
            beforeHash,
            afterHash
          });
        }
      }
      exports.TransactionOrderForkEvent = TransactionOrderForkEvent;
      class Provider {
        async getFeeData() {
          const {block, gasPrice} = await (0, properties_1.resolveProperties)({
            block: this.getBlock("latest"),
            gasPrice: this.getGasPrice().catch((error => null))
          });
          let lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;
          if (block && block.baseFeePerGas) {
            lastBaseFeePerGas = block.baseFeePerGas;
            maxPriorityFeePerGas = bignumber_1.BigNumber.from("1500000000");
            maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);
          }
          return {
            lastBaseFeePerGas,
            maxFeePerGas,
            maxPriorityFeePerGas,
            gasPrice
          };
        }
        addListener(eventName, listener) {
          return this.on(eventName, listener);
        }
        removeListener(eventName, listener) {
          return this.off(eventName, listener);
        }
        constructor() {
          logger.checkAbstract(new.target, Provider);
          (0, properties_1.defineReadOnly)(this, "_isProvider", true);
        }
        static isProvider(value) {
          return !!(value && value._isProvider);
        }
      }
      exports.Provider = Provider;
    },
    745(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "abstract-signer/5.7.3";
    },
    8788(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.VoidSigner = exports.Signer = void 0;
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(745);
      const logger = new logger_1.Logger(_version_1.version);
      const allowedTransactionKeys = [ "accessList", "ccipReadEnabled", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value" ];
      const forwardErrors = [ logger_1.Logger.errors.INSUFFICIENT_FUNDS, logger_1.Logger.errors.NONCE_EXPIRED, logger_1.Logger.errors.REPLACEMENT_UNDERPRICED ];
      class Signer {
        constructor() {
          logger.checkAbstract(new.target, Signer);
          (0, properties_1.defineReadOnly)(this, "_isSigner", true);
        }
        async getBalance(blockTag) {
          this._checkProvider("getBalance");
          return await this.provider.getBalance(this.getAddress(), blockTag);
        }
        async getTransactionCount(blockTag) {
          this._checkProvider("getTransactionCount");
          return await this.provider.getTransactionCount(this.getAddress(), blockTag);
        }
        async estimateGas(transaction) {
          this._checkProvider("estimateGas");
          const tx = await (0, properties_1.resolveProperties)(this.checkTransaction(transaction));
          return await this.provider.estimateGas(tx);
        }
        async call(transaction, blockTag) {
          this._checkProvider("call");
          const tx = await (0, properties_1.resolveProperties)(this.checkTransaction(transaction));
          return await this.provider.call(tx, blockTag);
        }
        async sendTransaction(transaction) {
          this._checkProvider("sendTransaction");
          const tx = await this.populateTransaction(transaction);
          const signedTx = await this.signTransaction(tx);
          return await this.provider.sendTransaction(signedTx);
        }
        async getChainId() {
          this._checkProvider("getChainId");
          const network = await this.provider.getNetwork();
          return network.chainId;
        }
        async getGasPrice() {
          this._checkProvider("getGasPrice");
          return await this.provider.getGasPrice();
        }
        async getFeeData() {
          this._checkProvider("getFeeData");
          return await this.provider.getFeeData();
        }
        async resolveName(name) {
          this._checkProvider("resolveName");
          return await this.provider.resolveName(name);
        }
        checkTransaction(transaction) {
          for (const key in transaction) {
            if (allowedTransactionKeys.indexOf(key) === -1) {
              logger.throwArgumentError("invalid transaction key: " + key, "transaction", transaction);
            }
          }
          const tx = (0, properties_1.shallowCopy)(transaction);
          if (tx.from == null) {
            tx.from = this.getAddress();
          } else {
            tx.from = Promise.all([ Promise.resolve(tx.from), this.getAddress() ]).then((result => {
              if (result[0].toLowerCase() !== result[1].toLowerCase()) {
                logger.throwArgumentError("from address mismatch", "transaction", transaction);
              }
              return result[0];
            }));
          }
          return tx;
        }
        async populateTransaction(transaction) {
          const tx = await (0, properties_1.resolveProperties)(this.checkTransaction(transaction));
          if (tx.to != null) {
            tx.to = Promise.resolve(tx.to).then((async to => {
              if (to == null) {
                return null;
              }
              const address = await this.resolveName(to);
              if (address == null) {
                logger.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
              }
              return address;
            }));
            tx.to.catch((error => {}));
          }
          const hasEip1559 = tx.maxFeePerGas != null || tx.maxPriorityFeePerGas != null;
          if (tx.gasPrice != null && (tx.type === 2 || hasEip1559)) {
            logger.throwArgumentError("eip-1559 transaction do not support gasPrice", "transaction", transaction);
          } else if ((tx.type === 0 || tx.type === 1) && hasEip1559) {
            logger.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas", "transaction", transaction);
          }
          if ((tx.type === 2 || tx.type == null) && tx.maxFeePerGas != null && tx.maxPriorityFeePerGas != null) {
            tx.type = 2;
          } else if (tx.type === 0 || tx.type === 1) {
            if (tx.gasPrice == null) {
              tx.gasPrice = this.getGasPrice();
            }
          } else {
            const feeData = await this.getFeeData();
            if (tx.type == null) {
              if (feeData.maxFeePerGas != null && feeData.maxPriorityFeePerGas != null) {
                tx.type = 2;
                if (tx.gasPrice != null) {
                  const gasPrice = tx.gasPrice;
                  delete tx.gasPrice;
                  tx.maxFeePerGas = gasPrice;
                  tx.maxPriorityFeePerGas = gasPrice;
                } else {
                  if (tx.maxFeePerGas == null) {
                    tx.maxFeePerGas = feeData.maxFeePerGas;
                  }
                  if (tx.maxPriorityFeePerGas == null) {
                    tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;
                  }
                }
              } else if (feeData.gasPrice != null) {
                if (hasEip1559) {
                  logger.throwError("network does not support EIP-1559", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                    operation: "populateTransaction"
                  });
                }
                if (tx.gasPrice == null) {
                  tx.gasPrice = feeData.gasPrice;
                }
                tx.type = 0;
              } else {
                logger.throwError("failed to get consistent fee data", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                  operation: "signer.getFeeData"
                });
              }
            } else if (tx.type === 2) {
              if (tx.maxFeePerGas == null) {
                tx.maxFeePerGas = feeData.maxFeePerGas;
              }
              if (tx.maxPriorityFeePerGas == null) {
                tx.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;
              }
            }
          }
          if (tx.nonce == null) {
            tx.nonce = this.getTransactionCount("pending");
          }
          if (tx.gasLimit == null) {
            tx.gasLimit = this.estimateGas(tx).catch((error => {
              if (forwardErrors.indexOf(error.code) >= 0) {
                throw error;
              }
              return logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", logger_1.Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
                error,
                tx
              });
            }));
          }
          if (tx.chainId == null) {
            tx.chainId = this.getChainId();
          } else {
            tx.chainId = Promise.all([ Promise.resolve(tx.chainId), this.getChainId() ]).then((results => {
              if (results[1] !== 0 && results[0] !== results[1]) {
                logger.throwArgumentError("chainId address mismatch", "transaction", transaction);
              }
              return results[0];
            }));
          }
          return await (0, properties_1.resolveProperties)(tx);
        }
        _checkProvider(operation) {
          if (!this.provider) {
            logger.throwError("missing provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: operation || "_checkProvider"
            });
          }
        }
        static isSigner(value) {
          return !!(value && value._isSigner);
        }
      }
      exports.Signer = Signer;
      class VoidSigner extends Signer {
        constructor(address, provider) {
          super();
          (0, properties_1.defineReadOnly)(this, "address", address);
          (0, properties_1.defineReadOnly)(this, "provider", provider || null);
        }
        getAddress() {
          return Promise.resolve(this.address);
        }
        _fail(message, operation) {
          return Promise.resolve().then((() => {
            logger.throwError(message, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation
            });
          }));
        }
        signMessage(message) {
          return this._fail("VoidSigner cannot sign messages", "signMessage");
        }
        signTransaction(transaction) {
          return this._fail("VoidSigner cannot sign transactions", "signTransaction");
        }
        _signTypedData(domain, types, value) {
          return this._fail("VoidSigner cannot sign typed data", "signTypedData");
        }
        connect(provider) {
          return new VoidSigner(this.address, provider);
        }
      }
      exports.VoidSigner = VoidSigner;
    },
    2812(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "address/5.7.3";
    },
    171(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.getAddress = getAddress;
      exports.isAddress = isAddress;
      exports.getIcapAddress = getIcapAddress;
      exports.getContractAddress = getContractAddress;
      exports.getCreate2Address = getCreate2Address;
      const bytes_1 = __webpack_require__(8380);
      const bignumber_1 = __webpack_require__(3804);
      const keccak256_1 = __webpack_require__(1136);
      const rlp_1 = __webpack_require__(589);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2812);
      const logger = new logger_1.Logger(_version_1.version);
      function getChecksumAddress(address) {
        if (!(0, bytes_1.isHexString)(address, 32)) {
          logger.throwArgumentError("invalid address", "address", address);
        }
        address = address.toLowerCase();
        const chars = address.substring(2).split("");
        const expanded = new Uint8Array(64);
        for (let i = 0; i < 64; i++) {
          expanded[i] = chars[i].charCodeAt(0);
        }
        const hashed = (0, bytes_1.arrayify)((0, keccak256_1.keccak256)(expanded));
        for (let i = 0; i < 64; i += 2) {
          if (hashed[i >> 1] >> 4 >= 8) {
            chars[i] = chars[i].toUpperCase();
          }
          if ((hashed[i >> 1] & 15) >= 8) {
            chars[i + 1] = chars[i + 1].toUpperCase();
          }
        }
        return "0x" + chars.join("");
      }
      const MAX_SAFE_INTEGER = 9007199254740991;
      function log10(x) {
        if (Math.log10) {
          return Math.log10(x);
        }
        return Math.log(x) / Math.LN10;
      }
      const ibanLookup = {};
      for (let i = 0; i < 10; i++) {
        ibanLookup[String(i)] = String(i);
      }
      for (let i = 0; i < 26; i++) {
        ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
      }
      const safeDigits = Math.floor(log10(MAX_SAFE_INTEGER));
      function ibanChecksum(address) {
        address = address.toUpperCase();
        address = address.substring(4) + address.substring(0, 2) + "00";
        let expanded = address.split("").map((c => ibanLookup[c])).join("");
        while (expanded.length >= safeDigits) {
          let block = expanded.substring(0, safeDigits);
          expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
        }
        let checksum = String(98 - parseInt(expanded, 10) % 97);
        while (checksum.length < 2) {
          checksum = "0" + checksum;
        }
        return checksum;
      }
      function getAddress(address) {
        let result = null;
        if (typeof address !== "string") {
          logger.throwArgumentError("invalid address", "address", address);
        }
        if (address.match(/^(0x)?[0-9a-fA-F]{64}$/)) {
          if (address.substring(0, 2) !== "0x") {
            address = "0x" + address;
          }
          result = getChecksumAddress(address);
          if (address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && result !== address) {
            logger.throwArgumentError("bad address checksum", "address", address);
          }
        } else if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
          if (address.substring(2, 4) !== ibanChecksum(address)) {
            logger.throwArgumentError("bad icap checksum", "address", address);
          }
          result = (0, bignumber_1._base36To16)(address.substring(4));
          while (result.length < 64) {
            result = "0" + result;
          }
          result = getChecksumAddress("0x" + result);
        } else {
          logger.throwArgumentError("invalid address", "address", address);
        }
        return result;
      }
      function isAddress(address) {
        try {
          getAddress(address);
          return true;
        } catch (error) {}
        return false;
      }
      function getIcapAddress(address) {
        let base36 = (0, bignumber_1._base16To36)(getAddress(address).substring(2)).toUpperCase();
        while (base36.length < 30) {
          base36 = "0" + base36;
        }
        return "XE" + ibanChecksum("XE00" + base36) + base36;
      }
      function getContractAddress(transaction) {
        let from = null;
        try {
          from = getAddress(transaction.from);
        } catch (error) {
          logger.throwArgumentError("missing from address", "transaction", transaction);
        }
        const nonce = (0, bytes_1.stripZeros)((0, bytes_1.arrayify)(bignumber_1.BigNumber.from(transaction.nonce).toHexString()));
        return getAddress((0, keccak256_1.keccak256)((0, rlp_1.encode)([ from, nonce ])));
      }
      function getCreate2Address(from, salt, initCodeHash) {
        if ((0, bytes_1.hexDataLength)(salt) !== 32) {
          logger.throwArgumentError("salt must be 32 bytes", "salt", salt);
        }
        if ((0, bytes_1.hexDataLength)(initCodeHash) !== 32) {
          logger.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
        }
        return getAddress((0, keccak256_1.keccak256)((0, bytes_1.concat)([ "0xff", getAddress(from), salt, initCodeHash ])));
      }
    },
    1892(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.encode = exports.decode = void 0;
      const bytes_1 = __webpack_require__(8380);
      function decode(textData) {
        textData = atob(textData);
        const data = [];
        for (let i = 0; i < textData.length; i++) {
          data.push(textData.charCodeAt(i));
        }
        return (0, bytes_1.arrayify)(data);
      }
      exports.decode = decode;
      function encode(data) {
        data = (0, bytes_1.arrayify)(data);
        let textData = "";
        for (let i = 0; i < data.length; i++) {
          textData += String.fromCharCode(data[i]);
        }
        return btoa(textData);
      }
      exports.encode = encode;
    },
    8886(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.encode = exports.decode = void 0;
      var base64_1 = __webpack_require__(1892);
      Object.defineProperty(exports, "decode", {
        enumerable: true,
        get: function() {
          return base64_1.decode;
        }
      });
      Object.defineProperty(exports, "encode", {
        enumerable: true,
        get: function() {
          return base64_1.encode;
        }
      });
    },
    4160(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Base58 = exports.Base32 = exports.BaseX = void 0;
      const bytes_1 = __webpack_require__(8380);
      const properties_1 = __webpack_require__(1476);
      class BaseX {
        constructor(alphabet) {
          (0, properties_1.defineReadOnly)(this, "alphabet", alphabet);
          (0, properties_1.defineReadOnly)(this, "base", alphabet.length);
          (0, properties_1.defineReadOnly)(this, "_alphabetMap", {});
          (0, properties_1.defineReadOnly)(this, "_leader", alphabet.charAt(0));
          for (let i = 0; i < alphabet.length; i++) {
            this._alphabetMap[alphabet.charAt(i)] = i;
          }
        }
        encode(value) {
          let source = (0, bytes_1.arrayify)(value);
          if (source.length === 0) {
            return "";
          }
          let digits = [ 0 ];
          for (let i = 0; i < source.length; ++i) {
            let carry = source[i];
            for (let j = 0; j < digits.length; ++j) {
              carry += digits[j] << 8;
              digits[j] = carry % this.base;
              carry = carry / this.base | 0;
            }
            while (carry > 0) {
              digits.push(carry % this.base);
              carry = carry / this.base | 0;
            }
          }
          let string = "";
          for (let k = 0; source[k] === 0 && k < source.length - 1; ++k) {
            string += this._leader;
          }
          for (let q = digits.length - 1; q >= 0; --q) {
            string += this.alphabet[digits[q]];
          }
          return string;
        }
        decode(value) {
          if (typeof value !== "string") {
            throw new TypeError("Expected String");
          }
          let bytes = [];
          if (value.length === 0) {
            return new Uint8Array(bytes);
          }
          bytes.push(0);
          for (let i = 0; i < value.length; i++) {
            let byte = this._alphabetMap[value[i]];
            if (byte === undefined) {
              throw new Error("Non-base" + this.base + " character");
            }
            let carry = byte;
            for (let j = 0; j < bytes.length; ++j) {
              carry += bytes[j] * this.base;
              bytes[j] = carry & 255;
              carry >>= 8;
            }
            while (carry > 0) {
              bytes.push(carry & 255);
              carry >>= 8;
            }
          }
          for (let k = 0; value[k] === this._leader && k < value.length - 1; ++k) {
            bytes.push(0);
          }
          return (0, bytes_1.arrayify)(new Uint8Array(bytes.reverse()));
        }
      }
      exports.BaseX = BaseX;
      const Base32 = new BaseX("abcdefghijklmnopqrstuvwxyz234567");
      exports.Base32 = Base32;
      const Base58 = new BaseX("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
      exports.Base58 = Base58;
    },
    3377(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "bignumber/5.7.1";
    },
    1079(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __importDefault = this && this.__importDefault || function(mod) {
        return mod && mod.__esModule ? mod : {
          default: mod
        };
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.BigNumber = void 0;
      exports.isBigNumberish = isBigNumberish;
      exports._base36To16 = _base36To16;
      exports._base16To36 = _base16To36;
      const bn_js_1 = __importDefault(__webpack_require__(9404));
      var BN = bn_js_1.default.BN;
      const bytes_1 = __webpack_require__(8380);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(3377);
      const logger = new logger_1.Logger(_version_1.version);
      const _constructorGuard = {};
      const MAX_SAFE = 9007199254740991;
      function isBigNumberish(value) {
        return value != null && (BigNumber.isBigNumber(value) || typeof value === "number" && value % 1 === 0 || typeof value === "string" && !!value.match(/^-?[0-9]+$/) || (0, 
        bytes_1.isHexString)(value) || typeof value === "bigint" || (0, bytes_1.isBytes)(value));
      }
      let _warnedToStringRadix = false;
      class BigNumber {
        constructor(constructorGuard, hex) {
          if (constructorGuard !== _constructorGuard) {
            logger.throwError("cannot call constructor directly; use BigNumber.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "new (BigNumber)"
            });
          }
          this._hex = hex;
          this._isBigNumber = true;
          Object.freeze(this);
        }
        fromTwos(value) {
          return toBigNumber(toBN(this).fromTwos(value));
        }
        toTwos(value) {
          return toBigNumber(toBN(this).toTwos(value));
        }
        abs() {
          if (this._hex[0] === "-") {
            return BigNumber.from(this._hex.substring(1));
          }
          return this;
        }
        add(other) {
          return toBigNumber(toBN(this).add(toBN(other)));
        }
        sub(other) {
          return toBigNumber(toBN(this).sub(toBN(other)));
        }
        div(other) {
          const o = BigNumber.from(other);
          if (o.isZero()) {
            throwFault("division-by-zero", "div");
          }
          return toBigNumber(toBN(this).div(toBN(other)));
        }
        mul(other) {
          return toBigNumber(toBN(this).mul(toBN(other)));
        }
        mod(other) {
          const value = toBN(other);
          if (value.isNeg()) {
            throwFault("division-by-zero", "mod");
          }
          return toBigNumber(toBN(this).umod(value));
        }
        pow(other) {
          const value = toBN(other);
          if (value.isNeg()) {
            throwFault("negative-power", "pow");
          }
          return toBigNumber(toBN(this).pow(value));
        }
        and(other) {
          const value = toBN(other);
          if (this.isNegative() || value.isNeg()) {
            throwFault("unbound-bitwise-result", "and");
          }
          return toBigNumber(toBN(this).and(value));
        }
        or(other) {
          const value = toBN(other);
          if (this.isNegative() || value.isNeg()) {
            throwFault("unbound-bitwise-result", "or");
          }
          return toBigNumber(toBN(this).or(value));
        }
        xor(other) {
          const value = toBN(other);
          if (this.isNegative() || value.isNeg()) {
            throwFault("unbound-bitwise-result", "xor");
          }
          return toBigNumber(toBN(this).xor(value));
        }
        mask(value) {
          if (this.isNegative() || value < 0) {
            throwFault("negative-width", "mask");
          }
          return toBigNumber(toBN(this).maskn(value));
        }
        shl(value) {
          if (this.isNegative() || value < 0) {
            throwFault("negative-width", "shl");
          }
          return toBigNumber(toBN(this).shln(value));
        }
        shr(value) {
          if (this.isNegative() || value < 0) {
            throwFault("negative-width", "shr");
          }
          return toBigNumber(toBN(this).shrn(value));
        }
        eq(other) {
          return toBN(this).eq(toBN(other));
        }
        lt(other) {
          return toBN(this).lt(toBN(other));
        }
        lte(other) {
          return toBN(this).lte(toBN(other));
        }
        gt(other) {
          return toBN(this).gt(toBN(other));
        }
        gte(other) {
          return toBN(this).gte(toBN(other));
        }
        isNegative() {
          return this._hex[0] === "-";
        }
        isZero() {
          return toBN(this).isZero();
        }
        toNumber() {
          try {
            return toBN(this).toNumber();
          } catch (error) {
            throwFault("overflow", "toNumber", this.toString());
          }
          return null;
        }
        toBigInt() {
          try {
            return BigInt(this.toString());
          } catch (e) {}
          return logger.throwError("this platform does not support BigInt", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            value: this.toString()
          });
        }
        toString() {
          if (arguments.length > 0) {
            if (arguments[0] === 10) {
              if (!_warnedToStringRadix) {
                _warnedToStringRadix = true;
                logger.warn("BigNumber.toString does not accept any parameters; base-10 is assumed");
              }
            } else if (arguments[0] === 16) {
              logger.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", logger_1.Logger.errors.UNEXPECTED_ARGUMENT, {});
            } else {
              logger.throwError("BigNumber.toString does not accept parameters", logger_1.Logger.errors.UNEXPECTED_ARGUMENT, {});
            }
          }
          return toBN(this).toString(10);
        }
        toHexString() {
          return this._hex;
        }
        toJSON(key) {
          return {
            type: "BigNumber",
            hex: this.toHexString()
          };
        }
        static from(value) {
          if (value instanceof BigNumber) {
            return value;
          }
          if (typeof value === "string") {
            if (value.match(/^-?0x[0-9a-f]+$/i)) {
              return new BigNumber(_constructorGuard, toHex(value));
            }
            if (value.match(/^-?[0-9]+$/)) {
              return new BigNumber(_constructorGuard, toHex(new BN(value)));
            }
            return logger.throwArgumentError("invalid BigNumber string", "value", value);
          }
          if (typeof value === "number") {
            if (value % 1) {
              throwFault("underflow", "BigNumber.from", value);
            }
            if (value >= MAX_SAFE || value <= -MAX_SAFE) {
              throwFault("overflow", "BigNumber.from", value);
            }
            return BigNumber.from(String(value));
          }
          const anyValue = value;
          if (typeof anyValue === "bigint") {
            return BigNumber.from(anyValue.toString());
          }
          if ((0, bytes_1.isBytes)(anyValue)) {
            return BigNumber.from((0, bytes_1.hexlify)(anyValue));
          }
          if (anyValue) {
            if (anyValue.toHexString) {
              const hex = anyValue.toHexString();
              if (typeof hex === "string") {
                return BigNumber.from(hex);
              }
            } else {
              let hex = anyValue._hex;
              if (hex == null && anyValue.type === "BigNumber") {
                hex = anyValue.hex;
              }
              if (typeof hex === "string") {
                if ((0, bytes_1.isHexString)(hex) || hex[0] === "-" && (0, bytes_1.isHexString)(hex.substring(1))) {
                  return BigNumber.from(hex);
                }
              }
            }
          }
          return logger.throwArgumentError("invalid BigNumber value", "value", value);
        }
        static isBigNumber(value) {
          return !!(value && value._isBigNumber);
        }
      }
      exports.BigNumber = BigNumber;
      function toHex(value) {
        if (typeof value !== "string") {
          return toHex(value.toString(16));
        }
        if (value[0] === "-") {
          value = value.substring(1);
          if (value[0] === "-") {
            logger.throwArgumentError("invalid hex", "value", value);
          }
          value = toHex(value);
          if (value === "0x00") {
            return value;
          }
          return "-" + value;
        }
        if (value.substring(0, 2) !== "0x") {
          value = "0x" + value;
        }
        if (value === "0x") {
          return "0x00";
        }
        if (value.length % 2) {
          value = "0x0" + value.substring(2);
        }
        while (value.length > 4 && value.substring(0, 4) === "0x00") {
          value = "0x" + value.substring(4);
        }
        return value;
      }
      function toBigNumber(value) {
        return BigNumber.from(toHex(value));
      }
      function toBN(value) {
        const hex = BigNumber.from(value).toHexString();
        if (hex[0] === "-") {
          return new BN("-" + hex.substring(3), 16);
        }
        return new BN(hex.substring(2), 16);
      }
      function throwFault(fault, operation, value) {
        const params = {
          fault,
          operation
        };
        if (value != null) {
          params.value = value;
        }
        return logger.throwError(fault, logger_1.Logger.errors.NUMERIC_FAULT, params);
      }
      function _base36To16(value) {
        return new BN(value, 36).toString(16);
      }
      function _base16To36(value) {
        return new BN(value, 16).toString(36);
      }
    },
    1719(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.FixedNumber = exports.FixedFormat = void 0;
      exports.formatFixed = formatFixed;
      exports.parseFixed = parseFixed;
      const bytes_1 = __webpack_require__(8380);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(3377);
      const logger = new logger_1.Logger(_version_1.version);
      const bignumber_1 = __webpack_require__(1079);
      const _constructorGuard = {};
      const Zero = bignumber_1.BigNumber.from(0);
      const NegativeOne = bignumber_1.BigNumber.from(-1);
      function throwFault(message, fault, operation, value) {
        const params = {
          fault,
          operation
        };
        if (value !== undefined) {
          params.value = value;
        }
        return logger.throwError(message, logger_1.Logger.errors.NUMERIC_FAULT, params);
      }
      let zeros = "0";
      while (zeros.length < 256) {
        zeros += zeros;
      }
      function getMultiplier(decimals) {
        if (typeof decimals !== "number") {
          try {
            decimals = bignumber_1.BigNumber.from(decimals).toNumber();
          } catch (e) {}
        }
        if (typeof decimals === "number" && decimals >= 0 && decimals <= 256 && !(decimals % 1)) {
          return "1" + zeros.substring(0, decimals);
        }
        return logger.throwArgumentError("invalid decimal size", "decimals", decimals);
      }
      function formatFixed(value, decimals) {
        if (decimals == null) {
          decimals = 0;
        }
        const multiplier = getMultiplier(decimals);
        value = bignumber_1.BigNumber.from(value);
        const negative = value.lt(Zero);
        if (negative) {
          value = value.mul(NegativeOne);
        }
        let fraction = value.mod(multiplier).toString();
        while (fraction.length < multiplier.length - 1) {
          fraction = "0" + fraction;
        }
        fraction = fraction.match(/^([0-9]*[1-9]|0)(0*)/)[1];
        const whole = value.div(multiplier).toString();
        if (multiplier.length === 1) {
          value = whole;
        } else {
          value = whole + "." + fraction;
        }
        if (negative) {
          value = "-" + value;
        }
        return value;
      }
      function parseFixed(value, decimals) {
        if (decimals == null) {
          decimals = 0;
        }
        const multiplier = getMultiplier(decimals);
        if (typeof value !== "string" || !value.match(/^-?[0-9.]+$/)) {
          logger.throwArgumentError("invalid decimal value", "value", value);
        }
        const negative = value.substring(0, 1) === "-";
        if (negative) {
          value = value.substring(1);
        }
        if (value === ".") {
          logger.throwArgumentError("missing value", "value", value);
        }
        const comps = value.split(".");
        if (comps.length > 2) {
          logger.throwArgumentError("too many decimal points", "value", value);
        }
        let whole = comps[0], fraction = comps[1];
        if (!whole) {
          whole = "0";
        }
        if (!fraction) {
          fraction = "0";
        }
        while (fraction[fraction.length - 1] === "0") {
          fraction = fraction.substring(0, fraction.length - 1);
        }
        if (fraction.length > multiplier.length - 1) {
          throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
        }
        if (fraction === "") {
          fraction = "0";
        }
        while (fraction.length < multiplier.length - 1) {
          fraction += "0";
        }
        const wholeValue = bignumber_1.BigNumber.from(whole);
        const fractionValue = bignumber_1.BigNumber.from(fraction);
        let wei = wholeValue.mul(multiplier).add(fractionValue);
        if (negative) {
          wei = wei.mul(NegativeOne);
        }
        return wei;
      }
      class FixedFormat {
        constructor(constructorGuard, signed, width, decimals) {
          if (constructorGuard !== _constructorGuard) {
            logger.throwError("cannot use FixedFormat constructor; use FixedFormat.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "new FixedFormat"
            });
          }
          this.signed = signed;
          this.width = width;
          this.decimals = decimals;
          this.name = (signed ? "" : "u") + "fixed" + String(width) + "x" + String(decimals);
          this._multiplier = getMultiplier(decimals);
          Object.freeze(this);
        }
        static from(value) {
          if (value instanceof FixedFormat) {
            return value;
          }
          if (typeof value === "number") {
            value = `fixed128x${value}`;
          }
          let signed = true;
          let width = 128;
          let decimals = 18;
          if (typeof value === "string") {
            if (value === "fixed") {} else if (value === "ufixed") {
              signed = false;
            } else {
              const match = value.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
              if (!match) {
                logger.throwArgumentError("invalid fixed format", "format", value);
              }
              signed = match[1] !== "u";
              width = parseInt(match[2]);
              decimals = parseInt(match[3]);
            }
          } else if (value) {
            const check = (key, type, defaultValue) => {
              if (value[key] == null) {
                return defaultValue;
              }
              if (typeof value[key] !== type) {
                logger.throwArgumentError("invalid fixed format (" + key + " not " + type + ")", "format." + key, value[key]);
              }
              return value[key];
            };
            signed = check("signed", "boolean", signed);
            width = check("width", "number", width);
            decimals = check("decimals", "number", decimals);
          }
          if (width % 8) {
            logger.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", width);
          }
          if (decimals > 80) {
            logger.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", decimals);
          }
          return new FixedFormat(_constructorGuard, signed, width, decimals);
        }
      }
      exports.FixedFormat = FixedFormat;
      class FixedNumber {
        constructor(constructorGuard, hex, value, format) {
          if (constructorGuard !== _constructorGuard) {
            logger.throwError("cannot use FixedNumber constructor; use FixedNumber.from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "new FixedFormat"
            });
          }
          this.format = format;
          this._hex = hex;
          this._value = value;
          this._isFixedNumber = true;
          Object.freeze(this);
        }
        _checkFormat(other) {
          if (this.format.name !== other.format.name) {
            logger.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", other);
          }
        }
        addUnsafe(other) {
          this._checkFormat(other);
          const a = parseFixed(this._value, this.format.decimals);
          const b = parseFixed(other._value, other.format.decimals);
          return FixedNumber.fromValue(a.add(b), this.format.decimals, this.format);
        }
        subUnsafe(other) {
          this._checkFormat(other);
          const a = parseFixed(this._value, this.format.decimals);
          const b = parseFixed(other._value, other.format.decimals);
          return FixedNumber.fromValue(a.sub(b), this.format.decimals, this.format);
        }
        mulUnsafe(other) {
          this._checkFormat(other);
          const a = parseFixed(this._value, this.format.decimals);
          const b = parseFixed(other._value, other.format.decimals);
          return FixedNumber.fromValue(a.mul(b).div(this.format._multiplier), this.format.decimals, this.format);
        }
        divUnsafe(other) {
          this._checkFormat(other);
          const a = parseFixed(this._value, this.format.decimals);
          const b = parseFixed(other._value, other.format.decimals);
          return FixedNumber.fromValue(a.mul(this.format._multiplier).div(b), this.format.decimals, this.format);
        }
        floor() {
          const comps = this.toString().split(".");
          if (comps.length === 1) {
            comps.push("0");
          }
          let result = FixedNumber.from(comps[0], this.format);
          const hasFraction = !comps[1].match(/^(0*)$/);
          if (this.isNegative() && hasFraction) {
            result = result.subUnsafe(ONE.toFormat(result.format));
          }
          return result;
        }
        ceiling() {
          const comps = this.toString().split(".");
          if (comps.length === 1) {
            comps.push("0");
          }
          let result = FixedNumber.from(comps[0], this.format);
          const hasFraction = !comps[1].match(/^(0*)$/);
          if (!this.isNegative() && hasFraction) {
            result = result.addUnsafe(ONE.toFormat(result.format));
          }
          return result;
        }
        round(decimals) {
          if (decimals == null) {
            decimals = 0;
          }
          const comps = this.toString().split(".");
          if (comps.length === 1) {
            comps.push("0");
          }
          if (decimals < 0 || decimals > 80 || decimals % 1) {
            logger.throwArgumentError("invalid decimal count", "decimals", decimals);
          }
          if (comps[1].length <= decimals) {
            return this;
          }
          const factor = FixedNumber.from("1" + zeros.substring(0, decimals), this.format);
          const bump = BUMP.toFormat(this.format);
          return this.mulUnsafe(factor).addUnsafe(bump).floor().divUnsafe(factor);
        }
        isZero() {
          return this._value === "0.0" || this._value === "0";
        }
        isNegative() {
          return this._value[0] === "-";
        }
        toString() {
          return this._value;
        }
        toHexString(width) {
          if (width == null) {
            return this._hex;
          }
          if (width % 8) {
            logger.throwArgumentError("invalid byte width", "width", width);
          }
          const hex = bignumber_1.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(width).toHexString();
          return (0, bytes_1.hexZeroPad)(hex, width / 8);
        }
        toUnsafeFloat() {
          return parseFloat(this.toString());
        }
        toFormat(format) {
          return FixedNumber.fromString(this._value, format);
        }
        static fromValue(value, decimals, format) {
          if (format == null && decimals != null && !(0, bignumber_1.isBigNumberish)(decimals)) {
            format = decimals;
            decimals = null;
          }
          if (decimals == null) {
            decimals = 0;
          }
          if (format == null) {
            format = "fixed";
          }
          return FixedNumber.fromString(formatFixed(value, decimals), FixedFormat.from(format));
        }
        static fromString(value, format) {
          if (format == null) {
            format = "fixed";
          }
          const fixedFormat = FixedFormat.from(format);
          const numeric = parseFixed(value, fixedFormat.decimals);
          if (!fixedFormat.signed && numeric.lt(Zero)) {
            throwFault("unsigned value cannot be negative", "overflow", "value", value);
          }
          let hex = null;
          if (fixedFormat.signed) {
            hex = numeric.toTwos(fixedFormat.width).toHexString();
          } else {
            hex = numeric.toHexString();
            hex = (0, bytes_1.hexZeroPad)(hex, fixedFormat.width / 8);
          }
          const decimal = formatFixed(numeric, fixedFormat.decimals);
          return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
        }
        static fromBytes(value, format) {
          if (format == null) {
            format = "fixed";
          }
          const fixedFormat = FixedFormat.from(format);
          if ((0, bytes_1.arrayify)(value).length > fixedFormat.width / 8) {
            throw new Error("overflow");
          }
          let numeric = bignumber_1.BigNumber.from(value);
          if (fixedFormat.signed) {
            numeric = numeric.fromTwos(fixedFormat.width);
          }
          const hex = numeric.toTwos((fixedFormat.signed ? 0 : 1) + fixedFormat.width).toHexString();
          const decimal = formatFixed(numeric, fixedFormat.decimals);
          return new FixedNumber(_constructorGuard, hex, decimal, fixedFormat);
        }
        static from(value, format) {
          if (typeof value === "string") {
            return FixedNumber.fromString(value, format);
          }
          if ((0, bytes_1.isBytes)(value)) {
            return FixedNumber.fromBytes(value, format);
          }
          try {
            return FixedNumber.fromValue(value, 0, format);
          } catch (error) {
            if (error.code !== logger_1.Logger.errors.INVALID_ARGUMENT) {
              throw error;
            }
          }
          return logger.throwArgumentError("invalid FixedNumber value", "value", value);
        }
        static isFixedNumber(value) {
          return !!(value && value._isFixedNumber);
        }
      }
      exports.FixedNumber = FixedNumber;
      const ONE = FixedNumber.from(1);
      const BUMP = FixedNumber.from("0.5");
    },
    3804(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports._base36To16 = exports._base16To36 = exports.parseFixed = exports.FixedNumber = exports.FixedFormat = exports.formatFixed = exports.BigNumber = void 0;
      var bignumber_1 = __webpack_require__(1079);
      Object.defineProperty(exports, "BigNumber", {
        enumerable: true,
        get: function() {
          return bignumber_1.BigNumber;
        }
      });
      var fixednumber_1 = __webpack_require__(1719);
      Object.defineProperty(exports, "formatFixed", {
        enumerable: true,
        get: function() {
          return fixednumber_1.formatFixed;
        }
      });
      Object.defineProperty(exports, "FixedFormat", {
        enumerable: true,
        get: function() {
          return fixednumber_1.FixedFormat;
        }
      });
      Object.defineProperty(exports, "FixedNumber", {
        enumerable: true,
        get: function() {
          return fixednumber_1.FixedNumber;
        }
      });
      Object.defineProperty(exports, "parseFixed", {
        enumerable: true,
        get: function() {
          return fixednumber_1.parseFixed;
        }
      });
      var bignumber_2 = __webpack_require__(1079);
      Object.defineProperty(exports, "_base16To36", {
        enumerable: true,
        get: function() {
          return bignumber_2._base16To36;
        }
      });
      Object.defineProperty(exports, "_base36To16", {
        enumerable: true,
        get: function() {
          return bignumber_2._base36To16;
        }
      });
    },
    3041(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "bytes/5.8.2";
    },
    8380(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.joinSignature = exports.splitSignature = exports.hexZeroPad = exports.hexStripZeros = exports.hexValue = exports.hexConcat = exports.hexDataSlice = exports.hexDataLength = exports.hexlify = exports.isHexString = exports.zeroPad = exports.stripZeros = exports.concat = exports.arrayify = exports.isBytes = exports.isBytesLike = void 0;
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(3041);
      const logger = new logger_1.Logger(_version_1.version);
      const SIG_WIRE_HEADER_SIZE = 12;
      function isHexable(value) {
        return !!value.toHexString;
      }
      function addSlice(array) {
        if (array.slice) {
          return array;
        }
        array.slice = function() {
          const args = Array.prototype.slice.call(arguments);
          return addSlice(new Uint8Array(Array.prototype.slice.apply(array, args)));
        };
        return array;
      }
      function isBytesLike(value) {
        return isHexString(value) && !(value.length % 2) || isBytes(value);
      }
      exports.isBytesLike = isBytesLike;
      function isInteger(value) {
        return typeof value === "number" && value == value && value % 1 === 0;
      }
      function isBytes(value) {
        if (value == null) {
          return false;
        }
        if (value.constructor === Uint8Array) {
          return true;
        }
        if (typeof value === "string") {
          return false;
        }
        if (!isInteger(value.length) || value.length < 0) {
          return false;
        }
        for (let i = 0; i < value.length; i++) {
          const v = value[i];
          if (!isInteger(v) || v < 0 || v >= 256) {
            return false;
          }
        }
        return true;
      }
      exports.isBytes = isBytes;
      function arrayify(value, options) {
        if (!options) {
          options = {};
        }
        if (typeof value === "number") {
          logger.checkSafeUint53(value, "invalid arrayify value");
          const result = [];
          while (value) {
            result.unshift(value & 255);
            value = parseInt(String(value / 256));
          }
          if (result.length === 0) {
            result.push(0);
          }
          return addSlice(new Uint8Array(result));
        }
        if (options.allowMissingPrefix && typeof value === "string" && value.substring(0, 2) !== "0x") {
          value = "0x" + value;
        }
        if (isHexable(value)) {
          value = value.toHexString();
        }
        if (isHexString(value)) {
          let hex = value.substring(2);
          if (hex.length % 2) {
            if (options.hexPad === "left") {
              hex = "0" + hex;
            } else if (options.hexPad === "right") {
              hex += "0";
            } else {
              logger.throwArgumentError("hex data is odd-length", "value", value);
            }
          }
          const result = [];
          for (let i = 0; i < hex.length; i += 2) {
            result.push(parseInt(hex.substring(i, i + 2), 16));
          }
          return addSlice(new Uint8Array(result));
        }
        if (isBytes(value)) {
          return addSlice(new Uint8Array(value));
        }
        return logger.throwArgumentError("invalid arrayify value", "value", value);
      }
      exports.arrayify = arrayify;
      function concat(items) {
        const objects = items.map((item => arrayify(item)));
        const length = objects.reduce(((accum, item) => accum + item.length), 0);
        const result = new Uint8Array(length);
        objects.reduce(((offset, object) => {
          result.set(object, offset);
          return offset + object.length;
        }), 0);
        return addSlice(result);
      }
      exports.concat = concat;
      function stripZeros(value) {
        let result = arrayify(value);
        if (result.length === 0) {
          return result;
        }
        let start = 0;
        while (start < result.length && result[start] === 0) {
          start++;
        }
        if (start) {
          result = result.slice(start);
        }
        return result;
      }
      exports.stripZeros = stripZeros;
      function zeroPad(value, length) {
        value = arrayify(value);
        if (value.length > length) {
          logger.throwArgumentError("value out of range", "value", arguments[0]);
        }
        const result = new Uint8Array(length);
        result.set(value, length - value.length);
        return addSlice(result);
      }
      exports.zeroPad = zeroPad;
      function isHexString(value, length) {
        if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
          return false;
        }
        if (length && value.length !== 2 + 2 * length) {
          return false;
        }
        return true;
      }
      exports.isHexString = isHexString;
      const HexCharacters = "0123456789abcdef";
      function hexlify(value, options) {
        if (!options) {
          options = {};
        }
        if (typeof value === "number") {
          logger.checkSafeUint53(value, "invalid hexlify value");
          let hex = "";
          while (value) {
            hex = HexCharacters[value & 15] + hex;
            value = Math.floor(value / 16);
          }
          if (hex.length) {
            if (hex.length % 2) {
              hex = "0" + hex;
            }
            return "0x" + hex;
          }
          return "0x00";
        }
        if (typeof value === "bigint") {
          value = value.toString(16);
          if (value.length % 2) {
            return "0x0" + value;
          }
          return "0x" + value;
        }
        if (options.allowMissingPrefix && typeof value === "string" && value.substring(0, 2) !== "0x") {
          value = "0x" + value;
        }
        if (isHexable(value)) {
          return value.toHexString();
        }
        if (isHexString(value)) {
          if (value.length % 2) {
            if (options.hexPad === "left") {
              value = "0x0" + value.substring(2);
            } else if (options.hexPad === "right") {
              value += "0";
            } else {
              logger.throwArgumentError("hex data is odd-length", "value", value);
            }
          }
          return value.toLowerCase();
        }
        if (isBytes(value)) {
          let result = "0x";
          for (let i = 0; i < value.length; i++) {
            let v = value[i];
            result += HexCharacters[(v & 240) >> 4] + HexCharacters[v & 15];
          }
          return result;
        }
        return logger.throwArgumentError("invalid hexlify value", "value", value);
      }
      exports.hexlify = hexlify;
      function hexDataLength(data) {
        if (typeof data !== "string") {
          data = hexlify(data);
        } else if (!isHexString(data) || data.length % 2) {
          return null;
        }
        return (data.length - 2) / 2;
      }
      exports.hexDataLength = hexDataLength;
      function hexDataSlice(data, offset, endOffset) {
        if (typeof data !== "string") {
          data = hexlify(data);
        } else if (!isHexString(data) || data.length % 2) {
          logger.throwArgumentError("invalid hexData", "value", data);
        }
        offset = 2 + 2 * offset;
        if (endOffset != null) {
          return "0x" + data.substring(offset, 2 + 2 * endOffset);
        }
        return "0x" + data.substring(offset);
      }
      exports.hexDataSlice = hexDataSlice;
      function hexConcat(items) {
        let result = "0x";
        items.forEach((item => {
          result += hexlify(item).substring(2);
        }));
        return result;
      }
      exports.hexConcat = hexConcat;
      function hexValue(value) {
        const trimmed = hexStripZeros(hexlify(value, {
          hexPad: "left"
        }));
        if (trimmed === "0x") {
          return "0x0";
        }
        return trimmed;
      }
      exports.hexValue = hexValue;
      function hexStripZeros(value) {
        if (typeof value !== "string") {
          value = hexlify(value);
        }
        if (!isHexString(value)) {
          logger.throwArgumentError("invalid hex string", "value", value);
        }
        value = value.substring(2);
        let offset = 0;
        while (offset < value.length && value[offset] === "0") {
          offset++;
        }
        return "0x" + value.substring(offset);
      }
      exports.hexStripZeros = hexStripZeros;
      function hexZeroPad(value, length) {
        if (typeof value !== "string") {
          value = hexlify(value);
        } else if (!isHexString(value)) {
          logger.throwArgumentError("invalid hex string", "value", value);
        }
        if (value.length > 2 * length + 2) {
          logger.throwArgumentError("value out of range", "value", arguments[1]);
        }
        while (value.length < 2 * length + 2) {
          value = "0x0" + value.substring(2);
        }
        return value;
      }
      exports.hexZeroPad = hexZeroPad;
      function splitSignature(signature) {
        const result = {
          signature: "",
          publicKey: ""
        };
        if (isBytesLike(signature)) {
          const bytes = arrayify(signature);
          if (bytes.length < SIG_WIRE_HEADER_SIZE) {
            throw new Error("splitSignature: blob too small to contain wire header");
          }
          const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
          const pubkeySize = view.getUint32(4, true);
          const sigSize = view.getUint32(8, true);
          const expectedLen = SIG_WIRE_HEADER_SIZE + pubkeySize + sigSize;
          if (bytes.length !== expectedLen) {
            throw new Error(`splitSignature: blob length ${bytes.length} does not match header (expected ${expectedLen})`);
          }
          result.publicKey = hexlify(bytes.slice(SIG_WIRE_HEADER_SIZE, SIG_WIRE_HEADER_SIZE + pubkeySize));
          result.signature = hexlify(bytes.slice(SIG_WIRE_HEADER_SIZE + pubkeySize));
        } else {
          result.publicKey = signature.publicKey;
          result.signature = signature.signature;
        }
        return result;
      }
      exports.splitSignature = splitSignature;
      function joinSignature(signature, sigType = 258) {
        const sig = splitSignature(signature);
        const pubkeyBytes = arrayify(sig.publicKey);
        const sigBytes = arrayify(sig.signature);
        const header = new Uint8Array(SIG_WIRE_HEADER_SIZE);
        const view = new DataView(header.buffer);
        view.setUint32(0, sigType, true);
        view.setUint32(4, pubkeyBytes.length, true);
        view.setUint32(8, sigBytes.length, true);
        return hexlify(concat([ header, pubkeyBytes, sigBytes ]));
      }
      exports.joinSignature = joinSignature;
    },
    4426(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.AddressZero = void 0;
      exports.AddressZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
    },
    2396(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.Two = exports.One = exports.Zero = exports.NegativeOne = void 0;
      const bignumber_1 = __webpack_require__(3804);
      const NegativeOne = bignumber_1.BigNumber.from(-1);
      exports.NegativeOne = NegativeOne;
      const Zero = bignumber_1.BigNumber.from(0);
      exports.Zero = Zero;
      const One = bignumber_1.BigNumber.from(1);
      exports.One = One;
      const Two = bignumber_1.BigNumber.from(2);
      exports.Two = Two;
      const WeiPerEther = bignumber_1.BigNumber.from("1000000000000000000");
      exports.WeiPerEther = WeiPerEther;
      const MaxUint256 = bignumber_1.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
      exports.MaxUint256 = MaxUint256;
      const MinInt256 = bignumber_1.BigNumber.from("-0x8000000000000000000000000000000000000000000000000000000000000000");
      exports.MinInt256 = MinInt256;
      const MaxInt256 = bignumber_1.BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
      exports.MaxInt256 = MaxInt256;
    },
    3652(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.HashZero = void 0;
      exports.HashZero = "0x0000000000000000000000000000000000000000000000000000000000000000";
    },
    846(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.EtherSymbol = exports.HashZero = exports.MaxInt256 = exports.MinInt256 = exports.MaxUint256 = exports.WeiPerEther = exports.Two = exports.One = exports.Zero = exports.NegativeOne = exports.AddressZero = void 0;
      var addresses_1 = __webpack_require__(4426);
      Object.defineProperty(exports, "AddressZero", {
        enumerable: true,
        get: function() {
          return addresses_1.AddressZero;
        }
      });
      var bignumbers_1 = __webpack_require__(2396);
      Object.defineProperty(exports, "NegativeOne", {
        enumerable: true,
        get: function() {
          return bignumbers_1.NegativeOne;
        }
      });
      Object.defineProperty(exports, "Zero", {
        enumerable: true,
        get: function() {
          return bignumbers_1.Zero;
        }
      });
      Object.defineProperty(exports, "One", {
        enumerable: true,
        get: function() {
          return bignumbers_1.One;
        }
      });
      Object.defineProperty(exports, "Two", {
        enumerable: true,
        get: function() {
          return bignumbers_1.Two;
        }
      });
      Object.defineProperty(exports, "WeiPerEther", {
        enumerable: true,
        get: function() {
          return bignumbers_1.WeiPerEther;
        }
      });
      Object.defineProperty(exports, "MaxUint256", {
        enumerable: true,
        get: function() {
          return bignumbers_1.MaxUint256;
        }
      });
      Object.defineProperty(exports, "MinInt256", {
        enumerable: true,
        get: function() {
          return bignumbers_1.MinInt256;
        }
      });
      Object.defineProperty(exports, "MaxInt256", {
        enumerable: true,
        get: function() {
          return bignumbers_1.MaxInt256;
        }
      });
      var hashes_1 = __webpack_require__(3652);
      Object.defineProperty(exports, "HashZero", {
        enumerable: true,
        get: function() {
          return hashes_1.HashZero;
        }
      });
      var strings_1 = __webpack_require__(8664);
      Object.defineProperty(exports, "EtherSymbol", {
        enumerable: true,
        get: function() {
          return strings_1.EtherSymbol;
        }
      });
    },
    8664(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.EtherSymbol = void 0;
      exports.EtherSymbol = "Ξ";
    },
    7261(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "contracts/5.7.3";
    },
    3008(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.ContractFactory = exports.Contract = exports.BaseContract = void 0;
      const abi_1 = __webpack_require__(7989);
      const abstract_provider_1 = __webpack_require__(103);
      const abstract_signer_1 = __webpack_require__(8788);
      const address_1 = __webpack_require__(171);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const properties_1 = __webpack_require__(1476);
      const transactions_1 = __webpack_require__(3776);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(7261);
      const logger = new logger_1.Logger(_version_1.version);
      const allowedTransactionKeys = {
        chainId: true,
        data: true,
        from: true,
        gasLimit: true,
        gasPrice: true,
        nonce: true,
        to: true,
        value: true,
        type: true,
        accessList: true,
        maxFeePerGas: true,
        maxPriorityFeePerGas: true,
        customData: true,
        ccipReadEnabled: true
      };
      async function resolveName(resolver, nameOrPromise) {
        const name = await nameOrPromise;
        if (typeof name !== "string") {
          logger.throwArgumentError("invalid address or ENS name", "name", name);
        }
        try {
          return (0, address_1.getAddress)(name);
        } catch (error) {}
        if (!resolver) {
          logger.throwError("a provider or signer is needed to resolve ENS names", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "resolveName"
          });
        }
        const address = await resolver.resolveName(name);
        if (address == null) {
          logger.throwArgumentError("resolver or addr is not configured for ENS name", "name", name);
        }
        return address;
      }
      async function resolveAddresses(resolver, value, paramType) {
        if (Array.isArray(paramType)) {
          return await Promise.all(paramType.map(((paramType, index) => resolveAddresses(resolver, Array.isArray(value) ? value[index] : value[paramType.name], paramType))));
        }
        if (paramType.type === "address") {
          return await resolveName(resolver, value);
        }
        if (paramType.type === "tuple") {
          return await resolveAddresses(resolver, value, paramType.components);
        }
        if (paramType.baseType === "array") {
          if (!Array.isArray(value)) {
            return Promise.reject(logger.makeError("invalid value for array", logger_1.Logger.errors.INVALID_ARGUMENT, {
              argument: "value",
              value
            }));
          }
          return await Promise.all(value.map((v => resolveAddresses(resolver, v, paramType.arrayChildren))));
        }
        return value;
      }
      async function populateTransaction(contract, fragment, args) {
        let overrides = {};
        if (args.length === fragment.inputs.length + 1 && typeof args[args.length - 1] === "object") {
          overrides = (0, properties_1.shallowCopy)(args.pop());
        }
        logger.checkArgumentCount(args.length, fragment.inputs.length, "passed to contract");
        if (contract.signer) {
          if (overrides.from) {
            overrides.from = (0, properties_1.resolveProperties)({
              override: resolveName(contract.signer, overrides.from),
              signer: contract.signer.getAddress()
            }).then((async check => {
              if ((0, address_1.getAddress)(check.signer) !== check.override) {
                logger.throwError("Contract with a Signer cannot override from", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                  operation: "overrides.from"
                });
              }
              return check.override;
            }));
          } else {
            overrides.from = contract.signer.getAddress();
          }
        } else if (overrides.from) {
          overrides.from = resolveName(contract.provider, overrides.from);
        }
        const resolved = await (0, properties_1.resolveProperties)({
          args: resolveAddresses(contract.signer || contract.provider, args, fragment.inputs),
          address: contract.resolvedAddress,
          overrides: (0, properties_1.resolveProperties)(overrides) || {}
        });
        const data = contract.interface.encodeFunctionData(fragment, resolved.args);
        const tx = {
          data,
          to: resolved.address
        };
        const ro = resolved.overrides;
        if (ro.nonce != null) {
          tx.nonce = bignumber_1.BigNumber.from(ro.nonce).toNumber();
        }
        if (ro.gasLimit != null) {
          tx.gasLimit = bignumber_1.BigNumber.from(ro.gasLimit);
        }
        if (ro.gasPrice != null) {
          tx.gasPrice = bignumber_1.BigNumber.from(ro.gasPrice);
        }
        if (ro.maxFeePerGas != null) {
          tx.maxFeePerGas = bignumber_1.BigNumber.from(ro.maxFeePerGas);
        }
        if (ro.maxPriorityFeePerGas != null) {
          tx.maxPriorityFeePerGas = bignumber_1.BigNumber.from(ro.maxPriorityFeePerGas);
        }
        if (ro.from != null) {
          tx.from = ro.from;
        }
        if (ro.type != null) {
          tx.type = ro.type;
        }
        if (ro.accessList != null) {
          tx.accessList = (0, transactions_1.accessListify)(ro.accessList);
        }
        if (tx.gasLimit == null && fragment.gas != null) {
          let intrinsic = 21e3;
          const bytes = (0, bytes_1.arrayify)(data);
          for (let i = 0; i < bytes.length; i++) {
            intrinsic += 4;
            if (bytes[i]) {
              intrinsic += 64;
            }
          }
          tx.gasLimit = bignumber_1.BigNumber.from(fragment.gas).add(intrinsic);
        }
        if (ro.value) {
          const roValue = bignumber_1.BigNumber.from(ro.value);
          if (!roValue.isZero() && !fragment.payable) {
            logger.throwError("non-payable method cannot override value", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "overrides.value",
              value: overrides.value
            });
          }
          tx.value = roValue;
        }
        if (ro.customData) {
          tx.customData = (0, properties_1.shallowCopy)(ro.customData);
        }
        if (ro.ccipReadEnabled) {
          tx.ccipReadEnabled = !!ro.ccipReadEnabled;
        }
        delete overrides.nonce;
        delete overrides.gasLimit;
        delete overrides.gasPrice;
        delete overrides.from;
        delete overrides.value;
        delete overrides.type;
        delete overrides.accessList;
        delete overrides.maxFeePerGas;
        delete overrides.maxPriorityFeePerGas;
        delete overrides.customData;
        delete overrides.ccipReadEnabled;
        const leftovers = Object.keys(overrides).filter((key => overrides[key] != null));
        if (leftovers.length) {
          logger.throwError(`cannot override ${leftovers.map((l => JSON.stringify(l))).join(",")}`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "overrides",
            overrides: leftovers
          });
        }
        return tx;
      }
      function buildPopulate(contract, fragment) {
        return function(...args) {
          return populateTransaction(contract, fragment, args);
        };
      }
      function buildEstimate(contract, fragment) {
        const signerOrProvider = contract.signer || contract.provider;
        return async function(...args) {
          if (!signerOrProvider) {
            logger.throwError("estimate require a provider or signer", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "estimateGas"
            });
          }
          const tx = await populateTransaction(contract, fragment, args);
          return await signerOrProvider.estimateGas(tx);
        };
      }
      function addContractWait(contract, tx) {
        const wait = tx.wait.bind(tx);
        tx.wait = confirmations => wait(confirmations).then((receipt => {
          receipt.events = receipt.logs.map((log => {
            let event = (0, properties_1.deepCopy)(log);
            let parsed = null;
            try {
              parsed = contract.interface.parseLog(log);
            } catch (e) {}
            if (parsed) {
              event.args = parsed.args;
              event.decode = (data, topics) => contract.interface.decodeEventLog(parsed.eventFragment, data, topics);
              event.event = parsed.name;
              event.eventSignature = parsed.signature;
            }
            event.removeListener = () => contract.provider;
            event.getBlock = () => contract.provider.getBlock(receipt.blockHash);
            event.getTransaction = () => contract.provider.getTransaction(receipt.transactionHash);
            event.getTransactionReceipt = () => Promise.resolve(receipt);
            return event;
          }));
          return receipt;
        }));
      }
      function buildCall(contract, fragment, collapseSimple) {
        const signerOrProvider = contract.signer || contract.provider;
        return async function(...args) {
          let blockTag = undefined;
          if (args.length === fragment.inputs.length + 1 && typeof args[args.length - 1] === "object") {
            const overrides = (0, properties_1.shallowCopy)(args.pop());
            if (overrides.blockTag != null) {
              blockTag = await overrides.blockTag;
            }
            delete overrides.blockTag;
            args.push(overrides);
          }
          if (contract.deployTransaction != null) {
            await contract._deployed(blockTag);
          }
          const tx = await populateTransaction(contract, fragment, args);
          const result = await signerOrProvider.call(tx, blockTag);
          try {
            let value = contract.interface.decodeFunctionResult(fragment, result);
            if (collapseSimple && fragment.outputs.length === 1) {
              value = value[0];
            }
            return value;
          } catch (error) {
            if (error.code === logger_1.Logger.errors.CALL_EXCEPTION) {
              error.address = contract.address;
              error.args = args;
              error.transaction = tx;
            }
            throw error;
          }
        };
      }
      function buildSend(contract, fragment) {
        return async function(...args) {
          if (!contract.signer) {
            logger.throwError("sending a transaction requires a signer", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "sendTransaction"
            });
          }
          if (contract.deployTransaction != null) {
            await contract._deployed();
          }
          const txRequest = await populateTransaction(contract, fragment, args);
          const tx = await contract.signer.sendTransaction(txRequest);
          addContractWait(contract, tx);
          return tx;
        };
      }
      function buildDefault(contract, fragment, collapseSimple) {
        if (fragment.constant) {
          return buildCall(contract, fragment, collapseSimple);
        }
        return buildSend(contract, fragment);
      }
      function getEventTag(filter) {
        if (filter.address && (filter.topics == null || filter.topics.length === 0)) {
          return "*";
        }
        return (filter.address || "*") + "@" + (filter.topics ? filter.topics.map((topic => {
          if (Array.isArray(topic)) {
            return topic.join("|");
          }
          return topic;
        })).join(":") : "");
      }
      class RunningEvent {
        constructor(tag, filter) {
          (0, properties_1.defineReadOnly)(this, "tag", tag);
          (0, properties_1.defineReadOnly)(this, "filter", filter);
          this._listeners = [];
        }
        addListener(listener, once) {
          this._listeners.push({
            listener,
            once
          });
        }
        removeListener(listener) {
          let done = false;
          this._listeners = this._listeners.filter((item => {
            if (done || item.listener !== listener) {
              return true;
            }
            done = true;
            return false;
          }));
        }
        removeAllListeners() {
          this._listeners = [];
        }
        listeners() {
          return this._listeners.map((i => i.listener));
        }
        listenerCount() {
          return this._listeners.length;
        }
        run(args) {
          const listenerCount = this.listenerCount();
          this._listeners = this._listeners.filter((item => {
            const argsCopy = args.slice();
            setTimeout((() => {
              item.listener.apply(this, argsCopy);
            }), 0);
            return !item.once;
          }));
          return listenerCount;
        }
        prepareEvent(event) {}
        getEmit(event) {
          return [ event ];
        }
      }
      class ErrorRunningEvent extends RunningEvent {
        constructor() {
          super("error", null);
        }
      }
      class FragmentRunningEvent extends RunningEvent {
        constructor(address, contractInterface, fragment, topics) {
          const filter = {
            address
          };
          let topic = contractInterface.getEventTopic(fragment);
          if (topics) {
            if (topic !== topics[0]) {
              logger.throwArgumentError("topic mismatch", "topics", topics);
            }
            filter.topics = topics.slice();
          } else {
            filter.topics = [ topic ];
          }
          super(getEventTag(filter), filter);
          (0, properties_1.defineReadOnly)(this, "address", address);
          (0, properties_1.defineReadOnly)(this, "interface", contractInterface);
          (0, properties_1.defineReadOnly)(this, "fragment", fragment);
        }
        prepareEvent(event) {
          super.prepareEvent(event);
          event.event = this.fragment.name;
          event.eventSignature = this.fragment.format();
          event.decode = (data, topics) => this.interface.decodeEventLog(this.fragment, data, topics);
          try {
            event.args = this.interface.decodeEventLog(this.fragment, event.data, event.topics);
          } catch (error) {
            event.args = null;
            event.decodeError = error;
          }
        }
        getEmit(event) {
          const errors = (0, abi_1.checkResultErrors)(event.args);
          if (errors.length) {
            throw errors[0].error;
          }
          const args = (event.args || []).slice();
          args.push(event);
          return args;
        }
      }
      class WildcardRunningEvent extends RunningEvent {
        constructor(address, contractInterface) {
          super("*", {
            address
          });
          (0, properties_1.defineReadOnly)(this, "address", address);
          (0, properties_1.defineReadOnly)(this, "interface", contractInterface);
        }
        prepareEvent(event) {
          super.prepareEvent(event);
          try {
            const parsed = this.interface.parseLog(event);
            event.event = parsed.name;
            event.eventSignature = parsed.signature;
            event.decode = (data, topics) => this.interface.decodeEventLog(parsed.eventFragment, data, topics);
            event.args = parsed.args;
          } catch (error) {}
        }
      }
      class BaseContract {
        constructor(addressOrName, contractInterface, signerOrProvider) {
          (0, properties_1.defineReadOnly)(this, "interface", (0, properties_1.getStatic)(new.target, "getInterface")(contractInterface));
          if (signerOrProvider == null) {
            (0, properties_1.defineReadOnly)(this, "provider", null);
            (0, properties_1.defineReadOnly)(this, "signer", null);
          } else if (abstract_signer_1.Signer.isSigner(signerOrProvider)) {
            (0, properties_1.defineReadOnly)(this, "provider", signerOrProvider.provider || null);
            (0, properties_1.defineReadOnly)(this, "signer", signerOrProvider);
          } else if (abstract_provider_1.Provider.isProvider(signerOrProvider)) {
            (0, properties_1.defineReadOnly)(this, "provider", signerOrProvider);
            (0, properties_1.defineReadOnly)(this, "signer", null);
          } else {
            logger.throwArgumentError("invalid signer or provider", "signerOrProvider", signerOrProvider);
          }
          (0, properties_1.defineReadOnly)(this, "callStatic", {});
          (0, properties_1.defineReadOnly)(this, "estimateGas", {});
          (0, properties_1.defineReadOnly)(this, "functions", {});
          (0, properties_1.defineReadOnly)(this, "populateTransaction", {});
          (0, properties_1.defineReadOnly)(this, "filters", {});
          {
            const uniqueFilters = {};
            Object.keys(this.interface.events).forEach((eventSignature => {
              const event = this.interface.events[eventSignature];
              (0, properties_1.defineReadOnly)(this.filters, eventSignature, ((...args) => ({
                address: this.address,
                topics: this.interface.encodeFilterTopics(event, args)
              })));
              if (!uniqueFilters[event.name]) {
                uniqueFilters[event.name] = [];
              }
              uniqueFilters[event.name].push(eventSignature);
            }));
            Object.keys(uniqueFilters).forEach((name => {
              const filters = uniqueFilters[name];
              if (filters.length === 1) {
                (0, properties_1.defineReadOnly)(this.filters, name, this.filters[filters[0]]);
              } else {
                logger.warn(`Duplicate definition of ${name} (${filters.join(", ")})`);
              }
            }));
          }
          (0, properties_1.defineReadOnly)(this, "_runningEvents", {});
          (0, properties_1.defineReadOnly)(this, "_wrappedEmits", {});
          if (addressOrName == null) {
            logger.throwArgumentError("invalid contract address or ENS name", "addressOrName", addressOrName);
          }
          (0, properties_1.defineReadOnly)(this, "address", addressOrName);
          if (this.provider) {
            (0, properties_1.defineReadOnly)(this, "resolvedAddress", resolveName(this.provider, addressOrName));
          } else {
            try {
              (0, properties_1.defineReadOnly)(this, "resolvedAddress", Promise.resolve((0, address_1.getAddress)(addressOrName)));
            } catch (error) {
              logger.throwError("provider is required to use ENS name as contract address", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                operation: "new Contract"
              });
            }
          }
          this.resolvedAddress.catch((e => {}));
          const uniqueNames = {};
          const uniqueSignatures = {};
          Object.keys(this.interface.functions).forEach((signature => {
            const fragment = this.interface.functions[signature];
            if (uniqueSignatures[signature]) {
              logger.warn(`Duplicate ABI entry for ${JSON.stringify(signature)}`);
              return;
            }
            uniqueSignatures[signature] = true;
            {
              const name = fragment.name;
              if (!uniqueNames[`%${name}`]) {
                uniqueNames[`%${name}`] = [];
              }
              uniqueNames[`%${name}`].push(signature);
            }
            if (this[signature] == null) {
              (0, properties_1.defineReadOnly)(this, signature, buildDefault(this, fragment, true));
            }
            if (this.functions[signature] == null) {
              (0, properties_1.defineReadOnly)(this.functions, signature, buildDefault(this, fragment, false));
            }
            if (this.callStatic[signature] == null) {
              (0, properties_1.defineReadOnly)(this.callStatic, signature, buildCall(this, fragment, true));
            }
            if (this.populateTransaction[signature] == null) {
              (0, properties_1.defineReadOnly)(this.populateTransaction, signature, buildPopulate(this, fragment));
            }
            if (this.estimateGas[signature] == null) {
              (0, properties_1.defineReadOnly)(this.estimateGas, signature, buildEstimate(this, fragment));
            }
          }));
          Object.keys(uniqueNames).forEach((name => {
            const signatures = uniqueNames[name];
            if (signatures.length > 1) {
              return;
            }
            name = name.substring(1);
            const signature = signatures[0];
            try {
              if (this[name] == null) {
                (0, properties_1.defineReadOnly)(this, name, this[signature]);
              }
            } catch (e) {}
            if (this.functions[name] == null) {
              (0, properties_1.defineReadOnly)(this.functions, name, this.functions[signature]);
            }
            if (this.callStatic[name] == null) {
              (0, properties_1.defineReadOnly)(this.callStatic, name, this.callStatic[signature]);
            }
            if (this.populateTransaction[name] == null) {
              (0, properties_1.defineReadOnly)(this.populateTransaction, name, this.populateTransaction[signature]);
            }
            if (this.estimateGas[name] == null) {
              (0, properties_1.defineReadOnly)(this.estimateGas, name, this.estimateGas[signature]);
            }
          }));
        }
        static getContractAddress(transaction) {
          return (0, address_1.getContractAddress)(transaction);
        }
        static getInterface(contractInterface) {
          if (abi_1.Interface.isInterface(contractInterface)) {
            return contractInterface;
          }
          return new abi_1.Interface(contractInterface);
        }
        deployed() {
          return this._deployed();
        }
        _deployed(blockTag) {
          if (!this._deployedPromise) {
            if (this.deployTransaction) {
              this._deployedPromise = this.deployTransaction.wait().then((() => this));
            } else {
              this._deployedPromise = this.provider.getCode(this.address, blockTag).then((code => {
                if (code === "0x") {
                  logger.throwError("contract not deployed", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                    contractAddress: this.address,
                    operation: "getDeployed"
                  });
                }
                return this;
              }));
            }
          }
          return this._deployedPromise;
        }
        fallback(overrides) {
          if (!this.signer) {
            logger.throwError("sending a transactions require a signer", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "sendTransaction(fallback)"
            });
          }
          const tx = (0, properties_1.shallowCopy)(overrides || {});
          [ "from", "to" ].forEach((function(key) {
            if (tx[key] == null) {
              return;
            }
            logger.throwError("cannot override " + key, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: key
            });
          }));
          tx.to = this.resolvedAddress;
          return this.deployed().then((() => this.signer.sendTransaction(tx)));
        }
        connect(signerOrProvider) {
          if (typeof signerOrProvider === "string") {
            signerOrProvider = new abstract_signer_1.VoidSigner(signerOrProvider, this.provider);
          }
          const contract = new this.constructor(this.address, this.interface, signerOrProvider);
          if (this.deployTransaction) {
            (0, properties_1.defineReadOnly)(contract, "deployTransaction", this.deployTransaction);
          }
          return contract;
        }
        attach(addressOrName) {
          return new this.constructor(addressOrName, this.interface, this.signer || this.provider);
        }
        static isIndexed(value) {
          return abi_1.Indexed.isIndexed(value);
        }
        _normalizeRunningEvent(runningEvent) {
          if (this._runningEvents[runningEvent.tag]) {
            return this._runningEvents[runningEvent.tag];
          }
          return runningEvent;
        }
        _getRunningEvent(eventName) {
          if (typeof eventName === "string") {
            if (eventName === "error") {
              return this._normalizeRunningEvent(new ErrorRunningEvent);
            }
            if (eventName === "event") {
              return this._normalizeRunningEvent(new RunningEvent("event", null));
            }
            if (eventName === "*") {
              return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
            }
            const fragment = this.interface.getEvent(eventName);
            return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment));
          }
          if (eventName.topics && eventName.topics.length > 0) {
            try {
              const topic = eventName.topics[0];
              if (typeof topic !== "string") {
                throw new Error("invalid topic");
              }
              const fragment = this.interface.getEvent(topic);
              return this._normalizeRunningEvent(new FragmentRunningEvent(this.address, this.interface, fragment, eventName.topics));
            } catch (error) {}
            const filter = {
              address: this.address,
              topics: eventName.topics
            };
            return this._normalizeRunningEvent(new RunningEvent(getEventTag(filter), filter));
          }
          return this._normalizeRunningEvent(new WildcardRunningEvent(this.address, this.interface));
        }
        _checkRunningEvents(runningEvent) {
          if (runningEvent.listenerCount() === 0) {
            delete this._runningEvents[runningEvent.tag];
            const emit = this._wrappedEmits[runningEvent.tag];
            if (emit && runningEvent.filter) {
              this.provider.off(runningEvent.filter, emit);
              delete this._wrappedEmits[runningEvent.tag];
            }
          }
        }
        _wrapEvent(runningEvent, log, listener) {
          const event = (0, properties_1.deepCopy)(log);
          event.removeListener = () => {
            if (!listener) {
              return;
            }
            runningEvent.removeListener(listener);
            this._checkRunningEvents(runningEvent);
          };
          event.getBlock = () => this.provider.getBlock(log.blockHash);
          event.getTransaction = () => this.provider.getTransaction(log.transactionHash);
          event.getTransactionReceipt = () => this.provider.getTransactionReceipt(log.transactionHash);
          runningEvent.prepareEvent(event);
          return event;
        }
        _addEventListener(runningEvent, listener, once) {
          if (!this.provider) {
            logger.throwError("events require a provider or a signer with a provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "once"
            });
          }
          runningEvent.addListener(listener, once);
          this._runningEvents[runningEvent.tag] = runningEvent;
          if (!this._wrappedEmits[runningEvent.tag]) {
            const wrappedEmit = log => {
              let event = this._wrapEvent(runningEvent, log, listener);
              if (event.decodeError == null) {
                try {
                  const args = runningEvent.getEmit(event);
                  this.emit(runningEvent.filter, ...args);
                } catch (error) {
                  event.decodeError = error.error;
                }
              }
              if (runningEvent.filter != null) {
                this.emit("event", event);
              }
              if (event.decodeError != null) {
                this.emit("error", event.decodeError, event);
              }
            };
            this._wrappedEmits[runningEvent.tag] = wrappedEmit;
            if (runningEvent.filter != null) {
              this.provider.on(runningEvent.filter, wrappedEmit);
            }
          }
        }
        queryFilter(event, fromBlockOrBlockhash, toBlock) {
          const runningEvent = this._getRunningEvent(event);
          const filter = (0, properties_1.shallowCopy)(runningEvent.filter);
          if (typeof fromBlockOrBlockhash === "string" && (0, bytes_1.isHexString)(fromBlockOrBlockhash, 32)) {
            if (toBlock != null) {
              logger.throwArgumentError("cannot specify toBlock with blockhash", "toBlock", toBlock);
            }
            filter.blockHash = fromBlockOrBlockhash;
          } else {
            filter.fromBlock = fromBlockOrBlockhash != null ? fromBlockOrBlockhash : 0;
            filter.toBlock = toBlock != null ? toBlock : "latest";
          }
          return this.provider.getLogs(filter).then((logs => logs.map((log => this._wrapEvent(runningEvent, log, null)))));
        }
        on(event, listener) {
          this._addEventListener(this._getRunningEvent(event), listener, false);
          return this;
        }
        once(event, listener) {
          this._addEventListener(this._getRunningEvent(event), listener, true);
          return this;
        }
        emit(eventName, ...args) {
          if (!this.provider) {
            return false;
          }
          const runningEvent = this._getRunningEvent(eventName);
          const result = runningEvent.run(args) > 0;
          this._checkRunningEvents(runningEvent);
          return result;
        }
        listenerCount(eventName) {
          if (!this.provider) {
            return 0;
          }
          if (eventName == null) {
            return Object.keys(this._runningEvents).reduce(((accum, key) => accum + this._runningEvents[key].listenerCount()), 0);
          }
          return this._getRunningEvent(eventName).listenerCount();
        }
        listeners(eventName) {
          if (!this.provider) {
            return [];
          }
          if (eventName == null) {
            const result = [];
            for (let tag in this._runningEvents) {
              this._runningEvents[tag].listeners().forEach((listener => {
                result.push(listener);
              }));
            }
            return result;
          }
          return this._getRunningEvent(eventName).listeners();
        }
        removeAllListeners(eventName) {
          if (!this.provider) {
            return this;
          }
          if (eventName == null) {
            for (const tag in this._runningEvents) {
              const runningEvent = this._runningEvents[tag];
              runningEvent.removeAllListeners();
              this._checkRunningEvents(runningEvent);
            }
            return this;
          }
          const runningEvent = this._getRunningEvent(eventName);
          runningEvent.removeAllListeners();
          this._checkRunningEvents(runningEvent);
          return this;
        }
        off(eventName, listener) {
          if (!this.provider) {
            return this;
          }
          const runningEvent = this._getRunningEvent(eventName);
          runningEvent.removeListener(listener);
          this._checkRunningEvents(runningEvent);
          return this;
        }
        removeListener(eventName, listener) {
          return this.off(eventName, listener);
        }
      }
      exports.BaseContract = BaseContract;
      class Contract extends BaseContract {}
      exports.Contract = Contract;
      class ContractFactory {
        constructor(contractInterface, bytecode, signer) {
          let bytecodeHex = null;
          if (typeof bytecode === "string") {
            bytecodeHex = bytecode;
          } else if ((0, bytes_1.isBytes)(bytecode)) {
            bytecodeHex = (0, bytes_1.hexlify)(bytecode);
          } else if (bytecode && typeof bytecode.object === "string") {
            bytecodeHex = bytecode.object;
          } else {
            bytecodeHex = "!";
          }
          if (bytecodeHex.substring(0, 2) !== "0x") {
            bytecodeHex = "0x" + bytecodeHex;
          }
          if (!(0, bytes_1.isHexString)(bytecodeHex) || bytecodeHex.length % 2) {
            logger.throwArgumentError("invalid bytecode", "bytecode", bytecode);
          }
          if (signer && !abstract_signer_1.Signer.isSigner(signer)) {
            logger.throwArgumentError("invalid signer", "signer", signer);
          }
          (0, properties_1.defineReadOnly)(this, "bytecode", bytecodeHex);
          (0, properties_1.defineReadOnly)(this, "interface", (0, properties_1.getStatic)(new.target, "getInterface")(contractInterface));
          (0, properties_1.defineReadOnly)(this, "signer", signer || null);
        }
        getDeployTransaction(...args) {
          let tx = {};
          if (args.length === this.interface.deploy.inputs.length + 1 && typeof args[args.length - 1] === "object") {
            tx = (0, properties_1.shallowCopy)(args.pop());
            for (const key in tx) {
              if (!allowedTransactionKeys[key]) {
                throw new Error("unknown transaction override " + key);
              }
            }
          }
          [ "data", "from", "to" ].forEach((key => {
            if (tx[key] == null) {
              return;
            }
            logger.throwError("cannot override " + key, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: key
            });
          }));
          if (tx.value) {
            const value = bignumber_1.BigNumber.from(tx.value);
            if (!value.isZero() && !this.interface.deploy.payable) {
              logger.throwError("non-payable constructor cannot override value", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                operation: "overrides.value",
                value: tx.value
              });
            }
          }
          logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
          tx.data = (0, bytes_1.hexlify)((0, bytes_1.concat)([ this.bytecode, this.interface.encodeDeploy(args) ]));
          return tx;
        }
        async deploy(...args) {
          let overrides = {};
          if (args.length === this.interface.deploy.inputs.length + 1) {
            overrides = args.pop();
          }
          logger.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
          const params = await resolveAddresses(this.signer, args, this.interface.deploy.inputs);
          params.push(overrides);
          const unsignedTx = this.getDeployTransaction(...params);
          const tx = await this.signer.sendTransaction(unsignedTx);
          const address = (0, properties_1.getStatic)(this.constructor, "getContractAddress")(tx);
          const contract = (0, properties_1.getStatic)(this.constructor, "getContract")(address, this.interface, this.signer);
          addContractWait(contract, tx);
          (0, properties_1.defineReadOnly)(contract, "deployTransaction", tx);
          return contract;
        }
        attach(address) {
          return this.constructor.getContract(address, this.interface, this.signer);
        }
        connect(signer) {
          return new this.constructor(this.interface, this.bytecode, signer);
        }
        static fromPurity(compilerOutput, signer) {
          if (compilerOutput == null) {
            logger.throwError("missing compiler output", logger_1.Logger.errors.MISSING_ARGUMENT, {
              argument: "compilerOutput"
            });
          }
          if (typeof compilerOutput === "string") {
            compilerOutput = JSON.parse(compilerOutput);
          }
          const abi = compilerOutput.abi;
          let bytecode = null;
          if (compilerOutput.bytecode) {
            bytecode = compilerOutput.bytecode;
          } else if (compilerOutput.evm && compilerOutput.evm.bytecode) {
            bytecode = compilerOutput.evm.bytecode;
          }
          return new this(abi, bytecode, signer);
        }
        static getInterface(contractInterface) {
          return Contract.getInterface(contractInterface);
        }
        static getContractAddress(tx) {
          return (0, address_1.getContractAddress)(tx);
        }
        static getContract(address, contractInterface, signer) {
          return new Contract(address, contractInterface, signer);
        }
      }
      exports.ContractFactory = ContractFactory;
    },
    334(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "hash/5.7.4";
    },
    9680(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.decode_arithmetic = decode_arithmetic;
      exports.read_payload = read_payload;
      exports.read_compressed_payload = read_compressed_payload;
      exports.signed = signed;
      exports.read_member_array = read_member_array;
      exports.read_mapped_map = read_mapped_map;
      exports.read_zero_terminated_array = read_zero_terminated_array;
      exports.read_emoji_trie = read_emoji_trie;
      function flat(array, depth) {
        if (depth == null) {
          depth = 1;
        }
        const result = [];
        const forEach = result.forEach;
        const flatDeep = function(arr, depth) {
          forEach.call(arr, (function(val) {
            if (depth > 0 && Array.isArray(val)) {
              flatDeep(val, depth - 1);
            } else {
              result.push(val);
            }
          }));
        };
        flatDeep(array, depth);
        return result;
      }
      function fromEntries(array) {
        const result = {};
        for (let i = 0; i < array.length; i++) {
          const value = array[i];
          result[value[0]] = value[1];
        }
        return result;
      }
      function decode_arithmetic(bytes) {
        let pos = 0;
        function u16() {
          return bytes[pos++] << 8 | bytes[pos++];
        }
        let symbol_count = u16();
        let total = 1;
        let acc = [ 0, 1 ];
        for (let i = 1; i < symbol_count; i++) {
          acc.push(total += u16());
        }
        let skip = u16();
        let pos_payload = pos;
        pos += skip;
        let read_width = 0;
        let read_buffer = 0;
        function read_bit() {
          if (read_width == 0) {
            read_buffer = read_buffer << 8 | bytes[pos++];
            read_width = 8;
          }
          return read_buffer >> --read_width & 1;
        }
        const N = 31;
        const FULL = 2 ** N;
        const HALF = FULL >>> 1;
        const QRTR = HALF >> 1;
        const MASK = FULL - 1;
        let register = 0;
        for (let i = 0; i < N; i++) register = register << 1 | read_bit();
        let symbols = [];
        let low = 0;
        let range = FULL;
        while (true) {
          let value = Math.floor(((register - low + 1) * total - 1) / range);
          let start = 0;
          let end = symbol_count;
          while (end - start > 1) {
            let mid = start + end >>> 1;
            if (value < acc[mid]) {
              end = mid;
            } else {
              start = mid;
            }
          }
          if (start == 0) break;
          symbols.push(start);
          let a = low + Math.floor(range * acc[start] / total);
          let b = low + Math.floor(range * acc[start + 1] / total) - 1;
          while (((a ^ b) & HALF) == 0) {
            register = register << 1 & MASK | read_bit();
            a = a << 1 & MASK;
            b = b << 1 & MASK | 1;
          }
          while (a & ~b & QRTR) {
            register = register & HALF | register << 1 & MASK >>> 1 | read_bit();
            a = a << 1 ^ HALF;
            b = (b ^ HALF) << 1 | HALF | 1;
          }
          low = a;
          range = 1 + b - a;
        }
        let offset = symbol_count - 4;
        return symbols.map((x => {
          switch (x - offset) {
           case 3:
            return offset + 65792 + (bytes[pos_payload++] << 16 | bytes[pos_payload++] << 8 | bytes[pos_payload++]);

           case 2:
            return offset + 256 + (bytes[pos_payload++] << 8 | bytes[pos_payload++]);

           case 1:
            return offset + bytes[pos_payload++];

           default:
            return x - 1;
          }
        }));
      }
      function read_payload(v) {
        let pos = 0;
        return () => v[pos++];
      }
      function read_compressed_payload(bytes) {
        return read_payload(decode_arithmetic(bytes));
      }
      function signed(i) {
        return i & 1 ? ~i >> 1 : i >> 1;
      }
      function read_counts(n, next) {
        let v = Array(n);
        for (let i = 0; i < n; i++) v[i] = 1 + next();
        return v;
      }
      function read_ascending(n, next) {
        let v = Array(n);
        for (let i = 0, x = -1; i < n; i++) v[i] = x += 1 + next();
        return v;
      }
      function read_deltas(n, next) {
        let v = Array(n);
        for (let i = 0, x = 0; i < n; i++) v[i] = x += signed(next());
        return v;
      }
      function read_member_array(next, lookup) {
        let v = read_ascending(next(), next);
        let n = next();
        let vX = read_ascending(n, next);
        let vN = read_counts(n, next);
        for (let i = 0; i < n; i++) {
          for (let j = 0; j < vN[i]; j++) {
            v.push(vX[i] + j);
          }
        }
        return lookup ? v.map((x => lookup[x])) : v;
      }
      function read_mapped_map(next) {
        let ret = [];
        while (true) {
          let w = next();
          if (w == 0) break;
          ret.push(read_linear_table(w, next));
        }
        while (true) {
          let w = next() - 1;
          if (w < 0) break;
          ret.push(read_replacement_table(w, next));
        }
        return fromEntries(flat(ret));
      }
      function read_zero_terminated_array(next) {
        let v = [];
        while (true) {
          let i = next();
          if (i == 0) break;
          v.push(i);
        }
        return v;
      }
      function read_transposed(n, w, next) {
        let m = Array(n).fill(undefined).map((() => []));
        for (let i = 0; i < w; i++) {
          read_deltas(n, next).forEach(((x, j) => m[j].push(x)));
        }
        return m;
      }
      function read_linear_table(w, next) {
        let dx = 1 + next();
        let dy = next();
        let vN = read_zero_terminated_array(next);
        let m = read_transposed(vN.length, 1 + w, next);
        return flat(m.map(((v, i) => {
          const x = v[0], ys = v.slice(1);
          return Array(vN[i]).fill(undefined).map(((_, j) => {
            let j_dy = j * dy;
            return [ x + j * dx, ys.map((y => y + j_dy)) ];
          }));
        })));
      }
      function read_replacement_table(w, next) {
        let n = 1 + next();
        let m = read_transposed(n, 1 + w, next);
        return m.map((v => [ v[0], v.slice(1) ]));
      }
      function read_emoji_trie(next) {
        let sorted = read_member_array(next).sort(((a, b) => a - b));
        return read();
        function read() {
          let branches = [];
          while (true) {
            let keys = read_member_array(next, sorted);
            if (keys.length == 0) break;
            branches.push({
              set: new Set(keys),
              node: read()
            });
          }
          branches.sort(((a, b) => b.set.size - a.set.size));
          let temp = next();
          let valid = temp % 3;
          temp = temp / 3 | 0;
          let fe0f = !!(temp & 1);
          temp >>= 1;
          let save = temp == 1;
          let check = temp == 2;
          return {
            branches,
            valid,
            fe0f,
            save,
            check
          };
        }
      }
    },
    1600(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.getData = getData;
      const base64_1 = __webpack_require__(8886);
      const decoder_js_1 = __webpack_require__(9680);
      function getData() {
        return (0, decoder_js_1.read_compressed_payload)((0, base64_1.decode)(" "));
      }
    },
    2351(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.ens_normalize_post_check = ens_normalize_post_check;
      exports.ens_normalize = ens_normalize;
      const strings_1 = __webpack_require__(2509);
      const include_js_1 = __webpack_require__(1600);
      const r = (0, include_js_1.getData)();
      const decoder_js_1 = __webpack_require__(9680);
      const VALID = new Set((0, decoder_js_1.read_member_array)(r));
      const IGNORED = new Set((0, decoder_js_1.read_member_array)(r));
      const MAPPED = (0, decoder_js_1.read_mapped_map)(r);
      const EMOJI_ROOT = (0, decoder_js_1.read_emoji_trie)(r);
      const HYPHEN = 45;
      const UNDERSCORE = 95;
      function explode_cp(name) {
        return (0, strings_1.toUtf8CodePoints)(name);
      }
      function filter_fe0f(cps) {
        return cps.filter((cp => cp != 65039));
      }
      function ens_normalize_post_check(name) {
        for (let label of name.split(".")) {
          let cps = explode_cp(label);
          try {
            for (let i = cps.lastIndexOf(UNDERSCORE) - 1; i >= 0; i--) {
              if (cps[i] !== UNDERSCORE) {
                throw new Error(`underscore only allowed at start`);
              }
            }
            if (cps.length >= 4 && cps.every((cp => cp < 128)) && cps[2] === HYPHEN && cps[3] === HYPHEN) {
              throw new Error(`invalid label extension`);
            }
          } catch (err) {
            throw new Error(`Invalid label "${label}": ${err.message}`);
          }
        }
        return name;
      }
      function ens_normalize(name) {
        return ens_normalize_post_check(normalize(name, filter_fe0f));
      }
      function normalize(name, emoji_filter) {
        let input = explode_cp(name).reverse();
        let output = [];
        while (input.length) {
          let emoji = consume_emoji_reversed(input);
          if (emoji) {
            output.push(...emoji_filter(emoji));
            continue;
          }
          let cp = input.pop();
          if (VALID.has(cp)) {
            output.push(cp);
            continue;
          }
          if (IGNORED.has(cp)) {
            continue;
          }
          let cps = MAPPED[cp];
          if (cps) {
            output.push(...cps);
            continue;
          }
          throw new Error(`Disallowed codepoint: 0x${cp.toString(16).toUpperCase()}`);
        }
        return ens_normalize_post_check(nfc(String.fromCodePoint(...output)));
      }
      function nfc(s) {
        return s.normalize("NFC");
      }
      function consume_emoji_reversed(cps, eaten) {
        let node = EMOJI_ROOT;
        let emoji;
        let saved;
        let stack = [];
        let pos = cps.length;
        if (eaten) eaten.length = 0;
        while (pos) {
          let cp = cps[--pos];
          node = node.branches.find((x => x.set.has(cp)))?.node;
          if (!node) break;
          if (node.save) {
            saved = cp;
          } else if (node.check) {
            if (cp === saved) break;
          }
          stack.push(cp);
          if (node.fe0f) {
            stack.push(65039);
            if (pos > 0 && cps[pos - 1] == 65039) pos--;
          }
          if (node.valid) {
            emoji = stack.slice();
            if (node.valid == 2) emoji.splice(1, 1);
            if (eaten) eaten.push(...cps.slice(pos).reverse());
            cps.length = pos;
          }
        }
        return emoji;
      }
    },
    6584(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.id = id;
      const keccak256_1 = __webpack_require__(1136);
      const strings_1 = __webpack_require__(2509);
      function id(text) {
        return (0, keccak256_1.keccak256)((0, strings_1.toUtf8Bytes)(text));
      }
    },
    413(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports._TypedDataEncoder = exports.hashMessage = exports.messagePrefix = exports.ensNormalize = exports.isValidName = exports.namehash = exports.dnsEncode = exports.id = void 0;
      const id_1 = __webpack_require__(6584);
      Object.defineProperty(exports, "id", {
        enumerable: true,
        get: function() {
          return id_1.id;
        }
      });
      const namehash_1 = __webpack_require__(8850);
      Object.defineProperty(exports, "dnsEncode", {
        enumerable: true,
        get: function() {
          return namehash_1.dnsEncode;
        }
      });
      Object.defineProperty(exports, "isValidName", {
        enumerable: true,
        get: function() {
          return namehash_1.isValidName;
        }
      });
      Object.defineProperty(exports, "namehash", {
        enumerable: true,
        get: function() {
          return namehash_1.namehash;
        }
      });
      const message_1 = __webpack_require__(238);
      Object.defineProperty(exports, "hashMessage", {
        enumerable: true,
        get: function() {
          return message_1.hashMessage;
        }
      });
      Object.defineProperty(exports, "messagePrefix", {
        enumerable: true,
        get: function() {
          return message_1.messagePrefix;
        }
      });
      const namehash_2 = __webpack_require__(8850);
      Object.defineProperty(exports, "ensNormalize", {
        enumerable: true,
        get: function() {
          return namehash_2.ensNormalize;
        }
      });
      const typed_data_1 = __webpack_require__(8362);
      Object.defineProperty(exports, "_TypedDataEncoder", {
        enumerable: true,
        get: function() {
          return typed_data_1.TypedDataEncoder;
        }
      });
    },
    238(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.messagePrefix = void 0;
      exports.hashMessage = hashMessage;
      const bytes_1 = __webpack_require__(8380);
      const keccak256_1 = __webpack_require__(1136);
      const strings_1 = __webpack_require__(2509);
      exports.messagePrefix = "QuantumEVM Signed Message\n";
      function hashMessage(message) {
        if (typeof message === "string") {
          message = (0, strings_1.toUtf8Bytes)(message);
        }
        return (0, keccak256_1.keccak256)((0, bytes_1.concat)([ (0, strings_1.toUtf8Bytes)(exports.messagePrefix), (0, 
        strings_1.toUtf8Bytes)(String(message.length)), message ]));
      }
    },
    8850(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.ensNormalize = ensNormalize;
      exports.isValidName = isValidName;
      exports.namehash = namehash;
      exports.dnsEncode = dnsEncode;
      const bytes_1 = __webpack_require__(8380);
      const strings_1 = __webpack_require__(2509);
      const keccak256_1 = __webpack_require__(1136);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(334);
      const logger = new logger_1.Logger(_version_1.version);
      const lib_1 = __webpack_require__(2351);
      const Zeros = new Uint8Array(32);
      Zeros.fill(0);
      function checkComponent(comp) {
        if (comp.length === 0) {
          throw new Error("invalid ENS name; empty component");
        }
        return comp;
      }
      function ensNameSplit(name) {
        const bytes = (0, strings_1.toUtf8Bytes)((0, lib_1.ens_normalize)(name));
        const comps = [];
        if (name.length === 0) {
          return comps;
        }
        let last = 0;
        for (let i = 0; i < bytes.length; i++) {
          const d = bytes[i];
          if (d === 46) {
            comps.push(checkComponent(bytes.slice(last, i)));
            last = i + 1;
          }
        }
        if (last >= bytes.length) {
          throw new Error("invalid ENS name; empty component");
        }
        comps.push(checkComponent(bytes.slice(last)));
        return comps;
      }
      function ensNormalize(name) {
        return ensNameSplit(name).map((comp => (0, strings_1.toUtf8String)(comp))).join(".");
      }
      function isValidName(name) {
        try {
          return ensNameSplit(name).length !== 0;
        } catch (error) {}
        return false;
      }
      function namehash(name) {
        if (typeof name !== "string") {
          logger.throwArgumentError("invalid ENS name; not a string", "name", name);
        }
        let result = Zeros;
        const comps = ensNameSplit(name);
        while (comps.length) {
          result = (0, keccak256_1.keccak256)((0, bytes_1.concat)([ result, (0, keccak256_1.keccak256)(comps.pop()) ]));
        }
        return (0, bytes_1.hexlify)(result);
      }
      function dnsEncode(name) {
        return (0, bytes_1.hexlify)((0, bytes_1.concat)(ensNameSplit(name).map((comp => {
          if (comp.length > 63) {
            throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");
          }
          const bytes = new Uint8Array(comp.length + 1);
          bytes.set(comp, 1);
          bytes[0] = bytes.length - 1;
          return bytes;
        })))) + "00";
      }
    },
    8362(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.TypedDataEncoder = void 0;
      const address_1 = __webpack_require__(171);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const keccak256_1 = __webpack_require__(1136);
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(334);
      const logger = new logger_1.Logger(_version_1.version);
      const id_1 = __webpack_require__(6584);
      const padding = new Uint8Array(32);
      padding.fill(0);
      const NegativeOne = bignumber_1.BigNumber.from(-1);
      const Zero = bignumber_1.BigNumber.from(0);
      const One = bignumber_1.BigNumber.from(1);
      const MaxUint256 = bignumber_1.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
      function hexPadRight(value) {
        const bytes = (0, bytes_1.arrayify)(value);
        const padOffset = bytes.length % 32;
        if (padOffset) {
          return (0, bytes_1.hexConcat)([ bytes, padding.slice(padOffset) ]);
        }
        return (0, bytes_1.hexlify)(bytes);
      }
      const hexTrue = (0, bytes_1.hexZeroPad)(One.toHexString(), 32);
      const hexFalse = (0, bytes_1.hexZeroPad)(Zero.toHexString(), 32);
      const domainFieldTypes = {
        name: "string",
        version: "string",
        chainId: "uint256",
        verifyingContract: "address",
        salt: "bytes32"
      };
      const domainFieldNames = [ "name", "version", "chainId", "verifyingContract", "salt" ];
      function checkString(key) {
        return function(value) {
          if (typeof value !== "string") {
            logger.throwArgumentError(`invalid domain value for ${JSON.stringify(key)}`, `domain.${key}`, value);
          }
          return value;
        };
      }
      const domainChecks = {
        name: checkString("name"),
        version: checkString("version"),
        chainId: function(value) {
          try {
            return bignumber_1.BigNumber.from(value).toString();
          } catch (error) {}
          return logger.throwArgumentError(`invalid domain value for "chainId"`, "domain.chainId", value);
        },
        verifyingContract: function(value) {
          try {
            return (0, address_1.getAddress)(value).toLowerCase();
          } catch (error) {}
          return logger.throwArgumentError(`invalid domain value "verifyingContract"`, "domain.verifyingContract", value);
        },
        salt: function(value) {
          try {
            const bytes = (0, bytes_1.arrayify)(value);
            if (bytes.length !== 32) {
              throw new Error("bad length");
            }
            return (0, bytes_1.hexlify)(bytes);
          } catch (error) {}
          return logger.throwArgumentError(`invalid domain value "salt"`, "domain.salt", value);
        }
      };
      function getBaseEncoder(type) {
        {
          const match = type.match(/^(u?)int(\d*)$/);
          if (match) {
            const signed = match[1] === "";
            const width = parseInt(match[2] || "256");
            if (width % 8 !== 0 || width > 256 || match[2] && match[2] !== String(width)) {
              logger.throwArgumentError("invalid numeric width", "type", type);
            }
            const boundsUpper = MaxUint256.mask(signed ? width - 1 : width);
            const boundsLower = signed ? boundsUpper.add(One).mul(NegativeOne) : Zero;
            return function(value) {
              const v = bignumber_1.BigNumber.from(value);
              if (v.lt(boundsLower) || v.gt(boundsUpper)) {
                logger.throwArgumentError(`value out-of-bounds for ${type}`, "value", value);
              }
              return (0, bytes_1.hexZeroPad)(v.toTwos(256).toHexString(), 32);
            };
          }
        }
        {
          const match = type.match(/^bytes(\d+)$/);
          if (match) {
            const width = parseInt(match[1]);
            if (width === 0 || width > 32 || match[1] !== String(width)) {
              logger.throwArgumentError("invalid bytes width", "type", type);
            }
            return function(value) {
              const bytes = (0, bytes_1.arrayify)(value);
              if (bytes.length !== width) {
                logger.throwArgumentError(`invalid length for ${type}`, "value", value);
              }
              return hexPadRight(value);
            };
          }
        }
        switch (type) {
         case "address":
          return function(value) {
            return (0, bytes_1.hexZeroPad)((0, address_1.getAddress)(value), 32);
          };

         case "bool":
          return function(value) {
            return !value ? hexFalse : hexTrue;
          };

         case "bytes":
          return function(value) {
            return (0, keccak256_1.keccak256)(value);
          };

         case "string":
          return function(value) {
            return (0, id_1.id)(value);
          };
        }
        return null;
      }
      function encodeType(name, fields) {
        return `${name}(${fields.map((({name, type}) => type + " " + name)).join(",")})`;
      }
      class TypedDataEncoder {
        constructor(types) {
          (0, properties_1.defineReadOnly)(this, "types", Object.freeze((0, properties_1.deepCopy)(types)));
          (0, properties_1.defineReadOnly)(this, "_encoderCache", {});
          (0, properties_1.defineReadOnly)(this, "_types", {});
          const links = {};
          const parents = {};
          const subtypes = {};
          Object.keys(types).forEach((type => {
            links[type] = {};
            parents[type] = [];
            subtypes[type] = {};
          }));
          for (const name in types) {
            const uniqueNames = {};
            types[name].forEach((field => {
              if (uniqueNames[field.name]) {
                logger.throwArgumentError(`duplicate variable name ${JSON.stringify(field.name)} in ${JSON.stringify(name)}`, "types", types);
              }
              uniqueNames[field.name] = true;
              const baseType = field.type.match(/^([^\x5b]*)(\x5b|$)/)[1];
              if (baseType === name) {
                logger.throwArgumentError(`circular type reference to ${JSON.stringify(baseType)}`, "types", types);
              }
              const encoder = getBaseEncoder(baseType);
              if (encoder) {
                return;
              }
              if (!parents[baseType]) {
                logger.throwArgumentError(`unknown type ${JSON.stringify(baseType)}`, "types", types);
              }
              parents[baseType].push(name);
              links[name][baseType] = true;
            }));
          }
          const primaryTypes = Object.keys(parents).filter((n => parents[n].length === 0));
          if (primaryTypes.length === 0) {
            logger.throwArgumentError("missing primary type", "types", types);
          } else if (primaryTypes.length > 1) {
            logger.throwArgumentError(`ambiguous primary types or unused types: ${primaryTypes.map((t => JSON.stringify(t))).join(", ")}`, "types", types);
          }
          (0, properties_1.defineReadOnly)(this, "primaryType", primaryTypes[0]);
          function checkCircular(type, found) {
            if (found[type]) {
              logger.throwArgumentError(`circular type reference to ${JSON.stringify(type)}`, "types", types);
            }
            found[type] = true;
            Object.keys(links[type]).forEach((child => {
              if (!parents[child]) {
                return;
              }
              checkCircular(child, found);
              Object.keys(found).forEach((subtype => {
                subtypes[subtype][child] = true;
              }));
            }));
            delete found[type];
          }
          checkCircular(this.primaryType, {});
          for (const name in subtypes) {
            const st = Object.keys(subtypes[name]);
            st.sort();
            this._types[name] = encodeType(name, types[name]) + st.map((t => encodeType(t, types[t]))).join("");
          }
        }
        getEncoder(type) {
          let encoder = this._encoderCache[type];
          if (!encoder) {
            encoder = this._encoderCache[type] = this._getEncoder(type);
          }
          return encoder;
        }
        _getEncoder(type) {
          {
            const encoder = getBaseEncoder(type);
            if (encoder) {
              return encoder;
            }
          }
          const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
          if (match) {
            const subtype = match[1];
            const subEncoder = this.getEncoder(subtype);
            const length = parseInt(match[3]);
            return value => {
              if (length >= 0 && value.length !== length) {
                logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", value);
              }
              let result = value.map(subEncoder);
              if (this._types[subtype]) {
                result = result.map(keccak256_1.keccak256);
              }
              return (0, keccak256_1.keccak256)((0, bytes_1.hexConcat)(result));
            };
          }
          const fields = this.types[type];
          if (fields) {
            const encodedType = (0, id_1.id)(this._types[type]);
            return value => {
              const values = fields.map((({name, type}) => {
                const result = this.getEncoder(type)(value[name]);
                if (this._types[type]) {
                  return (0, keccak256_1.keccak256)(result);
                }
                return result;
              }));
              values.unshift(encodedType);
              return (0, bytes_1.hexConcat)(values);
            };
          }
          return logger.throwArgumentError(`unknown type: ${type}`, "type", type);
        }
        encodeType(name) {
          const result = this._types[name];
          if (!result) {
            logger.throwArgumentError(`unknown type: ${JSON.stringify(name)}`, "name", name);
          }
          return result;
        }
        encodeData(type, value) {
          return this.getEncoder(type)(value);
        }
        hashStruct(name, value) {
          return (0, keccak256_1.keccak256)(this.encodeData(name, value));
        }
        encode(value) {
          return this.encodeData(this.primaryType, value);
        }
        hash(value) {
          return this.hashStruct(this.primaryType, value);
        }
        _visit(type, value, callback) {
          {
            const encoder = getBaseEncoder(type);
            if (encoder) {
              return callback(type, value);
            }
          }
          const match = type.match(/^(.*)(\x5b(\d*)\x5d)$/);
          if (match) {
            const subtype = match[1];
            const length = parseInt(match[3]);
            if (length >= 0 && value.length !== length) {
              logger.throwArgumentError("array length mismatch; expected length ${ arrayLength }", "value", value);
            }
            return value.map((v => this._visit(subtype, v, callback)));
          }
          const fields = this.types[type];
          if (fields) {
            return fields.reduce(((accum, {name, type}) => {
              accum[name] = this._visit(type, value[name], callback);
              return accum;
            }), {});
          }
          return logger.throwArgumentError(`unknown type: ${type}`, "type", type);
        }
        visit(value, callback) {
          return this._visit(this.primaryType, value, callback);
        }
        static from(types) {
          return new TypedDataEncoder(types);
        }
        static getPrimaryType(types) {
          return TypedDataEncoder.from(types).primaryType;
        }
        static hashStruct(name, types, value) {
          return TypedDataEncoder.from(types).hashStruct(name, value);
        }
        static hashDomain(domain) {
          const domainFields = [];
          for (const name in domain) {
            const type = domainFieldTypes[name];
            if (!type) {
              logger.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(name)}`, "domain", domain);
            }
            domainFields.push({
              name,
              type
            });
          }
          domainFields.sort(((a, b) => domainFieldNames.indexOf(a.name) - domainFieldNames.indexOf(b.name)));
          return TypedDataEncoder.hashStruct("EIP712Domain", {
            EIP712Domain: domainFields
          }, domain);
        }
        static encode(domain, types, value) {
          return (0, bytes_1.hexConcat)([ "0x1901", TypedDataEncoder.hashDomain(domain), TypedDataEncoder.from(types).hash(value) ]);
        }
        static hash(domain, types, value) {
          return (0, keccak256_1.keccak256)(TypedDataEncoder.encode(domain, types, value));
        }
        static async resolveNames(domain, types, value, resolveName) {
          domain = (0, properties_1.shallowCopy)(domain);
          const ensCache = {};
          if (domain.verifyingContract && !(0, bytes_1.isHexString)(domain.verifyingContract, 32)) {
            ensCache[domain.verifyingContract] = "0x";
          }
          const encoder = TypedDataEncoder.from(types);
          encoder.visit(value, ((type, value) => {
            if (type === "address" && !(0, bytes_1.isHexString)(value, 32)) {
              ensCache[value] = "0x";
            }
            return value;
          }));
          for (const name in ensCache) {
            ensCache[name] = await resolveName(name);
          }
          if (domain.verifyingContract && ensCache[domain.verifyingContract]) {
            domain.verifyingContract = ensCache[domain.verifyingContract];
          }
          value = encoder.visit(value, ((type, value) => {
            if (type === "address" && ensCache[value]) {
              return ensCache[value];
            }
            return value;
          }));
          return {
            domain,
            value
          };
        }
        static getPayload(domain, types, value) {
          TypedDataEncoder.hashDomain(domain);
          const domainValues = {};
          const domainTypes = [];
          domainFieldNames.forEach((name => {
            const value = domain[name];
            if (value == null) {
              return;
            }
            domainValues[name] = domainChecks[name](value);
            domainTypes.push({
              name,
              type: domainFieldTypes[name]
            });
          }));
          const encoder = TypedDataEncoder.from(types);
          const typesWithDomain = (0, properties_1.shallowCopy)(types);
          if (typesWithDomain.EIP712Domain) {
            logger.throwArgumentError("types must not contain EIP712Domain type", "types.EIP712Domain", types);
          } else {
            typesWithDomain.EIP712Domain = domainTypes;
          }
          encoder.encode(value);
          return {
            types: typesWithDomain,
            domain: domainValues,
            primaryType: encoder.primaryType,
            message: encoder.visit(value, ((type, value) => {
              if (type.match(/^bytes(\d*)/)) {
                return (0, bytes_1.hexlify)((0, bytes_1.arrayify)(value));
              }
              if (type.match(/^u?int/)) {
                return bignumber_1.BigNumber.from(value).toString();
              }
              switch (type) {
               case "address":
                return value.toLowerCase();

               case "bool":
                return !!value;

               case "string":
                if (typeof value !== "string") {
                  logger.throwArgumentError(`invalid string`, "value", value);
                }
                return value;
              }
              return logger.throwArgumentError("unsupported type", "type", type);
            }))
          };
        }
      }
      exports.TypedDataEncoder = TypedDataEncoder;
    },
    1613(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "json-wallets/5.7.4";
    },
    3550(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __importDefault = this && this.__importDefault || function(mod) {
        return mod && mod.__esModule ? mod : {
          default: mod
        };
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.CrowdsaleAccount = void 0;
      exports.decrypt = decrypt;
      const aes_js_1 = __importDefault(__webpack_require__(3836));
      const address_1 = __webpack_require__(171);
      const bytes_1 = __webpack_require__(8380);
      const keccak256_1 = __webpack_require__(1136);
      const pbkdf2_1 = __webpack_require__(1504);
      const strings_1 = __webpack_require__(2509);
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1613);
      const logger = new logger_1.Logger(_version_1.version);
      const utils_1 = __webpack_require__(1577);
      class CrowdsaleAccount extends properties_1.Description {
        isCrowdsaleAccount(value) {
          return !!(value && value._isCrowdsaleAccount);
        }
      }
      exports.CrowdsaleAccount = CrowdsaleAccount;
      function decrypt(json, password) {
        throw new Error("Decryption of crowdsale account not yet implemented");
      }
    },
    3120(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.getJsonWalletAddress = exports.isKeystoreWallet = exports.isCrowdsaleWallet = exports.encryptKeystore = exports.decryptKeystoreSync = exports.decryptKeystore = exports.decryptCrowdsale = void 0;
      exports.decryptJsonWallet = decryptJsonWallet;
      exports.decryptJsonWalletSync = decryptJsonWalletSync;
      const crowdsale_1 = __webpack_require__(3550);
      Object.defineProperty(exports, "decryptCrowdsale", {
        enumerable: true,
        get: function() {
          return crowdsale_1.decrypt;
        }
      });
      const inspect_1 = __webpack_require__(6788);
      Object.defineProperty(exports, "getJsonWalletAddress", {
        enumerable: true,
        get: function() {
          return inspect_1.getJsonWalletAddress;
        }
      });
      Object.defineProperty(exports, "isCrowdsaleWallet", {
        enumerable: true,
        get: function() {
          return inspect_1.isCrowdsaleWallet;
        }
      });
      Object.defineProperty(exports, "isKeystoreWallet", {
        enumerable: true,
        get: function() {
          return inspect_1.isKeystoreWallet;
        }
      });
      const keystore_1 = __webpack_require__(7102);
      Object.defineProperty(exports, "decryptKeystore", {
        enumerable: true,
        get: function() {
          return keystore_1.decrypt;
        }
      });
      Object.defineProperty(exports, "decryptKeystoreSync", {
        enumerable: true,
        get: function() {
          return keystore_1.decryptSync;
        }
      });
      Object.defineProperty(exports, "encryptKeystore", {
        enumerable: true,
        get: function() {
          return keystore_1.encrypt;
        }
      });
      function decryptJsonWallet(json, password, progressCallback) {
        if ((0, inspect_1.isCrowdsaleWallet)(json)) {
          if (progressCallback) {
            progressCallback(0);
          }
          const account = (0, crowdsale_1.decrypt)(json, password);
          if (progressCallback) {
            progressCallback(1);
          }
          return Promise.resolve(account);
        }
        if ((0, inspect_1.isKeystoreWallet)(json)) {
          return (0, keystore_1.decrypt)(json, password, progressCallback);
        }
        return Promise.reject(new Error("invalid JSON wallet"));
      }
      function decryptJsonWalletSync(json, password) {
        if ((0, inspect_1.isCrowdsaleWallet)(json)) {
          return (0, crowdsale_1.decrypt)(json, password);
        }
        if ((0, inspect_1.isKeystoreWallet)(json)) {
          return (0, keystore_1.decryptSync)(json, password);
        }
        throw new Error("invalid JSON wallet");
      }
    },
    6788(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.isCrowdsaleWallet = isCrowdsaleWallet;
      exports.isKeystoreWallet = isKeystoreWallet;
      exports.getJsonWalletAddress = getJsonWalletAddress;
      const address_1 = __webpack_require__(171);
      function isCrowdsaleWallet(json) {
        let data = null;
        try {
          data = JSON.parse(json);
        } catch (error) {
          return false;
        }
        return data.encseed && data.ethaddr;
      }
      function isKeystoreWallet(json) {
        let data = null;
        try {
          data = JSON.parse(json);
        } catch (error) {
          return false;
        }
        if (!data.version || parseInt(data.version) !== data.version || parseInt(data.version) !== 3) {
          return false;
        }
        return true;
      }
      function getJsonWalletAddress(json) {
        if (isCrowdsaleWallet(json)) {
          try {
            return (0, address_1.getAddress)(JSON.parse(json).ethaddr);
          } catch (error) {
            return null;
          }
        }
        if (isKeystoreWallet(json)) {
          try {
            return (0, address_1.getAddress)(JSON.parse(json).address);
          } catch (error) {
            return null;
          }
        }
        return null;
      }
    },
    7102(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __importDefault = this && this.__importDefault || function(mod) {
        return mod && mod.__esModule ? mod : {
          default: mod
        };
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.KeystoreAccount = void 0;
      exports.decryptSync = decryptSync;
      exports.decrypt = decrypt;
      exports.encrypt = encrypt;
      const aes_js_1 = __importDefault(__webpack_require__(3836));
      const scrypt_js_1 = __importDefault(__webpack_require__(9983));
      const address_1 = __webpack_require__(171);
      const bytes_1 = __webpack_require__(8380);
      const keccak256_1 = __webpack_require__(1136);
      const strings_1 = __webpack_require__(2509);
      const pbkdf2_1 = __webpack_require__(1504);
      const random_1 = __webpack_require__(590);
      const properties_1 = __webpack_require__(1476);
      const transactions_1 = __webpack_require__(3776);
      const signing_key_1 = __webpack_require__(2494);
      const utils_1 = __webpack_require__(1577);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1613);
      const logger = new logger_1.Logger(_version_1.version);
      class KeystoreAccount extends properties_1.Description {
        isKeystoreAccount(value) {
          return !!(value && value._isKeystoreAccount);
        }
      }
      exports.KeystoreAccount = KeystoreAccount;
      function hasMnemonic(value) {
        const mnemonic = value.mnemonic;
        return mnemonic;
      }
      function _decrypt(data, key, ciphertext) {
        const cipher = (0, utils_1.searchPath)(data, "crypto/cipher");
        if (cipher === "aes-128-ctr") {
          const iv = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "crypto/cipherparams/iv"));
          const counter = new aes_js_1.default.Counter(iv);
          const aesCtr = new aes_js_1.default.ModeOfOperation.ctr(key, counter);
          return (0, bytes_1.arrayify)(aesCtr.decrypt(ciphertext));
        }
        return null;
      }
      function _getAccount(data, key) {
        const ciphertext = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "crypto/ciphertext"));
        const computedMAC = (0, bytes_1.hexlify)((0, keccak256_1.keccak256)((0, bytes_1.concat)([ key.slice(16, 32), ciphertext ]))).substring(2);
        if (computedMAC !== (0, utils_1.searchPath)(data, "crypto/mac").toLowerCase()) {
          throw new Error("invalid password");
        }
        const keysArray = _decrypt(data, key.slice(0, 16), ciphertext);
        if (!keysArray) {
          logger.throwError("unsupported cipher", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "decrypt"
          });
        }
        const privateKey = (0, bytes_1.hexlify)(keysArray.slice(0, 2800));
        const publickey = (0, bytes_1.hexlify)(keysArray.slice(2800));
        const mnemonicKey = key.slice(32, 64);
        const address = (0, address_1.getAddress)((0, transactions_1.computeAddress)(publickey));
        const account = {
          _isKeystoreAccount: true,
          address,
          privateKey,
          publicKey: publickey
        };
        if ((0, utils_1.searchPath)(data, "x-qethers/version") === "0.1") {
          const mnemonicCiphertext = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "x-qethers/mnemonicCiphertext"));
          const mnemonicIv = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "x-qethers/mnemonicCounter"));
          const mnemonicCounter = new aes_js_1.default.Counter(mnemonicIv);
          const mnemonicAesCtr = new aes_js_1.default.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);
          const mnemonic = (0, strings_1.toUtf8String)(mnemonicAesCtr.decrypt(mnemonicCiphertext));
          account.mnemonic = mnemonic;
        }
        return new KeystoreAccount(account);
      }
      function pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc) {
        return (0, bytes_1.arrayify)((0, pbkdf2_1.pbkdf2)(passwordBytes, salt, count, dkLen, prfFunc));
      }
      function pbkdf2(passwordBytes, salt, count, dkLen, prfFunc) {
        return Promise.resolve(pbkdf2Sync(passwordBytes, salt, count, dkLen, prfFunc));
      }
      function _computeKdfKey(data, password, pbkdf2Func, scryptFunc, progressCallback) {
        const passwordBytes = (0, utils_1.getPassword)(password);
        const kdf = (0, utils_1.searchPath)(data, "crypto/kdf");
        if (kdf && typeof kdf === "string") {
          const throwError = function(name, value) {
            return logger.throwArgumentError("invalid key-derivation function parameters", name, value);
          };
          if (kdf.toLowerCase() === "scrypt") {
            const salt = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "crypto/kdfparams/salt"));
            const N = parseInt((0, utils_1.searchPath)(data, "crypto/kdfparams/n"));
            const r = parseInt((0, utils_1.searchPath)(data, "crypto/kdfparams/r"));
            const p = parseInt((0, utils_1.searchPath)(data, "crypto/kdfparams/p"));
            if (!N || !r || !p) {
              throwError("kdf", kdf);
            }
            if ((N & N - 1) !== 0) {
              throwError("N", N);
            }
            const dkLen = parseInt((0, utils_1.searchPath)(data, "crypto/kdfparams/dklen"));
            if (dkLen !== 32) {
              throwError("dklen", dkLen);
            }
            return scryptFunc(passwordBytes, salt, N, r, p, 64, progressCallback);
          } else if (kdf.toLowerCase() === "pbkdf2") {
            const salt = (0, utils_1.looseArrayify)((0, utils_1.searchPath)(data, "crypto/kdfparams/salt"));
            let prfFunc = null;
            const prf = (0, utils_1.searchPath)(data, "crypto/kdfparams/prf");
            if (prf === "hmac-sha256") {
              prfFunc = "sha256";
            } else if (prf === "hmac-sha512") {
              prfFunc = "sha512";
            } else {
              throwError("prf", prf);
            }
            const count = parseInt((0, utils_1.searchPath)(data, "crypto/kdfparams/c"));
            const dkLen = parseInt((0, utils_1.searchPath)(data, "crypto/kdfparams/dklen"));
            if (dkLen !== 32) {
              throwError("dklen", dkLen);
            }
            return pbkdf2Func(passwordBytes, salt, count, dkLen, prfFunc);
          }
        }
        return logger.throwArgumentError("unsupported key-derivation function", "kdf", kdf);
      }
      function decryptSync(json, password) {
        const data = JSON.parse(json);
        const key = _computeKdfKey(data, password, pbkdf2Sync, scrypt_js_1.default.syncScrypt);
        return _getAccount(data, key);
      }
      async function decrypt(json, password, progressCallback) {
        const data = JSON.parse(json);
        const key = await _computeKdfKey(data, password, pbkdf2, scrypt_js_1.default.scrypt, progressCallback);
        return _getAccount(data, key);
      }
      async function encrypt(account, password, options, progressCallback) {
        try {
          if (account.address !== (0, address_1.getAddress)((0, transactions_1.computeAddress)(account.publicKey))) {
            throw new Error("address/publicKey mismatch");
          }
          if (hasMnemonic(account)) {
            const key = await signing_key_1.SigningKey.generateFromMnemonics(account.mnemonic);
            if (account.privateKey !== key.privateKey) {
              throw new Error("mnemonic/privateKey mismatch");
            }
            if (account.publicKey !== key.publicKey) {
              throw new Error("mnemonic/publicKey mismatch");
            }
          }
        } catch (e) {
          return Promise.reject(e);
        }
        if (typeof options === "function" && !progressCallback) {
          options = {};
        }
        if (!options) {
          options = {};
        }
        const privateKey = (0, bytes_1.arrayify)(account.privateKey);
        const publicKey = (0, bytes_1.arrayify)(account.publicKey);
        const keysArray = new Uint8Array(privateKey.length + publicKey.length);
        keysArray.set(privateKey, 0);
        keysArray.set(publicKey, privateKey.length);
        const passwordBytes = (0, utils_1.getPassword)(password);
        let client = options.client;
        if (!client) {
          client = "qethers.js";
        }
        let salt = null;
        if (options.salt) {
          salt = (0, bytes_1.arrayify)(options.salt);
        } else {
          salt = (0, random_1.randomBytes)(32);
        }
        let iv = null;
        if (options.iv) {
          iv = (0, bytes_1.arrayify)(options.iv);
          if (iv.length !== 16) {
            throw new Error("invalid iv");
          }
        } else {
          iv = (0, random_1.randomBytes)(16);
        }
        let uuidRandom = null;
        if (options.uuid) {
          uuidRandom = (0, bytes_1.arrayify)(options.uuid);
          if (uuidRandom.length !== 16) {
            throw new Error("invalid uuid");
          }
        } else {
          uuidRandom = (0, random_1.randomBytes)(16);
        }
        let N = 1 << 17, r = 8, p = 1;
        if (options.scrypt) {
          if (options.scrypt.N) {
            N = options.scrypt.N;
          }
          if (options.scrypt.r) {
            r = options.scrypt.r;
          }
          if (options.scrypt.p) {
            p = options.scrypt.p;
          }
        }
        return scrypt_js_1.default.scrypt(passwordBytes, salt, N, r, p, 64, progressCallback).then((key => {
          key = (0, bytes_1.arrayify)(key);
          const derivedKey = key.slice(0, 16);
          const macPrefix = key.slice(16, 32);
          const mnemonicKey = key.slice(32, 64);
          const counter = new aes_js_1.default.Counter(iv);
          const aesCtr = new aes_js_1.default.ModeOfOperation.ctr(derivedKey, counter);
          const ciphertext = (0, bytes_1.arrayify)(aesCtr.encrypt(keysArray));
          const mac = (0, keccak256_1.keccak256)((0, bytes_1.concat)([ macPrefix, ciphertext ]));
          const data = {
            id: (0, utils_1.uuidV4)(uuidRandom),
            version: 3,
            crypto: {
              cipher: "aes-128-ctr",
              cipherparams: {
                iv: (0, bytes_1.hexlify)(iv).substring(2)
              },
              ciphertext: (0, bytes_1.hexlify)(ciphertext).substring(2),
              kdf: "scrypt",
              kdfparams: {
                salt: (0, bytes_1.hexlify)(salt).substring(2),
                n: N,
                dklen: 32,
                p,
                r
              },
              mac: mac.substring(2)
            }
          };
          if (hasMnemonic(account)) {
            const mnemonicIv = (0, random_1.randomBytes)(16);
            const mnemonicCounter = new aes_js_1.default.Counter(mnemonicIv);
            const mnemonicAesCtr = new aes_js_1.default.ModeOfOperation.ctr(mnemonicKey, mnemonicCounter);
            const mnemonicCiphertext = (0, bytes_1.arrayify)(mnemonicAesCtr.encrypt((0, strings_1.toUtf8Bytes)(account.mnemonic)));
            const now = new Date;
            const timestamp = now.getUTCFullYear() + "-" + (0, utils_1.zpad)(now.getUTCMonth() + 1, 2) + "-" + (0, 
            utils_1.zpad)(now.getUTCDate(), 2) + "T" + (0, utils_1.zpad)(now.getUTCHours(), 2) + "-" + (0, 
            utils_1.zpad)(now.getUTCMinutes(), 2) + "-" + (0, utils_1.zpad)(now.getUTCSeconds(), 2) + ".0Z";
            data["x-qethers"] = {
              client,
              gethFilename: "UTC--" + timestamp + "--" + data.address,
              mnemonicCounter: (0, bytes_1.hexlify)(mnemonicIv).substring(2),
              mnemonicCiphertext: (0, bytes_1.hexlify)(mnemonicCiphertext).substring(2),
              version: "0.1"
            };
          }
          return JSON.stringify(data);
        }));
      }
    },
    1577(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.looseArrayify = looseArrayify;
      exports.zpad = zpad;
      exports.getPassword = getPassword;
      exports.searchPath = searchPath;
      exports.uuidV4 = uuidV4;
      const bytes_1 = __webpack_require__(8380);
      const strings_1 = __webpack_require__(2509);
      function looseArrayify(hexString) {
        if (typeof hexString === "string" && hexString.substring(0, 2) !== "0x") {
          hexString = "0x" + hexString;
        }
        return (0, bytes_1.arrayify)(hexString);
      }
      function zpad(value, length) {
        value = String(value);
        while (value.length < length) {
          value = "0" + value;
        }
        return value;
      }
      function getPassword(password) {
        if (typeof password === "string") {
          return (0, strings_1.toUtf8Bytes)(password, strings_1.UnicodeNormalizationForm.NFKC);
        }
        return (0, bytes_1.arrayify)(password);
      }
      function searchPath(object, path) {
        let currentChild = object;
        const comps = path.toLowerCase().split("/");
        for (let i = 0; i < comps.length; i++) {
          let matchingChild = null;
          for (const key in currentChild) {
            if (key.toLowerCase() === comps[i]) {
              matchingChild = currentChild[key];
              break;
            }
          }
          if (matchingChild === null) {
            return null;
          }
          currentChild = matchingChild;
        }
        return currentChild;
      }
      function uuidV4(randomBytes) {
        const bytes = (0, bytes_1.arrayify)(randomBytes);
        bytes[6] = bytes[6] & 15 | 64;
        bytes[8] = bytes[8] & 63 | 128;
        const value = (0, bytes_1.hexlify)(bytes);
        return [ value.substring(2, 10), value.substring(10, 14), value.substring(14, 18), value.substring(18, 22), value.substring(22, 34) ].join("-");
      }
    },
    1136(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __importDefault = this && this.__importDefault || function(mod) {
        return mod && mod.__esModule ? mod : {
          default: mod
        };
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.keccak256 = keccak256;
      const js_sha3_1 = __importDefault(__webpack_require__(1176));
      const bytes_1 = __webpack_require__(8380);
      function keccak256(data) {
        return "0x" + js_sha3_1.default.keccak_256((0, bytes_1.arrayify)(data));
      }
    },
    4146(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "logger/5.7.1";
    },
    5289(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Logger = exports.ErrorCode = exports.LogLevel = void 0;
      let _permanentCensorErrors = false;
      let _censorErrors = false;
      const LogLevels = {
        debug: 1,
        default: 2,
        info: 2,
        warning: 3,
        error: 4,
        off: 5
      };
      let _logLevel = LogLevels["default"];
      const _version_1 = __webpack_require__(4146);
      let _globalLogger = null;
      function _checkNormalize() {
        try {
          const missing = [];
          [ "NFD", "NFC", "NFKD", "NFKC" ].forEach((form => {
            try {
              if ("test".normalize(form) !== "test") {
                throw new Error("bad normalize");
              }
            } catch (error) {
              missing.push(form);
            }
          }));
          if (missing.length) {
            throw new Error("missing " + missing.join(", "));
          }
          if (String.fromCharCode(233).normalize("NFD") !== String.fromCharCode(101, 769)) {
            throw new Error("broken implementation");
          }
        } catch (error) {
          return error.message;
        }
        return null;
      }
      const _normalizeError = _checkNormalize();
      var LogLevel;
      (function(LogLevel) {
        LogLevel["DEBUG"] = "DEBUG";
        LogLevel["INFO"] = "INFO";
        LogLevel["WARNING"] = "WARNING";
        LogLevel["ERROR"] = "ERROR";
        LogLevel["OFF"] = "OFF";
      })(LogLevel || (exports.LogLevel = LogLevel = {}));
      var ErrorCode;
      (function(ErrorCode) {
        ErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
        ErrorCode["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
        ErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION";
        ErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
        ErrorCode["SERVER_ERROR"] = "SERVER_ERROR";
        ErrorCode["TIMEOUT"] = "TIMEOUT";
        ErrorCode["BUFFER_OVERRUN"] = "BUFFER_OVERRUN";
        ErrorCode["NUMERIC_FAULT"] = "NUMERIC_FAULT";
        ErrorCode["MISSING_NEW"] = "MISSING_NEW";
        ErrorCode["INVALID_ARGUMENT"] = "INVALID_ARGUMENT";
        ErrorCode["MISSING_ARGUMENT"] = "MISSING_ARGUMENT";
        ErrorCode["UNEXPECTED_ARGUMENT"] = "UNEXPECTED_ARGUMENT";
        ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION";
        ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
        ErrorCode["NONCE_EXPIRED"] = "NONCE_EXPIRED";
        ErrorCode["REPLACEMENT_UNDERPRICED"] = "REPLACEMENT_UNDERPRICED";
        ErrorCode["UNPREDICTABLE_GAS_LIMIT"] = "UNPREDICTABLE_GAS_LIMIT";
        ErrorCode["TRANSACTION_REPLACED"] = "TRANSACTION_REPLACED";
        ErrorCode["ACTION_REJECTED"] = "ACTION_REJECTED";
      })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
      const HEX = "0123456789abcdef";
      class Logger {
        constructor(version) {
          Object.defineProperty(this, "version", {
            enumerable: true,
            value: version,
            writable: false
          });
        }
        _log(logLevel, args) {
          const level = logLevel.toLowerCase();
          if (LogLevels[level] == null) {
            this.throwArgumentError("invalid log level name", "logLevel", logLevel);
          }
          if (_logLevel > LogLevels[level]) {
            return;
          }
          console.log.apply(console, args);
        }
        debug(...args) {
          this._log(Logger.levels.DEBUG, args);
        }
        info(...args) {
          this._log(Logger.levels.INFO, args);
        }
        warn(...args) {
          this._log(Logger.levels.WARNING, args);
        }
        makeError(message, code, params) {
          if (_censorErrors) {
            return this.makeError("censored error", code, {});
          }
          if (!code) {
            code = Logger.errors.UNKNOWN_ERROR;
          }
          if (!params) {
            params = {};
          }
          const messageDetails = [];
          Object.keys(params).forEach((key => {
            const value = params[key];
            try {
              if (value instanceof Uint8Array) {
                let hex = "";
                for (let i = 0; i < value.length; i++) {
                  hex += HEX[value[i] >> 4];
                  hex += HEX[value[i] & 15];
                }
                messageDetails.push(key + "=Uint8Array(0x" + hex + ")");
              } else {
                messageDetails.push(key + "=" + JSON.stringify(value));
              }
            } catch (error) {
              messageDetails.push(key + "=" + JSON.stringify(params[key].toString()));
            }
          }));
          messageDetails.push(`code=${code}`);
          messageDetails.push(`version=${this.version}`);
          const reason = message;
          let url = "";
          switch (code) {
           case ErrorCode.NUMERIC_FAULT:
            {
              url = "NUMERIC_FAULT";
              const fault = message;
              switch (fault) {
               case "overflow":
               case "underflow":
               case "division-by-zero":
                url += "-" + fault;
                break;

               case "negative-power":
               case "negative-width":
                url += "-unsupported";
                break;

               case "unbound-bitwise-result":
                url += "-unbound-result";
                break;
              }
              break;
            }

           case ErrorCode.CALL_EXCEPTION:
           case ErrorCode.INSUFFICIENT_FUNDS:
           case ErrorCode.MISSING_NEW:
           case ErrorCode.NONCE_EXPIRED:
           case ErrorCode.REPLACEMENT_UNDERPRICED:
           case ErrorCode.TRANSACTION_REPLACED:
           case ErrorCode.UNPREDICTABLE_GAS_LIMIT:
            url = code;
            break;
          }
          if (url) {
            message += " [ See: https://links.ethers.org/v5-errors-" + url + " ]";
          }
          if (messageDetails.length) {
            message += " (" + messageDetails.join(", ") + ")";
          }
          const error = new Error(message);
          error.reason = reason;
          error.code = code;
          Object.keys(params).forEach((function(key) {
            error[key] = params[key];
          }));
          return error;
        }
        throwError(message, code, params) {
          throw this.makeError(message, code, params);
        }
        throwArgumentError(message, name, value) {
          return this.throwError(message, Logger.errors.INVALID_ARGUMENT, {
            argument: name,
            value
          });
        }
        assert(condition, message, code, params) {
          if (!!condition) {
            return;
          }
          this.throwError(message, code, params);
        }
        assertArgument(condition, message, name, value) {
          if (!!condition) {
            return;
          }
          this.throwArgumentError(message, name, value);
        }
        checkNormalize(message) {
          if (message == null) {
            message = "platform missing String.prototype.normalize";
          }
          if (_normalizeError) {
            this.throwError("platform missing String.prototype.normalize", Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "String.prototype.normalize",
              form: _normalizeError
            });
          }
        }
        checkSafeUint53(value, message) {
          if (typeof value !== "number") {
            return;
          }
          if (message == null) {
            message = "value not safe";
          }
          if (value < 0 || value >= 9007199254740991) {
            this.throwError(message, Logger.errors.NUMERIC_FAULT, {
              operation: "checkSafeInteger",
              fault: "out-of-safe-range",
              value
            });
          }
          if (value % 1) {
            this.throwError(message, Logger.errors.NUMERIC_FAULT, {
              operation: "checkSafeInteger",
              fault: "non-integer",
              value
            });
          }
        }
        checkArgumentCount(count, expectedCount, message) {
          if (message) {
            message = ": " + message;
          } else {
            message = "";
          }
          if (count < expectedCount) {
            this.throwError("missing argument" + message, Logger.errors.MISSING_ARGUMENT, {
              count,
              expectedCount
            });
          }
          if (count > expectedCount) {
            this.throwError("too many arguments" + message, Logger.errors.UNEXPECTED_ARGUMENT, {
              count,
              expectedCount
            });
          }
        }
        checkNew(target, kind) {
          if (target === Object || target == null) {
            this.throwError("missing new", Logger.errors.MISSING_NEW, {
              name: kind.name
            });
          }
        }
        checkAbstract(target, kind) {
          if (target === kind) {
            this.throwError("cannot instantiate abstract class " + JSON.stringify(kind.name) + " directly; use a sub-class", Logger.errors.UNSUPPORTED_OPERATION, {
              name: target.name,
              operation: "new"
            });
          } else if (target === Object || target == null) {
            this.throwError("missing new", Logger.errors.MISSING_NEW, {
              name: kind.name
            });
          }
        }
        static globalLogger() {
          if (!_globalLogger) {
            _globalLogger = new Logger(_version_1.version);
          }
          return _globalLogger;
        }
        static setCensorship(censorship, permanent) {
          if (!censorship && permanent) {
            this.globalLogger().throwError("cannot permanently disable censorship", Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "setCensorship"
            });
          }
          if (_permanentCensorErrors) {
            if (!censorship) {
              return;
            }
            this.globalLogger().throwError("error censorship permanent", Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "setCensorship"
            });
          }
          _censorErrors = !!censorship;
          _permanentCensorErrors = !!permanent;
        }
        static setLogLevel(logLevel) {
          const level = LogLevels[logLevel.toLowerCase()];
          if (level == null) {
            Logger.globalLogger().warn("invalid log level - " + logLevel);
            return;
          }
          _logLevel = level;
        }
        static from(version) {
          return new Logger(version);
        }
      }
      exports.Logger = Logger;
      Logger.errors = ErrorCode;
      Logger.levels = LogLevel;
    },
    3763(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "networks/5.8.0";
    },
    2510(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.getNetwork = void 0;
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(3763);
      const logger = new logger_1.Logger(_version_1.version);
      function isRenetworkable(value) {
        return value && typeof value.renetwork === "function";
      }
      const defaultRpcUrls = {
        zeus: "https://zeus.rpc.quantumevm.com/",
        poseidon: "https://poseidon.rpc.quantumevm.com/"
      };
      function qevmDefaultProvider(network) {
        const func = function(providers, options) {
          if (options == null) {
            options = {};
          }
          const providerList = [];
          if (providers.BlockscoutProvider && options.blockscout !== "-") {
            try {
              providerList.push(new providers.BlockscoutProvider(network, options.blockscout));
            } catch (error) {}
          }
          if (providerList.length === 0 && providers.JsonRpcProvider) {
            const networkName = typeof network === "string" ? network : network.name;
            const rpcUrl = options && options.rpc || defaultRpcUrls[networkName] || "http://localhost:8545";
            try {
              providerList.push(new providers.JsonRpcProvider(rpcUrl));
            } catch (error) {}
          }
          if (providerList.length === 0) {
            return null;
          }
          if (providers.FallbackProvider) {
            let quorum = 1;
            if (options.quorum != null) {
              quorum = options.quorum;
            } else if (network === "mainnet") {
              quorum = 1;
            }
            return new providers.FallbackProvider(providerList, quorum);
          }
          return providerList[0];
        };
        func.renetwork = function(network) {
          return qevmDefaultProvider(network);
        };
        return func;
      }
      const zeus = {
        chainId: 256,
        ensAddress: "0x0000000000000000000000000000000000000000000000000000000000000000",
        name: "zeus",
        _defaultProvider: qevmDefaultProvider("zeus")
      };
      const poseidon = {
        chainId: 257,
        ensAddress: "0x0000000000000000000000000000000000000000000000000000000000000000",
        name: "poseidon",
        _defaultProvider: qevmDefaultProvider("poseidon")
      };
      const networks = {
        unspecified: {
          chainId: 0,
          name: "unspecified"
        },
        zeus,
        mainnet: zeus,
        poseidon,
        testnet: poseidon
      };
      function getNetwork(network) {
        if (network == null) {
          return null;
        }
        if (typeof network === "number") {
          for (const name in networks) {
            const standard = networks[name];
            if (standard.chainId === network) {
              return {
                name: standard.name,
                chainId: standard.chainId,
                ensAddress: standard.ensAddress || null,
                _defaultProvider: standard._defaultProvider || null
              };
            }
          }
          return {
            chainId: network,
            name: "unknown"
          };
        }
        if (typeof network === "string") {
          const standard = networks[network];
          if (standard == null) {
            return null;
          }
          return {
            name: standard.name,
            chainId: standard.chainId,
            ensAddress: standard.ensAddress,
            _defaultProvider: standard._defaultProvider || null
          };
        }
        const standard = networks[network.name];
        if (!standard) {
          if (typeof network.chainId !== "number") {
            logger.throwArgumentError("invalid network chainId", "network", network);
          }
          return network;
        }
        if (network.chainId !== 0 && network.chainId !== standard.chainId) {
          logger.throwArgumentError("network chainId mismatch", "network", network);
        }
        let defaultProvider = network._defaultProvider || null;
        if (defaultProvider == null && standard._defaultProvider) {
          if (isRenetworkable(standard._defaultProvider)) {
            defaultProvider = standard._defaultProvider.renetwork(network);
          } else {
            defaultProvider = standard._defaultProvider;
          }
        }
        return {
          name: network.name,
          chainId: standard.chainId,
          ensAddress: network.ensAddress || standard.ensAddress || null,
          _defaultProvider: defaultProvider
        };
      }
      exports.getNetwork = getNetwork;
    },
    7232(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.pbkdf2 = void 0;
      const bytes_1 = __webpack_require__(8380);
      const sha2_1 = __webpack_require__(8417);
      function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) {
        password = (0, bytes_1.arrayify)(password);
        salt = (0, bytes_1.arrayify)(salt);
        let hLen;
        let l = 1;
        const DK = new Uint8Array(keylen);
        const block1 = new Uint8Array(salt.length + 4);
        block1.set(salt);
        let r;
        let T;
        for (let i = 1; i <= l; i++) {
          block1[salt.length] = i >> 24 & 255;
          block1[salt.length + 1] = i >> 16 & 255;
          block1[salt.length + 2] = i >> 8 & 255;
          block1[salt.length + 3] = i & 255;
          let U = (0, bytes_1.arrayify)((0, sha2_1.computeHmac)(hashAlgorithm, password, block1));
          if (!hLen) {
            hLen = U.length;
            T = new Uint8Array(hLen);
            l = Math.ceil(keylen / hLen);
            r = keylen - (l - 1) * hLen;
          }
          T.set(U);
          for (let j = 1; j < iterations; j++) {
            U = (0, bytes_1.arrayify)((0, sha2_1.computeHmac)(hashAlgorithm, password, U));
            for (let k = 0; k < hLen; k++) T[k] ^= U[k];
          }
          const destPos = (i - 1) * hLen;
          const len = i === l ? r : hLen;
          DK.set((0, bytes_1.arrayify)(T).slice(0, len), destPos);
        }
        return (0, bytes_1.hexlify)(DK);
      }
      exports.pbkdf2 = pbkdf2;
    },
    1504(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.pbkdf2 = void 0;
      var pbkdf2_1 = __webpack_require__(7232);
      Object.defineProperty(exports, "pbkdf2", {
        enumerable: true,
        get: function() {
          return pbkdf2_1.pbkdf2;
        }
      });
    },
    6121(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "properties/5.7.1";
    },
    1476(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Description = void 0;
      exports.defineReadOnly = defineReadOnly;
      exports.getStatic = getStatic;
      exports.resolveProperties = resolveProperties;
      exports.checkProperties = checkProperties;
      exports.shallowCopy = shallowCopy;
      exports.deepCopy = deepCopy;
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(6121);
      const logger = new logger_1.Logger(_version_1.version);
      function defineReadOnly(object, name, value) {
        Object.defineProperty(object, name, {
          enumerable: true,
          value,
          writable: false
        });
      }
      function getStatic(ctor, key) {
        for (let i = 0; i < 32; i++) {
          if (ctor[key]) {
            return ctor[key];
          }
          if (!ctor.prototype || typeof ctor.prototype !== "object") {
            break;
          }
          ctor = Object.getPrototypeOf(ctor.prototype).constructor;
        }
        return null;
      }
      async function resolveProperties(object) {
        const promises = Object.keys(object).map((key => {
          const value = object[key];
          return Promise.resolve(value).then((v => ({
            key,
            value: v
          })));
        }));
        const results = await Promise.all(promises);
        return results.reduce(((accum, result) => {
          accum[result.key] = result.value;
          return accum;
        }), {});
      }
      function checkProperties(object, properties) {
        if (!object || typeof object !== "object") {
          logger.throwArgumentError("invalid object", "object", object);
        }
        Object.keys(object).forEach((key => {
          if (!properties[key]) {
            logger.throwArgumentError("invalid object key - " + key, "transaction:" + key, object);
          }
        }));
      }
      function shallowCopy(object) {
        const result = {};
        for (const key in object) {
          result[key] = object[key];
        }
        return result;
      }
      const opaque = {
        bigint: true,
        boolean: true,
        function: true,
        number: true,
        string: true
      };
      function _isFrozen(object) {
        if (object === undefined || object === null || opaque[typeof object]) {
          return true;
        }
        if (Array.isArray(object) || typeof object === "object") {
          if (!Object.isFrozen(object)) {
            return false;
          }
          const keys = Object.keys(object);
          for (let i = 0; i < keys.length; i++) {
            let value = null;
            try {
              value = object[keys[i]];
            } catch (error) {
              continue;
            }
            if (!_isFrozen(value)) {
              return false;
            }
          }
          return true;
        }
        return logger.throwArgumentError(`Cannot deepCopy ${typeof object}`, "object", object);
      }
      function _deepCopy(object) {
        if (_isFrozen(object)) {
          return object;
        }
        if (Array.isArray(object)) {
          return Object.freeze(object.map((item => deepCopy(item))));
        }
        if (typeof object === "object") {
          const result = {};
          for (const key in object) {
            const value = object[key];
            if (value === undefined) {
              continue;
            }
            defineReadOnly(result, key, deepCopy(value));
          }
          return result;
        }
        return logger.throwArgumentError(`Cannot deepCopy ${typeof object}`, "object", object);
      }
      function deepCopy(object) {
        return _deepCopy(object);
      }
      class Description {
        constructor(info) {
          for (const key in info) {
            this[key] = deepCopy(info[key]);
          }
        }
      }
      exports.Description = Description;
    },
    2394(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "providers/1.1.0";
    },
    7408(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __importDefault = this && this.__importDefault || function(mod) {
        return mod && mod.__esModule ? mod : {
          default: mod
        };
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.BaseProvider = exports.Resolver = exports.Event = void 0;
      const abstract_provider_1 = __webpack_require__(103);
      const base64_1 = __webpack_require__(8886);
      const basex_1 = __webpack_require__(4160);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const constants_1 = __webpack_require__(846);
      const hash_1 = __webpack_require__(413);
      const networks_1 = __webpack_require__(2510);
      const properties_1 = __webpack_require__(1476);
      const sha2_1 = __webpack_require__(8417);
      const strings_1 = __webpack_require__(2509);
      const web_1 = __webpack_require__(6637);
      const bech32_1 = __importDefault(__webpack_require__(9674));
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      const formatter_1 = __webpack_require__(4915);
      const MAX_CCIP_REDIRECTS = 10;
      function checkTopic(topic) {
        if (topic == null) {
          return "null";
        }
        if ((0, bytes_1.hexDataLength)(topic) !== 32) {
          logger.throwArgumentError("invalid topic", "topic", topic);
        }
        return topic.toLowerCase();
      }
      function serializeTopics(topics) {
        topics = topics.slice();
        while (topics.length > 0 && topics[topics.length - 1] == null) {
          topics.pop();
        }
        return topics.map((topic => {
          if (Array.isArray(topic)) {
            const unique = {};
            topic.forEach((topic => {
              unique[checkTopic(topic)] = true;
            }));
            const sorted = Object.keys(unique);
            sorted.sort();
            return sorted.join("|");
          } else {
            return checkTopic(topic);
          }
        })).join("&");
      }
      function deserializeTopics(data) {
        if (data === "") {
          return [];
        }
        return data.split(/&/g).map((topic => {
          if (topic === "") {
            return [];
          }
          const comps = topic.split("|").map((topic => topic === "null" ? null : topic));
          return comps.length === 1 ? comps[0] : comps;
        }));
      }
      function getEventTag(eventName) {
        if (typeof eventName === "string") {
          eventName = eventName.toLowerCase();
          if ((0, bytes_1.hexDataLength)(eventName) === 32) {
            return "tx:" + eventName;
          }
          if (eventName.indexOf(":") === -1) {
            return eventName;
          }
        } else if (Array.isArray(eventName)) {
          return "filter:*:" + serializeTopics(eventName);
        } else if (abstract_provider_1.ForkEvent.isForkEvent(eventName)) {
          logger.warn("not implemented");
          throw new Error("not implemented");
        } else if (eventName && typeof eventName === "object") {
          return "filter:" + (eventName.address || "*") + ":" + serializeTopics(eventName.topics || []);
        }
        throw new Error("invalid event - " + eventName);
      }
      function getTime() {
        return (new Date).getTime();
      }
      function stall(duration) {
        return new Promise((resolve => {
          setTimeout(resolve, duration);
        }));
      }
      const PollableEvents = [ "block", "network", "pending", "poll" ];
      class Event {
        constructor(tag, listener, once) {
          (0, properties_1.defineReadOnly)(this, "tag", tag);
          (0, properties_1.defineReadOnly)(this, "listener", listener);
          (0, properties_1.defineReadOnly)(this, "once", once);
          this._lastBlockNumber = -2;
          this._inflight = false;
        }
        get event() {
          switch (this.type) {
           case "tx":
            return this.hash;

           case "filter":
            return this.filter;
          }
          return this.tag;
        }
        get type() {
          return this.tag.split(":")[0];
        }
        get hash() {
          const comps = this.tag.split(":");
          if (comps[0] !== "tx") {
            return null;
          }
          return comps[1];
        }
        get filter() {
          const comps = this.tag.split(":");
          if (comps[0] !== "filter") {
            return null;
          }
          const address = comps[1];
          const topics = deserializeTopics(comps[2]);
          const filter = {};
          if (topics.length > 0) {
            filter.topics = topics;
          }
          if (address && address !== "*") {
            filter.address = address;
          }
          return filter;
        }
        pollable() {
          return this.tag.indexOf(":") >= 0 || PollableEvents.indexOf(this.tag) >= 0;
        }
      }
      exports.Event = Event;
      const coinInfos = {
        0: {
          symbol: "btc",
          p2pkh: 0,
          p2sh: 5,
          prefix: "bc"
        },
        2: {
          symbol: "ltc",
          p2pkh: 48,
          p2sh: 50,
          prefix: "ltc"
        },
        3: {
          symbol: "doge",
          p2pkh: 30,
          p2sh: 22
        },
        60: {
          symbol: "eth",
          ilk: "eth"
        },
        61: {
          symbol: "etc",
          ilk: "eth"
        },
        700: {
          symbol: "xdai",
          ilk: "eth"
        }
      };
      function bytes32ify(value) {
        return (0, bytes_1.hexZeroPad)(bignumber_1.BigNumber.from(value).toHexString(), 32);
      }
      function base58Encode(data) {
        return basex_1.Base58.encode((0, bytes_1.concat)([ data, (0, bytes_1.hexDataSlice)((0, 
        sha2_1.sha256)((0, sha2_1.sha256)(data)), 0, 4) ]));
      }
      const matcherIpfs = new RegExp("^(ipfs)://(.*)$", "i");
      const matchers = [ new RegExp("^(https)://(.*)$", "i"), new RegExp("^(data):(.*)$", "i"), matcherIpfs, new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$", "i") ];
      function _parseString(result, start) {
        try {
          return (0, strings_1.toUtf8String)(_parseBytes(result, start));
        } catch (error) {}
        return null;
      }
      function _parseBytes(result, start) {
        if (result === "0x") {
          return null;
        }
        const offset = bignumber_1.BigNumber.from((0, bytes_1.hexDataSlice)(result, start, start + 32)).toNumber();
        const length = bignumber_1.BigNumber.from((0, bytes_1.hexDataSlice)(result, offset, offset + 32)).toNumber();
        return (0, bytes_1.hexDataSlice)(result, offset + 32, offset + 32 + length);
      }
      function getIpfsLink(link) {
        if (link.match(/^ipfs:\/\/ipfs\//i)) {
          link = link.substring(12);
        } else if (link.match(/^ipfs:\/\//i)) {
          link = link.substring(7);
        } else {
          logger.throwArgumentError("unsupported IPFS format", "link", link);
        }
        return `https://gateway.ipfs.io/ipfs/${link}`;
      }
      function numPad(value) {
        const result = (0, bytes_1.arrayify)(value);
        if (result.length > 32) {
          throw new Error("internal; should not happen");
        }
        const padded = new Uint8Array(32);
        padded.set(result, 32 - result.length);
        return padded;
      }
      function bytesPad(value) {
        if (value.length % 32 === 0) {
          return value;
        }
        const result = new Uint8Array(Math.ceil(value.length / 32) * 32);
        result.set(value);
        return result;
      }
      function encodeBytes(datas) {
        const result = [];
        let byteCount = 0;
        for (let i = 0; i < datas.length; i++) {
          result.push(null);
          byteCount += 32;
        }
        for (let i = 0; i < datas.length; i++) {
          const data = (0, bytes_1.arrayify)(datas[i]);
          result[i] = numPad(byteCount);
          result.push(numPad(data.length));
          result.push(bytesPad(data));
          byteCount += 32 + Math.ceil(data.length / 32) * 32;
        }
        return (0, bytes_1.hexConcat)(result);
      }
      class Resolver {
        constructor(provider, address, name, resolvedAddress) {
          (0, properties_1.defineReadOnly)(this, "provider", provider);
          (0, properties_1.defineReadOnly)(this, "name", name);
          (0, properties_1.defineReadOnly)(this, "address", provider.formatter.address(address));
          (0, properties_1.defineReadOnly)(this, "_resolvedAddress", resolvedAddress);
        }
        supportsWildcard() {
          if (!this._supportsEip2544) {
            this._supportsEip2544 = this.provider.call({
              to: this.address,
              data: "0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"
            }).then((result => bignumber_1.BigNumber.from(result).eq(1))).catch((error => {
              if (error.code === logger_1.Logger.errors.CALL_EXCEPTION) {
                return false;
              }
              this._supportsEip2544 = null;
              throw error;
            }));
          }
          return this._supportsEip2544;
        }
        async _fetch(selector, parameters) {
          const tx = {
            to: this.address,
            ccipReadEnabled: true,
            data: (0, bytes_1.hexConcat)([ selector, (0, hash_1.namehash)(this.name), parameters || "0x" ])
          };
          let parseBytes = false;
          if (await this.supportsWildcard()) {
            parseBytes = true;
            tx.data = (0, bytes_1.hexConcat)([ "0x9061b923", encodeBytes([ (0, hash_1.dnsEncode)(this.name), tx.data ]) ]);
          }
          try {
            let result = await this.provider.call(tx);
            if ((0, bytes_1.arrayify)(result).length % 32 === 4) {
              logger.throwError("resolver threw error", logger_1.Logger.errors.CALL_EXCEPTION, {
                transaction: tx,
                data: result
              });
            }
            if (parseBytes) {
              result = _parseBytes(result, 0);
            }
            return result;
          } catch (error) {
            if (error.code === logger_1.Logger.errors.CALL_EXCEPTION) {
              return null;
            }
            throw error;
          }
        }
        async _fetchBytes(selector, parameters) {
          const result = await this._fetch(selector, parameters);
          if (result != null) {
            return _parseBytes(result, 0);
          }
          return null;
        }
        _getAddress(coinType, hexBytes) {
          const coinInfo = coinInfos[String(coinType)];
          if (coinInfo == null) {
            logger.throwError(`unsupported coin type: ${coinType}`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: `getAddress(${coinType})`
            });
          }
          if (coinInfo.ilk === "eth") {
            return this.provider.formatter.address(hexBytes);
          }
          const bytes = (0, bytes_1.arrayify)(hexBytes);
          if (coinInfo.p2pkh != null) {
            const p2pkh = hexBytes.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);
            if (p2pkh) {
              const length = parseInt(p2pkh[1], 16);
              if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {
                return base58Encode((0, bytes_1.concat)([ [ coinInfo.p2pkh ], "0x" + p2pkh[2] ]));
              }
            }
          }
          if (coinInfo.p2sh != null) {
            const p2sh = hexBytes.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);
            if (p2sh) {
              const length = parseInt(p2sh[1], 16);
              if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {
                return base58Encode((0, bytes_1.concat)([ [ coinInfo.p2sh ], "0x" + p2sh[2] ]));
              }
            }
          }
          if (coinInfo.prefix != null) {
            const length = bytes[1];
            let version = bytes[0];
            if (version === 0) {
              if (length !== 20 && length !== 32) {
                version = -1;
              }
            } else {
              version = -1;
            }
            if (version >= 0 && bytes.length === 2 + length && length >= 1 && length <= 75) {
              const words = bech32_1.default.toWords(bytes.slice(2));
              words.unshift(version);
              return bech32_1.default.encode(coinInfo.prefix, words);
            }
          }
          return null;
        }
        async getAddress(coinType) {
          if (coinType == null) {
            coinType = 60;
          }
          if (coinType === 60) {
            try {
              const result = await this._fetch("0x3b3b57de");
              if (result === "0x" || result === constants_1.HashZero) {
                return null;
              }
              return this.provider.formatter.callAddress(result);
            } catch (error) {
              if (error.code === logger_1.Logger.errors.CALL_EXCEPTION) {
                return null;
              }
              throw error;
            }
          }
          const hexBytes = await this._fetchBytes("0xf1cb7e06", bytes32ify(coinType));
          if (hexBytes == null || hexBytes === "0x") {
            return null;
          }
          const address = this._getAddress(coinType, hexBytes);
          if (address == null) {
            logger.throwError(`invalid or unsupported coin data`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: `getAddress(${coinType})`,
              coinType,
              data: hexBytes
            });
          }
          return address;
        }
        async getAvatar() {
          const linkage = [ {
            type: "name",
            content: this.name
          } ];
          try {
            const avatar = await this.getText("avatar");
            if (avatar == null) {
              return null;
            }
            for (let i = 0; i < matchers.length; i++) {
              const match = avatar.match(matchers[i]);
              if (match == null) {
                continue;
              }
              const scheme = match[1].toLowerCase();
              switch (scheme) {
               case "https":
                linkage.push({
                  type: "url",
                  content: avatar
                });
                return {
                  linkage,
                  url: avatar
                };

               case "data":
                linkage.push({
                  type: "data",
                  content: avatar
                });
                return {
                  linkage,
                  url: avatar
                };

               case "ipfs":
                linkage.push({
                  type: "ipfs",
                  content: avatar
                });
                return {
                  linkage,
                  url: getIpfsLink(avatar)
                };

               case "erc721":
               case "erc1155":
                {
                  const selector = scheme === "erc721" ? "0xc87b56dd" : "0x0e89341c";
                  linkage.push({
                    type: scheme,
                    content: avatar
                  });
                  const owner = this._resolvedAddress || await this.getAddress();
                  const comps = (match[2] || "").split("/");
                  if (comps.length !== 2) {
                    return null;
                  }
                  const addr = await this.provider.formatter.address(comps[0]);
                  const tokenId = (0, bytes_1.hexZeroPad)(bignumber_1.BigNumber.from(comps[1]).toHexString(), 32);
                  if (scheme === "erc721") {
                    const tokenOwner = this.provider.formatter.callAddress(await this.provider.call({
                      to: addr,
                      data: (0, bytes_1.hexConcat)([ "0x6352211e", tokenId ])
                    }));
                    if (owner !== tokenOwner) {
                      return null;
                    }
                    linkage.push({
                      type: "owner",
                      content: tokenOwner
                    });
                  } else if (scheme === "erc1155") {
                    const balance = bignumber_1.BigNumber.from(await this.provider.call({
                      to: addr,
                      data: (0, bytes_1.hexConcat)([ "0x00fdd58e", (0, bytes_1.hexZeroPad)(owner, 32), tokenId ])
                    }));
                    if (balance.isZero()) {
                      return null;
                    }
                    linkage.push({
                      type: "balance",
                      content: balance.toString()
                    });
                  }
                  const tx = {
                    to: this.provider.formatter.address(comps[0]),
                    data: (0, bytes_1.hexConcat)([ selector, tokenId ])
                  };
                  let metadataUrl = _parseString(await this.provider.call(tx), 0);
                  if (metadataUrl == null) {
                    return null;
                  }
                  linkage.push({
                    type: "metadata-url-base",
                    content: metadataUrl
                  });
                  if (scheme === "erc1155") {
                    metadataUrl = metadataUrl.replace("{id}", tokenId.substring(2));
                    linkage.push({
                      type: "metadata-url-expanded",
                      content: metadataUrl
                    });
                  }
                  if (metadataUrl.match(/^ipfs:/i)) {
                    metadataUrl = getIpfsLink(metadataUrl);
                  }
                  linkage.push({
                    type: "metadata-url",
                    content: metadataUrl
                  });
                  const metadata = await (0, web_1.fetchJson)(metadataUrl);
                  if (!metadata) {
                    return null;
                  }
                  linkage.push({
                    type: "metadata",
                    content: JSON.stringify(metadata)
                  });
                  let imageUrl = metadata.image;
                  if (typeof imageUrl !== "string") {
                    return null;
                  }
                  if (imageUrl.match(/^(https:\/\/|data:)/i)) {} else {
                    const ipfs = imageUrl.match(matcherIpfs);
                    if (ipfs == null) {
                      return null;
                    }
                    linkage.push({
                      type: "url-ipfs",
                      content: imageUrl
                    });
                    imageUrl = getIpfsLink(imageUrl);
                  }
                  linkage.push({
                    type: "url",
                    content: imageUrl
                  });
                  return {
                    linkage,
                    url: imageUrl
                  };
                }
              }
            }
          } catch (error) {}
          return null;
        }
        async getContentHash() {
          const hexBytes = await this._fetchBytes("0xbc1c58d1");
          if (hexBytes == null || hexBytes === "0x") {
            return null;
          }
          const ipfs = hexBytes.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);
          if (ipfs) {
            const length = parseInt(ipfs[3], 16);
            if (ipfs[4].length === length * 2) {
              return "ipfs://" + basex_1.Base58.encode("0x" + ipfs[1]);
            }
          }
          const ipns = hexBytes.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);
          if (ipns) {
            const length = parseInt(ipns[3], 16);
            if (ipns[4].length === length * 2) {
              return "ipns://" + basex_1.Base58.encode("0x" + ipns[1]);
            }
          }
          const swarm = hexBytes.match(/^0xe40101fa011b20([0-9a-f]*)$/);
          if (swarm) {
            if (swarm[1].length === 32 * 2) {
              return "bzz://" + swarm[1];
            }
          }
          const skynet = hexBytes.match(/^0x90b2c605([0-9a-f]*)$/);
          if (skynet) {
            if (skynet[1].length === 34 * 2) {
              const urlSafe = {
                "=": "",
                "+": "-",
                "/": "_"
              };
              const hash = (0, base64_1.encode)("0x" + skynet[1]).replace(/[=+\/]/g, (a => urlSafe[a]));
              return "sia://" + hash;
            }
          }
          return logger.throwError(`invalid or unsupported content hash data`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "getContentHash()",
            data: hexBytes
          });
        }
        async getText(key) {
          let keyBytes = (0, strings_1.toUtf8Bytes)(key);
          keyBytes = (0, bytes_1.concat)([ bytes32ify(64), bytes32ify(keyBytes.length), keyBytes ]);
          if (keyBytes.length % 32 !== 0) {
            keyBytes = (0, bytes_1.concat)([ keyBytes, (0, bytes_1.hexZeroPad)("0x", 32 - key.length % 32) ]);
          }
          const hexBytes = await this._fetchBytes("0x59d1d43c", (0, bytes_1.hexlify)(keyBytes));
          if (hexBytes == null || hexBytes === "0x") {
            return null;
          }
          return (0, strings_1.toUtf8String)(hexBytes);
        }
      }
      exports.Resolver = Resolver;
      let defaultFormatter = null;
      let nextPollId = 1;
      class BaseProvider extends abstract_provider_1.Provider {
        constructor(network) {
          super();
          this._events = [];
          this._emitted = {
            block: -2
          };
          this.disableCcipRead = false;
          this.formatter = new.target.getFormatter();
          (0, properties_1.defineReadOnly)(this, "anyNetwork", network === "any");
          if (this.anyNetwork) {
            network = this.detectNetwork();
          }
          if (network instanceof Promise) {
            this._networkPromise = network;
            network.catch((error => {}));
            this._ready().catch((error => {}));
          } else {
            const knownNetwork = (0, properties_1.getStatic)(new.target, "getNetwork")(network);
            if (knownNetwork) {
              (0, properties_1.defineReadOnly)(this, "_network", knownNetwork);
              this.emit("network", knownNetwork, null);
            } else {
              logger.throwArgumentError("invalid network", "network", network);
            }
          }
          this._maxInternalBlockNumber = -1024;
          this._lastBlockNumber = -2;
          this._maxFilterBlockRange = 10;
          this._pollingInterval = 4e3;
          this._fastQueryDate = 0;
        }
        async _ready() {
          if (this._network == null) {
            let network = null;
            if (this._networkPromise) {
              try {
                network = await this._networkPromise;
              } catch (error) {}
            }
            if (network == null) {
              network = await this.detectNetwork();
            }
            if (!network) {
              logger.throwError("no network detected", logger_1.Logger.errors.UNKNOWN_ERROR, {});
            }
            if (this._network == null) {
              if (this.anyNetwork) {
                this._network = network;
              } else {
                (0, properties_1.defineReadOnly)(this, "_network", network);
              }
              this.emit("network", network, null);
            }
          }
          return this._network;
        }
        get ready() {
          return (0, web_1.poll)((() => this._ready().then((network => network), (error => {
            if (error.code === logger_1.Logger.errors.NETWORK_ERROR && error.event === "noNetwork") {
              return undefined;
            }
            throw error;
          }))));
        }
        static getFormatter() {
          if (defaultFormatter == null) {
            defaultFormatter = new formatter_1.Formatter;
          }
          return defaultFormatter;
        }
        static getNetwork(network) {
          return (0, networks_1.getNetwork)(network == null ? "zeus" : network);
        }
        async ccipReadFetch(tx, calldata, urls) {
          if (this.disableCcipRead || urls.length === 0) {
            return null;
          }
          const sender = tx.to.toLowerCase();
          const data = calldata.toLowerCase();
          const errorMessages = [];
          for (let i = 0; i < urls.length; i++) {
            const url = urls[i];
            const href = url.replace("{sender}", sender).replace("{data}", data);
            const json = url.indexOf("{data}") >= 0 ? null : JSON.stringify({
              data,
              sender
            });
            const result = await (0, web_1.fetchJson)({
              url: href,
              errorPassThrough: true
            }, json, ((value, response) => {
              value.status = response.statusCode;
              return value;
            }));
            if (result.data) {
              return result.data;
            }
            const errorMessage = result.message || "unknown error";
            if (result.status >= 400 && result.status < 500) {
              return logger.throwError(`response not found during CCIP fetch: ${errorMessage}`, logger_1.Logger.errors.SERVER_ERROR, {
                url,
                errorMessage
              });
            }
            errorMessages.push(errorMessage);
          }
          return logger.throwError(`error encountered during CCIP fetch: ${errorMessages.map((m => JSON.stringify(m))).join(", ")}`, logger_1.Logger.errors.SERVER_ERROR, {
            urls,
            errorMessages
          });
        }
        async _getInternalBlockNumber(maxAge) {
          await this._ready();
          if (maxAge > 0) {
            while (this._internalBlockNumber) {
              const internalBlockNumber = this._internalBlockNumber;
              try {
                const result = await internalBlockNumber;
                if (getTime() - result.respTime <= maxAge) {
                  return result.blockNumber;
                }
                break;
              } catch (error) {
                if (this._internalBlockNumber === internalBlockNumber) {
                  break;
                }
              }
            }
          }
          const reqTime = getTime();
          const checkInternalBlockNumber = (0, properties_1.resolveProperties)({
            blockNumber: this.perform("getBlockNumber", {}),
            networkError: this.getNetwork().then((network => null), (error => error))
          }).then((({blockNumber, networkError}) => {
            if (networkError) {
              if (this._internalBlockNumber === checkInternalBlockNumber) {
                this._internalBlockNumber = null;
              }
              throw networkError;
            }
            const respTime = getTime();
            blockNumber = bignumber_1.BigNumber.from(blockNumber).toNumber();
            if (blockNumber < this._maxInternalBlockNumber) {
              blockNumber = this._maxInternalBlockNumber;
            }
            this._maxInternalBlockNumber = blockNumber;
            this._setFastBlockNumber(blockNumber);
            return {
              blockNumber,
              reqTime,
              respTime
            };
          }));
          this._internalBlockNumber = checkInternalBlockNumber;
          checkInternalBlockNumber.catch((error => {
            if (this._internalBlockNumber === checkInternalBlockNumber) {
              this._internalBlockNumber = null;
            }
          }));
          return (await checkInternalBlockNumber).blockNumber;
        }
        async poll() {
          const pollId = nextPollId++;
          const runners = [];
          let blockNumber = null;
          try {
            blockNumber = await this._getInternalBlockNumber(100 + this.pollingInterval / 2);
          } catch (error) {
            this.emit("error", error);
            return;
          }
          this._setFastBlockNumber(blockNumber);
          this.emit("poll", pollId, blockNumber);
          if (blockNumber === this._lastBlockNumber) {
            this.emit("didPoll", pollId);
            return;
          }
          if (this._emitted.block === -2) {
            this._emitted.block = blockNumber - 1;
          }
          if (Math.abs(this._emitted.block - blockNumber) > 1e3) {
            logger.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${blockNumber})`);
            this.emit("error", logger.makeError("network block skew detected", logger_1.Logger.errors.NETWORK_ERROR, {
              blockNumber,
              event: "blockSkew",
              previousBlockNumber: this._emitted.block
            }));
            this.emit("block", blockNumber);
          } else {
            for (let i = this._emitted.block + 1; i <= blockNumber; i++) {
              this.emit("block", i);
            }
          }
          if (this._emitted.block !== blockNumber) {
            this._emitted.block = blockNumber;
            Object.keys(this._emitted).forEach((key => {
              if (key === "block") {
                return;
              }
              const eventBlockNumber = this._emitted[key];
              if (eventBlockNumber === "pending") {
                return;
              }
              if (blockNumber - eventBlockNumber > 12) {
                delete this._emitted[key];
              }
            }));
          }
          if (this._lastBlockNumber === -2) {
            this._lastBlockNumber = blockNumber - 1;
          }
          this._events.forEach((event => {
            switch (event.type) {
             case "tx":
              {
                const hash = event.hash;
                let runner = this.getTransactionReceipt(hash).then((receipt => {
                  if (!receipt || receipt.blockNumber == null) {
                    return null;
                  }
                  this._emitted["t:" + hash] = receipt.blockNumber;
                  this.emit(hash, receipt);
                  return null;
                })).catch((error => {
                  this.emit("error", error);
                }));
                runners.push(runner);
                break;
              }

             case "filter":
              {
                if (!event._inflight) {
                  event._inflight = true;
                  if (event._lastBlockNumber === -2) {
                    event._lastBlockNumber = blockNumber - 1;
                  }
                  const filter = event.filter;
                  filter.fromBlock = event._lastBlockNumber + 1;
                  filter.toBlock = blockNumber;
                  const minFromBlock = filter.toBlock - this._maxFilterBlockRange;
                  if (minFromBlock > filter.fromBlock) {
                    filter.fromBlock = minFromBlock;
                  }
                  if (filter.fromBlock < 0) {
                    filter.fromBlock = 0;
                  }
                  const runner = this.getLogs(filter).then((logs => {
                    event._inflight = false;
                    if (logs.length === 0) {
                      return;
                    }
                    logs.forEach((log => {
                      if (log.blockNumber > event._lastBlockNumber) {
                        event._lastBlockNumber = log.blockNumber;
                      }
                      this._emitted["b:" + log.blockHash] = log.blockNumber;
                      this._emitted["t:" + log.transactionHash] = log.blockNumber;
                      this.emit(filter, log);
                    }));
                  })).catch((error => {
                    this.emit("error", error);
                    event._inflight = false;
                  }));
                  runners.push(runner);
                }
                break;
              }
            }
          }));
          this._lastBlockNumber = blockNumber;
          Promise.all(runners).then((() => {
            this.emit("didPoll", pollId);
          })).catch((error => {
            this.emit("error", error);
          }));
          return;
        }
        resetEventsBlock(blockNumber) {
          this._lastBlockNumber = blockNumber - 1;
          if (this.polling) {
            this.poll();
          }
        }
        get network() {
          return this._network;
        }
        async detectNetwork() {
          return logger.throwError("provider does not support network detection", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "provider.detectNetwork"
          });
        }
        async getNetwork() {
          const network = await this._ready();
          const currentNetwork = await this.detectNetwork();
          if (network.chainId !== currentNetwork.chainId) {
            if (this.anyNetwork) {
              this._network = currentNetwork;
              this._lastBlockNumber = -2;
              this._fastBlockNumber = null;
              this._fastBlockNumberPromise = null;
              this._fastQueryDate = 0;
              this._emitted.block = -2;
              this._maxInternalBlockNumber = -1024;
              this._internalBlockNumber = null;
              this.emit("network", currentNetwork, network);
              await stall(0);
              return this._network;
            }
            const error = logger.makeError("underlying network changed", logger_1.Logger.errors.NETWORK_ERROR, {
              event: "changed",
              network,
              detectedNetwork: currentNetwork
            });
            this.emit("error", error);
            throw error;
          }
          return network;
        }
        get blockNumber() {
          this._getInternalBlockNumber(100 + this.pollingInterval / 2).then((blockNumber => {
            this._setFastBlockNumber(blockNumber);
          }), (error => {}));
          return this._fastBlockNumber != null ? this._fastBlockNumber : -1;
        }
        get polling() {
          return this._poller != null;
        }
        set polling(value) {
          if (value && !this._poller) {
            this._poller = setInterval((() => {
              this.poll();
            }), this.pollingInterval);
            if (!this._bootstrapPoll) {
              this._bootstrapPoll = setTimeout((() => {
                this.poll();
                this._bootstrapPoll = setTimeout((() => {
                  if (!this._poller) {
                    this.poll();
                  }
                  this._bootstrapPoll = null;
                }), this.pollingInterval);
              }), 0);
            }
          } else if (!value && this._poller) {
            clearInterval(this._poller);
            this._poller = null;
          }
        }
        get pollingInterval() {
          return this._pollingInterval;
        }
        set pollingInterval(value) {
          if (typeof value !== "number" || value <= 0 || parseInt(String(value)) != value) {
            throw new Error("invalid polling interval");
          }
          this._pollingInterval = value;
          if (this._poller) {
            clearInterval(this._poller);
            this._poller = setInterval((() => {
              this.poll();
            }), this._pollingInterval);
          }
        }
        _getFastBlockNumber() {
          const now = getTime();
          if (now - this._fastQueryDate > 2 * this._pollingInterval) {
            this._fastQueryDate = now;
            this._fastBlockNumberPromise = this.getBlockNumber().then((blockNumber => {
              if (this._fastBlockNumber == null || blockNumber > this._fastBlockNumber) {
                this._fastBlockNumber = blockNumber;
              }
              return this._fastBlockNumber;
            }));
          }
          return this._fastBlockNumberPromise;
        }
        _setFastBlockNumber(blockNumber) {
          if (this._fastBlockNumber != null && blockNumber < this._fastBlockNumber) {
            return;
          }
          this._fastQueryDate = getTime();
          if (this._fastBlockNumber == null || blockNumber > this._fastBlockNumber) {
            this._fastBlockNumber = blockNumber;
            this._fastBlockNumberPromise = Promise.resolve(blockNumber);
          }
        }
        async waitForTransaction(transactionHash, confirmations, timeout) {
          return this._waitForTransaction(transactionHash, confirmations == null ? 1 : confirmations, timeout || 0, null);
        }
        async _waitForTransaction(transactionHash, confirmations, timeout, replaceable) {
          const receipt = await this.getTransactionReceipt(transactionHash);
          if ((receipt ? receipt.confirmations : 0) >= confirmations) {
            return receipt;
          }
          return new Promise(((resolve, reject) => {
            const cancelFuncs = [];
            let done = false;
            const alreadyDone = function() {
              if (done) {
                return true;
              }
              done = true;
              cancelFuncs.forEach((func => {
                func();
              }));
              return false;
            };
            const minedHandler = receipt => {
              if (receipt.confirmations < confirmations) {
                return;
              }
              if (alreadyDone()) {
                return;
              }
              resolve(receipt);
            };
            this.on(transactionHash, minedHandler);
            cancelFuncs.push((() => {
              this.removeListener(transactionHash, minedHandler);
            }));
            if (replaceable) {
              let lastBlockNumber = replaceable.startBlock;
              let scannedBlock = null;
              const replaceHandler = async blockNumber => {
                if (done) {
                  return;
                }
                await stall(1e3);
                this.getTransactionCount(replaceable.from).then((async nonce => {
                  if (done) {
                    return;
                  }
                  if (nonce <= replaceable.nonce) {
                    lastBlockNumber = blockNumber;
                  } else {
                    {
                      const mined = await this.getTransaction(transactionHash);
                      if (mined && mined.blockNumber != null) {
                        return;
                      }
                    }
                    if (scannedBlock == null) {
                      scannedBlock = lastBlockNumber - 3;
                      if (scannedBlock < replaceable.startBlock) {
                        scannedBlock = replaceable.startBlock;
                      }
                    }
                    while (scannedBlock <= blockNumber) {
                      if (done) {
                        return;
                      }
                      const block = await this.getBlockWithTransactions(scannedBlock);
                      for (let ti = 0; ti < block.transactions.length; ti++) {
                        const tx = block.transactions[ti];
                        if (tx.hash === transactionHash) {
                          return;
                        }
                        if (tx.from === replaceable.from && tx.nonce === replaceable.nonce) {
                          if (done) {
                            return;
                          }
                          const receipt = await this.waitForTransaction(tx.hash, confirmations);
                          if (alreadyDone()) {
                            return;
                          }
                          let reason = "replaced";
                          if (tx.data === replaceable.data && tx.to === replaceable.to && tx.value.eq(replaceable.value)) {
                            reason = "repriced";
                          } else if (tx.data === "0x" && tx.from === tx.to && tx.value.isZero()) {
                            reason = "cancelled";
                          }
                          reject(logger.makeError("transaction was replaced", logger_1.Logger.errors.TRANSACTION_REPLACED, {
                            cancelled: reason === "replaced" || reason === "cancelled",
                            reason,
                            replacement: this._wrapTransaction(tx),
                            hash: transactionHash,
                            receipt
                          }));
                          return;
                        }
                      }
                      scannedBlock++;
                    }
                  }
                  if (done) {
                    return;
                  }
                  this.once("block", replaceHandler);
                }), (error => {
                  if (done) {
                    return;
                  }
                  this.once("block", replaceHandler);
                }));
              };
              if (done) {
                return;
              }
              this.once("block", replaceHandler);
              cancelFuncs.push((() => {
                this.removeListener("block", replaceHandler);
              }));
            }
            if (typeof timeout === "number" && timeout > 0) {
              const timer = setTimeout((() => {
                if (alreadyDone()) {
                  return;
                }
                reject(logger.makeError("timeout exceeded", logger_1.Logger.errors.TIMEOUT, {
                  timeout
                }));
              }), timeout);
              if (timer.unref) {
                timer.unref();
              }
              cancelFuncs.push((() => {
                clearTimeout(timer);
              }));
            }
          }));
        }
        async getBlockNumber() {
          return this._getInternalBlockNumber(0);
        }
        async getGasPrice() {
          await this.getNetwork();
          const result = await this.perform("getGasPrice", {});
          try {
            return bignumber_1.BigNumber.from(result);
          } catch (error) {
            return logger.throwError("bad result from backend", logger_1.Logger.errors.SERVER_ERROR, {
              method: "getGasPrice",
              result,
              error
            });
          }
        }
        async getBalance(addressOrName, blockTag) {
          await this.getNetwork();
          const params = await (0, properties_1.resolveProperties)({
            address: this._getAddress(addressOrName),
            blockTag: this._getBlockTag(blockTag)
          });
          const result = await this.perform("getBalance", params);
          try {
            return bignumber_1.BigNumber.from(result);
          } catch (error) {
            return logger.throwError("bad result from backend", logger_1.Logger.errors.SERVER_ERROR, {
              method: "getBalance",
              params,
              result,
              error
            });
          }
        }
        async getTransactionCount(addressOrName, blockTag) {
          await this.getNetwork();
          const params = await (0, properties_1.resolveProperties)({
            address: this._getAddress(addressOrName),
            blockTag: this._getBlockTag(blockTag)
          });
          const result = await this.perform("getTransactionCount", params);
          try {
            return bignumber_1.BigNumber.from(result).toNumber();
          } catch (error) {
            return logger.throwError("bad result from backend", logger_1.Logger.errors.SERVER_ERROR, {
              method: "getTransactionCount",
              params,
              result,
              error
            });
          }
        }
        async getCode(addressOrName, blockTag) {
          await this.getNetwork();
          const params = await (0, properties_1.resolveProperties)({
            address: this._getAddress(addressOrName),
            blockTag: this._getBlockTag(blockTag)
          });
          const result = await this.perform("getCode", params);
          try {
            return (0, bytes_1.hexlify)(result);
          } catch (error) {
            return logger.throwError("bad result from backend", logger_1.Logger.errors.SERVER_ERROR, {
              method: "getCode",
              params,
              result,
              error
            });
          }
        }
        async getStorageAt(addressOrName, position, blockTag) {
          await this.getNetwork();
          const params = await (0, properties_1.resolveProperties)({
            address: this._getAddress(addressOrName),
            blockTag: this._getBlockTag(blockTag),
            position: Promise.resolve(position).then((p => (0, bytes_1.hexValue)(p)))
          });
          const result = await this.perform("getStorageAt", params);
          try {
            return (0, bytes_1.hexlify)(result);
          } catch (error) {
            return logger.throwError("bad result from backend", logger_1.Logger.errors.SERVER_ERROR, {
              method: "getStorageAt",
              params,
              result,
              error
            });
          }
        }
        _wrapTransaction(tx, hash, startBlock) {
          if (hash != null && (0, bytes_1.hexDataLength)(hash) !== 32) {
            throw new Error("invalid response - sendTransaction");
          }
          const result = tx;
          if (hash != null && tx.hash !== hash) {
            logger.throwError("Transaction hash mismatch from Provider.sendTransaction.", logger_1.Logger.errors.UNKNOWN_ERROR, {
              expectedHash: tx.hash,
              returnedHash: hash
            });
          }
          result.wait = async (confirms, timeout) => {
            if (confirms == null) {
              confirms = 1;
            }
            if (timeout == null) {
              timeout = 0;
            }
            let replacement = undefined;
            if (confirms !== 0 && startBlock != null) {
              replacement = {
                data: tx.data,
                from: tx.from,
                nonce: tx.nonce,
                to: tx.to,
                value: tx.value,
                startBlock
              };
            }
            const receipt = await this._waitForTransaction(tx.hash, confirms, timeout, replacement);
            if (receipt == null && confirms === 0) {
              return null;
            }
            this._emitted["t:" + tx.hash] = receipt.blockNumber;
            if (receipt.status === 0) {
              logger.throwError("transaction failed", logger_1.Logger.errors.CALL_EXCEPTION, {
                transactionHash: tx.hash,
                transaction: tx,
                receipt
              });
            }
            return receipt;
          };
          return result;
        }
        async sendTransaction(signedTransaction) {
          await this.getNetwork();
          const hexTx = await Promise.resolve(signedTransaction).then((t => (0, bytes_1.hexlify)(t)));
          const tx = this.formatter.transaction(signedTransaction);
          if (tx.confirmations == null) {
            tx.confirmations = 0;
          }
          const blockNumber = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
          try {
            const hash = await this.perform("sendTransaction", {
              signedTransaction: hexTx
            });
            return this._wrapTransaction(tx, hash, blockNumber);
          } catch (error) {
            error.transaction = tx;
            error.transactionHash = tx.hash;
            throw error;
          }
        }
        async _getTransactionRequest(transaction) {
          const values = await transaction;
          const tx = {};
          [ "from", "to" ].forEach((key => {
            if (values[key] == null) {
              return;
            }
            tx[key] = Promise.resolve(values[key]).then((v => v ? this._getAddress(v) : null));
          }));
          [ "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "value" ].forEach((key => {
            if (values[key] == null) {
              return;
            }
            tx[key] = Promise.resolve(values[key]).then((v => v ? bignumber_1.BigNumber.from(v) : null));
          }));
          [ "type" ].forEach((key => {
            if (values[key] == null) {
              return;
            }
            tx[key] = Promise.resolve(values[key]).then((v => v != null ? v : null));
          }));
          if (values.accessList) {
            tx.accessList = this.formatter.accessList(values.accessList);
          }
          [ "data" ].forEach((key => {
            if (values[key] == null) {
              return;
            }
            tx[key] = Promise.resolve(values[key]).then((v => v ? (0, bytes_1.hexlify)(v) : null));
          }));
          return this.formatter.transactionRequest(await (0, properties_1.resolveProperties)(tx));
        }
        async _getFilter(filter) {
          filter = await filter;
          const result = {};
          if (filter.address != null) {
            result.address = this._getAddress(filter.address);
          }
          [ "blockHash", "topics" ].forEach((key => {
            if (filter[key] == null) {
              return;
            }
            result[key] = filter[key];
          }));
          [ "fromBlock", "toBlock" ].forEach((key => {
            if (filter[key] == null) {
              return;
            }
            result[key] = this._getBlockTag(filter[key]);
          }));
          return this.formatter.filter(await (0, properties_1.resolveProperties)(result));
        }
        async _call(transaction, blockTag, attempt) {
          if (attempt >= MAX_CCIP_REDIRECTS) {
            logger.throwError("CCIP read exceeded maximum redirections", logger_1.Logger.errors.SERVER_ERROR, {
              redirects: attempt,
              transaction
            });
          }
          const txSender = transaction.to;
          const result = await this.perform("call", {
            transaction,
            blockTag
          });
          if (attempt >= 0 && blockTag === "latest" && txSender != null && result.substring(0, 10) === "0x556f1830" && (0, 
          bytes_1.hexDataLength)(result) % 32 === 4) {
            try {
              const data = (0, bytes_1.hexDataSlice)(result, 4);
              const sender = (0, bytes_1.hexDataSlice)(data, 0, 32);
              if (!bignumber_1.BigNumber.from(sender).eq(txSender)) {
                logger.throwError("CCIP Read sender did not match", logger_1.Logger.errors.CALL_EXCEPTION, {
                  name: "OffchainLookup",
                  signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
                  transaction,
                  data: result
                });
              }
              const urls = [];
              const urlsOffset = bignumber_1.BigNumber.from((0, bytes_1.hexDataSlice)(data, 32, 64)).toNumber();
              const urlsLength = bignumber_1.BigNumber.from((0, bytes_1.hexDataSlice)(data, urlsOffset, urlsOffset + 32)).toNumber();
              const urlsData = (0, bytes_1.hexDataSlice)(data, urlsOffset + 32);
              for (let u = 0; u < urlsLength; u++) {
                const url = _parseString(urlsData, u * 32);
                if (url == null) {
                  logger.throwError("CCIP Read contained corrupt URL string", logger_1.Logger.errors.CALL_EXCEPTION, {
                    name: "OffchainLookup",
                    signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
                    transaction,
                    data: result
                  });
                }
                urls.push(url);
              }
              const calldata = _parseBytes(data, 64);
              if (!bignumber_1.BigNumber.from((0, bytes_1.hexDataSlice)(data, 100, 128)).isZero()) {
                logger.throwError("CCIP Read callback selector included junk", logger_1.Logger.errors.CALL_EXCEPTION, {
                  name: "OffchainLookup",
                  signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
                  transaction,
                  data: result
                });
              }
              const callbackSelector = (0, bytes_1.hexDataSlice)(data, 96, 100);
              const extraData = _parseBytes(data, 128);
              const ccipResult = await this.ccipReadFetch(transaction, calldata, urls);
              if (ccipResult == null) {
                logger.throwError("CCIP Read disabled or provided no URLs", logger_1.Logger.errors.CALL_EXCEPTION, {
                  name: "OffchainLookup",
                  signature: "OffchainLookup(address,string[],bytes,bytes4,bytes)",
                  transaction,
                  data: result
                });
              }
              const tx = {
                to: txSender,
                data: (0, bytes_1.hexConcat)([ callbackSelector, encodeBytes([ ccipResult, extraData ]) ])
              };
              return this._call(tx, blockTag, attempt + 1);
            } catch (error) {
              if (error.code === logger_1.Logger.errors.SERVER_ERROR) {
                throw error;
              }
            }
          }
          try {
            return (0, bytes_1.hexlify)(result);
          } catch (error) {
            return logger.throwError("bad result from backend", logger_1.Logger.errors.SERVER_ERROR, {
              method: "call",
              params: {
                transaction,
                blockTag
              },
              result,
              error
            });
          }
        }
        async call(transaction, blockTag) {
          await this.getNetwork();
          const resolved = await (0, properties_1.resolveProperties)({
            transaction: this._getTransactionRequest(transaction),
            blockTag: this._getBlockTag(blockTag),
            ccipReadEnabled: Promise.resolve(transaction.ccipReadEnabled)
          });
          return this._call(resolved.transaction, resolved.blockTag, resolved.ccipReadEnabled ? 0 : -1);
        }
        async estimateGas(transaction) {
          await this.getNetwork();
          const params = await (0, properties_1.resolveProperties)({
            transaction: this._getTransactionRequest(transaction)
          });
          const result = await this.perform("estimateGas", params);
          try {
            return bignumber_1.BigNumber.from(result);
          } catch (error) {
            return logger.throwError("bad result from backend", logger_1.Logger.errors.SERVER_ERROR, {
              method: "estimateGas",
              params,
              result,
              error
            });
          }
        }
        async _getAddress(addressOrName) {
          addressOrName = await addressOrName;
          if (typeof addressOrName !== "string") {
            logger.throwArgumentError("invalid address or ENS name", "name", addressOrName);
          }
          const address = await this.resolveName(addressOrName);
          if (address == null) {
            logger.throwError("ENS name not configured", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: `resolveName(${JSON.stringify(addressOrName)})`
            });
          }
          return address;
        }
        async _getBlock(blockHashOrBlockTag, includeTransactions) {
          await this.getNetwork();
          blockHashOrBlockTag = await blockHashOrBlockTag;
          let blockNumber = -128;
          const params = {
            includeTransactions: !!includeTransactions
          };
          if ((0, bytes_1.isHexString)(blockHashOrBlockTag, 32)) {
            params.blockHash = blockHashOrBlockTag;
          } else {
            try {
              params.blockTag = await this._getBlockTag(blockHashOrBlockTag);
              if ((0, bytes_1.isHexString)(params.blockTag)) {
                blockNumber = parseInt(params.blockTag.substring(2), 16);
              }
            } catch (error) {
              logger.throwArgumentError("invalid block hash or block tag", "blockHashOrBlockTag", blockHashOrBlockTag);
            }
          }
          return (0, web_1.poll)((async () => {
            const block = await this.perform("getBlock", params);
            if (block == null) {
              if (params.blockHash != null) {
                if (this._emitted["b:" + params.blockHash] == null) {
                  return null;
                }
              }
              if (params.blockTag != null) {
                if (blockNumber > this._emitted.block) {
                  return null;
                }
              }
              return undefined;
            }
            if (includeTransactions) {
              let blockNumber = null;
              for (let i = 0; i < block.transactions.length; i++) {
                const tx = block.transactions[i];
                if (tx.blockNumber == null) {
                  tx.confirmations = 0;
                } else if (tx.confirmations == null) {
                  if (blockNumber == null) {
                    blockNumber = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
                  }
                  let confirmations = blockNumber - tx.blockNumber + 1;
                  if (confirmations <= 0) {
                    confirmations = 1;
                  }
                  tx.confirmations = confirmations;
                }
              }
              const blockWithTxs = this.formatter.blockWithTransactions(block);
              blockWithTxs.transactions = blockWithTxs.transactions.map((tx => this._wrapTransaction(tx)));
              return blockWithTxs;
            }
            return this.formatter.block(block);
          }), {
            oncePoll: this
          });
        }
        getBlock(blockHashOrBlockTag) {
          return this._getBlock(blockHashOrBlockTag, false);
        }
        getBlockWithTransactions(blockHashOrBlockTag) {
          return this._getBlock(blockHashOrBlockTag, true);
        }
        async getTransaction(transactionHash) {
          await this.getNetwork();
          transactionHash = await transactionHash;
          const params = {
            transactionHash: this.formatter.hash(transactionHash, true)
          };
          return (0, web_1.poll)((async () => {
            const result = await this.perform("getTransaction", params);
            if (result == null) {
              if (this._emitted["t:" + transactionHash] == null) {
                return null;
              }
              return undefined;
            }
            const tx = this.formatter.transactionResponse(result);
            if (tx.blockNumber == null) {
              tx.confirmations = 0;
            } else if (tx.confirmations == null) {
              const blockNumber = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
              let confirmations = blockNumber - tx.blockNumber + 1;
              if (confirmations <= 0) {
                confirmations = 1;
              }
              tx.confirmations = confirmations;
            }
            return this._wrapTransaction(tx);
          }), {
            oncePoll: this
          });
        }
        async getTransactionReceipt(transactionHash) {
          await this.getNetwork();
          transactionHash = await transactionHash;
          const params = {
            transactionHash: this.formatter.hash(transactionHash, true)
          };
          return (0, web_1.poll)((async () => {
            const result = await this.perform("getTransactionReceipt", params);
            if (result == null) {
              if (this._emitted["t:" + transactionHash] == null) {
                return null;
              }
              return undefined;
            }
            if (result.blockHash == null) {
              return undefined;
            }
            const receipt = this.formatter.receipt(result);
            if (receipt.blockNumber == null) {
              receipt.confirmations = 0;
            } else if (receipt.confirmations == null) {
              const blockNumber = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
              let confirmations = blockNumber - receipt.blockNumber + 1;
              if (confirmations <= 0) {
                confirmations = 1;
              }
              receipt.confirmations = confirmations;
            }
            return receipt;
          }), {
            oncePoll: this
          });
        }
        async getLogs(filter) {
          await this.getNetwork();
          const params = await (0, properties_1.resolveProperties)({
            filter: this._getFilter(filter)
          });
          const logs = await this.perform("getLogs", params);
          logs.forEach((log => {
            if (log.removed == null) {
              log.removed = false;
            }
          }));
          return formatter_1.Formatter.arrayOf(this.formatter.filterLog.bind(this.formatter))(logs);
        }
        async getEtherPrice() {
          await this.getNetwork();
          return this.perform("getEtherPrice", {});
        }
        async _getBlockTag(blockTag) {
          blockTag = await blockTag;
          if (typeof blockTag === "number" && blockTag < 0) {
            if (blockTag % 1) {
              logger.throwArgumentError("invalid BlockTag", "blockTag", blockTag);
            }
            let blockNumber = await this._getInternalBlockNumber(100 + 2 * this.pollingInterval);
            blockNumber += blockTag;
            if (blockNumber < 0) {
              blockNumber = 0;
            }
            return this.formatter.blockTag(blockNumber);
          }
          return this.formatter.blockTag(blockTag);
        }
        async getResolver(name) {
          let currentName = name;
          while (true) {
            if (currentName === "" || currentName === ".") {
              return null;
            }
            if (name !== "eth" && currentName === "eth") {
              return null;
            }
            const addr = await this._getResolver(currentName, "getResolver");
            if (addr != null) {
              const resolver = new Resolver(this, addr, name);
              if (currentName !== name && !await resolver.supportsWildcard()) {
                return null;
              }
              return resolver;
            }
            currentName = currentName.split(".").slice(1).join(".");
          }
        }
        async _getResolver(name, operation) {
          if (operation == null) {
            operation = "ENS";
          }
          const network = await this.getNetwork();
          if (!network.ensAddress) {
            logger.throwError("network does not support ENS", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation,
              network: network.name
            });
          }
          try {
            const addrData = await this.call({
              to: network.ensAddress,
              data: "0x0178b8bf" + (0, hash_1.namehash)(name).substring(2)
            });
            return this.formatter.callAddress(addrData);
          } catch (error) {}
          return null;
        }
        async resolveName(name) {
          name = await name;
          try {
            return Promise.resolve(this.formatter.address(name));
          } catch (error) {
            if ((0, bytes_1.isHexString)(name)) {
              throw error;
            }
          }
          if (typeof name !== "string") {
            logger.throwArgumentError("invalid ENS name", "name", name);
          }
          const resolver = await this.getResolver(name);
          if (!resolver) {
            return null;
          }
          return await resolver.getAddress();
        }
        async lookupAddress(address) {
          address = await address;
          address = this.formatter.address(address);
          const node = address.substring(2).toLowerCase() + ".addr.reverse";
          const resolverAddr = await this._getResolver(node, "lookupAddress");
          if (resolverAddr == null) {
            return null;
          }
          const name = _parseString(await this.call({
            to: resolverAddr,
            data: "0x691f3431" + (0, hash_1.namehash)(node).substring(2)
          }), 0);
          const addr = await this.resolveName(name);
          if (addr != address) {
            return null;
          }
          return name;
        }
        async getAvatar(nameOrAddress) {
          let resolver = null;
          if ((0, bytes_1.isHexString)(nameOrAddress)) {
            const address = this.formatter.address(nameOrAddress);
            const node = address.substring(2).toLowerCase() + ".addr.reverse";
            const resolverAddress = await this._getResolver(node, "getAvatar");
            if (!resolverAddress) {
              return null;
            }
            resolver = new Resolver(this, resolverAddress, node);
            try {
              const avatar = await resolver.getAvatar();
              if (avatar) {
                return avatar.url;
              }
            } catch (error) {
              if (error.code !== logger_1.Logger.errors.CALL_EXCEPTION) {
                throw error;
              }
            }
            try {
              const name = _parseString(await this.call({
                to: resolverAddress,
                data: "0x691f3431" + (0, hash_1.namehash)(node).substring(2)
              }), 0);
              resolver = await this.getResolver(name);
            } catch (error) {
              if (error.code !== logger_1.Logger.errors.CALL_EXCEPTION) {
                throw error;
              }
              return null;
            }
          } else {
            resolver = await this.getResolver(nameOrAddress);
            if (!resolver) {
              return null;
            }
          }
          const avatar = await resolver.getAvatar();
          if (avatar == null) {
            return null;
          }
          return avatar.url;
        }
        perform(method, params) {
          return logger.throwError(method + " not implemented", logger_1.Logger.errors.NOT_IMPLEMENTED, {
            operation: method
          });
        }
        _startEvent(event) {
          this.polling = this._events.filter((e => e.pollable())).length > 0;
        }
        _stopEvent(event) {
          this.polling = this._events.filter((e => e.pollable())).length > 0;
        }
        _addEventListener(eventName, listener, once) {
          const event = new Event(getEventTag(eventName), listener, once);
          this._events.push(event);
          this._startEvent(event);
          return this;
        }
        on(eventName, listener) {
          return this._addEventListener(eventName, listener, false);
        }
        once(eventName, listener) {
          return this._addEventListener(eventName, listener, true);
        }
        emit(eventName, ...args) {
          let result = false;
          let stopped = [];
          let eventTag = getEventTag(eventName);
          this._events = this._events.filter((event => {
            if (event.tag !== eventTag) {
              return true;
            }
            setTimeout((() => {
              event.listener.apply(this, args);
            }), 0);
            result = true;
            if (event.once) {
              stopped.push(event);
              return false;
            }
            return true;
          }));
          stopped.forEach((event => {
            this._stopEvent(event);
          }));
          return result;
        }
        listenerCount(eventName) {
          if (!eventName) {
            return this._events.length;
          }
          let eventTag = getEventTag(eventName);
          return this._events.filter((event => event.tag === eventTag)).length;
        }
        listeners(eventName) {
          if (eventName == null) {
            return this._events.map((event => event.listener));
          }
          let eventTag = getEventTag(eventName);
          return this._events.filter((event => event.tag === eventTag)).map((event => event.listener));
        }
        off(eventName, listener) {
          if (listener == null) {
            return this.removeAllListeners(eventName);
          }
          const stopped = [];
          let found = false;
          let eventTag = getEventTag(eventName);
          this._events = this._events.filter((event => {
            if (event.tag !== eventTag || event.listener != listener) {
              return true;
            }
            if (found) {
              return true;
            }
            found = true;
            stopped.push(event);
            return false;
          }));
          stopped.forEach((event => {
            this._stopEvent(event);
          }));
          return this;
        }
        removeAllListeners(eventName) {
          let stopped = [];
          if (eventName == null) {
            stopped = this._events;
            this._events = [];
          } else {
            const eventTag = getEventTag(eventName);
            this._events = this._events.filter((event => {
              if (event.tag !== eventTag) {
                return true;
              }
              stopped.push(event);
              return false;
            }));
          }
          stopped.forEach((event => {
            this._stopEvent(event);
          }));
          return this;
        }
      }
      exports.BaseProvider = BaseProvider;
    },
    1426(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.IpcProvider = void 0;
      const IpcProvider = null;
      exports.IpcProvider = IpcProvider;
    },
    7008(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.WebSocket = void 0;
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      let WS = null;
      exports.WebSocket = WS;
      try {
        exports.WebSocket = WS = WebSocket;
        if (WS == null) {
          throw new Error("inject please");
        }
      } catch (error) {
        const logger = new logger_1.Logger(_version_1.version);
        exports.WebSocket = WS = function() {
          logger.throwError("WebSockets not supported in this environment", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "new WebSocket()"
          });
        };
      }
    },
    2649(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.FallbackProvider = void 0;
      const abstract_provider_1 = __webpack_require__(103);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const properties_1 = __webpack_require__(1476);
      const random_1 = __webpack_require__(590);
      const web_1 = __webpack_require__(6637);
      const base_provider_1 = __webpack_require__(7408);
      const formatter_1 = __webpack_require__(4915);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      function now() {
        return (new Date).getTime();
      }
      function checkNetworks(networks) {
        let result = null;
        for (let i = 0; i < networks.length; i++) {
          const network = networks[i];
          if (network == null) {
            return null;
          }
          if (result) {
            if (!(result.name === network.name && result.chainId === network.chainId && (result.ensAddress === network.ensAddress || result.ensAddress == null && network.ensAddress == null))) {
              logger.throwArgumentError("provider mismatch", "networks", networks);
            }
          } else {
            result = network;
          }
        }
        return result;
      }
      function median(values, maxDelta) {
        values = values.slice().sort();
        const middle = Math.floor(values.length / 2);
        if (values.length % 2) {
          return values[middle];
        }
        const a = values[middle - 1], b = values[middle];
        if (maxDelta != null && Math.abs(a - b) > maxDelta) {
          return null;
        }
        return (a + b) / 2;
      }
      function serialize(value) {
        if (value === null) {
          return "null";
        } else if (typeof value === "number" || typeof value === "boolean") {
          return JSON.stringify(value);
        } else if (typeof value === "string") {
          return value;
        } else if (bignumber_1.BigNumber.isBigNumber(value)) {
          return value.toString();
        } else if (Array.isArray(value)) {
          return JSON.stringify(value.map((i => serialize(i))));
        } else if (typeof value === "object") {
          const keys = Object.keys(value);
          keys.sort();
          return "{" + keys.map((key => {
            let v = value[key];
            if (typeof v === "function") {
              v = "[function]";
            } else {
              v = serialize(v);
            }
            return JSON.stringify(key) + ":" + v;
          })).join(",") + "}";
        }
        throw new Error("unknown value type: " + typeof value);
      }
      let nextRid = 1;
      function stall(duration) {
        let cancel = null;
        let timer = null;
        let promise = new Promise((resolve => {
          cancel = function() {
            if (timer) {
              clearTimeout(timer);
              timer = null;
            }
            resolve();
          };
          timer = setTimeout(cancel, duration);
        }));
        const wait = func => {
          promise = promise.then(func);
          return promise;
        };
        function getPromise() {
          return promise;
        }
        return {
          cancel,
          getPromise,
          wait
        };
      }
      const ForwardErrors = [ logger_1.Logger.errors.CALL_EXCEPTION, logger_1.Logger.errors.INSUFFICIENT_FUNDS, logger_1.Logger.errors.NONCE_EXPIRED, logger_1.Logger.errors.REPLACEMENT_UNDERPRICED, logger_1.Logger.errors.UNPREDICTABLE_GAS_LIMIT ];
      const ForwardProperties = [ "address", "args", "errorArgs", "errorSignature", "method", "transaction" ];
      function exposeDebugConfig(config, now) {
        const result = {
          weight: config.weight
        };
        Object.defineProperty(result, "provider", {
          get: () => config.provider
        });
        if (config.start) {
          result.start = config.start;
        }
        if (now) {
          result.duration = now - config.start;
        }
        if (config.done) {
          if (config.error) {
            result.error = config.error;
          } else {
            result.result = config.result || null;
          }
        }
        return result;
      }
      function normalizedTally(normalize, quorum) {
        return function(configs) {
          const tally = {};
          configs.forEach((c => {
            const value = normalize(c.result);
            if (!tally[value]) {
              tally[value] = {
                count: 0,
                result: c.result
              };
            }
            tally[value].count++;
          }));
          const keys = Object.keys(tally);
          for (let i = 0; i < keys.length; i++) {
            const check = tally[keys[i]];
            if (check.count >= quorum) {
              return check.result;
            }
          }
          return undefined;
        };
      }
      function getProcessFunc(provider, method, params) {
        let normalize = serialize;
        switch (method) {
         case "getBlockNumber":
          return function(configs) {
            const values = configs.map((c => c.result));
            let blockNumber = median(configs.map((c => c.result)), 2);
            if (blockNumber == null) {
              return undefined;
            }
            blockNumber = Math.ceil(blockNumber);
            if (values.indexOf(blockNumber + 1) >= 0) {
              blockNumber++;
            }
            if (blockNumber >= provider._highestBlockNumber) {
              provider._highestBlockNumber = blockNumber;
            }
            return provider._highestBlockNumber;
          };

         case "getGasPrice":
          return function(configs) {
            const values = configs.map((c => c.result));
            values.sort();
            return values[Math.floor(values.length / 2)];
          };

         case "getEtherPrice":
          return function(configs) {
            return median(configs.map((c => c.result)));
          };

         case "getBalance":
         case "getTransactionCount":
         case "getCode":
         case "getStorageAt":
         case "call":
         case "estimateGas":
         case "getLogs":
          break;

         case "getTransaction":
         case "getTransactionReceipt":
          normalize = function(tx) {
            if (tx == null) {
              return null;
            }
            tx = (0, properties_1.shallowCopy)(tx);
            tx.confirmations = -1;
            return serialize(tx);
          };
          break;

         case "getBlock":
          if (params.includeTransactions) {
            normalize = function(block) {
              if (block == null) {
                return null;
              }
              block = (0, properties_1.shallowCopy)(block);
              block.transactions = block.transactions.map((tx => {
                tx = (0, properties_1.shallowCopy)(tx);
                tx.confirmations = -1;
                return tx;
              }));
              return serialize(block);
            };
          } else {
            normalize = function(block) {
              if (block == null) {
                return null;
              }
              return serialize(block);
            };
          }
          break;

         default:
          throw new Error("unknown method: " + method);
        }
        return normalizedTally(normalize, provider.quorum);
      }
      async function waitForSync(config, blockNumber) {
        const provider = config.provider;
        if (provider.blockNumber != null && provider.blockNumber >= blockNumber || blockNumber === -1) {
          return provider;
        }
        return (0, web_1.poll)((() => new Promise(((resolve, reject) => {
          setTimeout((function() {
            if (provider.blockNumber >= blockNumber) {
              return resolve(provider);
            }
            if (config.cancelled) {
              return resolve(null);
            }
            return resolve(undefined);
          }), 0);
        }))), {
          oncePoll: provider
        });
      }
      async function getRunner(config, currentBlockNumber, method, params) {
        let provider = config.provider;
        switch (method) {
         case "getBlockNumber":
         case "getGasPrice":
          return provider[method]();

         case "getEtherPrice":
          if (provider.getEtherPrice) {
            return provider.getEtherPrice();
          }
          break;

         case "getBalance":
         case "getTransactionCount":
         case "getCode":
          if (params.blockTag && (0, bytes_1.isHexString)(params.blockTag)) {
            provider = await waitForSync(config, currentBlockNumber);
          }
          return provider[method](params.address, params.blockTag || "latest");

         case "getStorageAt":
          if (params.blockTag && (0, bytes_1.isHexString)(params.blockTag)) {
            provider = await waitForSync(config, currentBlockNumber);
          }
          return provider.getStorageAt(params.address, params.position, params.blockTag || "latest");

         case "getBlock":
          if (params.blockTag && (0, bytes_1.isHexString)(params.blockTag)) {
            provider = await waitForSync(config, currentBlockNumber);
          }
          return provider[params.includeTransactions ? "getBlockWithTransactions" : "getBlock"](params.blockTag || params.blockHash);

         case "call":
         case "estimateGas":
          if (params.blockTag && (0, bytes_1.isHexString)(params.blockTag)) {
            provider = await waitForSync(config, currentBlockNumber);
          }
          if (method === "call" && params.blockTag) {
            return provider[method](params.transaction, params.blockTag);
          }
          return provider[method](params.transaction);

         case "getTransaction":
         case "getTransactionReceipt":
          return provider[method](params.transactionHash);

         case "getLogs":
          {
            let filter = params.filter;
            if (filter.fromBlock && (0, bytes_1.isHexString)(filter.fromBlock) || filter.toBlock && (0, 
            bytes_1.isHexString)(filter.toBlock)) {
              provider = await waitForSync(config, currentBlockNumber);
            }
            return provider.getLogs(filter);
          }
        }
        return logger.throwError("unknown method error", logger_1.Logger.errors.UNKNOWN_ERROR, {
          method,
          params
        });
      }
      class FallbackProvider extends base_provider_1.BaseProvider {
        constructor(providers, quorum) {
          if (providers.length === 0) {
            logger.throwArgumentError("missing providers", "providers", providers);
          }
          const providerConfigs = providers.map(((configOrProvider, index) => {
            if (abstract_provider_1.Provider.isProvider(configOrProvider)) {
              const stallTimeout = (0, formatter_1.isCommunityResource)(configOrProvider) ? 2e3 : 750;
              const priority = 1;
              return Object.freeze({
                provider: configOrProvider,
                weight: 1,
                stallTimeout,
                priority
              });
            }
            const config = (0, properties_1.shallowCopy)(configOrProvider);
            if (config.priority == null) {
              config.priority = 1;
            }
            if (config.stallTimeout == null) {
              config.stallTimeout = (0, formatter_1.isCommunityResource)(configOrProvider) ? 2e3 : 750;
            }
            if (config.weight == null) {
              config.weight = 1;
            }
            const weight = config.weight;
            if (weight % 1 || weight > 512 || weight < 1) {
              logger.throwArgumentError("invalid weight; must be integer in [1, 512]", `providers[${index}].weight`, weight);
            }
            return Object.freeze(config);
          }));
          const total = providerConfigs.reduce(((accum, c) => accum + c.weight), 0);
          if (quorum == null) {
            quorum = total / 2;
          } else if (quorum > total) {
            logger.throwArgumentError("quorum will always fail; larger than total weight", "quorum", quorum);
          }
          let networkOrReady = checkNetworks(providerConfigs.map((c => c.provider.network)));
          if (networkOrReady == null) {
            networkOrReady = new Promise(((resolve, reject) => {
              setTimeout((() => {
                this.detectNetwork().then(resolve, reject);
              }), 0);
            }));
          }
          super(networkOrReady);
          (0, properties_1.defineReadOnly)(this, "providerConfigs", Object.freeze(providerConfigs));
          (0, properties_1.defineReadOnly)(this, "quorum", quorum);
          this._highestBlockNumber = -1;
        }
        async detectNetwork() {
          const networks = await Promise.all(this.providerConfigs.map((c => c.provider.getNetwork())));
          return checkNetworks(networks);
        }
        async perform(method, params) {
          if (method === "sendTransaction") {
            const results = await Promise.all(this.providerConfigs.map((c => c.provider.sendTransaction(params.signedTransaction).then((result => result.hash), (error => error)))));
            for (let i = 0; i < results.length; i++) {
              const result = results[i];
              if (typeof result === "string") {
                return result;
              }
            }
            throw results[0];
          }
          if (this._highestBlockNumber === -1 && method !== "getBlockNumber") {
            await this.getBlockNumber();
          }
          const processFunc = getProcessFunc(this, method, params);
          const configs = (0, random_1.shuffled)(this.providerConfigs.map(properties_1.shallowCopy));
          configs.sort(((a, b) => a.priority - b.priority));
          const currentBlockNumber = this._highestBlockNumber;
          let i = 0;
          let first = true;
          while (true) {
            const t0 = now();
            let inflightWeight = configs.filter((c => c.runner && t0 - c.start < c.stallTimeout)).reduce(((accum, c) => accum + c.weight), 0);
            while (inflightWeight < this.quorum && i < configs.length) {
              const config = configs[i++];
              const rid = nextRid++;
              config.start = now();
              config.staller = stall(config.stallTimeout);
              config.staller.wait((() => {
                config.staller = null;
              }));
              config.runner = getRunner(config, currentBlockNumber, method, params).then((result => {
                config.done = true;
                config.result = result;
                if (this.listenerCount("debug")) {
                  this.emit("debug", {
                    action: "request",
                    rid,
                    backend: exposeDebugConfig(config, now()),
                    request: {
                      method,
                      params: (0, properties_1.deepCopy)(params)
                    },
                    provider: this
                  });
                }
              }), (error => {
                config.done = true;
                config.error = error;
                if (this.listenerCount("debug")) {
                  this.emit("debug", {
                    action: "request",
                    rid,
                    backend: exposeDebugConfig(config, now()),
                    request: {
                      method,
                      params: (0, properties_1.deepCopy)(params)
                    },
                    provider: this
                  });
                }
              }));
              if (this.listenerCount("debug")) {
                this.emit("debug", {
                  action: "request",
                  rid,
                  backend: exposeDebugConfig(config, null),
                  request: {
                    method,
                    params: (0, properties_1.deepCopy)(params)
                  },
                  provider: this
                });
              }
              inflightWeight += config.weight;
            }
            const waiting = [];
            configs.forEach((c => {
              if (c.done || !c.runner) {
                return;
              }
              waiting.push(c.runner);
              if (c.staller) {
                waiting.push(c.staller.getPromise());
              }
            }));
            if (waiting.length) {
              await Promise.race(waiting);
            }
            const results = configs.filter((c => c.done && c.error == null));
            if (results.length >= this.quorum) {
              const result = processFunc(results);
              if (result !== undefined) {
                configs.forEach((c => {
                  if (c.staller) {
                    c.staller.cancel();
                  }
                  c.cancelled = true;
                }));
                return result;
              }
              if (!first) {
                await stall(100).getPromise();
              }
              first = false;
            }
            const errors = configs.reduce(((accum, c) => {
              if (!c.done || c.error == null) {
                return accum;
              }
              const code = c.error.code;
              if (ForwardErrors.indexOf(code) >= 0) {
                if (!accum[code]) {
                  accum[code] = {
                    error: c.error,
                    weight: 0
                  };
                }
                accum[code].weight += c.weight;
              }
              return accum;
            }), {});
            Object.keys(errors).forEach((errorCode => {
              const tally = errors[errorCode];
              if (tally.weight < this.quorum) {
                return;
              }
              configs.forEach((c => {
                if (c.staller) {
                  c.staller.cancel();
                }
                c.cancelled = true;
              }));
              const e = tally.error;
              const props = {};
              ForwardProperties.forEach((name => {
                if (e[name] == null) {
                  return;
                }
                props[name] = e[name];
              }));
              logger.throwError(e.reason || e.message, errorCode, props);
            }));
            if (configs.filter((c => !c.done)).length === 0) {
              break;
            }
          }
          configs.forEach((c => {
            if (c.staller) {
              c.staller.cancel();
            }
            c.cancelled = true;
          }));
          return logger.throwError("failed to meet quorum", logger_1.Logger.errors.SERVER_ERROR, {
            method,
            params,
            results: configs.map((c => exposeDebugConfig(c))),
            provider: this
          });
        }
      }
      exports.FallbackProvider = FallbackProvider;
    },
    4915(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.showThrottleMessage = exports.isCommunityResource = exports.isCommunityResourcable = exports.Formatter = void 0;
      const address_1 = __webpack_require__(171);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const constants_1 = __webpack_require__(846);
      const properties_1 = __webpack_require__(1476);
      const transactions_1 = __webpack_require__(3776);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      class Formatter {
        constructor() {
          this.formats = this.getDefaultFormats();
        }
        getDefaultFormats() {
          const formats = {};
          const address = this.address.bind(this);
          const bigNumber = this.bigNumber.bind(this);
          const blockTag = this.blockTag.bind(this);
          const data = this.data.bind(this);
          const hash = this.hash.bind(this);
          const hex = this.hex.bind(this);
          const number = this.number.bind(this);
          const type = this.type.bind(this);
          const strictData = v => this.data(v, true);
          formats.transaction = {
            hash,
            type,
            accessList: Formatter.allowNull(this.accessList.bind(this), null),
            blockHash: Formatter.allowNull(hash, null),
            blockNumber: Formatter.allowNull(number, null),
            transactionIndex: Formatter.allowNull(number, null),
            confirmations: Formatter.allowNull(number, null),
            from: address,
            gasPrice: Formatter.allowNull(bigNumber),
            maxPriorityFeePerGas: Formatter.allowNull(bigNumber),
            maxFeePerGas: Formatter.allowNull(bigNumber),
            gasLimit: bigNumber,
            to: Formatter.allowNull(address, null),
            value: bigNumber,
            nonce: number,
            data,
            signature: Formatter.allowNull(data),
            publicKey: Formatter.allowNull(data),
            creates: Formatter.allowNull(address, null),
            raw: Formatter.allowNull(data)
          };
          formats.transactionRequest = {
            from: Formatter.allowNull(address),
            nonce: Formatter.allowNull(number),
            gasLimit: Formatter.allowNull(bigNumber),
            gasPrice: Formatter.allowNull(bigNumber),
            maxPriorityFeePerGas: Formatter.allowNull(bigNumber),
            maxFeePerGas: Formatter.allowNull(bigNumber),
            to: Formatter.allowNull(address),
            value: Formatter.allowNull(bigNumber),
            data: Formatter.allowNull(strictData),
            type: Formatter.allowNull(number),
            accessList: Formatter.allowNull(this.accessList.bind(this), null)
          };
          formats.receiptLog = {
            transactionIndex: number,
            blockNumber: number,
            transactionHash: hash,
            address,
            topics: Formatter.arrayOf(hash),
            data,
            logIndex: number,
            blockHash: hash
          };
          formats.receipt = {
            to: Formatter.allowNull(this.address, null),
            from: Formatter.allowNull(this.address, null),
            contractAddress: Formatter.allowNull(address, null),
            transactionIndex: number,
            root: Formatter.allowNull(hex),
            gasUsed: bigNumber,
            logsBloom: Formatter.allowNull(data),
            blockHash: hash,
            transactionHash: hash,
            logs: Formatter.arrayOf(this.receiptLog.bind(this)),
            blockNumber: number,
            confirmations: Formatter.allowNull(number, null),
            cumulativeGasUsed: bigNumber,
            effectiveGasPrice: Formatter.allowNull(bigNumber),
            status: Formatter.allowNull(number),
            type
          };
          formats.block = {
            hash: Formatter.allowNull(hash),
            parentHash: hash,
            number,
            timestamp: number,
            nonce: Formatter.allowNull(hex),
            difficulty: this.difficulty.bind(this),
            gasLimit: bigNumber,
            gasUsed: bigNumber,
            miner: Formatter.allowNull(address),
            extraData: data,
            transactions: Formatter.allowNull(Formatter.arrayOf(hash)),
            baseFeePerGas: Formatter.allowNull(bigNumber)
          };
          formats.blockWithTransactions = (0, properties_1.shallowCopy)(formats.block);
          formats.blockWithTransactions.transactions = Formatter.allowNull(Formatter.arrayOf(this.transactionResponse.bind(this)));
          formats.filter = {
            fromBlock: Formatter.allowNull(blockTag, undefined),
            toBlock: Formatter.allowNull(blockTag, undefined),
            blockHash: Formatter.allowNull(hash, undefined),
            address: Formatter.allowNull(address, undefined),
            topics: Formatter.allowNull(this.topics.bind(this), undefined)
          };
          formats.filterLog = {
            blockNumber: Formatter.allowNull(number),
            blockHash: Formatter.allowNull(hash),
            transactionIndex: number,
            removed: Formatter.allowNull(this.boolean.bind(this)),
            address,
            data: Formatter.allowFalsish(data, "0x"),
            topics: Formatter.arrayOf(hash),
            transactionHash: hash,
            logIndex: number
          };
          return formats;
        }
        accessList(accessList) {
          return (0, transactions_1.accessListify)(accessList || []);
        }
        number(number) {
          if (number === "0x") {
            return 0;
          }
          return bignumber_1.BigNumber.from(number).toNumber();
        }
        type(number) {
          if (number === "0x" || number == null) {
            return 0;
          }
          return bignumber_1.BigNumber.from(number).toNumber();
        }
        bigNumber(value) {
          return bignumber_1.BigNumber.from(value);
        }
        boolean(value) {
          if (typeof value === "boolean") {
            return value;
          }
          if (typeof value === "string") {
            value = value.toLowerCase();
            if (value === "true") {
              return true;
            }
            if (value === "false") {
              return false;
            }
          }
          throw new Error("invalid boolean - " + value);
        }
        hex(value, strict) {
          if (typeof value === "string") {
            if (!strict && value.substring(0, 2) !== "0x") {
              value = "0x" + value;
            }
            if ((0, bytes_1.isHexString)(value)) {
              return value.toLowerCase();
            }
          }
          return logger.throwArgumentError("invalid hash", "value", value);
        }
        data(value, strict) {
          const result = this.hex(value, strict);
          if (result.length % 2 !== 0) {
            throw new Error("invalid data; odd-length - " + value);
          }
          return result;
        }
        address(value) {
          return (0, address_1.getAddress)(value);
        }
        callAddress(value) {
          if (!(0, bytes_1.isHexString)(value, 32)) {
            return null;
          }
          const address = (0, address_1.getAddress)(value);
          return address === constants_1.AddressZero ? null : address;
        }
        contractAddress(value) {
          return (0, address_1.getContractAddress)(value);
        }
        blockTag(blockTag) {
          if (blockTag == null) {
            return "latest";
          }
          if (blockTag === "earliest") {
            return "0x0";
          }
          switch (blockTag) {
           case "earliest":
            return "0x0";

           case "latest":
           case "pending":
           case "safe":
           case "finalized":
            return blockTag;
          }
          if (typeof blockTag === "number" || (0, bytes_1.isHexString)(blockTag)) {
            return (0, bytes_1.hexValue)(blockTag);
          }
          throw new Error("invalid blockTag");
        }
        hash(value, strict) {
          const result = this.hex(value, strict);
          if ((0, bytes_1.hexDataLength)(result) !== 32) {
            return logger.throwArgumentError("invalid hash", "value", value);
          }
          return result;
        }
        difficulty(value) {
          if (value == null) {
            return null;
          }
          const v = bignumber_1.BigNumber.from(value);
          try {
            return v.toNumber();
          } catch (error) {}
          return null;
        }
        uint256(value) {
          if (!(0, bytes_1.isHexString)(value)) {
            throw new Error("invalid uint256");
          }
          return (0, bytes_1.hexZeroPad)(value, 32);
        }
        _block(value, format) {
          if (value.author != null && value.miner == null) {
            value.miner = value.author;
          }
          const difficulty = value._difficulty != null ? value._difficulty : value.difficulty;
          const result = Formatter.check(format, value);
          result._difficulty = difficulty == null ? null : bignumber_1.BigNumber.from(difficulty);
          return result;
        }
        block(value) {
          return this._block(value, this.formats.block);
        }
        blockWithTransactions(value) {
          return this._block(value, this.formats.blockWithTransactions);
        }
        transactionRequest(value) {
          return Formatter.check(this.formats.transactionRequest, value);
        }
        transactionResponse(transaction) {
          if (transaction.gas != null && transaction.gasLimit == null) {
            transaction.gasLimit = transaction.gas;
          }
          if (transaction.to && bignumber_1.BigNumber.from(transaction.to).isZero()) {
            transaction.to = "0x0000000000000000000000000000000000000000000000000000000000000000";
          }
          if (transaction.input != null && transaction.data == null) {
            transaction.data = transaction.input;
          }
          if (transaction.to == null && transaction.creates == null) {
            transaction.creates = this.contractAddress(transaction);
          }
          if ((transaction.type === 1 || transaction.type === 2) && transaction.accessList == null) {
            transaction.accessList = [];
          }
          const result = Formatter.check(this.formats.transaction, transaction);
          if (transaction.chainId != null) {
            let chainId = transaction.chainId;
            if ((0, bytes_1.isHexString)(chainId)) {
              chainId = bignumber_1.BigNumber.from(chainId).toNumber();
            }
            result.chainId = chainId;
          } else {
            let chainId = transaction.networkId;
            if (chainId == null) {
              chainId = transaction.chainId;
            }
            if ((0, bytes_1.isHexString)(chainId)) {
              chainId = bignumber_1.BigNumber.from(chainId).toNumber();
            }
            if (typeof chainId !== "number") {
              chainId = 0;
            }
            if (typeof chainId !== "number") {
              chainId = 0;
            }
            result.chainId = chainId;
          }
          if (result.blockHash && result.blockHash.replace(/0/g, "") === "x") {
            result.blockHash = null;
          }
          return result;
        }
        transaction(value) {
          return (0, transactions_1.parse)(value);
        }
        receiptLog(value) {
          return Formatter.check(this.formats.receiptLog, value);
        }
        receipt(value) {
          const result = Formatter.check(this.formats.receipt, value);
          if (result.root != null) {
            if (result.root.length <= 4) {
              const value = bignumber_1.BigNumber.from(result.root).toNumber();
              if (value === 0 || value === 1) {
                if (result.status != null && result.status !== value) {
                  logger.throwArgumentError("alt-root-status/status mismatch", "value", {
                    root: result.root,
                    status: result.status
                  });
                }
                result.status = value;
                delete result.root;
              } else {
                logger.throwArgumentError("invalid alt-root-status", "value.root", result.root);
              }
            } else if (result.root.length !== 66) {
              logger.throwArgumentError("invalid root hash", "value.root", result.root);
            }
          }
          if (result.status != null) {
            result.byzantium = true;
          }
          return result;
        }
        topics(value) {
          if (Array.isArray(value)) {
            return value.map((v => this.topics(v)));
          } else if (value != null) {
            return this.hash(value, true);
          }
          return null;
        }
        filter(value) {
          return Formatter.check(this.formats.filter, value);
        }
        filterLog(value) {
          return Formatter.check(this.formats.filterLog, value);
        }
        static check(format, object) {
          const result = {};
          for (const key in format) {
            try {
              const value = format[key](object[key]);
              if (value !== undefined) {
                result[key] = value;
              }
            } catch (error) {
              error.checkKey = key;
              error.checkValue = object[key];
              throw error;
            }
          }
          return result;
        }
        static allowNull(format, nullValue) {
          return function(value) {
            if (value == null) {
              return nullValue;
            }
            return format(value);
          };
        }
        static allowFalsish(format, replaceValue) {
          return function(value) {
            if (!value) {
              return replaceValue;
            }
            return format(value);
          };
        }
        static arrayOf(format) {
          return function(array) {
            if (!Array.isArray(array)) {
              throw new Error("not an array");
            }
            const result = [];
            array.forEach((function(value) {
              result.push(format(value));
            }));
            return result;
          };
        }
      }
      exports.Formatter = Formatter;
      function isCommunityResourcable(value) {
        return value && typeof value.isCommunityResource === "function";
      }
      exports.isCommunityResourcable = isCommunityResourcable;
      function isCommunityResource(value) {
        return isCommunityResourcable(value) && value.isCommunityResource();
      }
      exports.isCommunityResource = isCommunityResource;
      let throttleMessage = false;
      function showThrottleMessage() {
        if (throttleMessage) {
          return;
        }
        throttleMessage = true;
        console.log("========= NOTICE =========");
        console.log("Request-Rate Exceeded  (this message will not be repeated)");
        console.log("");
        console.log("The default API keys for each service are provided as a highly-throttled,");
        console.log("community resource for low-traffic projects and early prototyping.");
        console.log("");
        console.log("While your application will continue to function, we highly recommended");
        console.log("signing up for your own API keys to improve performance, increase your");
        console.log("request rate/limit and enable other perks, such as metrics and advanced APIs.");
        console.log("");
        console.log("For more details: https://docs.ethers.io/api-keys/");
        console.log("==========================");
      }
      exports.showThrottleMessage = showThrottleMessage;
    },
    7649(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Formatter = exports.showThrottleMessage = exports.isCommunityResourcable = exports.isCommunityResource = exports.getNetwork = exports.getDefaultProvider = exports.JsonRpcSigner = exports.IpcProvider = exports.WebSocketProvider = exports.Web3Provider = exports.StaticJsonRpcProvider = exports.JsonRpcBatchProvider = exports.JsonRpcProvider = exports.FallbackProvider = exports.UrlJsonRpcProvider = exports.Resolver = exports.BaseProvider = exports.Provider = void 0;
      const abstract_provider_1 = __webpack_require__(103);
      Object.defineProperty(exports, "Provider", {
        enumerable: true,
        get: function() {
          return abstract_provider_1.Provider;
        }
      });
      const networks_1 = __webpack_require__(2510);
      Object.defineProperty(exports, "getNetwork", {
        enumerable: true,
        get: function() {
          return networks_1.getNetwork;
        }
      });
      const base_provider_1 = __webpack_require__(7408);
      Object.defineProperty(exports, "BaseProvider", {
        enumerable: true,
        get: function() {
          return base_provider_1.BaseProvider;
        }
      });
      Object.defineProperty(exports, "Resolver", {
        enumerable: true,
        get: function() {
          return base_provider_1.Resolver;
        }
      });
      const fallback_provider_1 = __webpack_require__(2649);
      Object.defineProperty(exports, "FallbackProvider", {
        enumerable: true,
        get: function() {
          return fallback_provider_1.FallbackProvider;
        }
      });
      const ipc_provider_1 = __webpack_require__(1426);
      Object.defineProperty(exports, "IpcProvider", {
        enumerable: true,
        get: function() {
          return ipc_provider_1.IpcProvider;
        }
      });
      const json_rpc_provider_1 = __webpack_require__(535);
      Object.defineProperty(exports, "JsonRpcProvider", {
        enumerable: true,
        get: function() {
          return json_rpc_provider_1.JsonRpcProvider;
        }
      });
      Object.defineProperty(exports, "JsonRpcSigner", {
        enumerable: true,
        get: function() {
          return json_rpc_provider_1.JsonRpcSigner;
        }
      });
      const json_rpc_batch_provider_1 = __webpack_require__(9904);
      Object.defineProperty(exports, "JsonRpcBatchProvider", {
        enumerable: true,
        get: function() {
          return json_rpc_batch_provider_1.JsonRpcBatchProvider;
        }
      });
      const url_json_rpc_provider_1 = __webpack_require__(3839);
      Object.defineProperty(exports, "StaticJsonRpcProvider", {
        enumerable: true,
        get: function() {
          return url_json_rpc_provider_1.StaticJsonRpcProvider;
        }
      });
      Object.defineProperty(exports, "UrlJsonRpcProvider", {
        enumerable: true,
        get: function() {
          return url_json_rpc_provider_1.UrlJsonRpcProvider;
        }
      });
      const web3_provider_1 = __webpack_require__(7254);
      Object.defineProperty(exports, "Web3Provider", {
        enumerable: true,
        get: function() {
          return web3_provider_1.Web3Provider;
        }
      });
      const websocket_provider_1 = __webpack_require__(4518);
      Object.defineProperty(exports, "WebSocketProvider", {
        enumerable: true,
        get: function() {
          return websocket_provider_1.WebSocketProvider;
        }
      });
      const formatter_1 = __webpack_require__(4915);
      Object.defineProperty(exports, "Formatter", {
        enumerable: true,
        get: function() {
          return formatter_1.Formatter;
        }
      });
      Object.defineProperty(exports, "isCommunityResourcable", {
        enumerable: true,
        get: function() {
          return formatter_1.isCommunityResourcable;
        }
      });
      Object.defineProperty(exports, "isCommunityResource", {
        enumerable: true,
        get: function() {
          return formatter_1.isCommunityResource;
        }
      });
      Object.defineProperty(exports, "showThrottleMessage", {
        enumerable: true,
        get: function() {
          return formatter_1.showThrottleMessage;
        }
      });
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      function getDefaultProvider(network, options) {
        if (network == null) {
          network = "zeus";
        }
        if (typeof network === "string") {
          const match = network.match(/^(ws|http)s?:/i);
          if (match) {
            switch (match[1].toLowerCase()) {
             case "http":
             case "https":
              return new json_rpc_provider_1.JsonRpcProvider(network);

             case "ws":
             case "wss":
              return new websocket_provider_1.WebSocketProvider(network);

             default:
              logger.throwArgumentError("unsupported URL scheme", "network", network);
            }
          }
        }
        const n = (0, networks_1.getNetwork)(network);
        if (!n || !n._defaultProvider) {
          logger.throwError("unsupported getDefaultProvider network", logger_1.Logger.errors.NETWORK_ERROR, {
            operation: "getDefaultProvider",
            network
          });
        }
        return n._defaultProvider({
          FallbackProvider: fallback_provider_1.FallbackProvider,
          JsonRpcProvider: json_rpc_provider_1.JsonRpcProvider,
          Web3Provider: web3_provider_1.Web3Provider,
          IpcProvider: ipc_provider_1.IpcProvider
        }, options);
      }
      exports.getDefaultProvider = getDefaultProvider;
    },
    9904(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.JsonRpcBatchProvider = void 0;
      const properties_1 = __webpack_require__(1476);
      const web_1 = __webpack_require__(6637);
      const json_rpc_provider_1 = __webpack_require__(535);
      class JsonRpcBatchProvider extends json_rpc_provider_1.JsonRpcProvider {
        send(method, params) {
          const request = {
            method,
            params,
            id: this._nextId++,
            jsonrpc: "2.0"
          };
          if (this._pendingBatch == null) {
            this._pendingBatch = [];
          }
          const inflightRequest = {
            request,
            resolve: null,
            reject: null
          };
          const promise = new Promise(((resolve, reject) => {
            inflightRequest.resolve = resolve;
            inflightRequest.reject = reject;
          }));
          this._pendingBatch.push(inflightRequest);
          if (!this._pendingBatchAggregator) {
            this._pendingBatchAggregator = setTimeout((() => {
              const batch = this._pendingBatch;
              this._pendingBatch = null;
              this._pendingBatchAggregator = null;
              const request = batch.map((inflight => inflight.request));
              this.emit("debug", {
                action: "requestBatch",
                request: (0, properties_1.deepCopy)(request),
                provider: this
              });
              return (0, web_1.fetchJson)(this.connection, JSON.stringify(request)).then((result => {
                this.emit("debug", {
                  action: "response",
                  request,
                  response: result,
                  provider: this
                });
                batch.forEach(((inflightRequest, index) => {
                  const payload = result[index];
                  if (payload.error) {
                    const error = new Error(payload.error.message);
                    error.code = payload.error.code;
                    error.data = payload.error.data;
                    inflightRequest.reject(error);
                  } else {
                    inflightRequest.resolve(payload.result);
                  }
                }));
              }), (error => {
                this.emit("debug", {
                  action: "response",
                  error,
                  request,
                  provider: this
                });
                batch.forEach((inflightRequest => {
                  inflightRequest.reject(error);
                }));
              }));
            }), 10);
          }
          return promise;
        }
      }
      exports.JsonRpcBatchProvider = JsonRpcBatchProvider;
    },
    535(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.JsonRpcProvider = exports.JsonRpcSigner = void 0;
      const abstract_signer_1 = __webpack_require__(8788);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const hash_1 = __webpack_require__(413);
      const properties_1 = __webpack_require__(1476);
      const strings_1 = __webpack_require__(2509);
      const transactions_1 = __webpack_require__(3776);
      const web_1 = __webpack_require__(6637);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      const base_provider_1 = __webpack_require__(7408);
      const errorGas = [ "call", "estimateGas" ];
      function spelunk(value, requireData) {
        if (value == null) {
          return null;
        }
        if (typeof value.message === "string" && value.message.match("reverted")) {
          const data = (0, bytes_1.isHexString)(value.data) ? value.data : null;
          if (!requireData || data) {
            return {
              message: value.message,
              data
            };
          }
        }
        if (typeof value === "object") {
          for (const key in value) {
            const result = spelunk(value[key], requireData);
            if (result) {
              return result;
            }
          }
          return null;
        }
        if (typeof value === "string") {
          try {
            return spelunk(JSON.parse(value), requireData);
          } catch (error) {}
        }
        return null;
      }
      function checkError(method, error, params) {
        const transaction = params.transaction || params.signedTransaction;
        if (method === "call") {
          const result = spelunk(error, true);
          if (result) {
            return result.data;
          }
          logger.throwError("missing revert data in call exception; Transaction reverted without a reason string", logger_1.Logger.errors.CALL_EXCEPTION, {
            data: "0x",
            transaction,
            error
          });
        }
        if (method === "estimateGas") {
          let result = spelunk(error.body, false);
          if (result == null) {
            result = spelunk(error, false);
          }
          if (result) {
            logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", logger_1.Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
              reason: result.message,
              method,
              transaction,
              error
            });
          }
        }
        let message = error.message;
        if (error.code === logger_1.Logger.errors.SERVER_ERROR && error.error && typeof error.error.message === "string") {
          message = error.error.message;
        } else if (typeof error.body === "string") {
          message = error.body;
        } else if (typeof error.responseText === "string") {
          message = error.responseText;
        }
        message = (message || "").toLowerCase();
        if (message.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)) {
          logger.throwError("insufficient funds for intrinsic transaction cost", logger_1.Logger.errors.INSUFFICIENT_FUNDS, {
            error,
            method,
            transaction
          });
        }
        if (message.match(/nonce (is )?too low/i)) {
          logger.throwError("nonce has already been used", logger_1.Logger.errors.NONCE_EXPIRED, {
            error,
            method,
            transaction
          });
        }
        if (message.match(/replacement transaction underpriced|transaction gas price.*too low/i)) {
          logger.throwError("replacement fee too low", logger_1.Logger.errors.REPLACEMENT_UNDERPRICED, {
            error,
            method,
            transaction
          });
        }
        if (message.match(/only replay-protected/i)) {
          logger.throwError("legacy pre-eip-155 transactions not supported", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            error,
            method,
            transaction
          });
        }
        if (errorGas.indexOf(method) >= 0 && message.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)) {
          logger.throwError("cannot estimate gas; transaction may fail or may require manual gas limit", logger_1.Logger.errors.UNPREDICTABLE_GAS_LIMIT, {
            error,
            method,
            transaction
          });
        }
        throw error;
      }
      function timer(timeout) {
        return new Promise((function(resolve) {
          setTimeout(resolve, timeout);
        }));
      }
      function getResult(payload) {
        if (payload.error) {
          const error = new Error(payload.error.message);
          error.code = payload.error.code;
          error.data = payload.error.data;
          throw error;
        }
        return payload.result;
      }
      function getLowerCase(value) {
        if (value) {
          return value.toLowerCase();
        }
        return value;
      }
      const _constructorGuard = {};
      class JsonRpcSigner extends abstract_signer_1.Signer {
        constructor(constructorGuard, provider, addressOrIndex) {
          super();
          if (constructorGuard !== _constructorGuard) {
            throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");
          }
          (0, properties_1.defineReadOnly)(this, "provider", provider);
          if (addressOrIndex == null) {
            addressOrIndex = 0;
          }
          if (typeof addressOrIndex === "string") {
            (0, properties_1.defineReadOnly)(this, "_address", this.provider.formatter.address(addressOrIndex));
            (0, properties_1.defineReadOnly)(this, "_index", null);
          } else if (typeof addressOrIndex === "number") {
            (0, properties_1.defineReadOnly)(this, "_index", addressOrIndex);
            (0, properties_1.defineReadOnly)(this, "_address", null);
          } else {
            logger.throwArgumentError("invalid address or index", "addressOrIndex", addressOrIndex);
          }
        }
        connect(provider) {
          return logger.throwError("cannot alter JSON-RPC Signer connection", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "connect"
          });
        }
        connectUnchecked() {
          return new UncheckedJsonRpcSigner(_constructorGuard, this.provider, this._address || this._index);
        }
        getAddress() {
          if (this._address) {
            return Promise.resolve(this._address);
          }
          return this.provider.send("eth_accounts", []).then((accounts => {
            if (accounts.length <= this._index) {
              logger.throwError("unknown account #" + this._index, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                operation: "getAddress"
              });
            }
            return this.provider.formatter.address(accounts[this._index]);
          }));
        }
        sendUncheckedTransaction(transaction) {
          transaction = (0, properties_1.shallowCopy)(transaction);
          const fromAddress = this.getAddress().then((address => {
            if (address) {
              address = address.toLowerCase();
            }
            return address;
          }));
          if (transaction.gasLimit == null) {
            const estimate = (0, properties_1.shallowCopy)(transaction);
            estimate.from = fromAddress;
            transaction.gasLimit = this.provider.estimateGas(estimate);
          }
          if (transaction.to != null) {
            transaction.to = Promise.resolve(transaction.to).then((async to => {
              if (to == null) {
                return null;
              }
              const address = await this.provider.resolveName(to);
              if (address == null) {
                logger.throwArgumentError("provided ENS name resolves to null", "tx.to", to);
              }
              return address;
            }));
          }
          return (0, properties_1.resolveProperties)({
            tx: (0, properties_1.resolveProperties)(transaction),
            sender: fromAddress
          }).then((({tx, sender}) => {
            if (tx.from != null) {
              if (tx.from.toLowerCase() !== sender) {
                logger.throwArgumentError("from address mismatch", "transaction", transaction);
              }
            } else {
              tx.from = sender;
            }
            const hexTx = this.provider.constructor.hexlifyTransaction(tx, {
              from: true
            });
            return this.provider.send("eth_sendTransaction", [ hexTx ]).then((hash => hash), (error => {
              if (typeof error.message === "string" && error.message.match(/user denied/i)) {
                logger.throwError("user rejected transaction", logger_1.Logger.errors.ACTION_REJECTED, {
                  action: "sendTransaction",
                  transaction: tx
                });
              }
              return checkError("sendTransaction", error, hexTx);
            }));
          }));
        }
        signTransaction(transaction) {
          return logger.throwError("signing transactions is unsupported", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "signTransaction"
          });
        }
        async sendTransaction(transaction) {
          const blockNumber = await this.provider._getInternalBlockNumber(100 + 2 * this.provider.pollingInterval);
          const hash = await this.sendUncheckedTransaction(transaction);
          try {
            return await (0, web_1.poll)((async () => {
              const tx = await this.provider.getTransaction(hash);
              if (tx === null) {
                return undefined;
              }
              return this.provider._wrapTransaction(tx, hash, blockNumber);
            }), {
              oncePoll: this.provider
            });
          } catch (error) {
            error.transactionHash = hash;
            throw error;
          }
        }
        async signMessage(message) {
          const data = typeof message === "string" ? (0, strings_1.toUtf8Bytes)(message) : message;
          const address = await this.getAddress();
          try {
            return await this.provider.send("personal_sign", [ (0, bytes_1.hexlify)(data), address.toLowerCase() ]);
          } catch (error) {
            if (typeof error.message === "string" && error.message.match(/user denied/i)) {
              logger.throwError("user rejected signing", logger_1.Logger.errors.ACTION_REJECTED, {
                action: "signMessage",
                from: address,
                messageData: message
              });
            }
            throw error;
          }
        }
        async _legacySignMessage(message) {
          const data = typeof message === "string" ? (0, strings_1.toUtf8Bytes)(message) : message;
          const address = await this.getAddress();
          try {
            return await this.provider.send("eth_sign", [ address.toLowerCase(), (0, bytes_1.hexlify)(data) ]);
          } catch (error) {
            if (typeof error.message === "string" && error.message.match(/user denied/i)) {
              logger.throwError("user rejected signing", logger_1.Logger.errors.ACTION_REJECTED, {
                action: "_legacySignMessage",
                from: address,
                messageData: message
              });
            }
            throw error;
          }
        }
        async _signTypedData(domain, types, value) {
          const populated = await hash_1._TypedDataEncoder.resolveNames(domain, types, value, (name => this.provider.resolveName(name)));
          const address = await this.getAddress();
          try {
            return await this.provider.send("eth_signTypedData_v4", [ address.toLowerCase(), JSON.stringify(hash_1._TypedDataEncoder.getPayload(populated.domain, types, populated.value)) ]);
          } catch (error) {
            if (typeof error.message === "string" && error.message.match(/user denied/i)) {
              logger.throwError("user rejected signing", logger_1.Logger.errors.ACTION_REJECTED, {
                action: "_signTypedData",
                from: address,
                messageData: {
                  domain: populated.domain,
                  types,
                  value: populated.value
                }
              });
            }
            throw error;
          }
        }
        async unlock(password) {
          const provider = this.provider;
          const address = await this.getAddress();
          return provider.send("personal_unlockAccount", [ address.toLowerCase(), password, null ]);
        }
      }
      exports.JsonRpcSigner = JsonRpcSigner;
      class UncheckedJsonRpcSigner extends JsonRpcSigner {
        sendTransaction(transaction) {
          return this.sendUncheckedTransaction(transaction).then((hash => ({
            hash,
            nonce: null,
            gasLimit: null,
            gasPrice: null,
            data: null,
            value: null,
            chainId: null,
            confirmations: 0,
            from: null,
            wait: confirmations => this.provider.waitForTransaction(hash, confirmations)
          })));
        }
      }
      const allowedTransactionKeys = {
        chainId: true,
        data: true,
        gasLimit: true,
        gasPrice: true,
        nonce: true,
        to: true,
        value: true,
        type: true,
        accessList: true,
        maxFeePerGas: true,
        maxPriorityFeePerGas: true
      };
      class JsonRpcProvider extends base_provider_1.BaseProvider {
        constructor(url, network) {
          let networkOrReady = network;
          if (networkOrReady == null) {
            networkOrReady = new Promise(((resolve, reject) => {
              setTimeout((() => {
                this.detectNetwork().then((network => {
                  resolve(network);
                }), (error => {
                  reject(error);
                }));
              }), 0);
            }));
          }
          super(networkOrReady);
          if (!url) {
            url = (0, properties_1.getStatic)(this.constructor, "defaultUrl")();
          }
          if (typeof url === "string") {
            (0, properties_1.defineReadOnly)(this, "connection", Object.freeze({
              url
            }));
          } else {
            (0, properties_1.defineReadOnly)(this, "connection", Object.freeze((0, properties_1.shallowCopy)(url)));
          }
          this._nextId = 42;
        }
        get _cache() {
          if (this._eventLoopCache == null) {
            this._eventLoopCache = {};
          }
          return this._eventLoopCache;
        }
        static defaultUrl() {
          return "http://localhost:8545";
        }
        detectNetwork() {
          if (!this._cache["detectNetwork"]) {
            this._cache["detectNetwork"] = this._uncachedDetectNetwork();
            setTimeout((() => {
              this._cache["detectNetwork"] = null;
            }), 0);
          }
          return this._cache["detectNetwork"];
        }
        async _uncachedDetectNetwork() {
          await timer(0);
          let chainId = null;
          try {
            chainId = await this.send("eth_chainId", []);
          } catch (error) {
            try {
              chainId = await this.send("net_version", []);
            } catch (error) {}
          }
          if (chainId != null) {
            const getNetwork = (0, properties_1.getStatic)(this.constructor, "getNetwork");
            try {
              return getNetwork(bignumber_1.BigNumber.from(chainId).toNumber());
            } catch (error) {
              return logger.throwError("could not detect network", logger_1.Logger.errors.NETWORK_ERROR, {
                chainId,
                event: "invalidNetwork",
                serverError: error
              });
            }
          }
          return logger.throwError("could not detect network", logger_1.Logger.errors.NETWORK_ERROR, {
            event: "noNetwork"
          });
        }
        getSigner(addressOrIndex) {
          return new JsonRpcSigner(_constructorGuard, this, addressOrIndex);
        }
        getUncheckedSigner(addressOrIndex) {
          return this.getSigner(addressOrIndex).connectUnchecked();
        }
        listAccounts() {
          return this.send("eth_accounts", []).then((accounts => accounts.map((a => this.formatter.address(a)))));
        }
        send(method, params) {
          const request = {
            method,
            params,
            id: this._nextId++,
            jsonrpc: "2.0"
          };
          this.emit("debug", {
            action: "request",
            request: (0, properties_1.deepCopy)(request),
            provider: this
          });
          const cache = [ "eth_chainId", "eth_blockNumber" ].indexOf(method) >= 0;
          if (cache && this._cache[method]) {
            return this._cache[method];
          }
          const result = (0, web_1.fetchJson)(this.connection, JSON.stringify(request), getResult).then((result => {
            this.emit("debug", {
              action: "response",
              request,
              response: result,
              provider: this
            });
            return result;
          }), (error => {
            this.emit("debug", {
              action: "response",
              error,
              request,
              provider: this
            });
            throw error;
          }));
          if (cache) {
            this._cache[method] = result;
            setTimeout((() => {
              this._cache[method] = null;
            }), 0);
          }
          return result;
        }
        prepareRequest(method, params) {
          switch (method) {
           case "getBlockNumber":
            return [ "eth_blockNumber", [] ];

           case "getGasPrice":
            return [ "eth_gasPrice", [] ];

           case "getBalance":
            return [ "eth_getBalance", [ getLowerCase(params.address), params.blockTag ] ];

           case "getTransactionCount":
            return [ "eth_getTransactionCount", [ getLowerCase(params.address), params.blockTag ] ];

           case "getCode":
            return [ "eth_getCode", [ getLowerCase(params.address), params.blockTag ] ];

           case "getStorageAt":
            return [ "eth_getStorageAt", [ getLowerCase(params.address), (0, bytes_1.hexZeroPad)(params.position, 32), params.blockTag ] ];

           case "sendTransaction":
            return [ "eth_sendRawTransaction", [ params.signedTransaction ] ];

           case "getBlock":
            if (params.blockTag) {
              return [ "eth_getBlockByNumber", [ params.blockTag, !!params.includeTransactions ] ];
            } else if (params.blockHash) {
              return [ "eth_getBlockByHash", [ params.blockHash, !!params.includeTransactions ] ];
            }
            return null;

           case "getTransaction":
            return [ "eth_getTransactionByHash", [ params.transactionHash ] ];

           case "getTransactionReceipt":
            return [ "eth_getTransactionReceipt", [ params.transactionHash ] ];

           case "call":
            {
              const hexlifyTransaction = (0, properties_1.getStatic)(this.constructor, "hexlifyTransaction");
              return [ "eth_call", [ hexlifyTransaction(params.transaction, {
                from: true
              }), params.blockTag ] ];
            }

           case "estimateGas":
            {
              const hexlifyTransaction = (0, properties_1.getStatic)(this.constructor, "hexlifyTransaction");
              return [ "eth_estimateGas", [ hexlifyTransaction(params.transaction, {
                from: true
              }) ] ];
            }

           case "getLogs":
            if (params.filter && params.filter.address != null) {
              params.filter.address = getLowerCase(params.filter.address);
            }
            return [ "eth_getLogs", [ params.filter ] ];

           default:
            break;
          }
          return null;
        }
        async perform(method, params) {
          if (method === "call" || method === "estimateGas") {
            const tx = params.transaction;
            if (tx && tx.type != null && bignumber_1.BigNumber.from(tx.type).isZero()) {
              if (tx.maxFeePerGas == null && tx.maxPriorityFeePerGas == null) {
                const feeData = await this.getFeeData();
                if (feeData.maxFeePerGas == null && feeData.maxPriorityFeePerGas == null) {
                  params = (0, properties_1.shallowCopy)(params);
                  params.transaction = (0, properties_1.shallowCopy)(tx);
                  delete params.transaction.type;
                }
              }
            }
          }
          const args = this.prepareRequest(method, params);
          if (args == null) {
            logger.throwError(method + " not implemented", logger_1.Logger.errors.NOT_IMPLEMENTED, {
              operation: method
            });
          }
          try {
            return await this.send(args[0], args[1]);
          } catch (error) {
            return checkError(method, error, params);
          }
        }
        _startEvent(event) {
          if (event.tag === "pending") {
            this._startPending();
          }
          super._startEvent(event);
        }
        _startPending() {
          if (this._pendingFilter != null) {
            return;
          }
          const self = this;
          const pendingFilter = this.send("eth_newPendingTransactionFilter", []);
          this._pendingFilter = pendingFilter;
          pendingFilter.then((function(filterId) {
            function poll() {
              self.send("eth_getFilterChanges", [ filterId ]).then((function(hashes) {
                if (self._pendingFilter != pendingFilter) {
                  return null;
                }
                let seq = Promise.resolve();
                hashes.forEach((function(hash) {
                  self._emitted["t:" + hash.toLowerCase()] = "pending";
                  seq = seq.then((function() {
                    return self.getTransaction(hash).then((function(tx) {
                      self.emit("pending", tx);
                      return null;
                    }));
                  }));
                }));
                return seq.then((function() {
                  return timer(1e3);
                }));
              })).then((function() {
                if (self._pendingFilter != pendingFilter) {
                  self.send("eth_uninstallFilter", [ filterId ]);
                  return;
                }
                setTimeout((function() {
                  poll();
                }), 0);
                return null;
              })).catch((error => {}));
            }
            poll();
            return filterId;
          })).catch((error => {}));
        }
        _stopEvent(event) {
          if (event.tag === "pending" && this.listenerCount("pending") === 0) {
            this._pendingFilter = null;
          }
          super._stopEvent(event);
        }
        static hexlifyTransaction(transaction, allowExtra) {
          const allowed = (0, properties_1.shallowCopy)(allowedTransactionKeys);
          if (allowExtra) {
            for (const key in allowExtra) {
              if (allowExtra[key]) {
                allowed[key] = true;
              }
            }
          }
          (0, properties_1.checkProperties)(transaction, allowed);
          const result = {};
          [ "chainId", "gasLimit", "gasPrice", "type", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "value" ].forEach((function(key) {
            if (transaction[key] == null) {
              return;
            }
            const value = (0, bytes_1.hexValue)(bignumber_1.BigNumber.from(transaction[key]));
            if (key === "gasLimit") {
              key = "gas";
            }
            result[key] = value;
          }));
          [ "from", "to", "data" ].forEach((function(key) {
            if (transaction[key] == null) {
              return;
            }
            result[key] = (0, bytes_1.hexlify)(transaction[key]);
          }));
          if (transaction.accessList) {
            result["accessList"] = (0, transactions_1.accessListify)(transaction.accessList);
          }
          return result;
        }
      }
      exports.JsonRpcProvider = JsonRpcProvider;
    },
    3839(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.UrlJsonRpcProvider = exports.StaticJsonRpcProvider = void 0;
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      const json_rpc_provider_1 = __webpack_require__(535);
      class StaticJsonRpcProvider extends json_rpc_provider_1.JsonRpcProvider {
        async detectNetwork() {
          let network = this.network;
          if (network == null) {
            network = await super.detectNetwork();
            if (!network) {
              logger.throwError("no network detected", logger_1.Logger.errors.UNKNOWN_ERROR, {});
            }
            if (this._network == null) {
              (0, properties_1.defineReadOnly)(this, "_network", network);
              this.emit("network", network, null);
            }
          }
          return network;
        }
      }
      exports.StaticJsonRpcProvider = StaticJsonRpcProvider;
      class UrlJsonRpcProvider extends StaticJsonRpcProvider {
        constructor(network, apiKey) {
          logger.checkAbstract(new.target, UrlJsonRpcProvider);
          network = (0, properties_1.getStatic)(new.target, "getNetwork")(network);
          apiKey = (0, properties_1.getStatic)(new.target, "getApiKey")(apiKey);
          const connection = (0, properties_1.getStatic)(new.target, "getUrl")(network, apiKey);
          super(connection, network);
          if (typeof apiKey === "string") {
            (0, properties_1.defineReadOnly)(this, "apiKey", apiKey);
          } else if (apiKey != null) {
            Object.keys(apiKey).forEach((key => {
              (0, properties_1.defineReadOnly)(this, key, apiKey[key]);
            }));
          }
        }
        _startPending() {
          logger.warn("WARNING: API provider does not support pending filters");
        }
        isCommunityResource() {
          return false;
        }
        getSigner(address) {
          return logger.throwError("API provider does not support signing", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "getSigner"
          });
        }
        listAccounts() {
          return Promise.resolve([]);
        }
        static getApiKey(apiKey) {
          return apiKey;
        }
        static getUrl(network, apiKey) {
          return logger.throwError("not implemented; sub-classes must override getUrl", logger_1.Logger.errors.NOT_IMPLEMENTED, {
            operation: "getUrl"
          });
        }
      }
      exports.UrlJsonRpcProvider = UrlJsonRpcProvider;
    },
    7254(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Web3Provider = void 0;
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      const json_rpc_provider_1 = __webpack_require__(535);
      let _nextId = 1;
      function buildWeb3LegacyFetcher(provider, sendFunc) {
        const fetcher = "Web3LegacyFetcher";
        return function(method, params) {
          const request = {
            method,
            params,
            id: _nextId++,
            jsonrpc: "2.0"
          };
          return new Promise(((resolve, reject) => {
            this.emit("debug", {
              action: "request",
              fetcher,
              request: (0, properties_1.deepCopy)(request),
              provider: this
            });
            sendFunc(request, ((error, response) => {
              if (error) {
                this.emit("debug", {
                  action: "response",
                  fetcher,
                  error,
                  request,
                  provider: this
                });
                return reject(error);
              }
              this.emit("debug", {
                action: "response",
                fetcher,
                request,
                response,
                provider: this
              });
              if (response.error) {
                const error = new Error(response.error.message);
                error.code = response.error.code;
                error.data = response.error.data;
                return reject(error);
              }
              resolve(response.result);
            }));
          }));
        };
      }
      function buildEip1193Fetcher(provider) {
        return function(method, params) {
          if (params == null) {
            params = [];
          }
          const request = {
            method,
            params
          };
          this.emit("debug", {
            action: "request",
            fetcher: "Eip1193Fetcher",
            request: (0, properties_1.deepCopy)(request),
            provider: this
          });
          return provider.request(request).then((response => {
            this.emit("debug", {
              action: "response",
              fetcher: "Eip1193Fetcher",
              request,
              response,
              provider: this
            });
            return response;
          }), (error => {
            this.emit("debug", {
              action: "response",
              fetcher: "Eip1193Fetcher",
              request,
              error,
              provider: this
            });
            throw error;
          }));
        };
      }
      class Web3Provider extends json_rpc_provider_1.JsonRpcProvider {
        constructor(provider, network) {
          if (provider == null) {
            logger.throwArgumentError("missing provider", "provider", provider);
          }
          let path = null;
          let jsonRpcFetchFunc = null;
          let subprovider = null;
          if (typeof provider === "function") {
            path = "unknown:";
            jsonRpcFetchFunc = provider;
          } else {
            path = provider.host || provider.path || "";
            subprovider = provider;
            if (provider.request) {
              if (path === "") {
                path = "eip-1193:";
              }
              jsonRpcFetchFunc = buildEip1193Fetcher(provider);
            } else if (provider.sendAsync) {
              jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.sendAsync.bind(provider));
            } else if (provider.send) {
              jsonRpcFetchFunc = buildWeb3LegacyFetcher(provider, provider.send.bind(provider));
            } else {
              logger.throwArgumentError("unsupported provider", "provider", provider);
            }
            if (!path) {
              path = "unknown:";
            }
          }
          super(path, network);
          (0, properties_1.defineReadOnly)(this, "jsonRpcFetchFunc", jsonRpcFetchFunc);
          (0, properties_1.defineReadOnly)(this, "provider", subprovider);
        }
        send(method, params) {
          return this.jsonRpcFetchFunc(method, params);
        }
      }
      exports.Web3Provider = Web3Provider;
    },
    4518(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.WebSocketProvider = void 0;
      const bignumber_1 = __webpack_require__(3804);
      const properties_1 = __webpack_require__(1476);
      const json_rpc_provider_1 = __webpack_require__(535);
      const ws_1 = __webpack_require__(7008);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2394);
      const logger = new logger_1.Logger(_version_1.version);
      let NextId = 1;
      class WebSocketProvider extends json_rpc_provider_1.JsonRpcProvider {
        constructor(url, network) {
          if (network === "any") {
            logger.throwError("WebSocketProvider does not support 'any' network yet", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "network:any"
            });
          }
          if (typeof url === "string") {
            super(url, network);
          } else {
            super("_websocket", network);
          }
          this._pollingInterval = -1;
          this._wsReady = false;
          if (typeof url === "string") {
            (0, properties_1.defineReadOnly)(this, "_websocket", new ws_1.WebSocket(this.connection.url));
          } else {
            (0, properties_1.defineReadOnly)(this, "_websocket", url);
          }
          (0, properties_1.defineReadOnly)(this, "_requests", {});
          (0, properties_1.defineReadOnly)(this, "_subs", {});
          (0, properties_1.defineReadOnly)(this, "_subIds", {});
          (0, properties_1.defineReadOnly)(this, "_detectNetwork", super.detectNetwork());
          this.websocket.onopen = () => {
            this._wsReady = true;
            Object.keys(this._requests).forEach((id => {
              this.websocket.send(this._requests[id].payload);
            }));
          };
          this.websocket.onmessage = messageEvent => {
            const data = messageEvent.data;
            const result = JSON.parse(data);
            if (result.id != null) {
              const id = String(result.id);
              const request = this._requests[id];
              delete this._requests[id];
              if (result.result !== undefined) {
                request.callback(null, result.result);
                this.emit("debug", {
                  action: "response",
                  request: JSON.parse(request.payload),
                  response: result.result,
                  provider: this
                });
              } else {
                let error = null;
                if (result.error) {
                  error = new Error(result.error.message || "unknown error");
                  (0, properties_1.defineReadOnly)(error, "code", result.error.code || null);
                  (0, properties_1.defineReadOnly)(error, "response", data);
                } else {
                  error = new Error("unknown error");
                }
                request.callback(error, undefined);
                this.emit("debug", {
                  action: "response",
                  error,
                  request: JSON.parse(request.payload),
                  provider: this
                });
              }
            } else if (result.method === "eth_subscription") {
              const sub = this._subs[result.params.subscription];
              if (sub) {
                sub.processFunc(result.params.result);
              }
            } else {
              console.warn("this should not happen");
            }
          };
          const fauxPoll = setInterval((() => {
            this.emit("poll");
          }), 1e3);
          if (fauxPoll.unref) {
            fauxPoll.unref();
          }
        }
        get websocket() {
          return this._websocket;
        }
        detectNetwork() {
          return this._detectNetwork;
        }
        get pollingInterval() {
          return 0;
        }
        resetEventsBlock(blockNumber) {
          logger.throwError("cannot reset events block on WebSocketProvider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "resetEventBlock"
          });
        }
        set pollingInterval(value) {
          logger.throwError("cannot set polling interval on WebSocketProvider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "setPollingInterval"
          });
        }
        async poll() {
          return null;
        }
        set polling(value) {
          if (!value) {
            return;
          }
          logger.throwError("cannot set polling on WebSocketProvider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "setPolling"
          });
        }
        send(method, params) {
          const rid = NextId++;
          return new Promise(((resolve, reject) => {
            function callback(error, result) {
              if (error) {
                return reject(error);
              }
              return resolve(result);
            }
            const payload = JSON.stringify({
              method,
              params,
              id: rid,
              jsonrpc: "2.0"
            });
            this.emit("debug", {
              action: "request",
              request: JSON.parse(payload),
              provider: this
            });
            this._requests[String(rid)] = {
              callback,
              payload
            };
            if (this._wsReady) {
              this.websocket.send(payload);
            }
          }));
        }
        static defaultUrl() {
          return "ws://localhost:8546";
        }
        async _subscribe(tag, param, processFunc) {
          let subIdPromise = this._subIds[tag];
          if (subIdPromise == null) {
            subIdPromise = Promise.all(param).then((param => this.send("eth_subscribe", param)));
            this._subIds[tag] = subIdPromise;
          }
          const subId = await subIdPromise;
          this._subs[subId] = {
            tag,
            processFunc
          };
        }
        _startEvent(event) {
          switch (event.type) {
           case "block":
            this._subscribe("block", [ "newHeads" ], (result => {
              const blockNumber = bignumber_1.BigNumber.from(result.number).toNumber();
              this._emitted.block = blockNumber;
              this.emit("block", blockNumber);
            }));
            break;

           case "pending":
            this._subscribe("pending", [ "newPendingTransactions" ], (result => {
              this.emit("pending", result);
            }));
            break;

           case "filter":
            this._subscribe(event.tag, [ "logs", this._getFilter(event.filter) ], (result => {
              if (result.removed == null) {
                result.removed = false;
              }
              this.emit(event.filter, this.formatter.filterLog(result));
            }));
            break;

           case "tx":
            {
              const emitReceipt = event => {
                const hash = event.hash;
                this.getTransactionReceipt(hash).then((receipt => {
                  if (!receipt) {
                    return;
                  }
                  this.emit(hash, receipt);
                }));
              };
              emitReceipt(event);
              this._subscribe("tx", [ "newHeads" ], (result => {
                this._events.filter((e => e.type === "tx")).forEach(emitReceipt);
              }));
              break;
            }

           case "debug":
           case "poll":
           case "willPoll":
           case "didPoll":
           case "error":
            break;

           default:
            console.log("unhandled:", event);
            break;
          }
        }
        _stopEvent(event) {
          let tag = event.tag;
          if (event.type === "tx") {
            if (this._events.filter((e => e.type === "tx")).length) {
              return;
            }
            tag = "tx";
          } else if (this.listenerCount(event.event)) {
            return;
          }
          const subId = this._subIds[tag];
          if (!subId) {
            return;
          }
          delete this._subIds[tag];
          subId.then((subId => {
            if (!this._subs[subId]) {
              return;
            }
            delete this._subs[subId];
            this.send("eth_unsubscribe", [ subId ]);
          }));
        }
        async destroy() {
          if (this.websocket.readyState === ws_1.WebSocket.CONNECTING) {
            await new Promise((resolve => {
              this.websocket.onopen = function() {
                resolve(true);
              };
              this.websocket.onerror = function() {
                resolve(false);
              };
            }));
          }
          this.websocket.close(1e3);
        }
      }
      exports.WebSocketProvider = WebSocketProvider;
    },
    7869(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "purity/5.7.2";
    },
    3184(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.pack = pack;
      exports.keccak256 = keccak256;
      exports.sha256 = sha256;
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const keccak256_1 = __webpack_require__(1136);
      const sha2_1 = __webpack_require__(8417);
      const strings_1 = __webpack_require__(2509);
      const regexBytes = new RegExp("^bytes([0-9]+)$");
      const regexNumber = new RegExp("^(u?int)([0-9]*)$");
      const regexArray = new RegExp("^(.*)\\[([0-9]*)\\]$");
      const Zeros = "0000000000000000000000000000000000000000000000000000000000000000";
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(7869);
      const logger = new logger_1.Logger(_version_1.version);
      function _pack(type, value, isArray) {
        switch (type) {
         case "address":
          if (isArray) {
            return (0, bytes_1.zeroPad)(value, 32);
          }
          return (0, bytes_1.arrayify)(value);

         case "string":
          return (0, strings_1.toUtf8Bytes)(value);

         case "bytes":
          return (0, bytes_1.arrayify)(value);

         case "bool":
          value = value ? "0x01" : "0x00";
          if (isArray) {
            return (0, bytes_1.zeroPad)(value, 32);
          }
          return (0, bytes_1.arrayify)(value);
        }
        let match = type.match(regexNumber);
        if (match) {
          let size = parseInt(match[2] || "256");
          if (match[2] && String(size) !== match[2] || size % 8 !== 0 || size === 0 || size > 256) {
            logger.throwArgumentError("invalid number type", "type", type);
          }
          if (isArray) {
            size = 256;
          }
          value = bignumber_1.BigNumber.from(value).toTwos(size);
          return (0, bytes_1.zeroPad)(value, size / 8);
        }
        match = type.match(regexBytes);
        if (match) {
          const size = parseInt(match[1]);
          if (String(size) !== match[1] || size === 0 || size > 32) {
            logger.throwArgumentError("invalid bytes type", "type", type);
          }
          if ((0, bytes_1.arrayify)(value).byteLength !== size) {
            logger.throwArgumentError(`invalid value for ${type}`, "value", value);
          }
          if (isArray) {
            return (0, bytes_1.arrayify)((value + Zeros).substring(0, 66));
          }
          return value;
        }
        match = type.match(regexArray);
        if (match && Array.isArray(value)) {
          const baseType = match[1];
          const count = parseInt(match[2] || String(value.length));
          if (count != value.length) {
            logger.throwArgumentError(`invalid array length for ${type}`, "value", value);
          }
          const result = [];
          value.forEach((function(value) {
            result.push(_pack(baseType, value, true));
          }));
          return (0, bytes_1.concat)(result);
        }
        return logger.throwArgumentError("invalid type", "type", type);
      }
      function pack(types, values) {
        if (types.length != values.length) {
          logger.throwArgumentError("wrong number of values; expected ${ types.length }", "values", values);
        }
        const tight = [];
        types.forEach((function(type, index) {
          tight.push(_pack(type, values[index]));
        }));
        return (0, bytes_1.hexlify)((0, bytes_1.concat)(tight));
      }
      function keccak256(types, values) {
        return (0, keccak256_1.keccak256)(pack(types, values));
      }
      function sha256(types, values) {
        return (0, sha2_1.sha256)(pack(types, values));
      }
    },
    850(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "qethers/1.0.13";
    },
    7785(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        Object.defineProperty(o, k2, {
          enumerable: true,
          get: function() {
            return m[k];
          }
        });
      } : function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
      });
      var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
        Object.defineProperty(o, "default", {
          enumerable: true,
          value: v
        });
      } : function(o, v) {
        o["default"] = v;
      });
      var __importStar = this && this.__importStar || function(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
        __setModuleDefault(result, mod);
        return result;
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Wordlist = exports.version = exports.wordlists = exports.utils = exports.logger = exports.errors = exports.constants = exports.FixedNumber = exports.BigNumber = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.providers = exports.getDefaultProvider = exports.VoidSigner = exports.Wallet = exports.Signer = exports.qethers = void 0;
      const qethers = __importStar(__webpack_require__(5235));
      exports.qethers = qethers;
      try {
        const anyGlobal = window;
        if (anyGlobal._ethers == null) {
          anyGlobal._ethers = qethers;
        }
      } catch (error) {}
      var qethers_1 = __webpack_require__(5235);
      Object.defineProperty(exports, "Signer", {
        enumerable: true,
        get: function() {
          return qethers_1.Signer;
        }
      });
      Object.defineProperty(exports, "Wallet", {
        enumerable: true,
        get: function() {
          return qethers_1.Wallet;
        }
      });
      Object.defineProperty(exports, "VoidSigner", {
        enumerable: true,
        get: function() {
          return qethers_1.VoidSigner;
        }
      });
      Object.defineProperty(exports, "getDefaultProvider", {
        enumerable: true,
        get: function() {
          return qethers_1.getDefaultProvider;
        }
      });
      Object.defineProperty(exports, "providers", {
        enumerable: true,
        get: function() {
          return qethers_1.providers;
        }
      });
      Object.defineProperty(exports, "BaseContract", {
        enumerable: true,
        get: function() {
          return qethers_1.BaseContract;
        }
      });
      Object.defineProperty(exports, "Contract", {
        enumerable: true,
        get: function() {
          return qethers_1.Contract;
        }
      });
      Object.defineProperty(exports, "ContractFactory", {
        enumerable: true,
        get: function() {
          return qethers_1.ContractFactory;
        }
      });
      Object.defineProperty(exports, "BigNumber", {
        enumerable: true,
        get: function() {
          return qethers_1.BigNumber;
        }
      });
      Object.defineProperty(exports, "FixedNumber", {
        enumerable: true,
        get: function() {
          return qethers_1.FixedNumber;
        }
      });
      Object.defineProperty(exports, "constants", {
        enumerable: true,
        get: function() {
          return qethers_1.constants;
        }
      });
      Object.defineProperty(exports, "errors", {
        enumerable: true,
        get: function() {
          return qethers_1.errors;
        }
      });
      Object.defineProperty(exports, "logger", {
        enumerable: true,
        get: function() {
          return qethers_1.logger;
        }
      });
      Object.defineProperty(exports, "utils", {
        enumerable: true,
        get: function() {
          return qethers_1.utils;
        }
      });
      Object.defineProperty(exports, "wordlists", {
        enumerable: true,
        get: function() {
          return qethers_1.wordlists;
        }
      });
      Object.defineProperty(exports, "version", {
        enumerable: true,
        get: function() {
          return qethers_1.version;
        }
      });
      Object.defineProperty(exports, "Wordlist", {
        enumerable: true,
        get: function() {
          return qethers_1.Wordlist;
        }
      });
    },
    5235(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        Object.defineProperty(o, k2, {
          enumerable: true,
          get: function() {
            return m[k];
          }
        });
      } : function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
      });
      var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
        Object.defineProperty(o, "default", {
          enumerable: true,
          value: v
        });
      } : function(o, v) {
        o["default"] = v;
      });
      var __importStar = this && this.__importStar || function(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
        __setModuleDefault(result, mod);
        return result;
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Wordlist = exports.version = exports.wordlists = exports.utils = exports.logger = exports.errors = exports.constants = exports.FixedNumber = exports.BigNumber = exports.ContractFactory = exports.Contract = exports.BaseContract = exports.providers = exports.getDefaultProvider = exports.VoidSigner = exports.Wallet = exports.Signer = void 0;
      const contracts_1 = __webpack_require__(3008);
      Object.defineProperty(exports, "BaseContract", {
        enumerable: true,
        get: function() {
          return contracts_1.BaseContract;
        }
      });
      Object.defineProperty(exports, "Contract", {
        enumerable: true,
        get: function() {
          return contracts_1.Contract;
        }
      });
      Object.defineProperty(exports, "ContractFactory", {
        enumerable: true,
        get: function() {
          return contracts_1.ContractFactory;
        }
      });
      const bignumber_1 = __webpack_require__(3804);
      Object.defineProperty(exports, "BigNumber", {
        enumerable: true,
        get: function() {
          return bignumber_1.BigNumber;
        }
      });
      Object.defineProperty(exports, "FixedNumber", {
        enumerable: true,
        get: function() {
          return bignumber_1.FixedNumber;
        }
      });
      const abstract_signer_1 = __webpack_require__(8788);
      Object.defineProperty(exports, "Signer", {
        enumerable: true,
        get: function() {
          return abstract_signer_1.Signer;
        }
      });
      Object.defineProperty(exports, "VoidSigner", {
        enumerable: true,
        get: function() {
          return abstract_signer_1.VoidSigner;
        }
      });
      const wallet_1 = __webpack_require__(1348);
      Object.defineProperty(exports, "Wallet", {
        enumerable: true,
        get: function() {
          return wallet_1.Wallet;
        }
      });
      const constants = __importStar(__webpack_require__(846));
      exports.constants = constants;
      const providers = __importStar(__webpack_require__(7649));
      exports.providers = providers;
      const providers_1 = __webpack_require__(7649);
      Object.defineProperty(exports, "getDefaultProvider", {
        enumerable: true,
        get: function() {
          return providers_1.getDefaultProvider;
        }
      });
      const wordlists_1 = __webpack_require__(6261);
      Object.defineProperty(exports, "Wordlist", {
        enumerable: true,
        get: function() {
          return wordlists_1.Wordlist;
        }
      });
      Object.defineProperty(exports, "wordlists", {
        enumerable: true,
        get: function() {
          return wordlists_1.wordlists;
        }
      });
      const utils = __importStar(__webpack_require__(6884));
      exports.utils = utils;
      const logger_1 = __webpack_require__(5289);
      Object.defineProperty(exports, "errors", {
        enumerable: true,
        get: function() {
          return logger_1.ErrorCode;
        }
      });
      const _version_1 = __webpack_require__(850);
      Object.defineProperty(exports, "version", {
        enumerable: true,
        get: function() {
          return _version_1.version;
        }
      });
      const logger = new logger_1.Logger(_version_1.version);
      exports.logger = logger;
    },
    6884(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        Object.defineProperty(o, k2, {
          enumerable: true,
          get: function() {
            return m[k];
          }
        });
      } : function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
      });
      var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
        Object.defineProperty(o, "default", {
          enumerable: true,
          value: v
        });
      } : function(o, v) {
        o["default"] = v;
      });
      var __importStar = this && this.__importStar || function(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
        __setModuleDefault(result, mod);
        return result;
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.dnsEncode = exports.parseBytes32String = exports.formatBytes32String = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports._toEscapedUtf8String = exports.nameprep = exports.hexDataSlice = exports.hexDataLength = exports.hexZeroPad = exports.hexValue = exports.hexStripZeros = exports.hexConcat = exports.isHexString = exports.hexlify = exports.base64 = exports.base58 = exports.TransactionDescription = exports.LogDescription = exports.Interface = exports.SigningKey = exports.isBytesLike = exports.isBytes = exports.zeroPad = exports.stripZeros = exports.concat = exports.arrayify = exports.shallowCopy = exports.resolveProperties = exports.getStatic = exports.defineReadOnly = exports.deepCopy = exports.checkProperties = exports.poll = exports.fetchJson = exports._fetchData = exports.RLP = exports.Logger = exports.checkResultErrors = exports.FormatTypes = exports.ParamType = exports.FunctionFragment = exports.EventFragment = exports.ErrorFragment = exports.ConstructorFragment = exports.Fragment = exports.defaultAbiCoder = exports.AbiCoder = void 0;
      exports.Indexed = exports.Utf8ErrorReason = exports.UnicodeNormalizationForm = exports.SupportedAlgorithm = exports.verifyTypedData = exports.verifyMessage = exports.recoverPublicKey = exports.recoverAddress = exports.computeAddress = exports.getJsonWalletAddress = exports.TransactionTypes = exports.serializeTransaction = exports.parseTransaction = exports.accessListify = exports.joinSignature = exports.splitSignature = exports.puritySha256 = exports.purityKeccak256 = exports.purityPack = exports.shuffled = exports.randomBytes = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.keccak256 = exports.computeHmac = exports.commify = exports.parseUnits = exports.formatUnits = exports.parseEther = exports.formatEther = exports.isAddress = exports.getCreate2Address = exports.getContractAddress = exports.getIcapAddress = exports.getAddress = exports._TypedDataEncoder = exports.id = exports.isValidName = exports.namehash = exports.hashMessage = void 0;
      const abi_1 = __webpack_require__(7989);
      Object.defineProperty(exports, "AbiCoder", {
        enumerable: true,
        get: function() {
          return abi_1.AbiCoder;
        }
      });
      Object.defineProperty(exports, "checkResultErrors", {
        enumerable: true,
        get: function() {
          return abi_1.checkResultErrors;
        }
      });
      Object.defineProperty(exports, "ConstructorFragment", {
        enumerable: true,
        get: function() {
          return abi_1.ConstructorFragment;
        }
      });
      Object.defineProperty(exports, "defaultAbiCoder", {
        enumerable: true,
        get: function() {
          return abi_1.defaultAbiCoder;
        }
      });
      Object.defineProperty(exports, "ErrorFragment", {
        enumerable: true,
        get: function() {
          return abi_1.ErrorFragment;
        }
      });
      Object.defineProperty(exports, "EventFragment", {
        enumerable: true,
        get: function() {
          return abi_1.EventFragment;
        }
      });
      Object.defineProperty(exports, "FormatTypes", {
        enumerable: true,
        get: function() {
          return abi_1.FormatTypes;
        }
      });
      Object.defineProperty(exports, "Fragment", {
        enumerable: true,
        get: function() {
          return abi_1.Fragment;
        }
      });
      Object.defineProperty(exports, "FunctionFragment", {
        enumerable: true,
        get: function() {
          return abi_1.FunctionFragment;
        }
      });
      Object.defineProperty(exports, "Indexed", {
        enumerable: true,
        get: function() {
          return abi_1.Indexed;
        }
      });
      Object.defineProperty(exports, "Interface", {
        enumerable: true,
        get: function() {
          return abi_1.Interface;
        }
      });
      Object.defineProperty(exports, "LogDescription", {
        enumerable: true,
        get: function() {
          return abi_1.LogDescription;
        }
      });
      Object.defineProperty(exports, "ParamType", {
        enumerable: true,
        get: function() {
          return abi_1.ParamType;
        }
      });
      Object.defineProperty(exports, "TransactionDescription", {
        enumerable: true,
        get: function() {
          return abi_1.TransactionDescription;
        }
      });
      const address_1 = __webpack_require__(171);
      Object.defineProperty(exports, "getAddress", {
        enumerable: true,
        get: function() {
          return address_1.getAddress;
        }
      });
      Object.defineProperty(exports, "getCreate2Address", {
        enumerable: true,
        get: function() {
          return address_1.getCreate2Address;
        }
      });
      Object.defineProperty(exports, "getContractAddress", {
        enumerable: true,
        get: function() {
          return address_1.getContractAddress;
        }
      });
      Object.defineProperty(exports, "getIcapAddress", {
        enumerable: true,
        get: function() {
          return address_1.getIcapAddress;
        }
      });
      Object.defineProperty(exports, "isAddress", {
        enumerable: true,
        get: function() {
          return address_1.isAddress;
        }
      });
      const base64 = __importStar(__webpack_require__(8886));
      exports.base64 = base64;
      const basex_1 = __webpack_require__(4160);
      Object.defineProperty(exports, "base58", {
        enumerable: true,
        get: function() {
          return basex_1.Base58;
        }
      });
      const bytes_1 = __webpack_require__(8380);
      Object.defineProperty(exports, "arrayify", {
        enumerable: true,
        get: function() {
          return bytes_1.arrayify;
        }
      });
      Object.defineProperty(exports, "concat", {
        enumerable: true,
        get: function() {
          return bytes_1.concat;
        }
      });
      Object.defineProperty(exports, "hexConcat", {
        enumerable: true,
        get: function() {
          return bytes_1.hexConcat;
        }
      });
      Object.defineProperty(exports, "hexDataSlice", {
        enumerable: true,
        get: function() {
          return bytes_1.hexDataSlice;
        }
      });
      Object.defineProperty(exports, "hexDataLength", {
        enumerable: true,
        get: function() {
          return bytes_1.hexDataLength;
        }
      });
      Object.defineProperty(exports, "hexlify", {
        enumerable: true,
        get: function() {
          return bytes_1.hexlify;
        }
      });
      Object.defineProperty(exports, "hexStripZeros", {
        enumerable: true,
        get: function() {
          return bytes_1.hexStripZeros;
        }
      });
      Object.defineProperty(exports, "hexValue", {
        enumerable: true,
        get: function() {
          return bytes_1.hexValue;
        }
      });
      Object.defineProperty(exports, "hexZeroPad", {
        enumerable: true,
        get: function() {
          return bytes_1.hexZeroPad;
        }
      });
      Object.defineProperty(exports, "isBytes", {
        enumerable: true,
        get: function() {
          return bytes_1.isBytes;
        }
      });
      Object.defineProperty(exports, "isBytesLike", {
        enumerable: true,
        get: function() {
          return bytes_1.isBytesLike;
        }
      });
      Object.defineProperty(exports, "isHexString", {
        enumerable: true,
        get: function() {
          return bytes_1.isHexString;
        }
      });
      Object.defineProperty(exports, "joinSignature", {
        enumerable: true,
        get: function() {
          return bytes_1.joinSignature;
        }
      });
      Object.defineProperty(exports, "zeroPad", {
        enumerable: true,
        get: function() {
          return bytes_1.zeroPad;
        }
      });
      Object.defineProperty(exports, "splitSignature", {
        enumerable: true,
        get: function() {
          return bytes_1.splitSignature;
        }
      });
      Object.defineProperty(exports, "stripZeros", {
        enumerable: true,
        get: function() {
          return bytes_1.stripZeros;
        }
      });
      const hash_1 = __webpack_require__(413);
      Object.defineProperty(exports, "_TypedDataEncoder", {
        enumerable: true,
        get: function() {
          return hash_1._TypedDataEncoder;
        }
      });
      Object.defineProperty(exports, "dnsEncode", {
        enumerable: true,
        get: function() {
          return hash_1.dnsEncode;
        }
      });
      Object.defineProperty(exports, "hashMessage", {
        enumerable: true,
        get: function() {
          return hash_1.hashMessage;
        }
      });
      Object.defineProperty(exports, "id", {
        enumerable: true,
        get: function() {
          return hash_1.id;
        }
      });
      Object.defineProperty(exports, "isValidName", {
        enumerable: true,
        get: function() {
          return hash_1.isValidName;
        }
      });
      Object.defineProperty(exports, "namehash", {
        enumerable: true,
        get: function() {
          return hash_1.namehash;
        }
      });
      const json_wallets_1 = __webpack_require__(3120);
      Object.defineProperty(exports, "getJsonWalletAddress", {
        enumerable: true,
        get: function() {
          return json_wallets_1.getJsonWalletAddress;
        }
      });
      const keccak256_1 = __webpack_require__(1136);
      Object.defineProperty(exports, "keccak256", {
        enumerable: true,
        get: function() {
          return keccak256_1.keccak256;
        }
      });
      const logger_1 = __webpack_require__(5289);
      Object.defineProperty(exports, "Logger", {
        enumerable: true,
        get: function() {
          return logger_1.Logger;
        }
      });
      const sha2_1 = __webpack_require__(8417);
      Object.defineProperty(exports, "computeHmac", {
        enumerable: true,
        get: function() {
          return sha2_1.computeHmac;
        }
      });
      Object.defineProperty(exports, "ripemd160", {
        enumerable: true,
        get: function() {
          return sha2_1.ripemd160;
        }
      });
      Object.defineProperty(exports, "sha256", {
        enumerable: true,
        get: function() {
          return sha2_1.sha256;
        }
      });
      Object.defineProperty(exports, "sha512", {
        enumerable: true,
        get: function() {
          return sha2_1.sha512;
        }
      });
      const purity_1 = __webpack_require__(3184);
      Object.defineProperty(exports, "purityKeccak256", {
        enumerable: true,
        get: function() {
          return purity_1.keccak256;
        }
      });
      Object.defineProperty(exports, "purityPack", {
        enumerable: true,
        get: function() {
          return purity_1.pack;
        }
      });
      Object.defineProperty(exports, "puritySha256", {
        enumerable: true,
        get: function() {
          return purity_1.sha256;
        }
      });
      const random_1 = __webpack_require__(590);
      Object.defineProperty(exports, "randomBytes", {
        enumerable: true,
        get: function() {
          return random_1.randomBytes;
        }
      });
      Object.defineProperty(exports, "shuffled", {
        enumerable: true,
        get: function() {
          return random_1.shuffled;
        }
      });
      const properties_1 = __webpack_require__(1476);
      Object.defineProperty(exports, "checkProperties", {
        enumerable: true,
        get: function() {
          return properties_1.checkProperties;
        }
      });
      Object.defineProperty(exports, "deepCopy", {
        enumerable: true,
        get: function() {
          return properties_1.deepCopy;
        }
      });
      Object.defineProperty(exports, "defineReadOnly", {
        enumerable: true,
        get: function() {
          return properties_1.defineReadOnly;
        }
      });
      Object.defineProperty(exports, "getStatic", {
        enumerable: true,
        get: function() {
          return properties_1.getStatic;
        }
      });
      Object.defineProperty(exports, "resolveProperties", {
        enumerable: true,
        get: function() {
          return properties_1.resolveProperties;
        }
      });
      Object.defineProperty(exports, "shallowCopy", {
        enumerable: true,
        get: function() {
          return properties_1.shallowCopy;
        }
      });
      const RLP = __importStar(__webpack_require__(589));
      exports.RLP = RLP;
      const signing_key_1 = __webpack_require__(2494);
      Object.defineProperty(exports, "recoverPublicKey", {
        enumerable: true,
        get: function() {
          return signing_key_1.recoverPublicKey;
        }
      });
      Object.defineProperty(exports, "SigningKey", {
        enumerable: true,
        get: function() {
          return signing_key_1.SigningKey;
        }
      });
      const strings_1 = __webpack_require__(2509);
      Object.defineProperty(exports, "formatBytes32String", {
        enumerable: true,
        get: function() {
          return strings_1.formatBytes32String;
        }
      });
      Object.defineProperty(exports, "nameprep", {
        enumerable: true,
        get: function() {
          return strings_1.nameprep;
        }
      });
      Object.defineProperty(exports, "parseBytes32String", {
        enumerable: true,
        get: function() {
          return strings_1.parseBytes32String;
        }
      });
      Object.defineProperty(exports, "_toEscapedUtf8String", {
        enumerable: true,
        get: function() {
          return strings_1._toEscapedUtf8String;
        }
      });
      Object.defineProperty(exports, "toUtf8Bytes", {
        enumerable: true,
        get: function() {
          return strings_1.toUtf8Bytes;
        }
      });
      Object.defineProperty(exports, "toUtf8CodePoints", {
        enumerable: true,
        get: function() {
          return strings_1.toUtf8CodePoints;
        }
      });
      Object.defineProperty(exports, "toUtf8String", {
        enumerable: true,
        get: function() {
          return strings_1.toUtf8String;
        }
      });
      Object.defineProperty(exports, "Utf8ErrorFuncs", {
        enumerable: true,
        get: function() {
          return strings_1.Utf8ErrorFuncs;
        }
      });
      const transactions_1 = __webpack_require__(3776);
      Object.defineProperty(exports, "accessListify", {
        enumerable: true,
        get: function() {
          return transactions_1.accessListify;
        }
      });
      Object.defineProperty(exports, "computeAddress", {
        enumerable: true,
        get: function() {
          return transactions_1.computeAddress;
        }
      });
      Object.defineProperty(exports, "parseTransaction", {
        enumerable: true,
        get: function() {
          return transactions_1.parse;
        }
      });
      Object.defineProperty(exports, "recoverAddress", {
        enumerable: true,
        get: function() {
          return transactions_1.recoverAddress;
        }
      });
      Object.defineProperty(exports, "serializeTransaction", {
        enumerable: true,
        get: function() {
          return transactions_1.serialize;
        }
      });
      Object.defineProperty(exports, "TransactionTypes", {
        enumerable: true,
        get: function() {
          return transactions_1.TransactionTypes;
        }
      });
      const units_1 = __webpack_require__(5700);
      Object.defineProperty(exports, "commify", {
        enumerable: true,
        get: function() {
          return units_1.commify;
        }
      });
      Object.defineProperty(exports, "formatEther", {
        enumerable: true,
        get: function() {
          return units_1.formatEther;
        }
      });
      Object.defineProperty(exports, "parseEther", {
        enumerable: true,
        get: function() {
          return units_1.parseEther;
        }
      });
      Object.defineProperty(exports, "formatUnits", {
        enumerable: true,
        get: function() {
          return units_1.formatUnits;
        }
      });
      Object.defineProperty(exports, "parseUnits", {
        enumerable: true,
        get: function() {
          return units_1.parseUnits;
        }
      });
      const wallet_1 = __webpack_require__(1348);
      Object.defineProperty(exports, "verifyMessage", {
        enumerable: true,
        get: function() {
          return wallet_1.verifyMessage;
        }
      });
      Object.defineProperty(exports, "verifyTypedData", {
        enumerable: true,
        get: function() {
          return wallet_1.verifyTypedData;
        }
      });
      const web_1 = __webpack_require__(6637);
      Object.defineProperty(exports, "_fetchData", {
        enumerable: true,
        get: function() {
          return web_1._fetchData;
        }
      });
      Object.defineProperty(exports, "fetchJson", {
        enumerable: true,
        get: function() {
          return web_1.fetchJson;
        }
      });
      Object.defineProperty(exports, "poll", {
        enumerable: true,
        get: function() {
          return web_1.poll;
        }
      });
      const sha2_2 = __webpack_require__(8417);
      Object.defineProperty(exports, "SupportedAlgorithm", {
        enumerable: true,
        get: function() {
          return sha2_2.SupportedAlgorithm;
        }
      });
      const strings_2 = __webpack_require__(2509);
      Object.defineProperty(exports, "UnicodeNormalizationForm", {
        enumerable: true,
        get: function() {
          return strings_2.UnicodeNormalizationForm;
        }
      });
      Object.defineProperty(exports, "Utf8ErrorReason", {
        enumerable: true,
        get: function() {
          return strings_2.Utf8ErrorReason;
        }
      });
    },
    1331(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "random/5.7.2";
    },
    7959(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.randomBytes = void 0;
      const bytes_1 = __webpack_require__(8380);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1331);
      const logger = new logger_1.Logger(_version_1.version);
      function getGlobal() {
        if (typeof self !== "undefined") {
          return self;
        }
        if (typeof window !== "undefined") {
          return window;
        }
        if (typeof __webpack_require__.g !== "undefined") {
          return __webpack_require__.g;
        }
        throw new Error("unable to locate global object");
      }
      const anyGlobal = getGlobal();
      let crypto = anyGlobal.crypto || anyGlobal.msCrypto;
      if (!crypto || !crypto.getRandomValues) {
        logger.warn("WARNING: Missing strong random number source");
        crypto = {
          getRandomValues: function(buffer) {
            return logger.throwError("no secure random source avaialble", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
              operation: "crypto.getRandomValues"
            });
          }
        };
      }
      function randomBytes(length) {
        if (length <= 0 || length > 1024 || length % 1 || length != length) {
          logger.throwArgumentError("invalid length", "length", length);
        }
        const result = new Uint8Array(length);
        crypto.getRandomValues(result);
        return (0, bytes_1.arrayify)(result);
      }
      exports.randomBytes = randomBytes;
    },
    590(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.shuffled = exports.randomBytes = void 0;
      var random_1 = __webpack_require__(7959);
      Object.defineProperty(exports, "randomBytes", {
        enumerable: true,
        get: function() {
          return random_1.randomBytes;
        }
      });
      var shuffle_1 = __webpack_require__(5655);
      Object.defineProperty(exports, "shuffled", {
        enumerable: true,
        get: function() {
          return shuffle_1.shuffled;
        }
      });
    },
    5655(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.shuffled = void 0;
      function shuffled(array) {
        array = array.slice();
        for (let i = array.length - 1; i > 0; i--) {
          const j = Math.floor(Math.random() * (i + 1));
          const tmp = array[i];
          array[i] = array[j];
          array[j] = tmp;
        }
        return array;
      }
      exports.shuffled = shuffled;
    },
    5150(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "rlp/5.7.1";
    },
    589(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.encode = encode;
      exports.decode = decode;
      const bytes_1 = __webpack_require__(8380);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(5150);
      const logger = new logger_1.Logger(_version_1.version);
      function arrayifyInteger(value) {
        const result = [];
        while (value) {
          result.unshift(value & 255);
          value >>= 8;
        }
        return result;
      }
      function unarrayifyInteger(data, offset, length) {
        let result = 0;
        for (let i = 0; i < length; i++) {
          result = result * 256 + data[offset + i];
        }
        return result;
      }
      function _encode(object) {
        if (Array.isArray(object)) {
          let payload = [];
          object.forEach((function(child) {
            payload = payload.concat(_encode(child));
          }));
          if (payload.length <= 55) {
            payload.unshift(192 + payload.length);
            return payload;
          }
          const length = arrayifyInteger(payload.length);
          length.unshift(247 + length.length);
          return length.concat(payload);
        }
        if (!(0, bytes_1.isBytesLike)(object)) {
          logger.throwArgumentError("RLP object must be BytesLike", "object", object);
        }
        const data = Array.prototype.slice.call((0, bytes_1.arrayify)(object));
        if (data.length === 1 && data[0] <= 127) {
          return data;
        } else if (data.length <= 55) {
          data.unshift(128 + data.length);
          return data;
        }
        const length = arrayifyInteger(data.length);
        length.unshift(183 + length.length);
        return length.concat(data);
      }
      function encode(object) {
        return (0, bytes_1.hexlify)(_encode(object));
      }
      function _decodeChildren(data, offset, childOffset, length) {
        const result = [];
        while (childOffset < offset + 1 + length) {
          const decoded = _decode(data, childOffset);
          result.push(decoded.result);
          childOffset += decoded.consumed;
          if (childOffset > offset + 1 + length) {
            logger.throwError("child data too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
          }
        }
        return {
          consumed: 1 + length,
          result
        };
      }
      function _decode(data, offset) {
        if (data.length === 0) {
          logger.throwError("data too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
        }
        if (data[offset] >= 248) {
          const lengthLength = data[offset] - 247;
          if (offset + 1 + lengthLength > data.length) {
            logger.throwError("data short segment too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
          }
          const length = unarrayifyInteger(data, offset + 1, lengthLength);
          if (offset + 1 + lengthLength + length > data.length) {
            logger.throwError("data long segment too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
          }
          return _decodeChildren(data, offset, offset + 1 + lengthLength, lengthLength + length);
        } else if (data[offset] >= 192) {
          const length = data[offset] - 192;
          if (offset + 1 + length > data.length) {
            logger.throwError("data array too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
          }
          return _decodeChildren(data, offset, offset + 1, length);
        } else if (data[offset] >= 184) {
          const lengthLength = data[offset] - 183;
          if (offset + 1 + lengthLength > data.length) {
            logger.throwError("data array too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
          }
          const length = unarrayifyInteger(data, offset + 1, lengthLength);
          if (offset + 1 + lengthLength + length > data.length) {
            logger.throwError("data array too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
          }
          const result = (0, bytes_1.hexlify)(data.slice(offset + 1 + lengthLength, offset + 1 + lengthLength + length));
          return {
            consumed: 1 + lengthLength + length,
            result
          };
        } else if (data[offset] >= 128) {
          const length = data[offset] - 128;
          if (offset + 1 + length > data.length) {
            logger.throwError("data too short", logger_1.Logger.errors.BUFFER_OVERRUN, {});
          }
          const result = (0, bytes_1.hexlify)(data.slice(offset + 1, offset + 1 + length));
          return {
            consumed: 1 + length,
            result
          };
        }
        return {
          consumed: 1,
          result: (0, bytes_1.hexlify)(data[offset])
        };
      }
      function decode(data) {
        const bytes = (0, bytes_1.arrayify)(data);
        const decoded = _decode(bytes, 0);
        if (decoded.consumed !== bytes.length) {
          logger.throwArgumentError("invalid rlp data", "data", data);
        }
        return decoded.result;
      }
    },
    7530(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "sha2/5.7.2";
    },
    3138(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __importDefault = this && this.__importDefault || function(mod) {
        return mod && mod.__esModule ? mod : {
          default: mod
        };
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.computeHmac = exports.sha512 = exports.sha256 = exports.ripemd160 = void 0;
      const hash_js_1 = __importDefault(__webpack_require__(7952));
      const bytes_1 = __webpack_require__(8380);
      const types_1 = __webpack_require__(1248);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(7530);
      const logger = new logger_1.Logger(_version_1.version);
      function ripemd160(data) {
        return "0x" + hash_js_1.default.ripemd160().update((0, bytes_1.arrayify)(data)).digest("hex");
      }
      exports.ripemd160 = ripemd160;
      function sha256(data) {
        return "0x" + hash_js_1.default.sha256().update((0, bytes_1.arrayify)(data)).digest("hex");
      }
      exports.sha256 = sha256;
      function sha512(data) {
        return "0x" + hash_js_1.default.sha512().update((0, bytes_1.arrayify)(data)).digest("hex");
      }
      exports.sha512 = sha512;
      function computeHmac(algorithm, key, data) {
        if (!types_1.SupportedAlgorithm[algorithm]) {
          logger.throwError("unsupported algorithm " + algorithm, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
            operation: "hmac",
            algorithm
          });
        }
        return "0x" + hash_js_1.default.hmac(hash_js_1.default[algorithm], (0, bytes_1.arrayify)(key)).update((0, 
        bytes_1.arrayify)(data)).digest("hex");
      }
      exports.computeHmac = computeHmac;
    },
    8417(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.SupportedAlgorithm = exports.sha512 = exports.sha256 = exports.ripemd160 = exports.computeHmac = void 0;
      const sha2_1 = __webpack_require__(3138);
      Object.defineProperty(exports, "computeHmac", {
        enumerable: true,
        get: function() {
          return sha2_1.computeHmac;
        }
      });
      Object.defineProperty(exports, "ripemd160", {
        enumerable: true,
        get: function() {
          return sha2_1.ripemd160;
        }
      });
      Object.defineProperty(exports, "sha256", {
        enumerable: true,
        get: function() {
          return sha2_1.sha256;
        }
      });
      Object.defineProperty(exports, "sha512", {
        enumerable: true,
        get: function() {
          return sha2_1.sha512;
        }
      });
      const types_1 = __webpack_require__(1248);
      Object.defineProperty(exports, "SupportedAlgorithm", {
        enumerable: true,
        get: function() {
          return types_1.SupportedAlgorithm;
        }
      });
    },
    1248(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.SupportedAlgorithm = void 0;
      var SupportedAlgorithm;
      (function(SupportedAlgorithm) {
        SupportedAlgorithm["sha256"] = "sha256";
        SupportedAlgorithm["sha512"] = "sha512";
      })(SupportedAlgorithm = exports.SupportedAlgorithm || (exports.SupportedAlgorithm = {}));
    },
    483(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "signing-key/5.7.12";
    },
    2494(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var Buffer = __webpack_require__(8287)["Buffer"];
      var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        Object.defineProperty(o, k2, {
          enumerable: true,
          get: function() {
            return m[k];
          }
        });
      } : function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
      });
      var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
        Object.defineProperty(o, "default", {
          enumerable: true,
          value: v
        });
      } : function(o, v) {
        o["default"] = v;
      });
      var __importStar = this && this.__importStar || function(mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
        __setModuleDefault(result, mod);
        return result;
      };
      var __importDefault = this && this.__importDefault || function(mod) {
        return mod && mod.__esModule ? mod : {
          default: mod
        };
      };
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.recoverPublicKey = exports.SigningKey = void 0;
      const bytes_1 = __webpack_require__(8380);
      const properties_1 = __webpack_require__(1476);
      const crypto_1 = __importDefault(__webpack_require__(1565));
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(483);
      const logger = new logger_1.Logger(_version_1.version);
      async function loadDilithium() {
        const isNode = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
        if (isNode) {
          const dilithiumPromise = __webpack_require__(6052);
          return await dilithiumPromise;
        } else {
          const mod = await Promise.resolve().then((() => __importStar(__webpack_require__(6052))));
          return await mod.createDilithium();
        }
      }
      class SigningKey {
        constructor(privateKey, publicKey) {
          if ((0, bytes_1.isHexString)(privateKey, 2800)) {
            (0, properties_1.defineReadOnly)(this, "privateKey", privateKey);
          } else {
            (0, properties_1.defineReadOnly)(this, "privateKey", (0, bytes_1.hexlify)(privateKey));
          }
          if ((0, bytes_1.hexDataLength)(this.privateKey) !== 2800) {
            logger.throwArgumentError("invalid private key", "privateKey", "[[ REDACTED ]]");
          }
          if ((0, bytes_1.isHexString)(privateKey, 1184)) {
            (0, properties_1.defineReadOnly)(this, "publicKey", publicKey);
          } else {
            (0, properties_1.defineReadOnly)(this, "publicKey", (0, bytes_1.hexlify)(publicKey));
          }
          if ((0, bytes_1.hexDataLength)(this.publicKey) !== 1184) {
            logger.throwArgumentError("invalid public key", "publicKey", "[[ REDACTED ]]");
          }
          (0, properties_1.defineReadOnly)(this, "_isSigningKey", true);
        }
        static async ensureInitialized() {
          if (SigningKey.dilithiumInstance) return;
          if (!SigningKey.dilithiumReady) {
            SigningKey.dilithiumReady = (async () => {
              SigningKey.dilithiumInstance = await loadDilithium();
            })();
          }
          return SigningKey.dilithiumReady;
        }
        static async create(privateKey, publicKey) {
          await SigningKey.ensureInitialized();
          return new SigningKey(privateKey, publicKey);
        }
        static createSync(privateKey, publicKey) {
          if (!SigningKey.dilithiumInstance) {
            throw new Error("Dilithium WASM is not initialized. Call SigningKey.initialize() first.");
          }
          return new SigningKey(privateKey, publicKey);
        }
        async signDigest(digest, kind = 1) {
          await SigningKey.ensureInitialized();
          const digestBytes = (0, bytes_1.arrayify)(digest);
          if (digestBytes.length !== 32) {
            logger.throwArgumentError("bad digest length", "digest", digest);
          }
          const sign = SigningKey.dilithiumInstance.sign(digestBytes, (0, bytes_1.arrayify)(this.privateKey), kind);
          return {
            signature: (0, bytes_1.hexlify)(sign.signature),
            publicKey: this.publicKey
          };
        }
        static async generateFromMnemonics(mnemonics) {
          await SigningKey.ensureInitialized();
          const words = mnemonics.split(" ");
          const hash_temp = crypto_1.default.createHash("sha256");
          for (const word of words) {
            hash_temp.update(Buffer.from(word, "utf-8"));
          }
          const hash = hash_temp.digest("hex");
          const seedBuffer = Buffer.from(hash, "hex");
          const seedBufferSerialized = seedBuffer.subarray(0, Math.floor(seedBuffer.length / 2));
          const {publicKey, privateKey} = SigningKey.dilithiumInstance.generateKeys(1, seedBufferSerialized);
          return new SigningKey(privateKey, publicKey);
        }
        static isSigningKey(value) {
          return !!(value && value._isSigningKey);
        }
        static async initialize() {
          if (SigningKey.dilithiumInstance == undefined) {
            SigningKey.dilithiumInstance = await loadDilithium();
          }
        }
      }
      exports.SigningKey = SigningKey;
      SigningKey.dilithiumInstance = null;
      SigningKey.dilithiumReady = null;
      function recoverPublicKey(digest, signature) {
        const sig = (0, bytes_1.splitSignature)(signature);
        return "0x" + sig.publicKey;
      }
      exports.recoverPublicKey = recoverPublicKey;
    },
    2798(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "strings/5.7.2";
    },
    4255(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.formatBytes32String = formatBytes32String;
      exports.parseBytes32String = parseBytes32String;
      const constants_1 = __webpack_require__(846);
      const bytes_1 = __webpack_require__(8380);
      const utf8_1 = __webpack_require__(3410);
      function formatBytes32String(text) {
        const bytes = (0, utf8_1.toUtf8Bytes)(text);
        if (bytes.length > 31) {
          throw new Error("bytes32 string must be less than 32 bytes");
        }
        return (0, bytes_1.hexlify)((0, bytes_1.concat)([ bytes, constants_1.HashZero ]).slice(0, 32));
      }
      function parseBytes32String(bytes) {
        const data = (0, bytes_1.arrayify)(bytes);
        if (data.length !== 32) {
          throw new Error("invalid bytes32 - not 32 bytes long");
        }
        if (data[31] !== 0) {
          throw new Error("invalid bytes32 string - no null terminator");
        }
        let length = 31;
        while (data[length - 1] === 0) {
          length--;
        }
        return (0, utf8_1.toUtf8String)(data.slice(0, length));
      }
    },
    4541(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports._nameprepTableA1 = _nameprepTableA1;
      exports._nameprepTableB2 = _nameprepTableB2;
      exports._nameprepTableC = _nameprepTableC;
      exports.nameprep = nameprep;
      const utf8_1 = __webpack_require__(3410);
      function bytes2(data) {
        if (data.length % 4 !== 0) {
          throw new Error("bad data");
        }
        let result = [];
        for (let i = 0; i < data.length; i += 4) {
          result.push(parseInt(data.substring(i, i + 4), 16));
        }
        return result;
      }
      function createTable(data, func) {
        if (!func) {
          func = function(value) {
            return [ parseInt(value, 16) ];
          };
        }
        let lo = 0;
        let result = {};
        data.split(",").forEach((pair => {
          let comps = pair.split(":");
          lo += parseInt(comps[0], 16);
          result[lo] = func(comps[1]);
        }));
        return result;
      }
      function createRangeTable(data) {
        let hi = 0;
        return data.split(",").map((v => {
          let comps = v.split("-");
          if (comps.length === 1) {
            comps[1] = "0";
          } else if (comps[1] === "") {
            comps[1] = "1";
          }
          let lo = hi + parseInt(comps[0], 16);
          hi = parseInt(comps[1], 16);
          return {
            l: lo,
            h: hi
          };
        }));
      }
      function matchMap(value, ranges) {
        let lo = 0;
        for (let i = 0; i < ranges.length; i++) {
          let range = ranges[i];
          lo += range.l;
          if (value >= lo && value <= lo + range.h && (value - lo) % (range.d || 1) === 0) {
            if (range.e && range.e.indexOf(value - lo) !== -1) {
              continue;
            }
            return range;
          }
        }
        return null;
      }
      const Table_A_1_ranges = createRangeTable("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d");
      const Table_B_1_flags = "ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((v => parseInt(v, 16)));
      const Table_B_2_ranges = [ {
        h: 25,
        s: 32,
        l: 65
      }, {
        h: 30,
        s: 32,
        e: [ 23 ],
        l: 127
      }, {
        h: 54,
        s: 1,
        e: [ 48 ],
        l: 64,
        d: 2
      }, {
        h: 14,
        s: 1,
        l: 57,
        d: 2
      }, {
        h: 44,
        s: 1,
        l: 17,
        d: 2
      }, {
        h: 10,
        s: 1,
        e: [ 2, 6, 8 ],
        l: 61,
        d: 2
      }, {
        h: 16,
        s: 1,
        l: 68,
        d: 2
      }, {
        h: 84,
        s: 1,
        e: [ 18, 24, 66 ],
        l: 19,
        d: 2
      }, {
        h: 26,
        s: 32,
        e: [ 17 ],
        l: 435
      }, {
        h: 22,
        s: 1,
        l: 71,
        d: 2
      }, {
        h: 15,
        s: 80,
        l: 40
      }, {
        h: 31,
        s: 32,
        l: 16
      }, {
        h: 32,
        s: 1,
        l: 80,
        d: 2
      }, {
        h: 52,
        s: 1,
        l: 42,
        d: 2
      }, {
        h: 12,
        s: 1,
        l: 55,
        d: 2
      }, {
        h: 40,
        s: 1,
        e: [ 38 ],
        l: 15,
        d: 2
      }, {
        h: 14,
        s: 1,
        l: 48,
        d: 2
      }, {
        h: 37,
        s: 48,
        l: 49
      }, {
        h: 148,
        s: 1,
        l: 6351,
        d: 2
      }, {
        h: 88,
        s: 1,
        l: 160,
        d: 2
      }, {
        h: 15,
        s: 16,
        l: 704
      }, {
        h: 25,
        s: 26,
        l: 854
      }, {
        h: 25,
        s: 32,
        l: 55915
      }, {
        h: 37,
        s: 40,
        l: 1247
      }, {
        h: 25,
        s: -119711,
        l: 53248
      }, {
        h: 25,
        s: -119763,
        l: 52
      }, {
        h: 25,
        s: -119815,
        l: 52
      }, {
        h: 25,
        s: -119867,
        e: [ 1, 4, 5, 7, 8, 11, 12, 17 ],
        l: 52
      }, {
        h: 25,
        s: -119919,
        l: 52
      }, {
        h: 24,
        s: -119971,
        e: [ 2, 7, 8, 17 ],
        l: 52
      }, {
        h: 24,
        s: -120023,
        e: [ 2, 7, 13, 15, 16, 17 ],
        l: 52
      }, {
        h: 25,
        s: -120075,
        l: 52
      }, {
        h: 25,
        s: -120127,
        l: 52
      }, {
        h: 25,
        s: -120179,
        l: 52
      }, {
        h: 25,
        s: -120231,
        l: 52
      }, {
        h: 25,
        s: -120283,
        l: 52
      }, {
        h: 25,
        s: -120335,
        l: 52
      }, {
        h: 24,
        s: -119543,
        e: [ 17 ],
        l: 56
      }, {
        h: 24,
        s: -119601,
        e: [ 17 ],
        l: 58
      }, {
        h: 24,
        s: -119659,
        e: [ 17 ],
        l: 58
      }, {
        h: 24,
        s: -119717,
        e: [ 17 ],
        l: 58
      }, {
        h: 24,
        s: -119775,
        e: [ 17 ],
        l: 58
      } ];
      const Table_B_2_lut_abs = createTable("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3");
      const Table_B_2_lut_rel = createTable("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7");
      const Table_B_2_complex = createTable("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D", bytes2);
      const Table_C_ranges = createRangeTable("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");
      function flatten(values) {
        return values.reduce(((accum, value) => {
          value.forEach((value => {
            accum.push(value);
          }));
          return accum;
        }), []);
      }
      function _nameprepTableA1(codepoint) {
        return !!matchMap(codepoint, Table_A_1_ranges);
      }
      function _nameprepTableB2(codepoint) {
        let range = matchMap(codepoint, Table_B_2_ranges);
        if (range) {
          return [ codepoint + range.s ];
        }
        let codes = Table_B_2_lut_abs[codepoint];
        if (codes) {
          return codes;
        }
        let shift = Table_B_2_lut_rel[codepoint];
        if (shift) {
          return [ codepoint + shift[0] ];
        }
        let complex = Table_B_2_complex[codepoint];
        if (complex) {
          return complex;
        }
        return null;
      }
      function _nameprepTableC(codepoint) {
        return !!matchMap(codepoint, Table_C_ranges);
      }
      function nameprep(value) {
        if (value.match(/^[a-z0-9-]*$/i) && value.length <= 59) {
          return value.toLowerCase();
        }
        let codes = (0, utf8_1.toUtf8CodePoints)(value);
        codes = flatten(codes.map((code => {
          if (Table_B_1_flags.indexOf(code) >= 0) {
            return [];
          }
          if (code >= 65024 && code <= 65039) {
            return [];
          }
          let codesTableB2 = _nameprepTableB2(code);
          if (codesTableB2) {
            return codesTableB2;
          }
          return [ code ];
        })));
        codes = (0, utf8_1.toUtf8CodePoints)((0, utf8_1._toUtf8String)(codes), utf8_1.UnicodeNormalizationForm.NFKC);
        codes.forEach((code => {
          if (_nameprepTableC(code)) {
            throw new Error("STRINGPREP_CONTAINS_PROHIBITED");
          }
        }));
        codes.forEach((code => {
          if (_nameprepTableA1(code)) {
            throw new Error("STRINGPREP_CONTAINS_UNASSIGNED");
          }
        }));
        let name = (0, utf8_1._toUtf8String)(codes);
        if (name.substring(0, 1) === "-" || name.substring(2, 4) === "--" || name.substring(name.length - 1) === "-") {
          throw new Error("invalid hyphen");
        }
        return name;
      }
    },
    2509(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.nameprep = exports.parseBytes32String = exports.formatBytes32String = exports.UnicodeNormalizationForm = exports.Utf8ErrorReason = exports.Utf8ErrorFuncs = exports.toUtf8String = exports.toUtf8CodePoints = exports.toUtf8Bytes = exports._toEscapedUtf8String = void 0;
      const bytes32_1 = __webpack_require__(4255);
      Object.defineProperty(exports, "formatBytes32String", {
        enumerable: true,
        get: function() {
          return bytes32_1.formatBytes32String;
        }
      });
      Object.defineProperty(exports, "parseBytes32String", {
        enumerable: true,
        get: function() {
          return bytes32_1.parseBytes32String;
        }
      });
      const idna_1 = __webpack_require__(4541);
      Object.defineProperty(exports, "nameprep", {
        enumerable: true,
        get: function() {
          return idna_1.nameprep;
        }
      });
      const utf8_1 = __webpack_require__(3410);
      Object.defineProperty(exports, "_toEscapedUtf8String", {
        enumerable: true,
        get: function() {
          return utf8_1._toEscapedUtf8String;
        }
      });
      Object.defineProperty(exports, "toUtf8Bytes", {
        enumerable: true,
        get: function() {
          return utf8_1.toUtf8Bytes;
        }
      });
      Object.defineProperty(exports, "toUtf8CodePoints", {
        enumerable: true,
        get: function() {
          return utf8_1.toUtf8CodePoints;
        }
      });
      Object.defineProperty(exports, "toUtf8String", {
        enumerable: true,
        get: function() {
          return utf8_1.toUtf8String;
        }
      });
      Object.defineProperty(exports, "UnicodeNormalizationForm", {
        enumerable: true,
        get: function() {
          return utf8_1.UnicodeNormalizationForm;
        }
      });
      Object.defineProperty(exports, "Utf8ErrorFuncs", {
        enumerable: true,
        get: function() {
          return utf8_1.Utf8ErrorFuncs;
        }
      });
      Object.defineProperty(exports, "Utf8ErrorReason", {
        enumerable: true,
        get: function() {
          return utf8_1.Utf8ErrorReason;
        }
      });
    },
    3410(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Utf8ErrorFuncs = exports.Utf8ErrorReason = exports.UnicodeNormalizationForm = void 0;
      exports.toUtf8Bytes = toUtf8Bytes;
      exports._toEscapedUtf8String = _toEscapedUtf8String;
      exports._toUtf8String = _toUtf8String;
      exports.toUtf8String = toUtf8String;
      exports.toUtf8CodePoints = toUtf8CodePoints;
      const bytes_1 = __webpack_require__(8380);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(2798);
      const logger = new logger_1.Logger(_version_1.version);
      var UnicodeNormalizationForm;
      (function(UnicodeNormalizationForm) {
        UnicodeNormalizationForm["current"] = "";
        UnicodeNormalizationForm["NFC"] = "NFC";
        UnicodeNormalizationForm["NFD"] = "NFD";
        UnicodeNormalizationForm["NFKC"] = "NFKC";
        UnicodeNormalizationForm["NFKD"] = "NFKD";
      })(UnicodeNormalizationForm || (exports.UnicodeNormalizationForm = UnicodeNormalizationForm = {}));
      var Utf8ErrorReason;
      (function(Utf8ErrorReason) {
        Utf8ErrorReason["UNEXPECTED_CONTINUE"] = "unexpected continuation byte";
        Utf8ErrorReason["BAD_PREFIX"] = "bad codepoint prefix";
        Utf8ErrorReason["OVERRUN"] = "string overrun";
        Utf8ErrorReason["MISSING_CONTINUE"] = "missing continuation byte";
        Utf8ErrorReason["OUT_OF_RANGE"] = "out of UTF-8 range";
        Utf8ErrorReason["UTF16_SURROGATE"] = "UTF-16 surrogate";
        Utf8ErrorReason["OVERLONG"] = "overlong representation";
      })(Utf8ErrorReason || (exports.Utf8ErrorReason = Utf8ErrorReason = {}));
      function errorFunc(reason, offset, bytes, output, badCodepoint) {
        return logger.throwArgumentError(`invalid codepoint at offset ${offset}; ${reason}`, "bytes", bytes);
      }
      function ignoreFunc(reason, offset, bytes, output, badCodepoint) {
        if (reason === Utf8ErrorReason.BAD_PREFIX || reason === Utf8ErrorReason.UNEXPECTED_CONTINUE) {
          let i = 0;
          for (let o = offset + 1; o < bytes.length; o++) {
            if (bytes[o] >> 6 !== 2) {
              break;
            }
            i++;
          }
          return i;
        }
        if (reason === Utf8ErrorReason.OVERRUN) {
          return bytes.length - offset - 1;
        }
        return 0;
      }
      function replaceFunc(reason, offset, bytes, output, badCodepoint) {
        if (reason === Utf8ErrorReason.OVERLONG) {
          output.push(badCodepoint);
          return 0;
        }
        output.push(65533);
        return ignoreFunc(reason, offset, bytes, output, badCodepoint);
      }
      exports.Utf8ErrorFuncs = Object.freeze({
        error: errorFunc,
        ignore: ignoreFunc,
        replace: replaceFunc
      });
      function getUtf8CodePoints(bytes, onError) {
        if (onError == null) {
          onError = exports.Utf8ErrorFuncs.error;
        }
        bytes = (0, bytes_1.arrayify)(bytes);
        const result = [];
        let i = 0;
        while (i < bytes.length) {
          const c = bytes[i++];
          if (c >> 7 === 0) {
            result.push(c);
            continue;
          }
          let extraLength = null;
          let overlongMask = null;
          if ((c & 224) === 192) {
            extraLength = 1;
            overlongMask = 127;
          } else if ((c & 240) === 224) {
            extraLength = 2;
            overlongMask = 2047;
          } else if ((c & 248) === 240) {
            extraLength = 3;
            overlongMask = 65535;
          } else {
            if ((c & 192) === 128) {
              i += onError(Utf8ErrorReason.UNEXPECTED_CONTINUE, i - 1, bytes, result);
            } else {
              i += onError(Utf8ErrorReason.BAD_PREFIX, i - 1, bytes, result);
            }
            continue;
          }
          if (i - 1 + extraLength >= bytes.length) {
            i += onError(Utf8ErrorReason.OVERRUN, i - 1, bytes, result);
            continue;
          }
          let res = c & (1 << 8 - extraLength - 1) - 1;
          for (let j = 0; j < extraLength; j++) {
            let nextChar = bytes[i];
            if ((nextChar & 192) != 128) {
              i += onError(Utf8ErrorReason.MISSING_CONTINUE, i, bytes, result);
              res = null;
              break;
            }
            res = res << 6 | nextChar & 63;
            i++;
          }
          if (res === null) {
            continue;
          }
          if (res > 1114111) {
            i += onError(Utf8ErrorReason.OUT_OF_RANGE, i - 1 - extraLength, bytes, result, res);
            continue;
          }
          if (res >= 55296 && res <= 57343) {
            i += onError(Utf8ErrorReason.UTF16_SURROGATE, i - 1 - extraLength, bytes, result, res);
            continue;
          }
          if (res <= overlongMask) {
            i += onError(Utf8ErrorReason.OVERLONG, i - 1 - extraLength, bytes, result, res);
            continue;
          }
          result.push(res);
        }
        return result;
      }
      function toUtf8Bytes(str, form = UnicodeNormalizationForm.current) {
        if (form != UnicodeNormalizationForm.current) {
          logger.checkNormalize();
          str = str.normalize(form);
        }
        let result = [];
        for (let i = 0; i < str.length; i++) {
          const c = str.charCodeAt(i);
          if (c < 128) {
            result.push(c);
          } else if (c < 2048) {
            result.push(c >> 6 | 192);
            result.push(c & 63 | 128);
          } else if ((c & 64512) == 55296) {
            i++;
            const c2 = str.charCodeAt(i);
            if (i >= str.length || (c2 & 64512) !== 56320) {
              throw new Error("invalid utf-8 string");
            }
            const pair = 65536 + ((c & 1023) << 10) + (c2 & 1023);
            result.push(pair >> 18 | 240);
            result.push(pair >> 12 & 63 | 128);
            result.push(pair >> 6 & 63 | 128);
            result.push(pair & 63 | 128);
          } else {
            result.push(c >> 12 | 224);
            result.push(c >> 6 & 63 | 128);
            result.push(c & 63 | 128);
          }
        }
        return (0, bytes_1.arrayify)(result);
      }
      function escapeChar(value) {
        const hex = "0000" + value.toString(16);
        return "\\u" + hex.substring(hex.length - 4);
      }
      function _toEscapedUtf8String(bytes, onError) {
        return '"' + getUtf8CodePoints(bytes, onError).map((codePoint => {
          if (codePoint < 256) {
            switch (codePoint) {
             case 8:
              return "\\b";

             case 9:
              return "\\t";

             case 10:
              return "\\n";

             case 13:
              return "\\r";

             case 34:
              return '\\"';

             case 92:
              return "\\\\";
            }
            if (codePoint >= 32 && codePoint < 127) {
              return String.fromCharCode(codePoint);
            }
          }
          if (codePoint <= 65535) {
            return escapeChar(codePoint);
          }
          codePoint -= 65536;
          return escapeChar((codePoint >> 10 & 1023) + 55296) + escapeChar((codePoint & 1023) + 56320);
        })).join("") + '"';
      }
      function _toUtf8String(codePoints) {
        return codePoints.map((codePoint => {
          if (codePoint <= 65535) {
            return String.fromCharCode(codePoint);
          }
          codePoint -= 65536;
          return String.fromCharCode((codePoint >> 10 & 1023) + 55296, (codePoint & 1023) + 56320);
        })).join("");
      }
      function toUtf8String(bytes, onError) {
        return _toUtf8String(getUtf8CodePoints(bytes, onError));
      }
      function toUtf8CodePoints(str, form = UnicodeNormalizationForm.current) {
        return getUtf8CodePoints(toUtf8Bytes(str, form));
      }
    },
    4861(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "transactions/5.7.3";
    },
    3776(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        var desc = Object.getOwnPropertyDescriptor(m, k);
        if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
          desc = {
            enumerable: true,
            get: function() {
              return m[k];
            }
          };
        }
        Object.defineProperty(o, k2, desc);
      } : function(o, m, k, k2) {
        if (k2 === undefined) k2 = k;
        o[k2] = m[k];
      });
      var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
        Object.defineProperty(o, "default", {
          enumerable: true,
          value: v
        });
      } : function(o, v) {
        o["default"] = v;
      });
      var __importStar = this && this.__importStar || function() {
        var ownKeys = function(o) {
          ownKeys = Object.getOwnPropertyNames || function(o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
          };
          return ownKeys(o);
        };
        return function(mod) {
          if (mod && mod.__esModule) return mod;
          var result = {};
          if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
          __setModuleDefault(result, mod);
          return result;
        };
      }();
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.TransactionTypes = void 0;
      exports.computeAddress = computeAddress;
      exports.recoverAddress = recoverAddress;
      exports.accessListify = accessListify;
      exports.serialize = serialize;
      exports.parse = parse;
      const address_1 = __webpack_require__(171);
      const bignumber_1 = __webpack_require__(3804);
      const bytes_1 = __webpack_require__(8380);
      const constants_1 = __webpack_require__(846);
      const keccak256_1 = __webpack_require__(1136);
      const properties_1 = __webpack_require__(1476);
      const RLP = __importStar(__webpack_require__(589));
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(4861);
      const logger = new logger_1.Logger(_version_1.version);
      var TransactionTypes;
      (function(TransactionTypes) {
        TransactionTypes[TransactionTypes["legacy"] = 0] = "legacy";
        TransactionTypes[TransactionTypes["eip2930"] = 1] = "eip2930";
        TransactionTypes[TransactionTypes["eip1559"] = 2] = "eip1559";
      })(TransactionTypes || (exports.TransactionTypes = TransactionTypes = {}));
      function handleAddress(value) {
        if (value === "0x") {
          return null;
        }
        return (0, address_1.getAddress)(value);
      }
      function handleNumber(value) {
        if (value === "0x") {
          return constants_1.Zero;
        }
        return bignumber_1.BigNumber.from(value);
      }
      const transactionFields = [ {
        name: "nonce",
        maxLength: 32,
        numeric: true
      }, {
        name: "gasPrice",
        maxLength: 32,
        numeric: true
      }, {
        name: "gasLimit",
        maxLength: 32,
        numeric: true
      }, {
        name: "to",
        length: 32
      }, {
        name: "value",
        maxLength: 32,
        numeric: true
      }, {
        name: "data"
      } ];
      const allowedTransactionKeys = {
        chainId: true,
        data: true,
        gasLimit: true,
        gasPrice: true,
        nonce: true,
        to: true,
        type: true,
        value: true
      };
      function computeAddress(publicKey) {
        return (0, keccak256_1.keccak256)(publicKey);
      }
      function recoverAddress(signature) {
        let sig = (0, bytes_1.splitSignature)(signature);
        return (0, keccak256_1.keccak256)(sig.publicKey);
      }
      function formatNumber(value, name) {
        const result = (0, bytes_1.stripZeros)(bignumber_1.BigNumber.from(value).toHexString());
        if (result.length > 32) {
          logger.throwArgumentError("invalid length for " + name, "transaction:" + name, value);
        }
        return result;
      }
      function accessSetify(addr, storageKeys) {
        return {
          address: (0, address_1.getAddress)(addr),
          storageKeys: (storageKeys || []).map(((storageKey, index) => {
            if ((0, bytes_1.hexDataLength)(storageKey) !== 32) {
              logger.throwArgumentError("invalid access list storageKey", `accessList[${addr}:${index}]`, storageKey);
            }
            return storageKey.toLowerCase();
          }))
        };
      }
      function accessListify(value) {
        if (Array.isArray(value)) {
          return value.map(((set, index) => {
            if (Array.isArray(set)) {
              if (set.length > 2) {
                logger.throwArgumentError("access list expected to be [ address, storageKeys[] ]", `value[${index}]`, set);
              }
              return accessSetify(set[0], set[1]);
            }
            return accessSetify(set.address, set.storageKeys);
          }));
        }
        const result = Object.keys(value).map((addr => {
          const storageKeys = value[addr].reduce(((accum, storageKey) => {
            accum[storageKey] = true;
            return accum;
          }), {});
          return accessSetify(addr, Object.keys(storageKeys).sort());
        }));
        result.sort(((a, b) => a.address.localeCompare(b.address)));
        return result;
      }
      function formatAccessList(value) {
        return accessListify(value).map((set => [ set.address, set.storageKeys ]));
      }
      function _serializeEip1559(transaction, signature) {
        if (transaction.gasPrice != null) {
          const gasPrice = bignumber_1.BigNumber.from(transaction.gasPrice);
          const maxFeePerGas = bignumber_1.BigNumber.from(transaction.maxFeePerGas || 0);
          if (!gasPrice.eq(maxFeePerGas)) {
            logger.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas", "tx", {
              gasPrice,
              maxFeePerGas
            });
          }
        }
        const fields = [ formatNumber(transaction.chainId || 0, "chainId"), formatNumber(transaction.nonce || 0, "nonce"), formatNumber(transaction.maxPriorityFeePerGas || 0, "maxPriorityFeePerGas"), formatNumber(transaction.maxFeePerGas || 0, "maxFeePerGas"), formatNumber(transaction.gasLimit || 0, "gasLimit"), transaction.to != null ? (0, 
        address_1.getAddress)(transaction.to) : "0x", formatNumber(transaction.value || 0, "value"), transaction.data || "0x", formatAccessList(transaction.accessList || []) ];
        if (signature) {
          fields.push((0, bytes_1.joinSignature)(signature));
        }
        return (0, bytes_1.hexConcat)([ "0x02", RLP.encode(fields) ]);
      }
      function _serializeEip2930(transaction, signature) {
        const fields = [ formatNumber(transaction.chainId || 0, "chainId"), formatNumber(transaction.nonce || 0, "nonce"), formatNumber(transaction.gasPrice || 0, "gasPrice"), formatNumber(transaction.gasLimit || 0, "gasLimit"), transaction.to != null ? (0, 
        address_1.getAddress)(transaction.to) : "0x", formatNumber(transaction.value || 0, "value"), transaction.data || "0x", formatAccessList(transaction.accessList || []) ];
        if (signature) {
          fields.push((0, bytes_1.joinSignature)(signature));
        }
        return (0, bytes_1.hexConcat)([ "0x01", RLP.encode(fields) ]);
      }
      function _serialize(transaction, signature) {
        (0, properties_1.checkProperties)(transaction, allowedTransactionKeys);
        const raw = [];
        transactionFields.forEach((function(fieldInfo) {
          let value = transaction[fieldInfo.name] || [];
          const options = {};
          if (fieldInfo.numeric) {
            options.hexPad = "left";
          }
          value = (0, bytes_1.arrayify)((0, bytes_1.hexlify)(value, options));
          if (fieldInfo.length && value.length !== fieldInfo.length && value.length > 0) {
            logger.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
          }
          if (fieldInfo.maxLength) {
            value = (0, bytes_1.stripZeros)(value);
            if (value.length > fieldInfo.maxLength) {
              logger.throwArgumentError("invalid length for " + fieldInfo.name, "transaction:" + fieldInfo.name, value);
            }
          }
          raw.push((0, bytes_1.hexlify)(value));
        }));
        let chainId = 0;
        if (transaction.chainId != null) {
          chainId = transaction.chainId;
          if (typeof chainId !== "number") {
            logger.throwArgumentError("invalid transaction.chainId", "transaction", transaction);
          }
        }
        if (chainId !== 0) {
          raw.push((0, bytes_1.hexlify)(chainId));
        }
        if (signature) {
          raw.push((0, bytes_1.joinSignature)(signature));
        }
        return RLP.encode(raw);
      }
      function serialize(transaction, signature) {
        if (transaction.type == null || transaction.type === 0) {
          if (transaction.accessList != null) {
            logger.throwArgumentError("untyped transactions do not support accessList; include type: 1", "transaction", transaction);
          }
          return _serialize(transaction, signature);
        }
        switch (transaction.type) {
         case 1:
          return _serializeEip2930(transaction, signature);

         case 2:
          return _serializeEip1559(transaction, signature);

         default:
          break;
        }
        return logger.throwError(`unsupported transaction type: ${transaction.type}`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
          operation: "serializeTransaction",
          transactionType: transaction.type
        });
      }
      function _parseEip1559(payload) {
        const transaction = RLP.decode(payload.slice(1));
        if (transaction.length !== 9 && transaction.length !== 10) {
          logger.throwArgumentError("invalid component count for transaction type: 2", "payload", (0, 
          bytes_1.hexlify)(payload));
        }
        const maxPriorityFeePerGas = handleNumber(transaction[2]);
        const maxFeePerGas = handleNumber(transaction[3]);
        const tx = {
          type: 2,
          chainId: handleNumber(transaction[0]).toNumber(),
          nonce: handleNumber(transaction[1]).toNumber(),
          maxPriorityFeePerGas,
          maxFeePerGas,
          gasPrice: null,
          gasLimit: handleNumber(transaction[4]),
          to: handleAddress(transaction[5]),
          value: handleNumber(transaction[6]),
          data: transaction[7],
          accessList: accessListify(transaction[8])
        };
        if (transaction.length === 9) {
          return tx;
        }
        tx.hash = (0, keccak256_1.keccak256)(payload);
        tx.signature = (0, bytes_1.splitSignature)(transaction.slice(9)[0]);
        tx.from = computeAddress(tx.signature.publicKey);
        return tx;
      }
      function _parseEip2930(payload) {
        const transaction = RLP.decode(payload.slice(1));
        if (transaction.length !== 8 && transaction.length !== 9) {
          logger.throwArgumentError("invalid component count for transaction type: 1", "payload", (0, 
          bytes_1.hexlify)(payload));
        }
        const tx = {
          type: 1,
          chainId: handleNumber(transaction[0]).toNumber(),
          nonce: handleNumber(transaction[1]).toNumber(),
          gasPrice: handleNumber(transaction[2]),
          gasLimit: handleNumber(transaction[3]),
          to: handleAddress(transaction[4]),
          value: handleNumber(transaction[5]),
          data: transaction[6],
          accessList: accessListify(transaction[7]),
          signature: ""
        };
        if (transaction.length === 8) {
          return tx;
        }
        tx.hash = (0, keccak256_1.keccak256)(payload);
        tx.signature = (0, bytes_1.splitSignature)(transaction.slice(8)[0]);
        tx.from = computeAddress(tx.signature.publicKey);
        return tx;
      }
      function _parseLegacyAndEIP_155(rawTransaction) {
        const transaction = RLP.decode(rawTransaction);
        if (transaction.length !== 8 && transaction.length !== 7 && transaction.length !== 6) {
          logger.throwArgumentError("invalid raw transaction", "rawTransaction", rawTransaction);
        }
        const tx = {
          nonce: handleNumber(transaction[0]).toNumber(),
          gasPrice: handleNumber(transaction[1]),
          gasLimit: handleNumber(transaction[2]),
          to: handleAddress(transaction[3]),
          value: handleNumber(transaction[4]),
          data: transaction[5],
          chainId: 0
        };
        tx.type = null;
        switch (transaction.length) {
         case 6:
          break;

         case 7:
          let temp = transaction.slice(6)[0];
          if (temp.length == 6522) {
            tx.hash = (0, keccak256_1.keccak256)(rawTransaction);
            tx.signature = (0, bytes_1.splitSignature)(temp);
            tx.from = computeAddress(tx.signature.publicKey);
          } else {
            tx.chainId = bignumber_1.BigNumber.from(temp).toNumber();
          }
          break;

         case 8:
          tx.chainId = bignumber_1.BigNumber.from(transaction.slice(6)[0]).toNumber();
          tx.hash = (0, keccak256_1.keccak256)(rawTransaction);
          tx.signature = (0, bytes_1.splitSignature)(transaction.slice(7)[0]);
          tx.from = computeAddress(tx.signature.publicKey);
          break;

         default:
          break;
        }
        return tx;
      }
      function parse(rawTransaction) {
        const payload = (0, bytes_1.arrayify)(rawTransaction);
        if (payload[0] > 127) {
          return _parseLegacyAndEIP_155(payload);
        }
        switch (payload[0]) {
         case 1:
          return _parseEip2930(payload);

         case 2:
          return _parseEip1559(payload);

         default:
          break;
        }
        return logger.throwError(`unsupported transaction type: ${payload[0]}`, logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
          operation: "parseTransaction",
          transactionType: payload[0]
        });
      }
    },
    1177(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "units/5.7.1";
    },
    5700(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.commify = commify;
      exports.formatUnits = formatUnits;
      exports.parseUnits = parseUnits;
      exports.formatEther = formatEther;
      exports.parseEther = parseEther;
      const bignumber_1 = __webpack_require__(3804);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1177);
      const logger = new logger_1.Logger(_version_1.version);
      const names = [ "wei", "kwei", "mwei", "gwei", "szabo", "finney", "qevm" ];
      function commify(value) {
        const comps = String(value).split(".");
        if (comps.length > 2 || !comps[0].match(/^-?[0-9]*$/) || comps[1] && !comps[1].match(/^[0-9]*$/) || value === "." || value === "-.") {
          logger.throwArgumentError("invalid value", "value", value);
        }
        let whole = comps[0];
        let negative = "";
        if (whole.substring(0, 1) === "-") {
          negative = "-";
          whole = whole.substring(1);
        }
        while (whole.substring(0, 1) === "0") {
          whole = whole.substring(1);
        }
        if (whole === "") {
          whole = "0";
        }
        let suffix = "";
        if (comps.length === 2) {
          suffix = "." + (comps[1] || "0");
        }
        while (suffix.length > 2 && suffix[suffix.length - 1] === "0") {
          suffix = suffix.substring(0, suffix.length - 1);
        }
        const formatted = [];
        while (whole.length) {
          if (whole.length <= 3) {
            formatted.unshift(whole);
            break;
          } else {
            const index = whole.length - 3;
            formatted.unshift(whole.substring(index));
            whole = whole.substring(0, index);
          }
        }
        return negative + formatted.join(",") + suffix;
      }
      function formatUnits(value, unitName) {
        if (typeof unitName === "string") {
          const index = names.indexOf(unitName);
          if (index !== -1) {
            unitName = 3 * index;
          }
        }
        return (0, bignumber_1.formatFixed)(value, unitName != null ? unitName : 18);
      }
      function parseUnits(value, unitName) {
        if (typeof value !== "string") {
          logger.throwArgumentError("value must be a string", "value", value);
        }
        if (typeof unitName === "string") {
          const index = names.indexOf(unitName);
          if (index !== -1) {
            unitName = 3 * index;
          }
        }
        return (0, bignumber_1.parseFixed)(value, unitName != null ? unitName : 18);
      }
      function formatEther(wei) {
        return formatUnits(wei, 18);
      }
      function parseEther(ether) {
        return parseUnits(ether, 18);
      }
    },
    1161(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "wallet/5.7.8";
    },
    1348(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Wallet = void 0;
      exports.verifyMessage = verifyMessage;
      exports.verifyTypedData = verifyTypedData;
      const address_1 = __webpack_require__(171);
      const abstract_signer_1 = __webpack_require__(8788);
      const bytes_1 = __webpack_require__(8380);
      const hash_1 = __webpack_require__(413);
      const keccak256_1 = __webpack_require__(1136);
      const properties_1 = __webpack_require__(1476);
      const signing_key_1 = __webpack_require__(2494);
      const json_wallets_1 = __webpack_require__(3120);
      const transactions_1 = __webpack_require__(3776);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(1161);
      const logger = new logger_1.Logger(_version_1.version);
      function isAccount(value) {
        return value != null && "_isSigningKey" in value === false && (0, bytes_1.isHexString)(value.privateKey, 2800) && (0, 
        bytes_1.isHexString)(value.publicKey, 1184) && value.address != null;
      }
      function hasMnemonic(value) {
        const mnemonic = value.mnemonic;
        return mnemonic;
      }
      class Wallet extends abstract_signer_1.Signer {
        constructor(signingKey, mnemonic, provider) {
          super();
          (0, properties_1.defineReadOnly)(this, "_signingKey", (() => signingKey));
          (0, properties_1.defineReadOnly)(this, "address", (0, address_1.getAddress)((0, 
          transactions_1.computeAddress)(signingKey.publicKey)));
          (0, properties_1.defineReadOnly)(this, "_mnemonic", (() => mnemonic));
          (0, properties_1.defineReadOnly)(this, "provider", provider || null);
        }
        static async create(credentials, provider) {
          if (credentials instanceof Wallet) {
            return new Wallet(await signing_key_1.SigningKey.create(credentials.privateKey, credentials.publicKey), credentials.mnemonic, provider);
          }
          if (typeof credentials === "string") {
            const signingKey = await signing_key_1.SigningKey.generateFromMnemonics(credentials);
            return new Wallet(signingKey, credentials, provider);
          }
          if (signing_key_1.SigningKey.isSigningKey(credentials)) {
            return new Wallet(credentials, null, provider);
          }
          if (isAccount(credentials)) {
            const signingKey = await signing_key_1.SigningKey.create(credentials.privateKey, credentials.publicKey);
            if (hasMnemonic(credentials)) {
              const testKey = await signing_key_1.SigningKey.generateFromMnemonics(credentials.mnemonic);
              if (testKey.privateKey !== signingKey.privateKey || testKey.publicKey !== signingKey.publicKey) {
                throw new Error("mnemonic/keys mismatch");
              }
              return new Wallet(signingKey, credentials.mnemonic, provider);
            } else {
              return new Wallet(signingKey, null, provider);
            }
          }
          throw new Error("Invalid credentials");
        }
        get mnemonic() {
          return this._mnemonic();
        }
        get privateKey() {
          return this._signingKey().privateKey;
        }
        get publicKey() {
          return this._signingKey().publicKey;
        }
        getAddress() {
          return Promise.resolve(this.address);
        }
        connect(provider) {
          return new Wallet(this._signingKey(), this._mnemonic(), provider);
        }
        async signTransaction(transaction) {
          const tx = await (0, properties_1.resolveProperties)(transaction);
          if (tx.from != null && (0, address_1.getAddress)(tx.from) !== this.address) {
            logger.throwArgumentError("transaction from address mismatch", "transaction.from", transaction.from);
          }
          delete tx.from;
          const digest = (0, keccak256_1.keccak256)((0, transactions_1.serialize)(tx));
          const signature = await this._signingKey().signDigest(digest);
          return (0, transactions_1.serialize)(tx, signature);
        }
        async signMessage(message) {
          return (0, bytes_1.joinSignature)(await this._signingKey().signDigest((0, hash_1.hashMessage)(message)));
        }
        async _signTypedData(domain, types, value) {
          const populated = await hash_1._TypedDataEncoder.resolveNames(domain, types, value, (async name => {
            if (!this.provider) {
              logger.throwError("cannot resolve ENS names without a provider", logger_1.Logger.errors.UNSUPPORTED_OPERATION, {
                operation: "resolveName",
                value: name
              });
            }
            return this.provider.resolveName(name);
          }));
          return (0, bytes_1.joinSignature)(await this._signingKey().signDigest(hash_1._TypedDataEncoder.hash(populated.domain, types, populated.value)));
        }
        encrypt(password, options, progressCallback) {
          if (typeof options === "function") {
            progressCallback = options;
            options = {};
          }
          return (0, json_wallets_1.encryptKeystore)(this, password, options || {}, progressCallback);
        }
        static async createRandom(options) {
          await signing_key_1.SigningKey.ensureInitialized();
          const result = signing_key_1.SigningKey.dilithiumInstance.generateKeys(1, null);
          const signingKey = await signing_key_1.SigningKey.create(result.privateKey, result.publicKey);
          return new Wallet(signingKey, null);
        }
        static async fromEncryptedJson(json, password, progressCallback) {
          const account = await (0, json_wallets_1.decryptJsonWallet)(json, password, progressCallback);
          return await Wallet.create(account);
        }
        static fromEncryptedJsonSync(json, password) {
          const account = (0, json_wallets_1.decryptJsonWalletSync)(json, password);
          const signingKey = signing_key_1.SigningKey.createSync(account.privateKey, account.publicKey);
          return new Wallet(signingKey, null);
        }
        static async fromMnemonic(mnemonic, provider) {
          return await Wallet.create(mnemonic, provider);
        }
      }
      exports.Wallet = Wallet;
      async function verifyMessage(message, signature) {
        await signing_key_1.SigningKey.ensureInitialized();
        const sig = (0, bytes_1.splitSignature)(signature);
        const varResult = signing_key_1.SigningKey.dilithiumInstance.verify((0, bytes_1.arrayify)(sig.signature), (0, 
        bytes_1.arrayify)((0, hash_1.hashMessage)(message)), (0, bytes_1.arrayify)(sig.publicKey), 1);
        return varResult.result;
      }
      async function verifyTypedData(domain, types, value, signature) {
        await signing_key_1.SigningKey.ensureInitialized();
        const sig = (0, bytes_1.splitSignature)(signature);
        const varResult = signing_key_1.SigningKey.dilithiumInstance.verify(sig.signature, hash_1._TypedDataEncoder.hash(domain, types, value), sig.publicKey, 1);
        return varResult.result;
      }
    },
    4510(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "web/5.7.4";
    },
    8215(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.getUrl = void 0;
      const bytes_1 = __webpack_require__(8380);
      async function getUrl(href, options) {
        if (options == null) {
          options = {};
        }
        const request = {
          method: options.method || "GET",
          headers: options.headers || {},
          body: options.body || undefined
        };
        if (options.skipFetchSetup !== true) {
          request.mode = "cors";
          request.cache = "no-cache";
          request.credentials = "same-origin";
          request.redirect = "follow";
          request.referrer = "client";
        }
        if (options.fetchOptions != null) {
          const opts = options.fetchOptions;
          if (opts.mode) {
            request.mode = opts.mode;
          }
          if (opts.cache) {
            request.cache = opts.cache;
          }
          if (opts.credentials) {
            request.credentials = opts.credentials;
          }
          if (opts.redirect) {
            request.redirect = opts.redirect;
          }
          if (opts.referrer) {
            request.referrer = opts.referrer;
          }
        }
        const response = await fetch(href, request);
        const body = await response.arrayBuffer();
        const headers = {};
        if (response.headers.forEach) {
          response.headers.forEach(((value, key) => {
            headers[key.toLowerCase()] = value;
          }));
        } else {
          response.headers.keys().forEach((key => {
            headers[key.toLowerCase()] = response.headers.get(key);
          }));
        }
        return {
          headers,
          statusCode: response.status,
          statusMessage: response.statusText,
          body: (0, bytes_1.arrayify)(new Uint8Array(body))
        };
      }
      exports.getUrl = getUrl;
    },
    6637(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.poll = exports.fetchJson = exports._fetchData = void 0;
      const base64_1 = __webpack_require__(8886);
      const bytes_1 = __webpack_require__(8380);
      const properties_1 = __webpack_require__(1476);
      const strings_1 = __webpack_require__(2509);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(4510);
      const logger = new logger_1.Logger(_version_1.version);
      const geturl_1 = __webpack_require__(8215);
      function staller(duration) {
        return new Promise((resolve => {
          setTimeout(resolve, duration);
        }));
      }
      function bodyify(value, type) {
        if (value == null) {
          return null;
        }
        if (typeof value === "string") {
          return value;
        }
        if ((0, bytes_1.isBytesLike)(value)) {
          if (type && (type.split("/")[0] === "text" || type.split(";")[0].trim() === "application/json")) {
            try {
              return (0, strings_1.toUtf8String)(value);
            } catch (error) {}
          }
          return (0, bytes_1.hexlify)(value);
        }
        return value;
      }
      function unpercent(value) {
        return (0, strings_1.toUtf8Bytes)(value.replace(/%([0-9a-f][0-9a-f])/gi, ((all, code) => String.fromCharCode(parseInt(code, 16)))));
      }
      function _fetchData(connection, body, processFunc) {
        const attemptLimit = typeof connection === "object" && connection.throttleLimit != null ? connection.throttleLimit : 12;
        logger.assertArgument(attemptLimit > 0 && attemptLimit % 1 === 0, "invalid connection throttle limit", "connection.throttleLimit", attemptLimit);
        const throttleCallback = typeof connection === "object" ? connection.throttleCallback : null;
        const throttleSlotInterval = typeof connection === "object" && typeof connection.throttleSlotInterval === "number" ? connection.throttleSlotInterval : 100;
        logger.assertArgument(throttleSlotInterval > 0 && throttleSlotInterval % 1 === 0, "invalid connection throttle slot interval", "connection.throttleSlotInterval", throttleSlotInterval);
        const errorPassThrough = typeof connection === "object" ? !!connection.errorPassThrough : false;
        const headers = {};
        let url = null;
        const options = {
          method: "GET"
        };
        let allow304 = false;
        let timeout = 2 * 60 * 1e3;
        if (typeof connection === "string") {
          url = connection;
        } else if (typeof connection === "object") {
          if (connection == null || connection.url == null) {
            logger.throwArgumentError("missing URL", "connection.url", connection);
          }
          url = connection.url;
          if (typeof connection.timeout === "number" && connection.timeout > 0) {
            timeout = connection.timeout;
          }
          if (connection.headers) {
            for (const key in connection.headers) {
              headers[key.toLowerCase()] = {
                key,
                value: String(connection.headers[key])
              };
              if ([ "if-none-match", "if-modified-since" ].indexOf(key.toLowerCase()) >= 0) {
                allow304 = true;
              }
            }
          }
          options.allowGzip = !!connection.allowGzip;
          if (connection.user != null && connection.password != null) {
            if (url.substring(0, 6) !== "https:" && connection.allowInsecureAuthentication !== true) {
              logger.throwError("basic authentication requires a secure https url", logger_1.Logger.errors.INVALID_ARGUMENT, {
                argument: "url",
                url,
                user: connection.user,
                password: "[REDACTED]"
              });
            }
            const authorization = connection.user + ":" + connection.password;
            headers["authorization"] = {
              key: "Authorization",
              value: "Basic " + (0, base64_1.encode)((0, strings_1.toUtf8Bytes)(authorization))
            };
          }
          if (connection.skipFetchSetup != null) {
            options.skipFetchSetup = !!connection.skipFetchSetup;
          }
          if (connection.fetchOptions != null) {
            options.fetchOptions = (0, properties_1.shallowCopy)(connection.fetchOptions);
          }
        }
        const reData = new RegExp("^data:([^;:]*)?(;base64)?,(.*)$", "i");
        const dataMatch = url ? url.match(reData) : null;
        if (dataMatch) {
          try {
            const response = {
              statusCode: 200,
              statusMessage: "OK",
              headers: {
                "content-type": dataMatch[1] || "text/plain"
              },
              body: dataMatch[2] ? (0, base64_1.decode)(dataMatch[3]) : unpercent(dataMatch[3])
            };
            let result = response.body;
            if (processFunc) {
              result = processFunc(response.body, response);
            }
            return Promise.resolve(result);
          } catch (error) {
            logger.throwError("processing response error", logger_1.Logger.errors.SERVER_ERROR, {
              body: bodyify(dataMatch[1], dataMatch[2]),
              error,
              requestBody: null,
              requestMethod: "GET",
              url
            });
          }
        }
        if (body) {
          options.method = "POST";
          options.body = body;
          if (headers["content-type"] == null) {
            headers["content-type"] = {
              key: "Content-Type",
              value: "application/octet-stream"
            };
          }
          if (headers["content-length"] == null) {
            headers["content-length"] = {
              key: "Content-Length",
              value: String(body.length)
            };
          }
        }
        const flatHeaders = {};
        Object.keys(headers).forEach((key => {
          const header = headers[key];
          flatHeaders[header.key] = header.value;
        }));
        options.headers = flatHeaders;
        const runningTimeout = function() {
          let timer = null;
          const promise = new Promise((function(resolve, reject) {
            if (timeout) {
              timer = setTimeout((() => {
                if (timer == null) {
                  return;
                }
                timer = null;
                reject(logger.makeError("timeout", logger_1.Logger.errors.TIMEOUT, {
                  requestBody: bodyify(options.body, flatHeaders["content-type"]),
                  requestMethod: options.method,
                  timeout,
                  url
                }));
              }), timeout);
            }
          }));
          const cancel = function() {
            if (timer == null) {
              return;
            }
            clearTimeout(timer);
            timer = null;
          };
          return {
            promise,
            cancel
          };
        }();
        const runningFetch = async function() {
          for (let attempt = 0; attempt < attemptLimit; attempt++) {
            let response = null;
            try {
              response = await (0, geturl_1.getUrl)(url, options);
              if (attempt < attemptLimit) {
                if (response.statusCode === 301 || response.statusCode === 302) {
                  const location = response.headers.location || "";
                  if (options.method === "GET" && location.match(/^https:/)) {
                    url = response.headers.location;
                    continue;
                  }
                } else if (response.statusCode === 429) {
                  let tryAgain = true;
                  if (throttleCallback) {
                    tryAgain = await throttleCallback(attempt, url);
                  }
                  if (tryAgain) {
                    let stall = 0;
                    const retryAfter = response.headers["retry-after"];
                    if (typeof retryAfter === "string" && retryAfter.match(/^[1-9][0-9]*$/)) {
                      stall = parseInt(retryAfter) * 1e3;
                    } else {
                      stall = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));
                    }
                    await staller(stall);
                    continue;
                  }
                }
              }
            } catch (error) {
              response = error.response;
              if (response == null) {
                runningTimeout.cancel();
                logger.throwError("missing response", logger_1.Logger.errors.SERVER_ERROR, {
                  requestBody: bodyify(options.body, flatHeaders["content-type"]),
                  requestMethod: options.method,
                  serverError: error,
                  url
                });
              }
            }
            let body = response.body;
            if (allow304 && response.statusCode === 304) {
              body = null;
            } else if (!errorPassThrough && (response.statusCode < 200 || response.statusCode >= 300)) {
              runningTimeout.cancel();
              logger.throwError("bad response", logger_1.Logger.errors.SERVER_ERROR, {
                status: response.statusCode,
                headers: response.headers,
                body: bodyify(body, response.headers ? response.headers["content-type"] : null),
                requestBody: bodyify(options.body, flatHeaders["content-type"]),
                requestMethod: options.method,
                url
              });
            }
            if (processFunc) {
              try {
                const result = await processFunc(body, response);
                runningTimeout.cancel();
                return result;
              } catch (error) {
                if (error.throttleRetry && attempt < attemptLimit) {
                  let tryAgain = true;
                  if (throttleCallback) {
                    tryAgain = await throttleCallback(attempt, url);
                  }
                  if (tryAgain) {
                    const timeout = throttleSlotInterval * parseInt(String(Math.random() * Math.pow(2, attempt)));
                    await staller(timeout);
                    continue;
                  }
                }
                runningTimeout.cancel();
                logger.throwError("processing response error", logger_1.Logger.errors.SERVER_ERROR, {
                  body: bodyify(body, response.headers ? response.headers["content-type"] : null),
                  error,
                  requestBody: bodyify(options.body, flatHeaders["content-type"]),
                  requestMethod: options.method,
                  url
                });
              }
            }
            runningTimeout.cancel();
            return body;
          }
          return logger.throwError("failed response", logger_1.Logger.errors.SERVER_ERROR, {
            requestBody: bodyify(options.body, flatHeaders["content-type"]),
            requestMethod: options.method,
            url
          });
        }();
        return Promise.race([ runningTimeout.promise, runningFetch ]);
      }
      exports._fetchData = _fetchData;
      function fetchJson(connection, json, processFunc) {
        let processJsonFunc = (value, response) => {
          let result = null;
          if (value != null) {
            try {
              result = JSON.parse((0, strings_1.toUtf8String)(value));
            } catch (error) {
              logger.throwError("invalid JSON", logger_1.Logger.errors.SERVER_ERROR, {
                body: value,
                error
              });
            }
          }
          if (processFunc) {
            result = processFunc(result, response);
          }
          return result;
        };
        let body = null;
        if (json != null) {
          body = (0, strings_1.toUtf8Bytes)(json);
          const updated = typeof connection === "string" ? {
            url: connection
          } : (0, properties_1.shallowCopy)(connection);
          if (updated.headers) {
            const hasContentType = Object.keys(updated.headers).filter((k => k.toLowerCase() === "content-type")).length !== 0;
            if (!hasContentType) {
              updated.headers = (0, properties_1.shallowCopy)(updated.headers);
              updated.headers["content-type"] = "application/json";
            }
          } else {
            updated.headers = {
              "content-type": "application/json"
            };
          }
          connection = updated;
        }
        return _fetchData(connection, body, processJsonFunc);
      }
      exports.fetchJson = fetchJson;
      function poll(func, options) {
        if (!options) {
          options = {};
        }
        options = (0, properties_1.shallowCopy)(options);
        if (options.floor == null) {
          options.floor = 0;
        }
        if (options.ceiling == null) {
          options.ceiling = 1e4;
        }
        if (options.interval == null) {
          options.interval = 250;
        }
        return new Promise((function(resolve, reject) {
          let timer = null;
          let done = false;
          const cancel = () => {
            if (done) {
              return false;
            }
            done = true;
            if (timer) {
              clearTimeout(timer);
            }
            return true;
          };
          if (options.timeout) {
            timer = setTimeout((() => {
              if (cancel()) {
                reject(new Error("timeout"));
              }
            }), options.timeout);
          }
          const retryLimit = options.retryLimit;
          let attempt = 0;
          function check() {
            return func().then((function(result) {
              if (result !== undefined) {
                if (cancel()) {
                  resolve(result);
                }
              } else if (options.oncePoll) {
                options.oncePoll.once("poll", check);
              } else if (options.onceBlock) {
                options.onceBlock.once("block", check);
              } else if (!done) {
                attempt++;
                if (attempt > retryLimit) {
                  if (cancel()) {
                    reject(new Error("retry limit reached"));
                  }
                  return;
                }
                let timeout = options.interval * parseInt(String(Math.random() * Math.pow(2, attempt)));
                if (timeout < options.floor) {
                  timeout = options.floor;
                }
                if (timeout > options.ceiling) {
                  timeout = options.ceiling;
                }
                setTimeout(check, timeout);
              }
              return null;
            }), (function(error) {
              if (cancel()) {
                reject(error);
              }
            }));
          }
          check();
        }));
      }
      exports.poll = poll;
    },
    6079(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.version = void 0;
      exports.version = "wordlists/5.7.1";
    },
    6261(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.wordlists = exports.Wordlist = exports.logger = void 0;
      const wordlist_1 = __webpack_require__(652);
      Object.defineProperty(exports, "logger", {
        enumerable: true,
        get: function() {
          return wordlist_1.logger;
        }
      });
      Object.defineProperty(exports, "Wordlist", {
        enumerable: true,
        get: function() {
          return wordlist_1.Wordlist;
        }
      });
      const wordlists_1 = __webpack_require__(9107);
      Object.defineProperty(exports, "wordlists", {
        enumerable: true,
        get: function() {
          return wordlists_1.wordlists;
        }
      });
    },
    6587(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langCz = void 0;
      const wordlist_1 = __webpack_require__(652);
      const words = " ";
      let wordlist = null;
      function loadWords(lang) {
        if (wordlist != null) {
          return;
        }
        wordlist = words.replace(/([A-Z])/g, " $1").toLowerCase().substring(1).split(" ");
        if (wordlist_1.Wordlist.check(lang) !== "0x25f44555f4af25b51a711136e1c7d6e50ce9f8917d39d6b1f076b2bb4d2fac1a") {
          wordlist = null;
          throw new Error("BIP39 Wordlist for en (English) FAILED");
        }
      }
      class LangCz extends wordlist_1.Wordlist {
        constructor() {
          super("cz");
        }
        getWord(index) {
          loadWords(this);
          return wordlist[index];
        }
        getWordIndex(word) {
          loadWords(this);
          return wordlist.indexOf(word);
        }
      }
      const langCz = new LangCz;
      exports.langCz = langCz;
      wordlist_1.Wordlist.register(langCz);
    },
    2578(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langEn = void 0;
      const wordlist_1 = __webpack_require__(652);
      const words = " ";
      let wordlist = null;
      function loadWords(lang) {
        if (wordlist != null) {
          return;
        }
        wordlist = words.replace(/([A-Z])/g, " $1").toLowerCase().substring(1).split(" ");
        if (wordlist_1.Wordlist.check(lang) !== "0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60") {
          wordlist = null;
          throw new Error("BIP39 Wordlist for en (English) FAILED");
        }
      }
      class LangEn extends wordlist_1.Wordlist {
        constructor() {
          super("en");
        }
        getWord(index) {
          loadWords(this);
          return wordlist[index];
        }
        getWordIndex(word) {
          loadWords(this);
          return wordlist.indexOf(word);
        }
      }
      const langEn = new LangEn;
      exports.langEn = langEn;
      wordlist_1.Wordlist.register(langEn);
    },
    8581(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langEs = void 0;
      const strings_1 = __webpack_require__(2509);
      const wordlist_1 = __webpack_require__(652);
      const words = "A/bacoAbdomenAbejaAbiertoAbogadoAbonoAbortoAbrazoAbrirAbueloAbusoAcabarAcademiaAccesoAccio/nAceiteAcelgaAcentoAceptarA/cidoAclararAcne/AcogerAcosoActivoActoActrizActuarAcudirAcuerdoAcusarAdictoAdmitirAdoptarAdornoAduanaAdultoAe/reoAfectarAficio/nAfinarAfirmarA/gilAgitarAgoni/aAgostoAgotarAgregarAgrioAguaAgudoA/guilaAgujaAhogoAhorroAireAislarAjedrezAjenoAjusteAlacra/nAlambreAlarmaAlbaA/lbumAlcaldeAldeaAlegreAlejarAlertaAletaAlfilerAlgaAlgodo/nAliadoAlientoAlivioAlmaAlmejaAlmi/barAltarAltezaAltivoAltoAlturaAlumnoAlzarAmableAmanteAmapolaAmargoAmasarA/mbarA/mbitoAmenoAmigoAmistadAmorAmparoAmplioAnchoAncianoAnclaAndarAnde/nAnemiaA/nguloAnilloA/nimoAni/sAnotarAntenaAntiguoAntojoAnualAnularAnuncioA~adirA~ejoA~oApagarAparatoApetitoApioAplicarApodoAporteApoyoAprenderAprobarApuestaApuroAradoAra~aArarA/rbitroA/rbolArbustoArchivoArcoArderArdillaArduoA/reaA/ridoAriesArmoni/aArne/sAromaArpaArpo/nArregloArrozArrugaArteArtistaAsaAsadoAsaltoAscensoAsegurarAseoAsesorAsientoAsiloAsistirAsnoAsombroA/speroAstillaAstroAstutoAsumirAsuntoAtajoAtaqueAtarAtentoAteoA/ticoAtletaA/tomoAtraerAtrozAtu/nAudazAudioAugeAulaAumentoAusenteAutorAvalAvanceAvaroAveAvellanaAvenaAvestruzAvio/nAvisoAyerAyudaAyunoAzafra/nAzarAzoteAzu/carAzufreAzulBabaBaborBacheBahi/aBaileBajarBalanzaBalco/nBaldeBambu/BancoBandaBa~oBarbaBarcoBarnizBarroBa/sculaBasto/nBasuraBatallaBateri/aBatirBatutaBau/lBazarBebe/BebidaBelloBesarBesoBestiaBichoBienBingoBlancoBloqueBlusaBoaBobinaBoboBocaBocinaBodaBodegaBoinaBolaBoleroBolsaBombaBondadBonitoBonoBonsa/iBordeBorrarBosqueBoteBoti/nBo/vedaBozalBravoBrazoBrechaBreveBrilloBrincoBrisaBrocaBromaBronceBroteBrujaBruscoBrutoBuceoBucleBuenoBueyBufandaBufo/nBu/hoBuitreBultoBurbujaBurlaBurroBuscarButacaBuzo/nCaballoCabezaCabinaCabraCacaoCada/verCadenaCaerCafe/Cai/daCaima/nCajaCajo/nCalCalamarCalcioCaldoCalidadCalleCalmaCalorCalvoCamaCambioCamelloCaminoCampoCa/ncerCandilCanelaCanguroCanicaCantoCa~aCa~o/nCaobaCaosCapazCapita/nCapoteCaptarCapuchaCaraCarbo/nCa/rcelCaretaCargaCari~oCarneCarpetaCarroCartaCasaCascoCaseroCaspaCastorCatorceCatreCaudalCausaCazoCebollaCederCedroCeldaCe/lebreCelosoCe/lulaCementoCenizaCentroCercaCerdoCerezaCeroCerrarCertezaCe/spedCetroChacalChalecoChampu/ChanclaChapaCharlaChicoChisteChivoChoqueChozaChuletaChuparCiclo/nCiegoCieloCienCiertoCifraCigarroCimaCincoCineCintaCipre/sCircoCiruelaCisneCitaCiudadClamorClanClaroClaseClaveClienteClimaCli/nicaCobreCoccio/nCochinoCocinaCocoCo/digoCodoCofreCogerCoheteCoji/nCojoColaColchaColegioColgarColinaCollarColmoColumnaCombateComerComidaCo/modoCompraCondeConejoCongaConocerConsejoContarCopaCopiaCorazo/nCorbataCorchoCordo/nCoronaCorrerCoserCosmosCostaCra/neoCra/terCrearCrecerCrei/doCremaCri/aCrimenCriptaCrisisCromoCro/nicaCroquetaCrudoCruzCuadroCuartoCuatroCuboCubrirCucharaCuelloCuentoCuerdaCuestaCuevaCuidarCulebraCulpaCultoCumbreCumplirCunaCunetaCuotaCupo/nCu/pulaCurarCuriosoCursoCurvaCutisDamaDanzaDarDardoDa/tilDeberDe/bilDe/cadaDecirDedoDefensaDefinirDejarDelfi/nDelgadoDelitoDemoraDensoDentalDeporteDerechoDerrotaDesayunoDeseoDesfileDesnudoDestinoDesvi/oDetalleDetenerDeudaDi/aDiabloDiademaDiamanteDianaDiarioDibujoDictarDienteDietaDiezDifi/cilDignoDilemaDiluirDineroDirectoDirigirDiscoDise~oDisfrazDivaDivinoDobleDoceDolorDomingoDonDonarDoradoDormirDorsoDosDosisDrago/nDrogaDuchaDudaDueloDue~oDulceDu/oDuqueDurarDurezaDuroE/banoEbrioEcharEcoEcuadorEdadEdicio/nEdificioEditorEducarEfectoEficazEjeEjemploElefanteElegirElementoElevarElipseE/liteElixirElogioEludirEmbudoEmitirEmocio/nEmpateEmpe~oEmpleoEmpresaEnanoEncargoEnchufeEnci/aEnemigoEneroEnfadoEnfermoEnga~oEnigmaEnlaceEnormeEnredoEnsayoEnse~arEnteroEntrarEnvaseEnvi/oE/pocaEquipoErizoEscalaEscenaEscolarEscribirEscudoEsenciaEsferaEsfuerzoEspadaEspejoEspi/aEsposaEspumaEsqui/EstarEsteEstiloEstufaEtapaEternoE/ticaEtniaEvadirEvaluarEventoEvitarExactoExamenExcesoExcusaExentoExigirExilioExistirE/xitoExpertoExplicarExponerExtremoFa/bricaFa/bulaFachadaFa/cilFactorFaenaFajaFaldaFalloFalsoFaltarFamaFamiliaFamosoFarao/nFarmaciaFarolFarsaFaseFatigaFaunaFavorFaxFebreroFechaFelizFeoFeriaFerozFe/rtilFervorFesti/nFiableFianzaFiarFibraFiccio/nFichaFideoFiebreFielFieraFiestaFiguraFijarFijoFilaFileteFilialFiltroFinFincaFingirFinitoFirmaFlacoFlautaFlechaFlorFlotaFluirFlujoFlu/orFobiaFocaFogataFogo/nFolioFolletoFondoFormaForroFortunaForzarFosaFotoFracasoFra/gilFranjaFraseFraudeFrei/rFrenoFresaFri/oFritoFrutaFuegoFuenteFuerzaFugaFumarFuncio/nFundaFurgo/nFuriaFusilFu/tbolFuturoGacelaGafasGaitaGajoGalaGaleri/aGalloGambaGanarGanchoGangaGansoGarajeGarzaGasolinaGastarGatoGavila/nGemeloGemirGenGe/neroGenioGenteGeranioGerenteGermenGestoGiganteGimnasioGirarGiroGlaciarGloboGloriaGolGolfoGolosoGolpeGomaGordoGorilaGorraGotaGoteoGozarGradaGra/ficoGranoGrasaGratisGraveGrietaGrilloGripeGrisGritoGrosorGru/aGruesoGrumoGrupoGuanteGuapoGuardiaGuerraGui/aGui~oGuionGuisoGuitarraGusanoGustarHaberHa/bilHablarHacerHachaHadaHallarHamacaHarinaHazHaza~aHebillaHebraHechoHeladoHelioHembraHerirHermanoHe/roeHervirHieloHierroHi/gadoHigieneHijoHimnoHistoriaHocicoHogarHogueraHojaHombreHongoHonorHonraHoraHormigaHornoHostilHoyoHuecoHuelgaHuertaHuesoHuevoHuidaHuirHumanoHu/medoHumildeHumoHundirHuraca/nHurtoIconoIdealIdiomaI/doloIglesiaIglu/IgualIlegalIlusio/nImagenIma/nImitarImparImperioImponerImpulsoIncapazI/ndiceInerteInfielInformeIngenioInicioInmensoInmuneInnatoInsectoInstanteIntere/sI/ntimoIntuirInu/tilInviernoIraIrisIroni/aIslaIsloteJabali/Jabo/nJamo/nJarabeJardi/nJarraJaulaJazmi/nJefeJeringaJineteJornadaJorobaJovenJoyaJuergaJuevesJuezJugadorJugoJugueteJuicioJuncoJunglaJunioJuntarJu/piterJurarJustoJuvenilJuzgarKiloKoalaLabioLacioLacraLadoLadro/nLagartoLa/grimaLagunaLaicoLamerLa/minaLa/mparaLanaLanchaLangostaLanzaLa/pizLargoLarvaLa/stimaLataLa/texLatirLaurelLavarLazoLealLeccio/nLecheLectorLeerLegio/nLegumbreLejanoLenguaLentoLe~aLeo/nLeopardoLesio/nLetalLetraLeveLeyendaLibertadLibroLicorLi/derLidiarLienzoLigaLigeroLimaLi/miteLimo/nLimpioLinceLindoLi/neaLingoteLinoLinternaLi/quidoLisoListaLiteraLitioLitroLlagaLlamaLlantoLlaveLlegarLlenarLlevarLlorarLloverLluviaLoboLocio/nLocoLocuraLo/gicaLogroLombrizLomoLonjaLoteLuchaLucirLugarLujoLunaLunesLupaLustroLutoLuzMacetaMachoMaderaMadreMaduroMaestroMafiaMagiaMagoMai/zMaldadMaletaMallaMaloMama/MamboMamutMancoMandoManejarMangaManiqui/ManjarManoMansoMantaMa~anaMapaMa/quinaMarMarcoMareaMarfilMargenMaridoMa/rmolMarro/nMartesMarzoMasaMa/scaraMasivoMatarMateriaMatizMatrizMa/ximoMayorMazorcaMechaMedallaMedioMe/dulaMejillaMejorMelenaMelo/nMemoriaMenorMensajeMenteMenu/MercadoMerengueMe/ritoMesMeso/nMetaMeterMe/todoMetroMezclaMiedoMielMiembroMigaMilMilagroMilitarMillo/nMimoMinaMineroMi/nimoMinutoMiopeMirarMisaMiseriaMisilMismoMitadMitoMochilaMocio/nModaModeloMohoMojarMoldeMolerMolinoMomentoMomiaMonarcaMonedaMonjaMontoMo~oMoradaMorderMorenoMorirMorroMorsaMortalMoscaMostrarMotivoMoverMo/vilMozoMuchoMudarMuebleMuelaMuerteMuestraMugreMujerMulaMuletaMultaMundoMu~ecaMuralMuroMu/sculoMuseoMusgoMu/sicaMusloNa/carNacio/nNadarNaipeNaranjaNarizNarrarNasalNatalNativoNaturalNa/useaNavalNaveNavidadNecioNe/ctarNegarNegocioNegroNeo/nNervioNetoNeutroNevarNeveraNichoNidoNieblaNietoNi~ezNi~oNi/tidoNivelNoblezaNocheNo/minaNoriaNormaNorteNotaNoticiaNovatoNovelaNovioNubeNucaNu/cleoNudilloNudoNueraNueveNuezNuloNu/meroNutriaOasisObesoObispoObjetoObraObreroObservarObtenerObvioOcaOcasoOce/anoOchentaOchoOcioOcreOctavoOctubreOcultoOcuparOcurrirOdiarOdioOdiseaOesteOfensaOfertaOficioOfrecerOgroOi/doOi/rOjoOlaOleadaOlfatoOlivoOllaOlmoOlorOlvidoOmbligoOndaOnzaOpacoOpcio/nO/peraOpinarOponerOptarO/pticaOpuestoOracio/nOradorOralO/rbitaOrcaOrdenOrejaO/rganoOrgi/aOrgulloOrienteOrigenOrillaOroOrquestaOrugaOsadi/aOscuroOseznoOsoOstraOto~oOtroOvejaO/vuloO/xidoOxi/genoOyenteOzonoPactoPadrePaellaPa/ginaPagoPai/sPa/jaroPalabraPalcoPaletaPa/lidoPalmaPalomaPalparPanPanalPa/nicoPanteraPa~ueloPapa/PapelPapillaPaquetePararParcelaParedParirParoPa/rpadoParquePa/rrafoPartePasarPaseoPasio/nPasoPastaPataPatioPatriaPausaPautaPavoPayasoPeato/nPecadoPeceraPechoPedalPedirPegarPeinePelarPelda~oPeleaPeligroPellejoPeloPelucaPenaPensarPe~o/nPeo/nPeorPepinoPeque~oPeraPerchaPerderPerezaPerfilPericoPerlaPermisoPerroPersonaPesaPescaPe/simoPesta~aPe/taloPetro/leoPezPezu~aPicarPicho/nPiePiedraPiernaPiezaPijamaPilarPilotoPimientaPinoPintorPinzaPi~aPiojoPipaPirataPisarPiscinaPisoPistaPito/nPizcaPlacaPlanPlataPlayaPlazaPleitoPlenoPlomoPlumaPluralPobrePocoPoderPodioPoemaPoesi/aPoetaPolenPolici/aPolloPolvoPomadaPomeloPomoPompaPonerPorcio/nPortalPosadaPoseerPosiblePostePotenciaPotroPozoPradoPrecozPreguntaPremioPrensaPresoPrevioPrimoPri/ncipePrisio/nPrivarProaProbarProcesoProductoProezaProfesorProgramaProlePromesaProntoPropioPro/ximoPruebaPu/blicoPucheroPudorPuebloPuertaPuestoPulgaPulirPulmo/nPulpoPulsoPumaPuntoPu~alPu~oPupaPupilaPure/QuedarQuejaQuemarQuererQuesoQuietoQui/micaQuinceQuitarRa/banoRabiaRaboRacio/nRadicalRai/zRamaRampaRanchoRangoRapazRa/pidoRaptoRasgoRaspaRatoRayoRazaRazo/nReaccio/nRealidadReba~oReboteRecaerRecetaRechazoRecogerRecreoRectoRecursoRedRedondoReducirReflejoReformaRefra/nRefugioRegaloRegirReglaRegresoRehe/nReinoRei/rRejaRelatoRelevoRelieveRellenoRelojRemarRemedioRemoRencorRendirRentaRepartoRepetirReposoReptilResRescateResinaRespetoRestoResumenRetiroRetornoRetratoReunirReve/sRevistaReyRezarRicoRiegoRiendaRiesgoRifaRi/gidoRigorRinco/nRi~o/nRi/oRiquezaRisaRitmoRitoRizoRobleRoceRociarRodarRodeoRodillaRoerRojizoRojoRomeroRomperRonRoncoRondaRopaRoperoRosaRoscaRostroRotarRubi/RuborRudoRuedaRugirRuidoRuinaRuletaRuloRumboRumorRupturaRutaRutinaSa/badoSaberSabioSableSacarSagazSagradoSalaSaldoSaleroSalirSalmo/nSalo/nSalsaSaltoSaludSalvarSambaSancio/nSandi/aSanearSangreSanidadSanoSantoSapoSaqueSardinaSarte/nSastreSata/nSaunaSaxofo/nSeccio/nSecoSecretoSectaSedSeguirSeisSelloSelvaSemanaSemillaSendaSensorSe~alSe~orSepararSepiaSequi/aSerSerieSermo/nServirSesentaSesio/nSetaSetentaSeveroSexoSextoSidraSiestaSieteSigloSignoSi/labaSilbarSilencioSillaSi/mboloSimioSirenaSistemaSitioSituarSobreSocioSodioSolSolapaSoldadoSoledadSo/lidoSoltarSolucio/nSombraSondeoSonidoSonoroSonrisaSopaSoplarSoporteSordoSorpresaSorteoSoste/nSo/tanoSuaveSubirSucesoSudorSuegraSueloSue~oSuerteSufrirSujetoSulta/nSumarSuperarSuplirSuponerSupremoSurSurcoSure~oSurgirSustoSutilTabacoTabiqueTablaTabu/TacoTactoTajoTalarTalcoTalentoTallaTalo/nTama~oTamborTangoTanqueTapaTapeteTapiaTapo/nTaquillaTardeTareaTarifaTarjetaTarotTarroTartaTatuajeTauroTazaTazo/nTeatroTechoTeclaTe/cnicaTejadoTejerTejidoTelaTele/fonoTemaTemorTemploTenazTenderTenerTenisTensoTeori/aTerapiaTercoTe/rminoTernuraTerrorTesisTesoroTestigoTeteraTextoTezTibioTiburo/nTiempoTiendaTierraTiesoTigreTijeraTildeTimbreTi/midoTimoTintaTi/oTi/picoTipoTiraTiro/nTita/nTi/tereTi/tuloTizaToallaTobilloTocarTocinoTodoTogaToldoTomarTonoTontoToparTopeToqueTo/raxToreroTormentaTorneoToroTorpedoTorreTorsoTortugaTosToscoToserTo/xicoTrabajoTractorTraerTra/ficoTragoTrajeTramoTranceTratoTraumaTrazarTre/bolTreguaTreintaTrenTreparTresTribuTrigoTripaTristeTriunfoTrofeoTrompaTroncoTropaTroteTrozoTrucoTruenoTrufaTuberi/aTuboTuertoTumbaTumorTu/nelTu/nicaTurbinaTurismoTurnoTutorUbicarU/lceraUmbralUnidadUnirUniversoUnoUntarU~aUrbanoUrbeUrgenteUrnaUsarUsuarioU/tilUtopi/aUvaVacaVaci/oVacunaVagarVagoVainaVajillaValeVa/lidoValleValorVa/lvulaVampiroVaraVariarVaro/nVasoVecinoVectorVehi/culoVeinteVejezVelaVeleroVelozVenaVencerVendaVenenoVengarVenirVentaVenusVerVeranoVerboVerdeVeredaVerjaVersoVerterVi/aViajeVibrarVicioVi/ctimaVidaVi/deoVidrioViejoViernesVigorVilVillaVinagreVinoVi~edoVioli/nViralVirgoVirtudVisorVi/speraVistaVitaminaViudoVivazViveroVivirVivoVolca/nVolumenVolverVorazVotarVotoVozVueloVulgarYacerYateYeguaYemaYernoYesoYodoYogaYogurZafiroZanjaZapatoZarzaZonaZorroZumoZurdo";
      const lookup = {};
      let wordlist = null;
      function dropDiacritic(word) {
        wordlist_1.logger.checkNormalize();
        return (0, strings_1.toUtf8String)(Array.prototype.filter.call((0, strings_1.toUtf8Bytes)(word.normalize("NFD").toLowerCase()), (c => c >= 65 && c <= 90 || c >= 97 && c <= 123)));
      }
      function expand(word) {
        const output = [];
        Array.prototype.forEach.call((0, strings_1.toUtf8Bytes)(word), (c => {
          if (c === 47) {
            output.push(204);
            output.push(129);
          } else if (c === 126) {
            output.push(110);
            output.push(204);
            output.push(131);
          } else {
            output.push(c);
          }
        }));
        return (0, strings_1.toUtf8String)(output);
      }
      function loadWords(lang) {
        if (wordlist != null) {
          return;
        }
        wordlist = words.replace(/([A-Z])/g, " $1").toLowerCase().substring(1).split(" ").map((w => expand(w)));
        wordlist.forEach(((word, index) => {
          lookup[dropDiacritic(word)] = index;
        }));
        if (wordlist_1.Wordlist.check(lang) !== "0xf74fb7092aeacdfbf8959557de22098da512207fb9f109cb526994938cf40300") {
          wordlist = null;
          throw new Error("BIP39 Wordlist for es (Spanish) FAILED");
        }
      }
      class LangEs extends wordlist_1.Wordlist {
        constructor() {
          super("es");
        }
        getWord(index) {
          loadWords(this);
          return wordlist[index];
        }
        getWordIndex(word) {
          loadWords(this);
          return lookup[dropDiacritic(word)];
        }
      }
      const langEs = new LangEs;
      exports.langEs = langEs;
      wordlist_1.Wordlist.register(langEs);
    },
    3485(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langFr = void 0;
      const strings_1 = __webpack_require__(2509);
      const wordlist_1 = __webpack_require__(652);
      const words = " ";
      let wordlist = null;
      const lookup = {};
      function dropDiacritic(word) {
        wordlist_1.logger.checkNormalize();
        return (0, strings_1.toUtf8String)(Array.prototype.filter.call((0, strings_1.toUtf8Bytes)(word.normalize("NFD").toLowerCase()), (c => c >= 65 && c <= 90 || c >= 97 && c <= 123)));
      }
      function expand(word) {
        const output = [];
        Array.prototype.forEach.call((0, strings_1.toUtf8Bytes)(word), (c => {
          if (c === 47) {
            output.push(204);
            output.push(129);
          } else if (c === 45) {
            output.push(204);
            output.push(128);
          } else {
            output.push(c);
          }
        }));
        return (0, strings_1.toUtf8String)(output);
      }
      function loadWords(lang) {
        if (wordlist != null) {
          return;
        }
        wordlist = words.replace(/([A-Z])/g, " $1").toLowerCase().substring(1).split(" ").map((w => expand(w)));
        wordlist.forEach(((word, index) => {
          lookup[dropDiacritic(word)] = index;
        }));
        if (wordlist_1.Wordlist.check(lang) !== "0x51deb7ae009149dc61a6bd18a918eb7ac78d2775726c68e598b92d002519b045") {
          wordlist = null;
          throw new Error("BIP39 Wordlist for fr (French) FAILED");
        }
      }
      class LangFr extends wordlist_1.Wordlist {
        constructor() {
          super("fr");
        }
        getWord(index) {
          loadWords(this);
          return wordlist[index];
        }
        getWordIndex(word) {
          loadWords(this);
          return lookup[dropDiacritic(word)];
        }
      }
      const langFr = new LangFr;
      exports.langFr = langFr;
      wordlist_1.Wordlist.register(langFr);
    },
    4908(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langIt = void 0;
      const wordlist_1 = __webpack_require__(652);
      const words = " ";
      let wordlist = null;
      function loadWords(lang) {
        if (wordlist != null) {
          return;
        }
        wordlist = words.replace(/([A-Z])/g, " $1").toLowerCase().substring(1).split(" ");
        if (wordlist_1.Wordlist.check(lang) !== "0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620") {
          wordlist = null;
          throw new Error("BIP39 Wordlist for it (Italian) FAILED");
        }
      }
      class LangIt extends wordlist_1.Wordlist {
        constructor() {
          super("it");
        }
        getWord(index) {
          loadWords(this);
          return wordlist[index];
        }
        getWordIndex(word) {
          loadWords(this);
          return wordlist.indexOf(word);
        }
      }
      const langIt = new LangIt;
      exports.langIt = langIt;
      wordlist_1.Wordlist.register(langIt);
    },
    6136(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langJa = void 0;
      const bytes_1 = __webpack_require__(8380);
      const strings_1 = __webpack_require__(2509);
      const wordlist_1 = __webpack_require__(652);
      const data = [ "AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQCIBCIHCeNCgBCgFCVECVcCmkCmwCZXCZFCdRClOClmClFCjDCjdCnXCwBCwXCcRCFQCFjGXhGNhGDEGDMGCDGCHGIFGgBGVXGVEGVRGmXGsXGdYGoSGbRGnXGwXGwDGWRGFNGFLGFOGFdGFkEABEBDEBFEXOEaBEKSENBENDEYXEIgEIkEgBEgQEgHEhFEudEuFEiBEiHEiFEZDEvBEsXEsFEdXEdREkFEbBEbRElFEPCEfkEFNYAEYAhYBNYQdYDXYSRYCEYYoYgQYgRYuRYmCYZTYdBYbEYlXYjQYRbYWRpKXpQopQnpSFpCXpIBpISphNpdBpdRpbRpcZpFBpFNpFDpFopFrLADLBuLXQLXcLaFLCXLEhLpBLpFLHXLeVLhILdHLdRLoDLbRLrXIABIBQIBCIBsIBoIBMIBRIXaIaRIKYIKRINBINuICDIGBIIDIIkIgRIxFIyQIiHIdRIbYIbRIlHIwRIMYIcRIRVITRIFBIFNIFQOABOAFOBQOaFONBONMOQFOSFOCDOGBOEQOpBOLXOIBOIFOgQOgFOyQOycOmXOsXOdIOkHOMEOMkOWWHBNHXNHXWHNXHDuHDRHSuHSRHHoHhkHmRHdRHkQHlcHlRHwBHWcgAEgAggAkgBNgBQgBEgXOgYcgLXgHjgyQgiBgsFgdagMYgWSgFQgFEVBTVXEVKBVKNVKDVKYVKRVNBVNYVDBVDxVSBVSRVCjVGNVLXVIFVhBVhcVsXVdRVbRVlRhBYhKYhDYhGShxWhmNhdahdkhbRhjohMXhTRxAXxXSxKBxNBxEQxeNxeQxhXxsFxdbxlHxjcxFBxFNxFQxFOxFoyNYyYoybcyMYuBQuBRuBruDMuCouHBudQukkuoBulVuMXuFEmCYmCRmpRmeDmiMmjdmTFmFQiADiBOiaRiKRiNBiNRiSFiGkiGFiERipRiLFiIFihYibHijBijEiMXiWBiFBiFCUBQUXFUaRUNDUNcUNRUNFUDBUSHUCDUGBUGFUEqULNULoUIRUeEUeYUgBUhFUuRUiFUsXUdFUkHUbBUjSUjYUwXUMDUcHURdUTBUrBUrXUrQZAFZXZZaRZKFZNBZQFZCXZGBZYdZpBZLDZIFZHXZHNZeQZVRZVFZmXZiBZvFZdFZkFZbHZbFZwXZcCZcRZRBvBQvBGvBLvBWvCovMYsAFsBDsaRsKFsNFsDrsSHsSFsCXsCRsEBsEHsEfspBsLBsLDsIgsIRseGsbRsFBsFQsFSdNBdSRdCVdGHdYDdHcdVbdySduDdsXdlRdwXdWYdWcdWRkBMkXOkaRkNIkNFkSFkCFkYBkpRkeNkgBkhVkmXksFklVkMBkWDkFNoBNoaQoaFoNBoNXoNaoNEoSRoEroYXoYCoYbopRopFomXojkowXorFbBEbEIbdBbjYlaRlDElMXlFDjKjjSRjGBjYBjYkjpRjLXjIBjOFjeVjbRjwBnXQnSHnpFnLXnINnMBnTRwXBwXNwXYwNFwQFwSBwGFwLXwLDweNwgBwuHwjDwnXMBXMpFMIBMeNMTHcaQcNBcDHcSFcCXcpBcLXcLDcgFcuFcnXcwXccDcTQcrFTQErXNrCHrpFrgFrbFrTHrFcWNYWNbWEHWMXWTR", "ABGHABIJAEAVAYJQALZJAIaRAHNXAHdcAHbRAZJMAZJRAZTRAdVJAklmAbcNAjdRAMnRAMWYAWpRAWgRAFgBAFhBAFdcBNJBBNJDBQKBBQhcBQlmBDEJBYJkBYJTBpNBBpJFBIJBBIJDBIcABOKXBOEJBOVJBOiJBOZJBepBBeLXBeIFBegBBgGJBVJXBuocBiJRBUJQBlXVBlITBwNFBMYVBcqXBTlmBWNFBWiJBWnRBFGHBFwXXKGJXNJBXNZJXDTTXSHSXSVRXSlHXCJDXGQJXEhXXYQJXYbRXOfXXeNcXVJFXhQJXhEJXdTRXjdXXMhBXcQTXRGBXTEBXTnQXFCXXFOFXFgFaBaFaBNJaBCJaBpBaBwXaNJKaNJDaQIBaDpRaEPDaHMFamDJalEJaMZJaFaFaFNBaFQJaFLDaFVHKBCYKBEBKBHDKXaFKXGdKXEJKXpHKXIBKXZDKXwXKKwLKNacKNYJKNJoKNWcKDGdKDTRKChXKGaRKGhBKGbRKEBTKEaRKEPTKLMDKLWRKOHDKVJcKdBcKlIBKlOPKFSBKFEPKFpFNBNJNJBQNBGHNBEPNBHXNBgFNBVXNBZDNBsXNBwXNNaRNNJDNNJENNJkNDCJNDVDNGJRNJiDNZJNNsCJNJFNNFSBNFCXNFEPNFLXNFIFQJBFQCaRQJEQQLJDQLJFQIaRQOqXQHaFQHHQQVJXQVJDQhNJQmEIQZJFQsJXQJrFQWbRDJABDBYJDXNFDXCXDXLXDXZDDXsJDQqXDSJFDJCXDEPkDEqXDYmQDpSJDOCkDOGQDHEIDVJDDuDuDWEBDJFgSBNDSBSFSBGHSBIBSBTQSKVYSJQNSJQiSJCXSEqXSJYVSIiJSOMYSHAHSHaQSeCFSepQSegBSHdHSHrFShSJSJuHSJUFSkNRSrSrSWEBSFaHSJFQSFCXSFGDSFYXSFODSFgBSFVXSFhBSFxFSFkFSFbBSFMFCADdCJXBCXaFCXKFCXNFCXCXCXGBCXEJCXYBCXLDCXIBCXOPCXHXCXgBCXhBCXiBCXlDCXcHCJNBCJNFCDCJCDGBCDVXCDhBCDiDCDJdCCmNCpJFCIaRCOqXCHCHCHZJCViJCuCuCmddCJiFCdNBCdHhClEJCnUJCreSCWlgCWTRCFBFCFNBCFYBCFVFCFhFCFdSCFTBCFWDGBNBGBQFGJBCGBEqGBpBGBgQGNBEGNJYGNkOGNJRGDUFGJpQGHaBGJeNGJeEGVBlGVKjGiJDGvJHGsVJGkEBGMIJGWjNGFBFGFCXGFGBGFYXGFpBGFMFEASJEAWpEJNFECJVEIXSEIQJEOqXEOcFEeNcEHEJEHlFEJgFEhlmEmDJEmZJEiMBEUqXEoSREPBFEPXFEPKFEPSFEPEFEPpFEPLXEPIBEJPdEPcFEPTBEJnXEqlHEMpREFCXEFODEFcFYASJYJAFYBaBYBVXYXpFYDhBYCJBYJGFYYbRYeNcYJeVYiIJYZJcYvJgYvJRYJsXYsJFYMYMYreVpBNHpBEJpBwXpQxFpYEJpeNDpJeDpeSFpeCHpHUJpHbBpHcHpmUJpiiJpUJrpsJuplITpFaBpFQqpFGBpFEfpFYBpFpBpFLJpFIDpFgBpFVXpFyQpFuFpFlFpFjDpFnXpFwXpJFMpFTBLXCJLXEFLXhFLXUJLXbFLalmLNJBLSJQLCLCLGJBLLDJLHaFLeNFLeSHLeCXLepFLhaRLZsJLsJDLsJrLocaLlLlLMdbLFNBLFSBLFEHLFkFIBBFIBXFIBaQIBKXIBSFIBpHIBLXIBgBIBhBIBuHIBmXIBiFIBZXIBvFIBbFIBjQIBwXIBWFIKTRIQUJIDGFICjQIYSRIINXIJeCIVaRImEkIZJFIvJRIsJXIdCJIJoRIbBQIjYBIcqXITFVIreVIFKFIFSFIFCJIFGFIFLDIFIBIJFOIFgBIFVXIJFhIFxFIFmXIFdHIFbBIJFrIJFWOBGBOQfXOOKjOUqXOfXBOqXEOcqXORVJOFIBOFlDHBIOHXiFHNTRHCJXHIaRHHJDHHEJHVbRHZJYHbIBHRsJHRkDHWlmgBKFgBSBgBCDgBGHgBpBgBIBgBVJgBuBgBvFgKDTgQVXgDUJgGSJgOqXgmUMgZIJgTUJgWIEgFBFgFNBgFDJgFSFgFGBgFYXgJFOgFgQgFVXgFhBgFbHgJFWVJABVQKcVDgFVOfXVeDFVhaRVmGdViJYVMaRVFNHhBNDhBCXhBEqhBpFhBLXhNJBhSJRheVXhhKEhxlmhZIJhdBQhkIJhbMNhMUJhMZJxNJgxQUJxDEkxDdFxSJRxplmxeSBxeCXxeGFxeYXxepQxegBxWVcxFEQxFLXxFIBxFgBxFxDxFZtxFdcxFbBxFwXyDJXyDlcuASJuDJpuDIBuCpJuGSJuIJFueEFuZIJusJXudWEuoIBuWGJuFBcuFKEuFNFuFQFuFDJuFGJuFVJuFUtuFdHuFTBmBYJmNJYmQhkmLJDmLJomIdXmiJYmvJRmsJRmklmmMBymMuCmclmmcnQiJABiJBNiJBDiBSFiBCJiBEFiBYBiBpFiBLXiBTHiJNciDEfiCZJiECJiJEqiOkHiHKFieNDiHJQieQcieDHieSFieCXieGFieEFieIHiegFihUJixNoioNXiFaBiFKFiFNDiFEPiFYXitFOitFHiFgBiFVEiFmXiFitiFbBiFMFiFrFUCXQUIoQUIJcUHQJUeCEUHwXUUJDUUqXUdWcUcqXUrnQUFNDUFSHUFCFUFEfUFLXUtFOZBXOZXSBZXpFZXVXZEQJZEJkZpDJZOqXZeNHZeCDZUqXZFBQZFEHZFLXvBAFvBKFvBCXvBEPvBpHvBIDvBgFvBuHvQNJvFNFvFGBvFIBvJFcsXCDsXLXsXsXsXlFsXcHsQqXsJQFsEqXseIFsFEHsFjDdBxOdNpRdNJRdEJbdpJRdhZJdnSJdrjNdFNJdFQHdFhNkNJDkYaRkHNRkHSRkVbRkuMRkjSJkcqDoSJFoEiJoYZJoOfXohEBoMGQocqXbBAFbBXFbBaFbBNDbBGBbBLXbBTBbBWDbGJYbIJHbFQqbFpQlDgQlOrFlVJRjGEBjZJRnXvJnXbBnEfHnOPDngJRnxfXnUJWwXEJwNpJwDpBwEfXwrEBMDCJMDGHMDIJMLJDcQGDcQpHcqXccqNFcqCXcFCJRBSBRBGBRBEJRBpQTBNFTBQJTBpBTBVXTFABTFSBTFCFTFGBTFMDrXCJrXLDrDNJrEfHrFQJrFitWNjdWNTR", "AKLJMANOPFASNJIAEJWXAYJNRAIIbRAIcdaAeEfDAgidRAdjNYAMYEJAMIbRAFNJBAFpJFBBIJYBDZJFBSiJhBGdEBBEJfXBEJqXBEJWRBpaUJBLXrXBIYJMBOcfXBeEfFBestXBjNJRBcDJOBFEqXXNvJRXDMBhXCJNYXOAWpXONJWXHDEBXeIaRXhYJDXZJSJXMDJOXcASJXFVJXaBQqXaBZJFasXdQaFSJQaFEfXaFpJHaFOqXKBNSRKXvJBKQJhXKEJQJKEJGFKINJBKIJjNKgJNSKVElmKVhEBKiJGFKlBgJKjnUJKwsJYKMFIJKFNJDKFIJFKFOfXNJBSFNJBCXNBpJFNJBvQNJBMBNJLJXNJOqXNJeCXNJeGFNdsJCNbTKFNwXUJQNFEPQDiJcQDMSJQSFpBQGMQJQJeOcQyCJEQUJEBQJFBrQFEJqDXDJFDJXpBDJXIMDGiJhDIJGRDJeYcDHrDJDVXgFDkAWpDkIgRDjDEqDMvJRDJFNFDJFIBSKclmSJQOFSJQVHSJQjDSJGJBSJGJFSECJoSHEJqSJHTBSJVJDSViJYSZJNBSJsJDSFSJFSFEfXSJFLXCBUJVCJXSBCJXpBCXVJXCJXsXCJXdFCJNJHCLIJgCHiJFCVNJMChCJhCUHEJCsJTRCJdYcCoQJCCFEfXCFIJgCFUJxCFstFGJBaQGJBIDGQJqXGYJNRGJHKFGeQqDGHEJFGJeLXGHIiJGHdBlGUJEBGkIJTGFQPDGJFEqEAGegEJIJBEJVJXEhQJTEiJNcEJZJFEJoEqEjDEqEPDsXEPGJBEPOqXEPeQFEfDiDEJfEFEfepQEfMiJEqXNBEqDIDEqeSFEqVJXEMvJRYXNJDYXEJHYKVJcYYJEBYJeEcYJUqXYFpJFYFstXpAZJMpBSJFpNBNFpeQPDpHLJDpHIJFpHgJFpeitFpHZJFpJFADpFSJFpJFCJpFOqXpFitBpJFZJLXIJFLIJgRLVNJWLVHJMLwNpJLFGJBLFLJDLFOqXLJFUJIBDJXIBGJBIJBYQIJBIBIBOqXIBcqDIEGJFILNJTIIJEBIOiJhIJeNBIJeIBIhiJIIWoTRIJFAHIJFpBIJFuHIFUtFIJFTHOSBYJOEcqXOHEJqOvBpFOkVJrObBVJOncqDOcNJkHhNJRHuHJuHdMhBgBUqXgBsJXgONJBgHNJDgHHJQgJeitgHsJXgJyNagyDJBgZJDrgsVJQgkEJNgkjSJgJFAHgFCJDgFZtMVJXNFVXQfXVJXDJVXoQJVQVJQVDEfXVDvJHVEqNFVeQfXVHpJFVHxfXVVJSRVVmaRVlIJOhCXVJhHjYkhxCJVhWVUJhWiJcxBNJIxeEqDxfXBFxcFEPxFSJFxFYJXyBDQJydaUJyFOPDuYCJYuLvJRuHLJXuZJLDuFOPDuFZJHuFcqXmKHJdmCQJcmOsVJiJAGFitLCFieOfXiestXiZJMEikNJQirXzFiFQqXiFIJFiFZJFiFvtFUHpJFUteIcUteOcUVCJkUhdHcUbEJEUJqXQUMNJhURjYkUFitFZDGJHZJIxDZJVJXZJFDJZJFpQvBNJBvBSJFvJxBrseQqDsVFVJdFLJDkEJNBkmNJYkFLJDoQJOPoGsJRoEAHBoEJfFbBQqDbBZJHbFVJXlFIJBjYIrXjeitcjjCEBjWMNBwXQfXwXOaFwDsJXwCJTRwrCZJMDNJQcDDJFcqDOPRYiJFTBsJXTQIJBTFEfXTFLJDrXEJFrEJXMrFZJFWEJdEWYTlm", "ABCDEFACNJTRAMBDJdAcNJVXBLNJEBXSIdWRXErNJkXYDJMBXZJCJaXMNJaYKKVJKcKDEJqXKDcNJhKVJrNYKbgJVXKFVJSBNBYBwDNJeQfXNJeEqXNhGJWENJFiJRQlIJbEQJfXxDQqXcfXQFNDEJQFwXUJDYcnUJDJIBgQDIUJTRDJFEqDSJQSJFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC", "BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD", "QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD", "IJBEJqXZJ" ];
      const mapping = "~~AzB~X~a~KN~Q~D~S~C~G~E~Y~p~L~I~O~eH~g~V~hxyumi~~U~~Z~~v~~s~~dkoblPjfnqwMcRTr~W~~~F~~~~~Jt";
      let wordlist = null;
      function hex(word) {
        return (0, bytes_1.hexlify)((0, strings_1.toUtf8Bytes)(word));
      }
      const KiYoKu = "0xe3818de38284e3818f";
      const KyoKu = "0xe3818de38283e3818f";
      function loadWords(lang) {
        if (wordlist !== null) {
          return;
        }
        wordlist = [];
        const transform = {};
        transform[(0, strings_1.toUtf8String)([ 227, 130, 154 ])] = false;
        transform[(0, strings_1.toUtf8String)([ 227, 130, 153 ])] = false;
        transform[(0, strings_1.toUtf8String)([ 227, 130, 133 ])] = (0, strings_1.toUtf8String)([ 227, 130, 134 ]);
        transform[(0, strings_1.toUtf8String)([ 227, 129, 163 ])] = (0, strings_1.toUtf8String)([ 227, 129, 164 ]);
        transform[(0, strings_1.toUtf8String)([ 227, 130, 131 ])] = (0, strings_1.toUtf8String)([ 227, 130, 132 ]);
        transform[(0, strings_1.toUtf8String)([ 227, 130, 135 ])] = (0, strings_1.toUtf8String)([ 227, 130, 136 ]);
        function normalize(word) {
          let result = "";
          for (let i = 0; i < word.length; i++) {
            let kana = word[i];
            const target = transform[kana];
            if (target === false) {
              continue;
            }
            if (target) {
              kana = target;
            }
            result += kana;
          }
          return result;
        }
        function sortJapanese(a, b) {
          a = normalize(a);
          b = normalize(b);
          if (a < b) {
            return -1;
          }
          if (a > b) {
            return 1;
          }
          return 0;
        }
        for (let length = 3; length <= 9; length++) {
          const d = data[length - 3];
          for (let offset = 0; offset < d.length; offset += length) {
            const word = [];
            for (let i = 0; i < length; i++) {
              const k = mapping.indexOf(d[offset + i]);
              word.push(227);
              word.push(k & 64 ? 130 : 129);
              word.push((k & 63) + 128);
            }
            wordlist.push((0, strings_1.toUtf8String)(word));
          }
        }
        wordlist.sort(sortJapanese);
        if (hex(wordlist[442]) === KiYoKu && hex(wordlist[443]) === KyoKu) {
          const tmp = wordlist[442];
          wordlist[442] = wordlist[443];
          wordlist[443] = tmp;
        }
        if (wordlist_1.Wordlist.check(lang) !== "0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600") {
          wordlist = null;
          throw new Error("BIP39 Wordlist for ja (Japanese) FAILED");
        }
      }
      class LangJa extends wordlist_1.Wordlist {
        constructor() {
          super("ja");
        }
        getWord(index) {
          loadWords(this);
          return wordlist[index];
        }
        getWordIndex(word) {
          loadWords(this);
          return wordlist.indexOf(word);
        }
        split(mnemonic) {
          wordlist_1.logger.checkNormalize();
          return mnemonic.split(/(?:\u3000| )+/g);
        }
        join(words) {
          return words.join("　");
        }
      }
      const langJa = new LangJa;
      exports.langJa = langJa;
      wordlist_1.Wordlist.register(langJa);
    },
    1699(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langKo = void 0;
      const strings_1 = __webpack_require__(2509);
      const wordlist_1 = __webpack_require__(652);
      const data = [ "OYAa", "ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8AnDg8AnFboAnFl3AnHX4AnHbrAnHgrAnIl3AnJgvAnLXoAnLX4AnLbrAnLgrAnLhrAnMXoAnMgrAnOn3AnSbrAnSeoAnvLnAn3OnCTGgvCTSlvCTvAUCTvKnCTvNTCT3CZCT3GUCT3MTCT8HnCUCZrCULf8CULnvCU3HnCU3JUCY6NUCbDb8CbFZoCbLnrCboOTCboScCbrFnCbvLnCb8AgCb8HgCb$LnCkLfoClBn3CloDUDTHT8DTLl3DTSU8DTrAaDTrLXDTrLjDTrOYDTrOgDTvFXDTvFnDT3HUDT3LfDUCT9DUDT4DUFVoDUFV8DUFkoDUGgrDUJnrDULl8DUMT8DUMXrDUMX4DUMg8DUOUoDUOgvDUOg8DUSToDUSZ8DbDXoDbDgoDbGT8DbJn3DbLg3DbLn4DbMXrDbMg8DbOToDboJXGTClvGTDT8GTFZrGTLVoGTLlvGTLl3GTMg8GTOTvGTSlrGToCUGTrDgGTrJYGTrScGTtLnGTvAnGTvQgGUCZrGUDTvGUFZoGUHXrGULnvGUMT8GUoMgGXoLnGXrMXGXrMnGXvFnGYLnvGZOnvGZvOnGZ8LaGZ8LmGbAl3GbDYvGbDlrGbHX3GbJl4GbLV8GbLn3GbMn4GboJTGboRfGbvFUGb3GUGb4JnGgDX3GgFl$GgJlrGgLX6GgLZoGgLf8GgOXoGgrAgGgrJXGgrMYGgrScGgvATGgvOYGnAgoGnJgvGnLZoGnLg3GnLnrGnQn8GnSbrGnrMgHTClvHTDToHTFT3HTQT8HToJTHToJgHTrDUHTrMnHTvFYHTvRfHT8MnHT8SUHUAZ8HUBb4HUDTvHUoMYHXFl6HXJX6HXQlrHXrAUHXrMnHXrSbHXvFYHXvKXHX3LjHX3MeHYvQlHZrScHZvDbHbAcrHbFT3HbFl3HbJT8HbLTrHbMT8HbMXrHbMbrHbQb8HbSX3HboDbHboJTHbrFUHbrHgHbrJTHb8JTHb8MnHb8QgHgAlrHgDT3HgGgrHgHgrHgJTrHgJT8HgLX@HgLnrHgMT8HgMX8HgMboHgOnrHgQToHgRg3HgoHgHgrCbHgrFnHgrLVHgvAcHgvAfHnAloHnCTrHnCnvHnGTrHnGZ8HnGnvHnJT8HnLf8HnLkvHnMg8HnRTrITvFUITvFnJTAXrJTCV8JTFT3JTFT8JTFn4JTGgvJTHT8JTJT8JTJXvJTJl3JTJnvJTLX4JTLf8JTLhvJTMT8JTMXrJTMnrJTObrJTQT8JTSlvJT8DUJT8FkJT8MTJT8OXJT8OgJT8QUJT8RfJUHZoJXFT4JXFlrJXGZ8JXGnrJXLV8JXLgvJXMXoJXMX3JXNboJXPlvJXoJTJXoLkJXrAXJXrHUJXrJgJXvJTJXvOnJX4KnJYAl3JYJT8JYLhvJYQToJYrQXJY6NUJbAl3JbCZrJbDloJbGT8JbGgrJbJXvJbJboJbLf8JbLhrJbLl3JbMnvJbRg8JbSZ8JboDbJbrCZJbrSUJb3KnJb8LnJfRn8JgAXrJgCZrJgDTrJgGZrJgGZ8JgHToJgJT8JgJXoJgJgvJgLX4JgLZ3JgLZ8JgLn4JgMgrJgMn4JgOgvJgPX6JgRnvJgSToJgoCZJgoJbJgoMYJgrJXJgrJgJgrLjJg6MTJlCn3JlGgvJlJl8Jl4AnJl8FnJl8HgJnAToJnATrJnAbvJnDUoJnGnrJnJXrJnJXvJnLhvJnLnrJnLnvJnMToJnMT8JnMXvJnMX3JnMg8JnMlrJnMn4JnOX8JnST4JnSX3JnoAgJnoAnJnoJTJnoObJnrAbJnrAkJnrHnJnrJTJnrJYJnrOYJnrScJnvCUJnvFaJnvJgJnvJnJnvOYJnvQUJnvRUJn3FnJn3JTKnFl3KnLT6LTDlvLTMnoLTOn3LTRl3LTSb4LTSlrLToAnLToJgLTrAULTrAcLTrCULTrHgLTrMgLT3JnLULnrLUMX8LUoJgLVATrLVDTrLVLb8LVoJgLV8MgLV8RTLXDg3LXFlrLXrCnLXrLXLX3GTLX4GgLX4OYLZAXrLZAcrLZAgrLZAhrLZDXyLZDlrLZFbrLZFl3LZJX6LZJX8LZLc8LZLnrLZSU8LZoJTLZoJnLZrAgLZrAnLZrJYLZrLULZrMgLZrSkLZvAnLZvGULZvJeLZvOTLZ3FZLZ4JXLZ8STLZ8ScLaAT3LaAl3LaHT8LaJTrLaJT8LaJXrLaJgvLaJl4LaLVoLaMXrLaMXvLaMX8LbClvLbFToLbHlrLbJn4LbLZ3LbLhvLbMXrLbMnoLbvSULcLnrLc8HnLc8MTLdrMnLeAgoLeOgvLeOn3LfAl3LfLnvLfMl3LfOX8Lf8AnLf8JXLf8LXLgJTrLgJXrLgJl8LgMX8LgRZrLhCToLhrAbLhrFULhrJXLhvJYLjHTrLjHX4LjJX8LjLhrLjSX3LjSZ4LkFX4LkGZ8LkGgvLkJTrLkMXoLkSToLkSU8LkSZ8LkoOYLl3FfLl3MgLmAZrLmCbrLmGgrLmHboLmJnoLmJn3LmLfoLmLhrLmSToLnAX6LnAb6LnCZ3LnCb3LnDTvLnDb8LnFl3LnGnrLnHZvLnHgvLnITvLnJT8LnJX8LnJlvLnLf8LnLg6LnLhvLnLnoLnMXrLnMg8LnQlvLnSbrLnrAgLnrAnLnrDbLnrFkLnrJdLnrMULnrOYLnrSTLnvAnLnvDULnvHgLnvOYLnvOnLn3GgLn4DULn4JTLn4JnMTAZoMTAloMTDb8MTFT8MTJnoMTJnrMTLZrMTLhrMTLkvMTMX8MTRTrMToATMTrDnMTrOnMT3JnMT4MnMT8FUMT8FaMT8FlMT8GTMT8GbMT8GnMT8HnMT8JTMT8JbMT8OTMUCl8MUJTrMUJU8MUMX8MURTrMUSToMXAX6MXAb6MXCZoMXFXrMXHXrMXLgvMXOgoMXrAUMXrAnMXrHgMXrJYMXrJnMXrMTMXrMgMXrOYMXrSZMXrSgMXvDUMXvOTMX3JgMX3OTMX4JnMX8DbMX8FnMX8HbMX8HgMX8HnMX8LbMX8MnMX8OnMYAb8MYGboMYHTvMYHX4MYLTrMYLnvMYMToMYOgvMYRg3MYSTrMbAToMbAXrMbAl3MbAn8MbGZ8MbJT8MbJXrMbMXvMbMX8MbMnoMbrMUMb8AfMb8FbMb8FkMcJXoMeLnrMgFl3MgGTvMgGXoMgGgrMgGnrMgHT8MgHZrMgJnoMgLnrMgLnvMgMT8MgQUoMgrHnMgvAnMg8HgMg8JYMg8LfMloJnMl8ATMl8AXMl8JYMnAToMnAT4MnAZ8MnAl3MnAl4MnCl8MnHT8MnHg8MnJnoMnLZoMnLhrMnMXoMnMX3MnMnrMnOgvMnrFbMnrFfMnrFnMnrNTMnvJXNTMl8OTCT3OTFV8OTFn3OTHZvOTJXrOTOl3OT3ATOT3JUOT3LZOT3LeOT3MbOT8ATOT8AbOT8AgOT8MbOUCXvOUMX3OXHXvOXLl3OXrMUOXvDbOX6NUOX8JbOYFZoOYLbrOYLkoOYMg8OYSX3ObHTrObHT4ObJgrObLhrObMX3ObOX8Ob8FnOeAlrOeJT8OeJXrOeJnrOeLToOeMb8OgJXoOgLXoOgMnrOgOXrOgOloOgoAgOgoJbOgoMYOgoSTOg8AbOjLX4OjMnoOjSV8OnLVoOnrAgOn3DUPXQlrPXvFXPbvFTPdAT3PlFn3PnvFbQTLn4QToAgQToMTQULV8QURg8QUoJnQXCXvQbFbrQb8AaQb8AcQb8FbQb8MYQb8ScQeAlrQeLhrQjAn3QlFXoQloJgQloSnRTLnvRTrGURTrJTRUJZrRUoJlRUrQnRZrLmRZrMnRZrSnRZ8ATRZ8JbRZ8ScRbMT8RbST3RfGZrRfMX8RfMgrRfSZrRnAbrRnGT8RnvJgRnvLfRnvMTRn8AaSTClvSTJgrSTOXrSTRg3STRnvSToAcSToAfSToAnSToHnSToLjSToMTSTrAaSTrEUST3BYST8AgST8LmSUAZvSUAgrSUDT4SUDT8SUGgvSUJXoSUJXvSULTrSU8JTSU8LjSV8AnSV8JgSXFToSXLf8SYvAnSZrDUSZrMUSZrMnSZ8HgSZ8JTSZ8JgSZ8MYSZ8QUSaQUoSbCT3SbHToSbQYvSbSl4SboJnSbvFbSb8HbSb8JgSb8OTScGZrScHgrScJTvScMT8ScSToScoHbScrMTScvAnSeAZrSeAcrSeHboSeJUoSeLhrSeMT8SeMXrSe6JgSgHTrSkJnoSkLnvSk8CUSlFl3SlrSnSl8GnSmAboSmGT8SmJU8", "ATLnDlATrAZoATrJX4ATrMT8ATrMX4ATrRTrATvDl8ATvJUoATvMl8AT3AToAT3MX8AT8CT3AT8DT8AT8HZrAT8HgoAUAgFnAUCTFnAXoMX8AXrAT8AXrGgvAXrJXvAXrOgoAXvLl3AZvAgoAZvFbrAZvJXoAZvJl8AZvJn3AZvMX8AZvSbrAZ8FZoAZ8LZ8AZ8MU8AZ8OTvAZ8SV8AZ8SX3AbAgFZAboJnoAbvGboAb8ATrAb8AZoAb8AgrAb8Al4Ab8Db8Ab8JnoAb8LX4Ab8LZrAb8LhrAb8MT8Ab8OUoAb8Qb8Ab8ST8AcrAUoAcrAc8AcrCZ3AcrFT3AcrFZrAcrJl4AcrJn3AcrMX3AcrOTvAc8AZ8Ac8MT8AfAcJXAgoFn4AgoGgvAgoGnrAgoLc8AgoMXoAgrLnrAkrSZ8AlFXCTAloHboAlrHbrAlrLhrAlrLkoAl3CZrAl3LUoAl3LZrAnrAl4AnrMT8An3HT4BT3IToBX4MnvBb!Ln$CTGXMnCToLZ4CTrHT8CT3JTrCT3RZrCT#GTvCU6GgvCU8Db8CU8GZrCU8HT8CboLl3CbrGgrCbrMU8Cb8DT3Cb8GnrCb8LX4Cb8MT8Cb8ObrCgrGgvCgrKX4Cl8FZoDTrAbvDTrDboDTrGT6DTrJgrDTrMX3DTrRZrDTrRg8DTvAVvDTvFZoDT3DT8DT3Ln3DT4HZrDT4MT8DT8AlrDT8MT8DUAkGbDUDbJnDYLnQlDbDUOYDbMTAnDbMXSnDboAT3DboFn4DboLnvDj6JTrGTCgFTGTGgFnGTJTMnGTLnPlGToJT8GTrCT3GTrLVoGTrLnvGTrMX3GTrMboGTvKl3GZClFnGZrDT3GZ8DTrGZ8FZ8GZ8MXvGZ8On8GZ8ST3GbCnQXGbMbFnGboFboGboJg3GboMXoGb3JTvGb3JboGb3Mn6Gb3Qb8GgDXLjGgMnAUGgrDloGgrHX4GgrSToGgvAXrGgvAZvGgvFbrGgvLl3GgvMnvGnDnLXGnrATrGnrMboGnuLl3HTATMnHTAgCnHTCTCTHTrGTvHTrHTvHTrJX8HTrLl8HTrMT8HTrMgoHTrOTrHTuOn3HTvAZrHTvDTvHTvGboHTvJU8HTvLl3HTvMXrHTvQb4HT4GT6HT4JT8HT4Jb#HT8Al3HT8GZrHT8GgrHT8HX4HT8Jb8HT8JnoHT8LTrHT8LgvHT8SToHT8SV8HUoJUoHUoJX8HUoLnrHXrLZoHXvAl3HX3LnrHX4FkvHX4LhrHX4MXoHX4OnoHZrAZ8HZrDb8HZrGZ8HZrJnrHZvGZ8HZvLnvHZ8JnvHZ8LhrHbCXJlHbMTAnHboJl4HbpLl3HbrJX8HbrLnrHbrMnvHbvRYrHgoSTrHgrFV8HgrGZ8HgrJXoHgrRnvHgvBb!HgvGTrHgvHX4HgvHn!HgvLTrHgvSU8HnDnLbHnFbJbHnvDn8Hn6GgvHn!BTvJTCTLnJTQgFnJTrAnvJTrLX4JTrOUoJTvFn3JTvLnrJTvNToJT3AgoJT3Jn4JT3LhvJT3ObrJT8AcrJT8Al3JT8JT8JT8JnoJT8LX4JT8LnrJT8MX3JT8Rg3JT8Sc8JUoBTvJU8AToJU8GZ8JU8GgvJU8JTrJU8JXrJU8JnrJU8LnvJU8ScvJXHnJlJXrGgvJXrJU8JXrLhrJXrMT8JXrMXrJXrQUoJXvCTvJXvGZ8JXvGgrJXvQT8JX8Ab8JX8DT8JX8GZ8JX8HZvJX8LnrJX8MT8JX8MXoJX8MnvJX8ST3JYGnCTJbAkGbJbCTAnJbLTAcJboDT3JboLb6JbrAnvJbrCn3JbrDl8JbrGboJbrIZoJbrJnvJbrMnvJbrQb4Jb8RZrJeAbAnJgJnFbJgScAnJgrATrJgvHZ8JgvMn4JlJlFbJlLiQXJlLjOnJlRbOlJlvNXoJlvRl3Jl4AcrJl8AUoJl8MnrJnFnMlJnHgGbJnoDT8JnoFV8JnoGgvJnoIT8JnoQToJnoRg3JnrCZ3JnrGgrJnrHTvJnrLf8JnrOX8JnvAT3JnvFZoJnvGT8JnvJl4JnvMT8JnvMX8JnvOXrJnvPX6JnvSX3JnvSZrJn3MT8Jn3MX8Jn3RTrLTATKnLTJnLTLTMXKnLTRTQlLToGb8LTrAZ8LTrCZ8LTrDb8LTrHT8LT3PX6LT4FZoLT$CTvLT$GgrLUvHX3LVoATrLVoAgoLVoJboLVoMX3LVoRg3LV8CZ3LV8FZoLV8GTvLXrDXoLXrFbrLXvAgvLXvFlrLXvLl3LXvRn6LX4Mb8LX8GT8LYCXMnLYrMnrLZoSTvLZrAZvLZrAloLZrFToLZrJXvLZrJboLZrJl4LZrLnrLZrMT8LZrOgvLZrRnvLZrST4LZvMX8LZvSlvLZ8AgoLZ8CT3LZ8JT8LZ8LV8LZ8LZoLZ8Lg8LZ8SV8LZ8SbrLZ$HT8LZ$Mn4La6CTvLbFbMnLbRYFTLbSnFZLboJT8LbrAT9LbrGb3LbrQb8LcrJX8LcrMXrLerHTvLerJbrLerNboLgrDb8LgrGZ8LgrHTrLgrMXrLgrSU8LgvJTrLgvLl3Lg6Ll3LhrLnrLhrMT8LhvAl4LiLnQXLkoAgrLkoJT8LkoJn4LlrSU8Ll3FZoLl3HTrLl3JX8Ll3JnoLl3LToLmLeFbLnDUFbLnLVAnLnrATrLnrAZoLnrAb8LnrAlrLnrGgvLnrJU8LnrLZrLnrLhrLnrMb8LnrOXrLnrSZ8LnvAb4LnvDTrLnvDl8LnvHTrLnvHbrLnvJT8LnvJU8LnvJbrLnvLhvLnvMX8LnvMb8LnvNnoLnvSU8Ln3Al3Ln4FZoLn4GT6Ln4JgvLn4LhrLn4MT8Ln4SToMToCZrMToJX8MToLX4MToLf8MToRg3MTrEloMTvGb6MT3BTrMT3Lb6MT8AcrMT8AgrMT8GZrMT8JnoMT8LnrMT8MX3MUOUAnMXAbFnMXoAloMXoJX8MXoLf8MXoLl8MXrAb8MXrDTvMXrGT8MXrGgrMXrHTrMXrLf8MXrMU8MXrOXvMXrQb8MXvGT8MXvHTrMXvLVoMX3AX3MX3Jn3MX3LhrMX3MX3MX4AlrMX4OboMX8GTvMX8GZrMX8GgrMX8JT8MX8JX8MX8LhrMX8MT8MYDUFbMYMgDbMbGnFfMbvLX4MbvLl3Mb8Mb8Mb8ST4MgGXCnMg8ATrMg8AgoMg8CZrMg8DTrMg8DboMg8HTrMg8JgrMg8LT8MloJXoMl8AhrMl8JT8MnLgAUMnoJXrMnoLX4MnoLhrMnoMT8MnrAl4MnrDb8MnrOTvMnrOgvMnrQb8MnrSU8MnvGgrMnvHZ8Mn3MToMn4DTrMn4LTrMn4Mg8NnBXAnOTFTFnOToAToOTrGgvOTrJX8OT3JXoOT6MTrOT8GgrOT8HTpOT8MToOUoHT8OUoJT8OUoLn3OXrAgoOXrDg8OXrMT8OXvSToOX6CTvOX8CZrOX8OgrOb6HgvOb8AToOb8MT8OcvLZ8OgvAlrOgvHTvOgvJTrOgvJnrOgvLZrOgvLn4OgvMT8OgvRTrOg8AZoOg8DbvOnrOXoOnvJn4OnvLhvOnvRTrOn3GgoOn3JnvOn6JbvOn8OTrPTGYFTPbBnFnPbGnDnPgDYQTPlrAnvPlrETvPlrLnvPlrMXvPlvFX4QTMTAnQTrJU8QYCnJlQYJlQlQbGTQbQb8JnrQb8LZoQb8LnvQb8MT8Qb8Ml8Qb8ST4QloAl4QloHZvQloJX8QloMn8QnJZOlRTrAZvRTrDTrRTvJn4RTvLhvRT4Jb8RZrAZrRZ8AkrRZ8JU8RZ8LV8RZ8LnvRbJlQXRg3GboRg3MnvRg8AZ8Rg8JboRg8Jl4RnLTCbRnvFl3RnvQb8SToAl4SToCZrSToFZoSToHXrSToJU8SToJgvSToJl4SToLhrSToMX3STrAlvSTrCT9STrCgrSTrGgrSTrHXrSTrHboSTrJnoSTrNboSTvLnrST4AZoST8Ab8ST8JT8SUoJn3SU6HZ#SU6JTvSU8Db8SU8HboSU8LgrSV8JT8SZrAcrSZrAl3SZrJT8SZrJnvSZrMT8SZvLUoSZ4FZoSZ8JnoSZ8RZrScoLnrScoMT8ScoMX8ScrAT4ScrAZ8ScrLZ8ScrLkvScvDb8ScvLf8ScvNToSgrFZrShvKnrSloHUoSloLnrSlrMXoSl8HgrSmrJUoSn3BX6", "ATFlOn3ATLgrDYAT4MTAnAT8LTMnAYJnRTrAbGgJnrAbLV8LnAbvNTAnAeFbLg3AgOYMXoAlQbFboAnDboAfAnJgoJTBToDgAnBUJbAl3BboDUAnCTDlvLnCTFTrSnCYoQTLnDTwAbAnDUDTrSnDUHgHgrDX8LXFnDbJXAcrETvLTLnGTFTQbrGTMnGToGT3DUFbGUJlPX3GbQg8LnGboJbFnGb3GgAYGgAg8ScGgMbAXrGgvAbAnGnJTLnvGnvATFgHTDT6ATHTrDlJnHYLnMn8HZrSbJTHZ8LTFnHbFTJUoHgSeMT8HgrLjAnHgvAbAnHlFUrDlHnDgvAnHnHTFT3HnQTGnrJTAaMXvJTGbCn3JTOgrAnJXvAXMnJbMg8SnJbMnRg3Jb8LTMnJnAl3OnJnGYrQlJnJlQY3LTDlCn3LTJjLg3LTLgvFXLTMg3GTLV8HUOgLXFZLg3LXNXrMnLX8QXFnLX9AlMYLYLXPXrLZAbJU8LZDUJU8LZMXrSnLZ$AgFnLaPXrDULbFYrMnLbMn8LXLboJgJgLeFbLg3LgLZrSnLgOYAgoLhrRnJlLkCTrSnLkOnLhrLnFX%AYLnFZoJXLnHTvJbLnLloAbMTATLf8MTHgJn3MTMXrAXMT3MTFnMUITvFnMXFX%AYMXMXvFbMXrFTDbMYAcMX3MbLf8SnMb8JbFnMgMXrMTMgvAXFnMgvGgCmMnAloSnMnFnJTrOXvMXSnOX8HTMnObJT8ScObLZFl3ObMXCZoPTLgrQXPUFnoQXPU3RXJlPX3RkQXPbrJXQlPlrJbFnQUAhrDbQXGnCXvQYLnHlvQbLfLnvRTOgvJbRXJYrQlRYLnrQlRbLnrQlRlFT8JlRlFnrQXSTClCn3STHTrAnSTLZQlrSTMnGTrSToHgGbSTrGTDnSTvGXCnST3HgFbSU3HXAXSbAnJn3SbFT8LnScLfLnv", "AT3JgJX8AT8FZoSnAT8JgFV8AT8LhrDbAZ8JT8DbAb8GgLhrAb8SkLnvAe8MT8SnAlMYJXLVAl3GYDTvAl3LfLnvBUDTvLl3CTOn3HTrCT3DUGgrCU8MT8AbCbFTrJUoCgrDb8MTDTLV8JX8DTLnLXQlDT8LZrSnDUQb8FZ8DUST4JnvDb8ScOUoDj6GbJl4GTLfCYMlGToAXvFnGboAXvLnGgAcrJn3GgvFnSToGnLf8JnvGn#HTDToHTLnFXJlHTvATFToHTvHTDToHTvMTAgoHT3STClvHT4AlFl6HT8HTDToHUoDgJTrHUoScMX3HbRZrMXoHboJg8LTHgDb8JTrHgMToLf8HgvLnLnoHnHn3HT4Hn6MgvAnJTJU8ScvJT3AaQT8JT8HTrAnJXrRg8AnJbAloMXoJbrATFToJbvMnoSnJgDb6GgvJgDb8MXoJgSX3JU8JguATFToJlPYLnQlJlQkDnLbJlQlFYJlJl8Lf8OTJnCTFnLbJnLTHXMnJnLXGXCnJnoFfRg3JnrMYRg3Jn3HgFl3KT8Dg8LnLTRlFnPTLTvPbLbvLVoSbrCZLXMY6HT3LXNU7DlrLXNXDTATLX8DX8LnLZDb8JU8LZMnoLhrLZSToJU8LZrLaLnrLZvJn3SnLZ8LhrSnLaJnoMT8LbFlrHTvLbrFTLnrLbvATLlvLb6OTFn3LcLnJZOlLeAT6Mn4LeJT3ObrLg6LXFlrLhrJg8LnLhvDlPX4LhvLfLnvLj6JTFT3LnFbrMXoLnQluCTvLnrQXCY6LnvLfLnvLnvMgLnvLnvSeLf8MTMbrJn3MT3JgST3MT8AnATrMT8LULnrMUMToCZrMUScvLf8MXoDT8SnMX6ATFToMX8AXMT8MX8FkMT8MX8HTrDUMX8ScoSnMYJT6CTvMgAcrMXoMg8SToAfMlvAXLg3MnFl3AnvOT3AnFl3OUoATHT8OU3RnLXrOXrOXrSnObPbvFn6Og8HgrSnOg8OX8DbPTvAgoJgPU3RYLnrPXrDnJZrPb8CTGgvPlrLTDlvPlvFUJnoQUvFXrQlQeMnoAl3QlrQlrSnRTFTrJUoSTDlLiLXSTFg6HT3STJgoMn4STrFTJTrSTrLZFl3ST4FnMXoSUrDlHUoScvHTvSnSfLkvMXo", "AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg", "HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb", "AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl" ];
      const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";
      function getHangul(code) {
        if (code >= 40) {
          code = code + 168 - 40;
        } else if (code >= 19) {
          code = code + 97 - 19;
        }
        return (0, strings_1.toUtf8String)([ 225, (code >> 6) + 132, (code & 63) + 128 ]);
      }
      let wordlist = null;
      function loadWords(lang) {
        if (wordlist != null) {
          return;
        }
        wordlist = [];
        data.forEach(((data, length) => {
          length += 4;
          for (let i = 0; i < data.length; i += length) {
            let word = "";
            for (let j = 0; j < length; j++) {
              word += getHangul(codes.indexOf(data[i + j]));
            }
            wordlist.push(word);
          }
        }));
        wordlist.sort();
        if (wordlist_1.Wordlist.check(lang) !== "0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a") {
          wordlist = null;
          throw new Error("BIP39 Wordlist for ko (Korean) FAILED");
        }
      }
      class LangKo extends wordlist_1.Wordlist {
        constructor() {
          super("ko");
        }
        getWord(index) {
          loadWords(this);
          return wordlist[index];
        }
        getWordIndex(word) {
          loadWords(this);
          return wordlist.indexOf(word);
        }
      }
      const langKo = new LangKo;
      exports.langKo = langKo;
      wordlist_1.Wordlist.register(langKo);
    },
    5911(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.langZhTw = exports.langZhCn = void 0;
      const strings_1 = __webpack_require__(2509);
      const wordlist_1 = __webpack_require__(652);
      const data = "}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN<di,AM=W5%QO&ka&ua,hM^tm=zV=JA=wR&+X]7P&NB#4J#5L|/b[dA}tJ<Do&6m&u2[U1&Kb.HM&mC=w0&MW<rY,Hq#6M}QG,13&wP}Jp]Ow%ue&Kg<HP<D9~4k~9T&I2_c6$9T#9/[C5~7O~4a=cs&O7=KK=An&l9$6U$8A&uD&QI|/Y&bg}Ux&F2#6b}E2&JN&kW&kp=U/&bb=Xl<Cj}k+~5J#6L&5z&9i}b4&Fo,ho(X0_g3~4O$Fz&QE<HN=Ww]6/%GF-Vw=tj&/D&PN#9g=YO}cL&Of&PI~5I&Ip=vU=IW#9G;0o-wU}ss&QR<BT&R9=tk$PY_dh&Pq-yh]7T,nj.Xu=EP&76=cI&Fs*Xg}z7$Gb&+I=DF,AF=cA}rL#7j=Dz&3y<Aa$52=PQ}b0(iY$Fa}oL&xV#6U=ec=WZ,xh%RY<dp#9N&Fl&44=WH*A7=sh&TB&8P=07;u+&PK}uh}J5#72)V/=xC,AB$k0&f6;1E|+5=1B,3v]6n&wR%b+&xx]7f=Ol}fl;+D^wG]7E;nB;uh^Ir&l5=JL,nS=cf=g5;u6|/Q$Gc=MH%Hg#5d%M6^86=U+$Gz,l/,ir^5y&Ba&/F-IY&FI&be%IZ#77&PW_Nu$kE(Yf&NX]7Z,Jy&FJ(Xo&Nz#/d=y7&MX<Ag}Z+;nE]Dt(iG#4D=13&Pj~4c%v8&Zo%OL&/X#4W<HR&ie~6J_1O(Y2=y5=Ad*cv_eB#6k&PX:BU#7A;uk&Ft&Fx_dD=U2;vB=U5=4F}+O&GN.HH:9s=b0%NV(jO&IH=JT}Z9=VZ<Af,Kx^4m&uJ%c6,6r;9m#+L}cf%Kh&F3~4H=vP}bu,Hz|++,1w]nv}k6;uu$jw*Kl*WX&uM[x7&Fr[m7$NO&QN]hu=JN}nR^8g#/h(ps|KC;vd}xz=V0}p6&FD$G1#7K<bG_4p~8g&cf;u4=tl}+k%5/}fz;uw<cA=u1}gU}VM=LJ=eX&+L&Pr#4U}p2:nC,2K]7H:jF&9x}uX#9O=MB<fz~8X~5m&4D&kN&u5%E/(h7(ZF&VG<de(qM|/e-Wt=3x(a+,/R]f/&ND$Ro&nU}0g=KA%kH&NK$Ke<dS}cB&IX~5g$TN]6m=Uv,Is&Py=Ef%Kz#+/%bi&+A<F4$OG&4C&FL#9V<Zk=2I_eE&6c]nw&kq$HG}y+&A8$P3}OH=XP]70%IS(AJ_gH%GZ&tY&AZ=vb~6y&/r=VI=Wv<Zi=fl=xf&eL}c8}OL=MJ=g8$F7=YT}9u=0+^xC}JH&nL^N0~4T]K2,Cy%OC#6s;vG(AC^xe^cG&MF}Br#9P;wD-7h$O/&xA}Fn^PC]6i]7G&8V$Qs;vl(TB~73~4l<mW&6V=2y&uY&+3)aP}XF;LP&kx$wU=t7;uy<FN&lz)7E=Oo*Y+;wI}9q}le;J6&Ri&4t&Qr#8B=cb&vG=J5|Ql(h5<Yy~4+}QD,Lx=wn%K/&RK=dO&Pw,Q9=co%4u;9u}g0@6a^4I%b0=zo|/c&tX=dQ=OS#+b=yz_AB&wB&Pm=W9$HP_gR=62=AO=ti=hI,oA&jr&dH=tm&b6$P2(x8=zi;nG~7F;05]0n[Ix&3m}rg=Xp=cd&uz]7t;97=cN;vV<jf&FF&F1=6Q&Ik*Kk&P4,2z=fQ]7D&3u,H0=d/}Uw<ZN<7R}Kv;0f$H7,MD]7n$F0#88~9Z%da=by;+T#/u=VF&fO&kr^kf<AB]sU,I5$Ng&Pz;0i&QD&vM=Yl:BM;nJ_xJ]U7&Kf&30,3f|Z9*dC)je_jA&Q4&Kp$NH(Yz#6S&Id%Ib=KX,AD=KV%dP}tW&Pk^+E_Ni=cq,3R}VZ(Si=b+}rv;0j}rZ]uA,/w(Sx&Jv$w9&4d&wE,NJ$Gy=J/]Ls#7k<ZQ<Y/&uj]Ov$PM;v3,2F&+u:up=On&3e,Jv;90=J+&Qm]6q}bK#+d~8Y(h2]hA;99&AS=I/}qB&dQ}yJ-VM}Vl&ui,iB&G3|Dc]7d=eQ%dX%JC_1L~4d^NP;vJ&/1)ZI#7N]9X[bQ&PL=0L(UZ,Lm&kc&IR}n7(iR<AQ<dg=33=vN}ft}au]7I,Ba=x9=dR~6R&Tq=Xi,3d$Nr&Bc}DI&ku&vf]Dn,/F&iD,Ll&Nw=0y&I7=Ls=/A&tU=Qe}Ua&uk&+F=g4=gh=Vj#+1&Qn}Uy*44#5F,Pc&Rz*Xn=oh=5W;0n_Nf(iE<Y7=vr=Zu]oz#5Z%mI=kN=Bv_Jp(T2;vt_Ml<FS&uI=L/&6P]64$M7}86<bo%QX(SI%IY&VK=Al&Ux;vv;ut*E/%uh<ZE|O3,M2(yc]yu=Wk&tp:Ex}hr,Cl&WE)+Z=8U}I2_4Q,hA_si=iw=OM=tM=yZ%Ia=U7;wT}b+;uo=Za}yS!5x}HD}fb#5O_dA;Nv%uB(yB;01(Sf}Fk;v7}Pt#8v<mZ#7L,/r&Pl~4w&f5=Ph$Fw_LF&8m,bL=yJ&BH}p/*Jn}tU~5Q;wB(h6]Df]8p^+B;E4&Wc=d+;Ea&bw$8C&FN,DM=Yf}mP~5w=fT#6V=mC=Fi=AV}jB&AN}lW}aH#/D)dZ;hl;vE}/7,CJ;31&w8,hj%u9_Js=jJ&4M~8k=TN&eC}nL&uc-wi&lX}dj=Mv=e2#6u=cr$uq$6G]8W}Jb:nm=Yg<b3(UA;vX&6n&xF=KT,jC,De&R8&oY=Zv&oB]7/=Z2&Oa}bf,hh(4h^tZ&72&Nx;D2&xL~5h~40)ZG)h+=OJ&RA]Bv$yB=Oq=df,AQ%Jn}OJ;11,3z&Tl&tj;v+^Hv,Dh(id=s+]7N&N3)9Q~8f,S4=uW=w4&uX,LX&3d]CJ&yp&8x<b2_do&lP=y/<cy_dG=Oi=7R(VH(lt_1T,Iq_AA;12^6T%k6#8K[B1{oO<AU[Bt;1b$9S&Ps<8T=St{bY,jB(Zp&63&Uv$9V,PM]6v&Af}zW[bW_oq}sm}nB&Kq&gC&ff_eq_2m&5F&TI}rf}Gf;Zr_z9;ER&jk}iz_sn<BN~+n&vo=Vi%97|ZR=Wc,WE&6t]6z%85(ly#84=KY)6m_5/=aX,N3}Tm&he&6K]tR_B2-I3;u/&hU&lH<AP=iB&IA=XL;/5&Nh=wv<BH#79=vS=zl<AA=0X_RG}Bw&9p$NW,AX&kP_Lp&/Z(Tc]Mu}hs#6I}5B&cI<bq&H9#6m=K9}vH(Y1(Y0#4B&w6,/9&gG<bE,/O=zb}I4_l8<B/;wL%Qo<HO[Mq=XX}0v&BP&F4(mG}0i}nm,EC=9u{I3,xG&/9=JY*DK&hR)BX=EI=cx=b/{6k}yX%A+&wa}Xb=la;wi^lL;0t}jo&Qb=xg=XB}iO<qo{bR=NV&8f=a0&Jy;0v=uK)HK;vN#6h&jB(h/%ud&NI%wY.X7=Pt}Cu-uL&Gs_hl%mH,tm]78=Lb^Q0#7Y=1u<Bt&+Q=Co_RH,w3;1e}ux<aU;ui}U3&Q5%bt]63&UQ|0l&uL}O7&3o,AV&dm|Nj(Xt*5+(Uu&Hh(p7(UF=VR=Bp^Jl&Hd[ix)9/=Iq]C8<67]66}mB%6f}bb}JI]8T$HA}db=YM&pa=2J}tS&Y0=PS&y4=cX$6E,hX,XP&nR;04,FQ&l0&Vm_Dv#5Y~8Z=Bi%MA]6x=JO:+p,Az&9q,Hj~6/}SD=K1:EJ}nA;Qo#/E]9R,Ie&6X%W3]61&v4=xX_MC=0q;06(Xq=fs}IG}Dv=0l}o7$iZ;9v&LH&DP-7a&OY,SZ,Kz,Cv&dh=fx|Nh,F/~7q=XF&w+;9n&Gw;0h}Z7<7O&JK(S7&LS<AD<ac=wo<Dt&zw%4B=4v#8P;9o~6p*vV=Tm,Or&I6=1q}nY=P0=gq&Bl&Uu,Ch%yb}UY=zh}dh}rl(T4_xk(YA#8R*xH,IN}Jn]7V}C4&Ty}j3]7p=cL=3h&wW%Qv<Z3=f0&RI&+S(ic_zq}oN&/Y=z1;Td=LW=0e=OI(Vc,+b^ju(UL;0r:Za%8v=Rp=zw&58&73&wK}qX]6y&8E)a2}WR=wP^ur&nQ<cH}Re=Aq&wk}Q0&+q=PP,Gc|/d^k5,Fw]8Y}Pg]p3=ju=ed}r5_yf&Cs]7z$/G<Cm&Jp&54_1G_gP_Ll}JZ;0u]k8_7k(Sg]65{9i=LN&Sx&WK,iW&fD&Lk{9a}Em-9c#8N&io=sy]8d&nT&IK(lx#7/$lW(Td<s8~49,3o<7Y=MW(T+_Jr&Wd,iL}Ct=xh&5V;v4&8n%Kx=iF&l2_0B{B+,If(J0,Lv;u8=Kx-vB=HC&vS=Z6&fU&vE^xK;3D=4h=MR#45:Jw;0d}iw=LU}I5=I0]gB*im,K9}GU,1k_4U&Tt=Vs(iX&lU(TF#7y,ZO}oA&m5#5P}PN}Uz=hM<B1&FB<aG,e6~7T<tP(UQ_ZT=wu&F8)aQ]iN,1r_Lo&/g:CD}84{J1_Ki&Na&3n$jz&FE=dc;uv;va}in}ll=fv(h1&3h}fp=Cy}BM(+E~8m}lo%v7=hC(T6$cj=BQ=Bw(DR,2j=Ks,NS|F+;00=fU=70}Mb(YU;+G&m7&hr=Sk%Co]t+(X5_Jw}0r}gC(AS-IP&QK<Z2#8Q$WC]WX}T2&pG_Ka,HC=R4&/N;Z+;ch(C7,D4$3p_Mk&B2$8D=n9%Ky#5z(CT&QJ#7B]DC]gW}nf~5M;Iw#80}Tc_1F#4Z-aC}Hl=ph=fz,/3=aW}JM}nn;DG;vm}wn,4P}T3;wx&RG$u+}zK=0b;+J_Ek{re<aZ=AS}yY#5D]7q,Cp}xN=VP*2C}GZ}aG~+m_Cs=OY#6r]6g<GS}LC(UB=3A=Bo}Jy<c4}Is;1P<AG}Op<Z1}ld}nS=1Z,yM&95&98=CJ(4t:2L$Hk=Zo}Vc;+I}np&N1}9y=iv}CO*7p=jL)px]tb^zh&GS&Vl%v/;vR=14=zJ&49|/f]hF}WG;03=8P}o/&Gg&rp;DB,Kv}Ji&Pb;aA^ll(4j%yt}+K$Ht#4y&hY]7Y<F1,eN}bG(Uh%6Z]t5%G7;+F_RE;it}tL=LS&Da=Xx(S+(4f=8G=yI}cJ}WP=37=jS}pX}hd)fp<A8=Jt~+o$HJ=M6}iX=g9}CS=dv=Cj(mP%Kd,xq|+9&LD(4/=Xm&QP=Lc}LX&fL;+K=Op(lu=Qs.qC:+e&L+=Jj#8w;SL]7S(b+#4I=c1&nG_Lf&uH;+R)ZV<bV%B/,TE&0H&Jq&Ah%OF&Ss(p2,Wv&I3=Wl}Vq;1L&lJ#9b_1H=8r=b8=JH(SZ=hD=J2#7U,/U#/X~6P,FU<eL=jx,mG=hG=CE&PU=Se(qX&LY=X6=y4&tk&QQ&tf=4g&xI}W+&mZ=Dc#7w}Lg;DA;wQ_Kb(cJ=hR%yX&Yb,hw{bX_4X;EP;1W_2M}Uc=b5(YF,CM&Tp^OJ{DD]6s=vF=Yo~8q}XH}Fu%P5(SJ=Qt;MO]s8<F3&B3&8T(Ul-BS*dw&dR<87}/8]62$PZ]Lx<Au}9Q]7c=ja=KR,Go,Us&v6(qk}pG&G2=ev^GM%w4&H4]7F&dv]J6}Ew:9w=sj-ZL}Ym$+h(Ut(Um~4n=Xs(U7%eE=Qc_JR<CA#6t<Fv|/I,IS,EG<F2(Xy$/n<Fa(h9}+9_2o&N4#7X<Zq|+f_Dp=dt&na,Ca=NJ)jY=8C=YG=s6&Q+<DO}D3=xB&R1(lw;Qn<bF(Cu|/B}HV=SS&n7,10&u0]Dm%A6^4Q=WR(TD=Xo<GH,Rj(l8)bP&n/=LM&CF,F5&ml=PJ;0k=LG=tq,Rh,D6@4i=1p&+9=YC%er_Mh;nI;0q=Fw]80=xq=FM$Gv;v6&nc;wK%H2&Kj;vs,AA=YP,66}bI(qR~5U=6q~4b$Ni=K5.X3$So&Iu(p+]8G=Cf=RY(TS_O3(iH&57=fE=Dg_Do#9z#7H;FK{qd_2k%JR}en&gh_z8;Rx}9p<cN_Ne,DO;LN_7o~/p=NF=5Y}gN<ce<C1,QE]Wv=3u<BC}GK]yq}DY&u/_hj=II(pz&rC,jV&+Z}ut=NQ;Cg-SR_ZS,+o=u/;Oy_RK_QF(Fx&xP}Wr&TA,Uh&g1=yr{ax[VF$Pg(YB;Ox=Vy;+W(Sp}XV%dd&33(l/]l4#4Y}OE=6c=bw(A7&9t%wd&N/&mo,JH&Qe)fm=Ao}fu=tH";
      const deltaData = "FAZDC6BALcLZCA+GBARCW8wNCcDDZ8LVFBOqqDUiou+M42TFAyERXFb7EjhP+vmBFpFrUpfDV2F7eB+eCltCHJFWLFCED+pWTojEIHFXc3aFn4F68zqjEuKidS1QBVPDEhE7NA4mhMF7oThD49ot3FgtzHFCK0acW1x8DH1EmLoIlrWFBLE+y5+NA3Cx65wJHTaEZVaK1mWAmPGxgYCdxwOjTDIt/faOEhTl1vqNsKtJCOhJWuio2g07KLZEQsFBUpNtwEByBgxFslFheFbiEPvi61msDvApxCzB6rBCzox7joYA5UdDc+Cb4FSgIabpXFAj3bjkmFAxCZE+mD/SFf/0ELecYCt3nLoxC6WEZf2tKDB4oZvrEmqFkKk7BwILA7gtYBpsTq//D4jD0F0wEB9pyQ1BD5Ba0oYHDI+sbDFhvrHXdDHfgFEIJLi5r8qercNFBgFLC4bo5ERJtamWBDFy73KCEb6M8VpmEt330ygCTK58EIIFkYgF84gtGA9Uyh3m68iVrFbWFbcbqiCYHZ9J1jeRPbL8yswhMiDbhEhdNoSwFbZrLT740ABEqgCkO8J1BLd1VhKKR4sD1yUo0z+FF59Mvg71CFbyEhbHSFBKEIKyoQNgQppq9T0KAqePu0ZFGrXOHdKJqkoTFhYvpDNyuuznrN84thJbsCoO6Cu6Xlvntvy0QYuAExQEYtTUBf3CoCqwgGFZ4u1HJFzDVwEy3cjcpV4QvsPaBC3rCGyCF23o4K3pp2gberGgFEJEHo4nHICtyKH2ZqyxhN05KBBJIQlKh/Oujv/DH32VrlqFdIFC7Fz9Ct4kaqFME0UETLprnN9kfy+kFmtQBB0+5CFu0N9Ij8l/VvJDh2oq3hT6EzjTHKFN7ZjZwoTsAZ4Exsko6Fpa6WC+sduz8jyrLpegTv2h1EBeYpLpm2czQW0KoCcS0bCVXCmuWJDBjN1nQNLdF58SFJ0h7i3pC3oEOKy/FjBklL70XvBEEIWp2yZ04xObzAWDDJG7f+DbqBEA7LyiR95j7MDVdDViz2RE5vWlBMv5e4+VfhP3aXNPhvLSynb9O2x4uFBV+3jqu6d5pCG28/sETByvmu/+IJ0L3wb4rj9DNOLBF6XPIODr4L19U9RRofAG6Nxydi8Bki8BhGJbBAJKzbJxkZSlF9Q2Cu8oKqggB9hBArwLLqEBWEtFowy8XK8bEyw9snT+BeyFk1ZCSrdmgfEwFePTgCjELBEnIbjaDDPJm36rG9pztcEzT8dGk23SBhXBB1H4z+OWze0ooFzz8pDBYFvp9j9tvFByf9y4EFdVnz026CGR5qMr7fxMHN8UUdlyJAzlTBDRC28k+L4FB8078ljyD91tUj1ocnTs8vdEf7znbzm+GIjEZnoZE5rnLL700Xc7yHfz05nWxy03vBB9YGHYOWxgMQGBCR24CVYNE1hpfKxN0zKnfJDmmMgMmBWqNbjfSyFCBWSCGCgR8yFXiHyEj+VtD1FB3FpC1zI0kFbzifiKTLm9yq5zFmur+q8FHqjoOBWsBPiDbnCC2ErunV6cJ6TygXFYHYp7MKN9RUlSIS8/xBAGYLzeqUnBF4QbsTuUkUqGs6CaiDWKWjQK9EJkjpkTmNCPYXL";
      const wordlist = {
        zh_cn: null,
        zh_tw: null
      };
      const Checks = {
        zh_cn: "0x17bcc4d8547e5a7135e365d1ab443aaae95e76d8230c2782c67305d4f21497a1",
        zh_tw: "0x51e720e90c7b87bec1d70eb6e74a21a449bd3ec9c020b01d3a40ed991b60ce5d"
      };
      const codes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
      const style = "~!@#$%^&*_-=[]{}|;:,.()<>?";
      function loadWords(lang) {
        if (wordlist[lang.locale] !== null) {
          return;
        }
        wordlist[lang.locale] = [];
        let deltaOffset = 0;
        for (let i = 0; i < 2048; i++) {
          const s = style.indexOf(data[i * 3]);
          const bytes = [ 228 + (s >> 2), 128 + codes.indexOf(data[i * 3 + 1]), 128 + codes.indexOf(data[i * 3 + 2]) ];
          if (lang.locale === "zh_tw") {
            const common = s % 4;
            for (let i = common; i < 3; i++) {
              bytes[i] = codes.indexOf(deltaData[deltaOffset++]) + (i == 0 ? 228 : 128);
            }
          }
          wordlist[lang.locale].push((0, strings_1.toUtf8String)(bytes));
        }
        if (wordlist_1.Wordlist.check(lang) !== Checks[lang.locale]) {
          wordlist[lang.locale] = null;
          throw new Error("BIP39 Wordlist for " + lang.locale + " (Chinese) FAILED");
        }
      }
      class LangZh extends wordlist_1.Wordlist {
        constructor(country) {
          super("zh_" + country);
        }
        getWord(index) {
          loadWords(this);
          return wordlist[this.locale][index];
        }
        getWordIndex(word) {
          loadWords(this);
          return wordlist[this.locale].indexOf(word);
        }
        split(mnemonic) {
          mnemonic = mnemonic.replace(/(?:\u3000| )+/g, "");
          return mnemonic.split("");
        }
      }
      const langZhCn = new LangZh("cn");
      exports.langZhCn = langZhCn;
      wordlist_1.Wordlist.register(langZhCn);
      wordlist_1.Wordlist.register(langZhCn, "zh");
      const langZhTw = new LangZh("tw");
      exports.langZhTw = langZhTw;
      wordlist_1.Wordlist.register(langZhTw);
    },
    652(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.Wordlist = exports.logger = void 0;
      const exportWordlist = false;
      const hash_1 = __webpack_require__(413);
      const properties_1 = __webpack_require__(1476);
      const logger_1 = __webpack_require__(5289);
      const _version_1 = __webpack_require__(6079);
      exports.logger = new logger_1.Logger(_version_1.version);
      class Wordlist {
        constructor(locale) {
          exports.logger.checkAbstract(new.target, Wordlist);
          (0, properties_1.defineReadOnly)(this, "locale", locale);
        }
        split(mnemonic) {
          return mnemonic.toLowerCase().split(/ +/g);
        }
        join(words) {
          return words.join(" ");
        }
        static check(wordlist) {
          const words = [];
          for (let i = 0; i < 2048; i++) {
            const word = wordlist.getWord(i);
            if (i !== wordlist.getWordIndex(word)) {
              return "0x";
            }
            words.push(word);
          }
          return (0, hash_1.id)(words.join("\n") + "\n");
        }
        static register(lang, name) {
          if (!name) {
            name = lang.locale;
          }
          if (exportWordlist) {
            try {
              const anyGlobal = window;
              if (anyGlobal._ethers && anyGlobal._ethers.wordlists) {
                if (!anyGlobal._ethers.wordlists[name]) {
                  (0, properties_1.defineReadOnly)(anyGlobal._ethers.wordlists, name, lang);
                }
              }
            } catch (error) {}
          }
        }
      }
      exports.Wordlist = Wordlist;
    },
    9107(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.wordlists = void 0;
      const lang_cz_1 = __webpack_require__(6587);
      const lang_en_1 = __webpack_require__(2578);
      const lang_es_1 = __webpack_require__(8581);
      const lang_fr_1 = __webpack_require__(3485);
      const lang_ja_1 = __webpack_require__(6136);
      const lang_ko_1 = __webpack_require__(1699);
      const lang_it_1 = __webpack_require__(4908);
      const lang_zh_1 = __webpack_require__(5911);
      exports.wordlists = {
        cz: lang_cz_1.langCz,
        en: lang_en_1.langEn,
        es: lang_es_1.langEs,
        fr: lang_fr_1.langFr,
        it: lang_it_1.langIt,
        ja: lang_ja_1.langJa,
        ko: lang_ko_1.langKo,
        zh: lang_zh_1.langZhCn,
        zh_cn: lang_zh_1.langZhCn,
        zh_tw: lang_zh_1.langZhTw
      };
    },
    3836(module) {
      "use strict";
      (function(root) {
        function checkInt(value) {
          return parseInt(value) === value;
        }
        function checkInts(arrayish) {
          if (!checkInt(arrayish.length)) {
            return false;
          }
          for (var i = 0; i < arrayish.length; i++) {
            if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {
              return false;
            }
          }
          return true;
        }
        function coerceArray(arg, copy) {
          if (arg.buffer && ArrayBuffer.isView(arg) && arg.name === "Uint8Array") {
            if (copy) {
              if (arg.slice) {
                arg = arg.slice();
              } else {
                arg = Array.prototype.slice.call(arg);
              }
            }
            return arg;
          }
          if (Array.isArray(arg)) {
            if (!checkInts(arg)) {
              throw new Error("Array contains invalid value: " + arg);
            }
            return new Uint8Array(arg);
          }
          if (checkInt(arg.length) && checkInts(arg)) {
            return new Uint8Array(arg);
          }
          throw new Error("unsupported array-like object");
        }
        function createArray(length) {
          return new Uint8Array(length);
        }
        function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {
          if (sourceStart != null || sourceEnd != null) {
            if (sourceArray.slice) {
              sourceArray = sourceArray.slice(sourceStart, sourceEnd);
            } else {
              sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);
            }
          }
          targetArray.set(sourceArray, targetStart);
        }
        var convertUtf8 = function() {
          function toBytes(text) {
            var result = [], i = 0;
            text = encodeURI(text);
            while (i < text.length) {
              var c = text.charCodeAt(i++);
              if (c === 37) {
                result.push(parseInt(text.substr(i, 2), 16));
                i += 2;
              } else {
                result.push(c);
              }
            }
            return coerceArray(result);
          }
          function fromBytes(bytes) {
            var result = [], i = 0;
            while (i < bytes.length) {
              var c = bytes[i];
              if (c < 128) {
                result.push(String.fromCharCode(c));
                i++;
              } else if (c > 191 && c < 224) {
                result.push(String.fromCharCode((c & 31) << 6 | bytes[i + 1] & 63));
                i += 2;
              } else {
                result.push(String.fromCharCode((c & 15) << 12 | (bytes[i + 1] & 63) << 6 | bytes[i + 2] & 63));
                i += 3;
              }
            }
            return result.join("");
          }
          return {
            toBytes,
            fromBytes
          };
        }();
        var convertHex = function() {
          function toBytes(text) {
            var result = [];
            for (var i = 0; i < text.length; i += 2) {
              result.push(parseInt(text.substr(i, 2), 16));
            }
            return result;
          }
          var Hex = "0123456789abcdef";
          function fromBytes(bytes) {
            var result = [];
            for (var i = 0; i < bytes.length; i++) {
              var v = bytes[i];
              result.push(Hex[(v & 240) >> 4] + Hex[v & 15]);
            }
            return result.join("");
          }
          return {
            toBytes,
            fromBytes
          };
        }();
        var numberOfRounds = {
          16: 10,
          24: 12,
          32: 14
        };
        var rcon = [ 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145 ];
        var S = [ 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22 ];
        var Si = [ 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125 ];
        var T1 = [ 3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363, 3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264, 3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118, 3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163, 2824099068, 1841019862, 739644986 ];
        var T2 = [ 2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938, 1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398, 1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806, 252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112, 4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910, 1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160, 1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083, 1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144, 2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930, 504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013, 1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884, 1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121, 1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487, 550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008, 4238890068, 3597515707, 975967766 ];
        var T3 = [ 1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347, 4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228, 1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077, 67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126 ];
        var T4 = [ 1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422, 4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643, 1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962, 67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436 ];
        var T5 = [ 1374988112, 2118214995, 437757123, 975658646, 1001089995, 530400753, 2902087851, 1273168787, 540080725, 2910219766, 2295101073, 4110568485, 1340463100, 3307916247, 641025152, 3043140495, 3736164937, 632953703, 1172967064, 1576976609, 3274667266, 2169303058, 2370213795, 1809054150, 59727847, 361929877, 3211623147, 2505202138, 3569255213, 1484005843, 1239443753, 2395588676, 1975683434, 4102977912, 2572697195, 666464733, 3202437046, 4035489047, 3374361702, 2110667444, 1675577880, 3843699074, 2538681184, 1649639237, 2976151520, 3144396420, 4269907996, 4178062228, 1883793496, 2403728665, 2497604743, 1383856311, 2876494627, 1917518562, 3810496343, 1716890410, 3001755655, 800440835, 2261089178, 3543599269, 807962610, 599762354, 33778362, 3977675356, 2328828971, 2809771154, 4077384432, 1315562145, 1708848333, 101039829, 3509871135, 3299278474, 875451293, 2733856160, 92987698, 2767645557, 193195065, 1080094634, 1584504582, 3178106961, 1042385657, 2531067453, 3711829422, 1306967366, 2438237621, 1908694277, 67556463, 1615861247, 429456164, 3602770327, 2302690252, 1742315127, 2968011453, 126454664, 3877198648, 2043211483, 2709260871, 2084704233, 4169408201, 0, 159417987, 841739592, 504459436, 1817866830, 4245618683, 260388950, 1034867998, 908933415, 168810852, 1750902305, 2606453969, 607530554, 202008497, 2472011535, 3035535058, 463180190, 2160117071, 1641816226, 1517767529, 470948374, 3801332234, 3231722213, 1008918595, 303765277, 235474187, 4069246893, 766945465, 337553864, 1475418501, 2943682380, 4003061179, 2743034109, 4144047775, 1551037884, 1147550661, 1543208500, 2336434550, 3408119516, 3069049960, 3102011747, 3610369226, 1113818384, 328671808, 2227573024, 2236228733, 3535486456, 2935566865, 3341394285, 496906059, 3702665459, 226906860, 2009195472, 733156972, 2842737049, 294930682, 1206477858, 2835123396, 2700099354, 1451044056, 573804783, 2269728455, 3644379585, 2362090238, 2564033334, 2801107407, 2776292904, 3669462566, 1068351396, 742039012, 1350078989, 1784663195, 1417561698, 4136440770, 2430122216, 775550814, 2193862645, 2673705150, 1775276924, 1876241833, 3475313331, 3366754619, 270040487, 3902563182, 3678124923, 3441850377, 1851332852, 3969562369, 2203032232, 3868552805, 2868897406, 566021896, 4011190502, 3135740889, 1248802510, 3936291284, 699432150, 832877231, 708780849, 3332740144, 899835584, 1951317047, 4236429990, 3767586992, 866637845, 4043610186, 1106041591, 2144161806, 395441711, 1984812685, 1139781709, 3433712980, 3835036895, 2664543715, 1282050075, 3240894392, 1181045119, 2640243204, 25965917, 4203181171, 4211818798, 3009879386, 2463879762, 3910161971, 1842759443, 2597806476, 933301370, 1509430414, 3943906441, 3467192302, 3076639029, 3776767469, 2051518780, 2631065433, 1441952575, 404016761, 1942435775, 1408749034, 1610459739, 3745345300, 2017778566, 3400528769, 3110650942, 941896748, 3265478751, 371049330, 3168937228, 675039627, 4279080257, 967311729, 135050206, 3635733660, 1683407248, 2076935265, 3576870512, 1215061108, 3501741890 ];
        var T6 = [ 1347548327, 1400783205, 3273267108, 2520393566, 3409685355, 4045380933, 2880240216, 2471224067, 1428173050, 4138563181, 2441661558, 636813900, 4233094615, 3620022987, 2149987652, 2411029155, 1239331162, 1730525723, 2554718734, 3781033664, 46346101, 310463728, 2743944855, 3328955385, 3875770207, 2501218972, 3955191162, 3667219033, 768917123, 3545789473, 692707433, 1150208456, 1786102409, 2029293177, 1805211710, 3710368113, 3065962831, 401639597, 1724457132, 3028143674, 409198410, 2196052529, 1620529459, 1164071807, 3769721975, 2226875310, 486441376, 2499348523, 1483753576, 428819965, 2274680428, 3075636216, 598438867, 3799141122, 1474502543, 711349675, 129166120, 53458370, 2592523643, 2782082824, 4063242375, 2988687269, 3120694122, 1559041666, 730517276, 2460449204, 4042459122, 2706270690, 3446004468, 3573941694, 533804130, 2328143614, 2637442643, 2695033685, 839224033, 1973745387, 957055980, 2856345839, 106852767, 1371368976, 4181598602, 1033297158, 2933734917, 1179510461, 3046200461, 91341917, 1862534868, 4284502037, 605657339, 2547432937, 3431546947, 2003294622, 3182487618, 2282195339, 954669403, 3682191598, 1201765386, 3917234703, 3388507166, 0, 2198438022, 1211247597, 2887651696, 1315723890, 4227665663, 1443857720, 507358933, 657861945, 1678381017, 560487590, 3516619604, 975451694, 2970356327, 261314535, 3535072918, 2652609425, 1333838021, 2724322336, 1767536459, 370938394, 182621114, 3854606378, 1128014560, 487725847, 185469197, 2918353863, 3106780840, 3356761769, 2237133081, 1286567175, 3152976349, 4255350624, 2683765030, 3160175349, 3309594171, 878443390, 1988838185, 3704300486, 1756818940, 1673061617, 3403100636, 272786309, 1075025698, 545572369, 2105887268, 4174560061, 296679730, 1841768865, 1260232239, 4091327024, 3960309330, 3497509347, 1814803222, 2578018489, 4195456072, 575138148, 3299409036, 446754879, 3629546796, 4011996048, 3347532110, 3252238545, 4270639778, 915985419, 3483825537, 681933534, 651868046, 2755636671, 3828103837, 223377554, 2607439820, 1649704518, 3270937875, 3901806776, 1580087799, 4118987695, 3198115200, 2087309459, 2842678573, 3016697106, 1003007129, 2802849917, 1860738147, 2077965243, 164439672, 4100872472, 32283319, 2827177882, 1709610350, 2125135846, 136428751, 3874428392, 3652904859, 3460984630, 3572145929, 3593056380, 2939266226, 824852259, 818324884, 3224740454, 930369212, 2801566410, 2967507152, 355706840, 1257309336, 4148292826, 243256656, 790073846, 2373340630, 1296297904, 1422699085, 3756299780, 3818836405, 457992840, 3099667487, 2135319889, 77422314, 1560382517, 1945798516, 788204353, 1521706781, 1385356242, 870912086, 325965383, 2358957921, 2050466060, 2388260884, 2313884476, 4006521127, 901210569, 3990953189, 1014646705, 1503449823, 1062597235, 2031621326, 3212035895, 3931371469, 1533017514, 350174575, 2256028891, 2177544179, 1052338372, 741876788, 1606591296, 1914052035, 213705253, 2334669897, 1107234197, 1899603969, 3725069491, 2631447780, 2422494913, 1635502980, 1893020342, 1950903388, 1120974935 ];
        var T7 = [ 2807058932, 1699970625, 2764249623, 1586903591, 1808481195, 1173430173, 1487645946, 59984867, 4199882800, 1844882806, 1989249228, 1277555970, 3623636965, 3419915562, 1149249077, 2744104290, 1514790577, 459744698, 244860394, 3235995134, 1963115311, 4027744588, 2544078150, 4190530515, 1608975247, 2627016082, 2062270317, 1507497298, 2200818878, 567498868, 1764313568, 3359936201, 2305455554, 2037970062, 1047239e3, 1910319033, 1337376481, 2904027272, 2892417312, 984907214, 1243112415, 830661914, 861968209, 2135253587, 2011214180, 2927934315, 2686254721, 731183368, 1750626376, 4246310725, 1820824798, 4172763771, 3542330227, 48394827, 2404901663, 2871682645, 671593195, 3254988725, 2073724613, 145085239, 2280796200, 2779915199, 1790575107, 2187128086, 472615631, 3029510009, 4075877127, 3802222185, 4107101658, 3201631749, 1646252340, 4270507174, 1402811438, 1436590835, 3778151818, 3950355702, 3963161475, 4020912224, 2667994737, 273792366, 2331590177, 104699613, 95345982, 3175501286, 2377486676, 1560637892, 3564045318, 369057872, 4213447064, 3919042237, 1137477952, 2658625497, 1119727848, 2340947849, 1530455833, 4007360968, 172466556, 266959938, 516552836, 0, 2256734592, 3980931627, 1890328081, 1917742170, 4294704398, 945164165, 3575528878, 958871085, 3647212047, 2787207260, 1423022939, 775562294, 1739656202, 3876557655, 2530391278, 2443058075, 3310321856, 547512796, 1265195639, 437656594, 3121275539, 719700128, 3762502690, 387781147, 218828297, 3350065803, 2830708150, 2848461854, 428169201, 122466165, 3720081049, 1627235199, 648017665, 4122762354, 1002783846, 2117360635, 695634755, 3336358691, 4234721005, 4049844452, 3704280881, 2232435299, 574624663, 287343814, 612205898, 1039717051, 840019705, 2708326185, 793451934, 821288114, 1391201670, 3822090177, 376187827, 3113855344, 1224348052, 1679968233, 2361698556, 1058709744, 752375421, 2431590963, 1321699145, 3519142200, 2734591178, 188127444, 2177869557, 3727205754, 2384911031, 3215212461, 2648976442, 2450346104, 3432737375, 1180849278, 331544205, 3102249176, 4150144569, 2952102595, 2159976285, 2474404304, 766078933, 313773861, 2570832044, 2108100632, 1668212892, 3145456443, 2013908262, 418672217, 3070356634, 2594734927, 1852171925, 3867060991, 3473416636, 3907448597, 2614737639, 919489135, 164948639, 2094410160, 2997825956, 590424639, 2486224549, 1723872674, 3157750862, 3399941250, 3501252752, 3625268135, 2555048196, 3673637356, 1343127501, 4130281361, 3599595085, 2957853679, 1297403050, 81781910, 3051593425, 2283490410, 532201772, 1367295589, 3926170974, 895287692, 1953757831, 1093597963, 492483431, 3528626907, 1446242576, 1192455638, 1636604631, 209336225, 344873464, 1015671571, 669961897, 3375740769, 3857572124, 2973530695, 3747192018, 1933530610, 3464042516, 935293895, 3454686199, 2858115069, 1863638845, 3683022916, 4085369519, 3292445032, 875313188, 1080017571, 3279033885, 621591778, 1233856572, 2504130317, 24197544, 3017672716, 3835484340, 3247465558, 2220981195, 3060847922, 1551124588, 1463996600 ];
        var T8 = [ 4104605777, 1097159550, 396673818, 660510266, 2875968315, 2638606623, 4200115116, 3808662347, 821712160, 1986918061, 3430322568, 38544885, 3856137295, 718002117, 893681702, 1654886325, 2975484382, 3122358053, 3926825029, 4274053469, 796197571, 1290801793, 1184342925, 3556361835, 2405426947, 2459735317, 1836772287, 1381620373, 3196267988, 1948373848, 3764988233, 3385345166, 3263785589, 2390325492, 1480485785, 3111247143, 3780097726, 2293045232, 548169417, 3459953789, 3746175075, 439452389, 1362321559, 1400849762, 1685577905, 1806599355, 2174754046, 137073913, 1214797936, 1174215055, 3731654548, 2079897426, 1943217067, 1258480242, 529487843, 1437280870, 3945269170, 3049390895, 3313212038, 923313619, 679998e3, 3215307299, 57326082, 377642221, 3474729866, 2041877159, 133361907, 1776460110, 3673476453, 96392454, 878845905, 2801699524, 777231668, 4082475170, 2330014213, 4142626212, 2213296395, 1626319424, 1906247262, 1846563261, 562755902, 3708173718, 1040559837, 3871163981, 1418573201, 3294430577, 114585348, 1343618912, 2566595609, 3186202582, 1078185097, 3651041127, 3896688048, 2307622919, 425408743, 3371096953, 2081048481, 1108339068, 2216610296, 0, 2156299017, 736970802, 292596766, 1517440620, 251657213, 2235061775, 2933202493, 758720310, 265905162, 1554391400, 1532285339, 908999204, 174567692, 1474760595, 4002861748, 2610011675, 3234156416, 3693126241, 2001430874, 303699484, 2478443234, 2687165888, 585122620, 454499602, 151849742, 2345119218, 3064510765, 514443284, 4044981591, 1963412655, 2581445614, 2137062819, 19308535, 1928707164, 1715193156, 4219352155, 1126790795, 600235211, 3992742070, 3841024952, 836553431, 1669664834, 2535604243, 3323011204, 1243905413, 3141400786, 4180808110, 698445255, 2653899549, 2989552604, 2253581325, 3252932727, 3004591147, 1891211689, 2487810577, 3915653703, 4237083816, 4030667424, 2100090966, 865136418, 1229899655, 953270745, 3399679628, 3557504664, 4118925222, 2061379749, 3079546586, 2915017791, 983426092, 2022837584, 1607244650, 2118541908, 2366882550, 3635996816, 972512814, 3283088770, 1568718495, 3499326569, 3576539503, 621982671, 2895723464, 410887952, 2623762152, 1002142683, 645401037, 1494807662, 2595684844, 1335535747, 2507040230, 4293295786, 3167684641, 367585007, 3885750714, 1865862730, 2668221674, 2960971305, 2763173681, 1059270954, 2777952454, 2724642869, 1320957812, 2194319100, 2429595872, 2815956275, 77089521, 3973773121, 3444575871, 2448830231, 1305906550, 4021308739, 2857194700, 2516901860, 3518358430, 1787304780, 740276417, 1699839814, 1592394909, 2352307457, 2272556026, 188821243, 1729977011, 3687994002, 274084841, 3594982253, 3613494426, 2701949495, 4162096729, 322734571, 2837966542, 1640576439, 484830689, 1202797690, 3537852828, 4067639125, 349075736, 3342319475, 4157467219, 4255800159, 1030690015, 1155237496, 2951971274, 1757691577, 607398968, 2738905026, 499347990, 3794078908, 1011452712, 227885567, 2818666809, 213114376, 3034881240, 1455525988, 3414450555, 850817237, 1817998408, 3092726480 ];
        var U1 = [ 0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795 ];
        var U2 = [ 0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388, 2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918, 3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846, 2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212, 711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376, 768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545, 3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461, 2827177882, 2743944855 ];
        var U3 = [ 0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588, 1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278, 2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195, 1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861, 830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892, 1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199, 2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239e3, 861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833, 1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868, 752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927, 2544078150 ];
        var U4 = [ 0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555, 3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998e3, 865136418, 983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453, 3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243, 3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584, 265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495, 1418573201, 1335535747, 1184342925 ];
        function convertToInt32(bytes) {
          var result = [];
          for (var i = 0; i < bytes.length; i += 4) {
            result.push(bytes[i] << 24 | bytes[i + 1] << 16 | bytes[i + 2] << 8 | bytes[i + 3]);
          }
          return result;
        }
        var AES = function(key) {
          if (!(this instanceof AES)) {
            throw Error("AES must be instanitated with `new`");
          }
          Object.defineProperty(this, "key", {
            value: coerceArray(key, true)
          });
          this._prepare();
        };
        AES.prototype._prepare = function() {
          var rounds = numberOfRounds[this.key.length];
          if (rounds == null) {
            throw new Error("invalid key size (must be 16, 24 or 32 bytes)");
          }
          this._Ke = [];
          this._Kd = [];
          for (var i = 0; i <= rounds; i++) {
            this._Ke.push([ 0, 0, 0, 0 ]);
            this._Kd.push([ 0, 0, 0, 0 ]);
          }
          var roundKeyCount = (rounds + 1) * 4;
          var KC = this.key.length / 4;
          var tk = convertToInt32(this.key);
          var index;
          for (var i = 0; i < KC; i++) {
            index = i >> 2;
            this._Ke[index][i % 4] = tk[i];
            this._Kd[rounds - index][i % 4] = tk[i];
          }
          var rconpointer = 0;
          var t = KC, tt;
          while (t < roundKeyCount) {
            tt = tk[KC - 1];
            tk[0] ^= S[tt >> 16 & 255] << 24 ^ S[tt >> 8 & 255] << 16 ^ S[tt & 255] << 8 ^ S[tt >> 24 & 255] ^ rcon[rconpointer] << 24;
            rconpointer += 1;
            if (KC != 8) {
              for (var i = 1; i < KC; i++) {
                tk[i] ^= tk[i - 1];
              }
            } else {
              for (var i = 1; i < KC / 2; i++) {
                tk[i] ^= tk[i - 1];
              }
              tt = tk[KC / 2 - 1];
              tk[KC / 2] ^= S[tt & 255] ^ S[tt >> 8 & 255] << 8 ^ S[tt >> 16 & 255] << 16 ^ S[tt >> 24 & 255] << 24;
              for (var i = KC / 2 + 1; i < KC; i++) {
                tk[i] ^= tk[i - 1];
              }
            }
            var i = 0, r, c;
            while (i < KC && t < roundKeyCount) {
              r = t >> 2;
              c = t % 4;
              this._Ke[r][c] = tk[i];
              this._Kd[rounds - r][c] = tk[i++];
              t++;
            }
          }
          for (var r = 1; r < rounds; r++) {
            for (var c = 0; c < 4; c++) {
              tt = this._Kd[r][c];
              this._Kd[r][c] = U1[tt >> 24 & 255] ^ U2[tt >> 16 & 255] ^ U3[tt >> 8 & 255] ^ U4[tt & 255];
            }
          }
        };
        AES.prototype.encrypt = function(plaintext) {
          if (plaintext.length != 16) {
            throw new Error("invalid plaintext size (must be 16 bytes)");
          }
          var rounds = this._Ke.length - 1;
          var a = [ 0, 0, 0, 0 ];
          var t = convertToInt32(plaintext);
          for (var i = 0; i < 4; i++) {
            t[i] ^= this._Ke[0][i];
          }
          for (var r = 1; r < rounds; r++) {
            for (var i = 0; i < 4; i++) {
              a[i] = T1[t[i] >> 24 & 255] ^ T2[t[(i + 1) % 4] >> 16 & 255] ^ T3[t[(i + 2) % 4] >> 8 & 255] ^ T4[t[(i + 3) % 4] & 255] ^ this._Ke[r][i];
            }
            t = a.slice();
          }
          var result = createArray(16), tt;
          for (var i = 0; i < 4; i++) {
            tt = this._Ke[rounds][i];
            result[4 * i] = (S[t[i] >> 24 & 255] ^ tt >> 24) & 255;
            result[4 * i + 1] = (S[t[(i + 1) % 4] >> 16 & 255] ^ tt >> 16) & 255;
            result[4 * i + 2] = (S[t[(i + 2) % 4] >> 8 & 255] ^ tt >> 8) & 255;
            result[4 * i + 3] = (S[t[(i + 3) % 4] & 255] ^ tt) & 255;
          }
          return result;
        };
        AES.prototype.decrypt = function(ciphertext) {
          if (ciphertext.length != 16) {
            throw new Error("invalid ciphertext size (must be 16 bytes)");
          }
          var rounds = this._Kd.length - 1;
          var a = [ 0, 0, 0, 0 ];
          var t = convertToInt32(ciphertext);
          for (var i = 0; i < 4; i++) {
            t[i] ^= this._Kd[0][i];
          }
          for (var r = 1; r < rounds; r++) {
            for (var i = 0; i < 4; i++) {
              a[i] = T5[t[i] >> 24 & 255] ^ T6[t[(i + 3) % 4] >> 16 & 255] ^ T7[t[(i + 2) % 4] >> 8 & 255] ^ T8[t[(i + 1) % 4] & 255] ^ this._Kd[r][i];
            }
            t = a.slice();
          }
          var result = createArray(16), tt;
          for (var i = 0; i < 4; i++) {
            tt = this._Kd[rounds][i];
            result[4 * i] = (Si[t[i] >> 24 & 255] ^ tt >> 24) & 255;
            result[4 * i + 1] = (Si[t[(i + 3) % 4] >> 16 & 255] ^ tt >> 16) & 255;
            result[4 * i + 2] = (Si[t[(i + 2) % 4] >> 8 & 255] ^ tt >> 8) & 255;
            result[4 * i + 3] = (Si[t[(i + 1) % 4] & 255] ^ tt) & 255;
          }
          return result;
        };
        var ModeOfOperationECB = function(key) {
          if (!(this instanceof ModeOfOperationECB)) {
            throw Error("AES must be instanitated with `new`");
          }
          this.description = "Electronic Code Block";
          this.name = "ecb";
          this._aes = new AES(key);
        };
        ModeOfOperationECB.prototype.encrypt = function(plaintext) {
          plaintext = coerceArray(plaintext);
          if (plaintext.length % 16 !== 0) {
            throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
          }
          var ciphertext = createArray(plaintext.length);
          var block = createArray(16);
          for (var i = 0; i < plaintext.length; i += 16) {
            copyArray(plaintext, block, 0, i, i + 16);
            block = this._aes.encrypt(block);
            copyArray(block, ciphertext, i);
          }
          return ciphertext;
        };
        ModeOfOperationECB.prototype.decrypt = function(ciphertext) {
          ciphertext = coerceArray(ciphertext);
          if (ciphertext.length % 16 !== 0) {
            throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
          }
          var plaintext = createArray(ciphertext.length);
          var block = createArray(16);
          for (var i = 0; i < ciphertext.length; i += 16) {
            copyArray(ciphertext, block, 0, i, i + 16);
            block = this._aes.decrypt(block);
            copyArray(block, plaintext, i);
          }
          return plaintext;
        };
        var ModeOfOperationCBC = function(key, iv) {
          if (!(this instanceof ModeOfOperationCBC)) {
            throw Error("AES must be instanitated with `new`");
          }
          this.description = "Cipher Block Chaining";
          this.name = "cbc";
          if (!iv) {
            iv = createArray(16);
          } else if (iv.length != 16) {
            throw new Error("invalid initialation vector size (must be 16 bytes)");
          }
          this._lastCipherblock = coerceArray(iv, true);
          this._aes = new AES(key);
        };
        ModeOfOperationCBC.prototype.encrypt = function(plaintext) {
          plaintext = coerceArray(plaintext);
          if (plaintext.length % 16 !== 0) {
            throw new Error("invalid plaintext size (must be multiple of 16 bytes)");
          }
          var ciphertext = createArray(plaintext.length);
          var block = createArray(16);
          for (var i = 0; i < plaintext.length; i += 16) {
            copyArray(plaintext, block, 0, i, i + 16);
            for (var j = 0; j < 16; j++) {
              block[j] ^= this._lastCipherblock[j];
            }
            this._lastCipherblock = this._aes.encrypt(block);
            copyArray(this._lastCipherblock, ciphertext, i);
          }
          return ciphertext;
        };
        ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {
          ciphertext = coerceArray(ciphertext);
          if (ciphertext.length % 16 !== 0) {
            throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");
          }
          var plaintext = createArray(ciphertext.length);
          var block = createArray(16);
          for (var i = 0; i < ciphertext.length; i += 16) {
            copyArray(ciphertext, block, 0, i, i + 16);
            block = this._aes.decrypt(block);
            for (var j = 0; j < 16; j++) {
              plaintext[i + j] = block[j] ^ this._lastCipherblock[j];
            }
            copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);
          }
          return plaintext;
        };
        var ModeOfOperationCFB = function(key, iv, segmentSize) {
          if (!(this instanceof ModeOfOperationCFB)) {
            throw Error("AES must be instanitated with `new`");
          }
          this.description = "Cipher Feedback";
          this.name = "cfb";
          if (!iv) {
            iv = createArray(16);
          } else if (iv.length != 16) {
            throw new Error("invalid initialation vector size (must be 16 size)");
          }
          if (!segmentSize) {
            segmentSize = 1;
          }
          this.segmentSize = segmentSize;
          this._shiftRegister = coerceArray(iv, true);
          this._aes = new AES(key);
        };
        ModeOfOperationCFB.prototype.encrypt = function(plaintext) {
          if (plaintext.length % this.segmentSize != 0) {
            throw new Error("invalid plaintext size (must be segmentSize bytes)");
          }
          var encrypted = coerceArray(plaintext, true);
          var xorSegment;
          for (var i = 0; i < encrypted.length; i += this.segmentSize) {
            xorSegment = this._aes.encrypt(this._shiftRegister);
            for (var j = 0; j < this.segmentSize; j++) {
              encrypted[i + j] ^= xorSegment[j];
            }
            copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
            copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);
          }
          return encrypted;
        };
        ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {
          if (ciphertext.length % this.segmentSize != 0) {
            throw new Error("invalid ciphertext size (must be segmentSize bytes)");
          }
          var plaintext = coerceArray(ciphertext, true);
          var xorSegment;
          for (var i = 0; i < plaintext.length; i += this.segmentSize) {
            xorSegment = this._aes.encrypt(this._shiftRegister);
            for (var j = 0; j < this.segmentSize; j++) {
              plaintext[i + j] ^= xorSegment[j];
            }
            copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);
            copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);
          }
          return plaintext;
        };
        var ModeOfOperationOFB = function(key, iv) {
          if (!(this instanceof ModeOfOperationOFB)) {
            throw Error("AES must be instanitated with `new`");
          }
          this.description = "Output Feedback";
          this.name = "ofb";
          if (!iv) {
            iv = createArray(16);
          } else if (iv.length != 16) {
            throw new Error("invalid initialation vector size (must be 16 bytes)");
          }
          this._lastPrecipher = coerceArray(iv, true);
          this._lastPrecipherIndex = 16;
          this._aes = new AES(key);
        };
        ModeOfOperationOFB.prototype.encrypt = function(plaintext) {
          var encrypted = coerceArray(plaintext, true);
          for (var i = 0; i < encrypted.length; i++) {
            if (this._lastPrecipherIndex === 16) {
              this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);
              this._lastPrecipherIndex = 0;
            }
            encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];
          }
          return encrypted;
        };
        ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;
        var Counter = function(initialValue) {
          if (!(this instanceof Counter)) {
            throw Error("Counter must be instanitated with `new`");
          }
          if (initialValue !== 0 && !initialValue) {
            initialValue = 1;
          }
          if (typeof initialValue === "number") {
            this._counter = createArray(16);
            this.setValue(initialValue);
          } else {
            this.setBytes(initialValue);
          }
        };
        Counter.prototype.setValue = function(value) {
          if (typeof value !== "number" || parseInt(value) != value) {
            throw new Error("invalid counter value (must be an integer)");
          }
          for (var index = 15; index >= 0; --index) {
            this._counter[index] = value % 256;
            value = value >> 8;
          }
        };
        Counter.prototype.setBytes = function(bytes) {
          bytes = coerceArray(bytes, true);
          if (bytes.length != 16) {
            throw new Error("invalid counter bytes size (must be 16 bytes)");
          }
          this._counter = bytes;
        };
        Counter.prototype.increment = function() {
          for (var i = 15; i >= 0; i--) {
            if (this._counter[i] === 255) {
              this._counter[i] = 0;
            } else {
              this._counter[i]++;
              break;
            }
          }
        };
        var ModeOfOperationCTR = function(key, counter) {
          if (!(this instanceof ModeOfOperationCTR)) {
            throw Error("AES must be instanitated with `new`");
          }
          this.description = "Counter";
          this.name = "ctr";
          if (!(counter instanceof Counter)) {
            counter = new Counter(counter);
          }
          this._counter = counter;
          this._remainingCounter = null;
          this._remainingCounterIndex = 16;
          this._aes = new AES(key);
        };
        ModeOfOperationCTR.prototype.encrypt = function(plaintext) {
          var encrypted = coerceArray(plaintext, true);
          for (var i = 0; i < encrypted.length; i++) {
            if (this._remainingCounterIndex === 16) {
              this._remainingCounter = this._aes.encrypt(this._counter._counter);
              this._remainingCounterIndex = 0;
              this._counter.increment();
            }
            encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];
          }
          return encrypted;
        };
        ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;
        function pkcs7pad(data) {
          data = coerceArray(data, true);
          var padder = 16 - data.length % 16;
          var result = createArray(data.length + padder);
          copyArray(data, result);
          for (var i = data.length; i < result.length; i++) {
            result[i] = padder;
          }
          return result;
        }
        function pkcs7strip(data) {
          data = coerceArray(data, true);
          if (data.length < 16) {
            throw new Error("PKCS#7 invalid length");
          }
          var padder = data[data.length - 1];
          if (padder > 16) {
            throw new Error("PKCS#7 padding byte out of range");
          }
          var length = data.length - padder;
          for (var i = 0; i < padder; i++) {
            if (data[length + i] !== padder) {
              throw new Error("PKCS#7 invalid padding byte");
            }
          }
          var result = createArray(length);
          copyArray(data, result, 0, 0, length);
          return result;
        }
        var aesjs = {
          AES,
          Counter,
          ModeOfOperation: {
            ecb: ModeOfOperationECB,
            cbc: ModeOfOperationCBC,
            cfb: ModeOfOperationCFB,
            ofb: ModeOfOperationOFB,
            ctr: ModeOfOperationCTR
          },
          utils: {
            hex: convertHex,
            utf8: convertUtf8
          },
          padding: {
            pkcs7: {
              pad: pkcs7pad,
              strip: pkcs7strip
            }
          },
          _arrayTest: {
            coerceArray,
            createArray,
            copyArray
          }
        };
        if (true) {
          module.exports = aesjs;
        } else {}
      })(this);
    },
    3853(__unused_webpack_module, exports) {
      "use strict";
      var __webpack_unused_export__;
      __webpack_unused_export__ = {
        value: true
      };
      function ucs2length(str) {
        const len = str.length;
        let length = 0;
        let pos = 0;
        let value;
        while (pos < len) {
          length++;
          value = str.charCodeAt(pos++);
          if (value >= 55296 && value <= 56319 && pos < len) {
            value = str.charCodeAt(pos);
            if ((value & 64512) === 56320) pos++;
          }
        }
        return length;
      }
      exports.A = ucs2length;
      ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default';
    },
    3905(module, __unused_webpack_exports, __webpack_require__) {
      var __webpack_dirname__ = "/";
      var process = __webpack_require__(5606);
      var Module = typeof self !== "undefined" && typeof self.Module !== "undefined" ? self.Module : {};
      var jsModule = null && Module;
      var moduleOverrides = {};
      var key;
      for (key in Module) {
        if (Module.hasOwnProperty(key)) {
          moduleOverrides[key] = Module[key];
        }
      }
      var arguments_ = [];
      var thisProgram = "./this.program";
      var quit_ = function(status, toThrow) {
        throw toThrow;
      };
      var ENVIRONMENT_IS_WEB = false;
      var ENVIRONMENT_IS_WORKER = false;
      var ENVIRONMENT_IS_NODE = false;
      var ENVIRONMENT_IS_SHELL = false;
      ENVIRONMENT_IS_WEB = typeof window === "object";
      ENVIRONMENT_IS_WORKER = typeof importScripts === "function";
      ENVIRONMENT_IS_NODE = typeof process === "object" && typeof process.versions === "object" && typeof process.versions.node === "string";
      ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER;
      var scriptDirectory = "";
      function locateFile(path) {
        if (Module["locateFile"]) {
          return Module["locateFile"](path, scriptDirectory);
        }
        return scriptDirectory + path;
      }
      var read_, readAsync, readBinary, setWindowTitle;
      var nodeFS;
      var nodePath;
      if (ENVIRONMENT_IS_NODE) {
        if (ENVIRONMENT_IS_WORKER) {
          scriptDirectory = __webpack_require__(4049).dirname(scriptDirectory) + "/";
        } else {
          scriptDirectory = __webpack_dirname__ + "/";
        }
        read_ = function shell_read(filename, binary) {
          if (!nodeFS) nodeFS = __webpack_require__(2789);
          if (!nodePath) nodePath = __webpack_require__(4049);
          filename = nodePath["normalize"](filename);
          return nodeFS["readFileSync"](filename, binary ? null : "utf8");
        };
        readBinary = function readBinary(filename) {
          var ret = read_(filename, true);
          if (!ret.buffer) {
            ret = new Uint8Array(ret);
          }
          assert(ret.buffer);
          return ret;
        };
        if (process["argv"].length > 1) {
          thisProgram = process["argv"][1].replace(/\\/g, "/");
        }
        arguments_ = process["argv"].slice(2);
        if (true) {
          module["exports"] = Module;
        }
        process["on"]("uncaughtException", (function(ex) {
          if (!(ex instanceof ExitStatus)) {
            throw ex;
          }
        }));
        process["on"]("unhandledRejection", abort);
        quit_ = function(status) {
          process["exit"](status);
        };
        Module["inspect"] = function() {
          return "[Emscripten Module object]";
        };
      } else if (ENVIRONMENT_IS_SHELL) {
        if (typeof read != "undefined") {
          read_ = function shell_read(f) {
            return read(f);
          };
        }
        readBinary = function readBinary(f) {
          var data;
          if (typeof readbuffer === "function") {
            return new Uint8Array(readbuffer(f));
          }
          data = read(f, "binary");
          assert(typeof data === "object");
          return data;
        };
        if (typeof scriptArgs != "undefined") {
          arguments_ = scriptArgs;
        } else if (typeof arguments != "undefined") {
          arguments_ = arguments;
        }
        if (typeof quit === "function") {
          quit_ = function(status) {
            quit(status);
          };
        }
        if (typeof print !== "undefined") {
          if (typeof console === "undefined") console = {};
          console.log = print;
          console.warn = console.error = typeof printErr !== "undefined" ? printErr : print;
        }
      } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {
        if (ENVIRONMENT_IS_WORKER) {
          scriptDirectory = self.location.href;
        } else if (typeof document !== "undefined" && document.currentScript) {
          scriptDirectory = document.currentScript.src;
        }
        if (scriptDirectory.indexOf("blob:") !== 0) {
          scriptDirectory = scriptDirectory.substr(0, scriptDirectory.lastIndexOf("/") + 1);
        } else {
          scriptDirectory = "";
        }
        {
          read_ = function(url) {
            var xhr = new XMLHttpRequest;
            xhr.open("GET", url, false);
            xhr.send(null);
            return xhr.responseText;
          };
          if (ENVIRONMENT_IS_WORKER) {
            readBinary = function(url) {
              var xhr = new XMLHttpRequest;
              xhr.open("GET", url, false);
              xhr.responseType = "arraybuffer";
              xhr.send(null);
              return new Uint8Array(xhr.response);
            };
          }
          readAsync = function(url, onload, onerror) {
            var xhr = new XMLHttpRequest;
            xhr.open("GET", url, true);
            xhr.responseType = "arraybuffer";
            xhr.onload = function() {
              if (xhr.status == 200 || xhr.status == 0 && xhr.response) {
                onload(xhr.response);
                return;
              }
              onerror();
            };
            xhr.onerror = onerror;
            xhr.send(null);
          };
        }
        setWindowTitle = function(title) {
          document.title = title;
        };
      } else {}
      var out = Module["print"] || console.log.bind(console);
      var err = Module["printErr"] || console.warn.bind(console);
      for (key in moduleOverrides) {
        if (moduleOverrides.hasOwnProperty(key)) {
          Module[key] = moduleOverrides[key];
        }
      }
      moduleOverrides = null;
      if (Module["arguments"]) arguments_ = Module["arguments"];
      if (Module["thisProgram"]) thisProgram = Module["thisProgram"];
      if (Module["quit"]) quit_ = Module["quit"];
      var wasmBinary;
      if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"];
      var noExitRuntime = Module["noExitRuntime"] || true;
      if (typeof WebAssembly !== "object") {
        abort("no native wasm support detected");
      }
      var wasmMemory;
      var ABORT = false;
      var EXITSTATUS;
      function assert(condition, text) {
        if (!condition) {
          abort("Assertion failed: " + text);
        }
      }
      var ALLOC_NORMAL = 0;
      var ALLOC_STACK = 1;
      function allocate(slab, allocator) {
        var ret;
        if (allocator == ALLOC_STACK) {
          ret = stackAlloc(slab.length);
        } else {
          ret = _malloc(slab.length);
        }
        if (slab.subarray || slab.slice) {
          HEAPU8.set(slab, ret);
        } else {
          HEAPU8.set(new Uint8Array(slab), ret);
        }
        return ret;
      }
      var UTF8Decoder = typeof TextDecoder !== "undefined" ? new TextDecoder("utf8") : undefined;
      function UTF8ArrayToString(heap, idx, maxBytesToRead) {
        var endIdx = idx + maxBytesToRead;
        var endPtr = idx;
        while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr;
        if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) {
          return UTF8Decoder.decode(heap.subarray(idx, endPtr));
        } else {
          var str = "";
          while (idx < endPtr) {
            var u0 = heap[idx++];
            if (!(u0 & 128)) {
              str += String.fromCharCode(u0);
              continue;
            }
            var u1 = heap[idx++] & 63;
            if ((u0 & 224) == 192) {
              str += String.fromCharCode((u0 & 31) << 6 | u1);
              continue;
            }
            var u2 = heap[idx++] & 63;
            if ((u0 & 240) == 224) {
              u0 = (u0 & 15) << 12 | u1 << 6 | u2;
            } else {
              u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heap[idx++] & 63;
            }
            if (u0 < 65536) {
              str += String.fromCharCode(u0);
            } else {
              var ch = u0 - 65536;
              str += String.fromCharCode(55296 | ch >> 10, 56320 | ch & 1023);
            }
          }
        }
        return str;
      }
      function UTF8ToString(ptr, maxBytesToRead) {
        return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : "";
      }
      function alignUp(x, multiple) {
        if (x % multiple > 0) {
          x += multiple - x % multiple;
        }
        return x;
      }
      var buffer, HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64;
      function updateGlobalBufferAndViews(buf) {
        buffer = buf;
        Module["HEAP8"] = HEAP8 = new Int8Array(buf);
        Module["HEAP16"] = HEAP16 = new Int16Array(buf);
        Module["HEAP32"] = HEAP32 = new Int32Array(buf);
        Module["HEAPU8"] = HEAPU8 = new Uint8Array(buf);
        Module["HEAPU16"] = HEAPU16 = new Uint16Array(buf);
        Module["HEAPU32"] = HEAPU32 = new Uint32Array(buf);
        Module["HEAPF32"] = HEAPF32 = new Float32Array(buf);
        Module["HEAPF64"] = HEAPF64 = new Float64Array(buf);
      }
      var INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 16777216;
      var wasmTable;
      var __ATPRERUN__ = [];
      var __ATINIT__ = [];
      var __ATPOSTRUN__ = [];
      var runtimeInitialized = false;
      function preRun() {
        if (Module["preRun"]) {
          if (typeof Module["preRun"] == "function") Module["preRun"] = [ Module["preRun"] ];
          while (Module["preRun"].length) {
            addOnPreRun(Module["preRun"].shift());
          }
        }
        callRuntimeCallbacks(__ATPRERUN__);
      }
      function initRuntime() {
        runtimeInitialized = true;
        callRuntimeCallbacks(__ATINIT__);
      }
      function postRun() {
        if (Module["postRun"]) {
          if (typeof Module["postRun"] == "function") Module["postRun"] = [ Module["postRun"] ];
          while (Module["postRun"].length) {
            addOnPostRun(Module["postRun"].shift());
          }
        }
        callRuntimeCallbacks(__ATPOSTRUN__);
      }
      function addOnPreRun(cb) {
        __ATPRERUN__.unshift(cb);
      }
      function addOnInit(cb) {
        __ATINIT__.unshift(cb);
      }
      function addOnPostRun(cb) {
        __ATPOSTRUN__.unshift(cb);
      }
      var runDependencies = 0;
      var runDependencyWatcher = null;
      var dependenciesFulfilled = null;
      function addRunDependency(id) {
        runDependencies++;
        if (Module["monitorRunDependencies"]) {
          Module["monitorRunDependencies"](runDependencies);
        }
      }
      function removeRunDependency(id) {
        runDependencies--;
        if (Module["monitorRunDependencies"]) {
          Module["monitorRunDependencies"](runDependencies);
        }
        if (runDependencies == 0) {
          if (runDependencyWatcher !== null) {
            clearInterval(runDependencyWatcher);
            runDependencyWatcher = null;
          }
          if (dependenciesFulfilled) {
            var callback = dependenciesFulfilled;
            dependenciesFulfilled = null;
            callback();
          }
        }
      }
      Module["preloadedImages"] = {};
      Module["preloadedAudios"] = {};
      function abort(what) {
        if (Module["onAbort"]) {
          Module["onAbort"](what);
        }
        what += "";
        err(what);
        ABORT = true;
        EXITSTATUS = 1;
        what = "abort(" + what + "). Build with -s ASSERTIONS=1 for more info.";
        var e = new WebAssembly.RuntimeError(what);
        throw e;
      }
      var dataURIPrefix = "data:application/octet-stream;base64,";
      function isDataURI(filename) {
        return filename.startsWith(dataURIPrefix);
      }
      function isFileURI(filename) {
        return filename.startsWith("file://");
      }
      var wasmBinaryFile = "argon2.wasm";
      if (!isDataURI(wasmBinaryFile)) {
        wasmBinaryFile = locateFile(wasmBinaryFile);
      }
      function getBinary(file) {
        try {
          if (file == wasmBinaryFile && wasmBinary) {
            return new Uint8Array(wasmBinary);
          }
          if (readBinary) {
            return readBinary(file);
          } else {
            throw "both async and sync fetching of the wasm failed";
          }
        } catch (err) {
          abort(err);
        }
      }
      function getBinaryPromise() {
        if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {
          if (typeof fetch === "function" && !isFileURI(wasmBinaryFile)) {
            return fetch(wasmBinaryFile, {
              credentials: "same-origin"
            }).then((function(response) {
              if (!response["ok"]) {
                throw "failed to load wasm binary file at '" + wasmBinaryFile + "'";
              }
              return response["arrayBuffer"]();
            })).catch((function() {
              return getBinary(wasmBinaryFile);
            }));
          } else {
            if (readAsync) {
              return new Promise((function(resolve, reject) {
                readAsync(wasmBinaryFile, (function(response) {
                  resolve(new Uint8Array(response));
                }), reject);
              }));
            }
          }
        }
        return Promise.resolve().then((function() {
          return getBinary(wasmBinaryFile);
        }));
      }
      function createWasm() {
        var info = {
          a: asmLibraryArg
        };
        function receiveInstance(instance, module) {
          var exports = instance.exports;
          Module["asm"] = exports;
          wasmMemory = Module["asm"]["c"];
          updateGlobalBufferAndViews(wasmMemory.buffer);
          wasmTable = Module["asm"]["k"];
          addOnInit(Module["asm"]["d"]);
          removeRunDependency("wasm-instantiate");
        }
        addRunDependency("wasm-instantiate");
        function receiveInstantiationResult(result) {
          receiveInstance(result["instance"]);
        }
        function instantiateArrayBuffer(receiver) {
          return getBinaryPromise().then((function(binary) {
            var result = WebAssembly.instantiate(binary, info);
            return result;
          })).then(receiver, (function(reason) {
            err("failed to asynchronously prepare wasm: " + reason);
            abort(reason);
          }));
        }
        function instantiateAsync() {
          if (!wasmBinary && typeof WebAssembly.instantiateStreaming === "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && typeof fetch === "function") {
            return fetch(wasmBinaryFile, {
              credentials: "same-origin"
            }).then((function(response) {
              var result = WebAssembly.instantiateStreaming(response, info);
              return result.then(receiveInstantiationResult, (function(reason) {
                err("wasm streaming compile failed: " + reason);
                err("falling back to ArrayBuffer instantiation");
                return instantiateArrayBuffer(receiveInstantiationResult);
              }));
            }));
          } else {
            return instantiateArrayBuffer(receiveInstantiationResult);
          }
        }
        if (Module["instantiateWasm"]) {
          try {
            var exports = Module["instantiateWasm"](info, receiveInstance);
            return exports;
          } catch (e) {
            err("Module.instantiateWasm callback failed with error: " + e);
            return false;
          }
        }
        instantiateAsync();
        return {};
      }
      function callRuntimeCallbacks(callbacks) {
        while (callbacks.length > 0) {
          var callback = callbacks.shift();
          if (typeof callback == "function") {
            callback(Module);
            continue;
          }
          var func = callback.func;
          if (typeof func === "number") {
            if (callback.arg === undefined) {
              wasmTable.get(func)();
            } else {
              wasmTable.get(func)(callback.arg);
            }
          } else {
            func(callback.arg === undefined ? null : callback.arg);
          }
        }
      }
      function _emscripten_memcpy_big(dest, src, num) {
        HEAPU8.copyWithin(dest, src, src + num);
      }
      function emscripten_realloc_buffer(size) {
        try {
          wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16);
          updateGlobalBufferAndViews(wasmMemory.buffer);
          return 1;
        } catch (e) {}
      }
      function _emscripten_resize_heap(requestedSize) {
        var oldSize = HEAPU8.length;
        requestedSize = requestedSize >>> 0;
        var maxHeapSize = 2147418112;
        if (requestedSize > maxHeapSize) {
          return false;
        }
        for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {
          var overGrownHeapSize = oldSize * (1 + .2 / cutDown);
          overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);
          var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));
          var replacement = emscripten_realloc_buffer(newSize);
          if (replacement) {
            return true;
          }
        }
        return false;
      }
      var asmLibraryArg = {
        a: _emscripten_memcpy_big,
        b: _emscripten_resize_heap
      };
      var asm = createWasm();
      var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function() {
        return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["d"]).apply(null, arguments);
      };
      var _argon2_hash = Module["_argon2_hash"] = function() {
        return (_argon2_hash = Module["_argon2_hash"] = Module["asm"]["e"]).apply(null, arguments);
      };
      var _malloc = Module["_malloc"] = function() {
        return (_malloc = Module["_malloc"] = Module["asm"]["f"]).apply(null, arguments);
      };
      var _free = Module["_free"] = function() {
        return (_free = Module["_free"] = Module["asm"]["g"]).apply(null, arguments);
      };
      var _argon2_verify = Module["_argon2_verify"] = function() {
        return (_argon2_verify = Module["_argon2_verify"] = Module["asm"]["h"]).apply(null, arguments);
      };
      var _argon2_error_message = Module["_argon2_error_message"] = function() {
        return (_argon2_error_message = Module["_argon2_error_message"] = Module["asm"]["i"]).apply(null, arguments);
      };
      var _argon2_encodedlen = Module["_argon2_encodedlen"] = function() {
        return (_argon2_encodedlen = Module["_argon2_encodedlen"] = Module["asm"]["j"]).apply(null, arguments);
      };
      var _argon2_hash_ext = Module["_argon2_hash_ext"] = function() {
        return (_argon2_hash_ext = Module["_argon2_hash_ext"] = Module["asm"]["l"]).apply(null, arguments);
      };
      var _argon2_verify_ext = Module["_argon2_verify_ext"] = function() {
        return (_argon2_verify_ext = Module["_argon2_verify_ext"] = Module["asm"]["m"]).apply(null, arguments);
      };
      var stackAlloc = Module["stackAlloc"] = function() {
        return (stackAlloc = Module["stackAlloc"] = Module["asm"]["n"]).apply(null, arguments);
      };
      Module["allocate"] = allocate;
      Module["UTF8ToString"] = UTF8ToString;
      Module["ALLOC_NORMAL"] = ALLOC_NORMAL;
      var calledRun;
      function ExitStatus(status) {
        this.name = "ExitStatus";
        this.message = "Program terminated with exit(" + status + ")";
        this.status = status;
      }
      dependenciesFulfilled = function runCaller() {
        if (!calledRun) run();
        if (!calledRun) dependenciesFulfilled = runCaller;
      };
      function run(args) {
        args = args || arguments_;
        if (runDependencies > 0) {
          return;
        }
        preRun();
        if (runDependencies > 0) {
          return;
        }
        function doRun() {
          if (calledRun) return;
          calledRun = true;
          Module["calledRun"] = true;
          if (ABORT) return;
          initRuntime();
          if (Module["onRuntimeInitialized"]) Module["onRuntimeInitialized"]();
          postRun();
        }
        if (Module["setStatus"]) {
          Module["setStatus"]("Running...");
          setTimeout((function() {
            setTimeout((function() {
              Module["setStatus"]("");
            }), 1);
            doRun();
          }), 1);
        } else {
          doRun();
        }
      }
      Module["run"] = run;
      if (Module["preInit"]) {
        if (typeof Module["preInit"] == "function") Module["preInit"] = [ Module["preInit"] ];
        while (Module["preInit"].length > 0) {
          Module["preInit"].pop()();
        }
      }
      run();
      if (true) module.exports = Module;
      Module.unloadRuntime = function() {
        if (typeof self !== "undefined") {
          delete self.Module;
        }
        Module = jsModule = wasmMemory = wasmTable = asm = buffer = HEAP8 = HEAPU8 = HEAP16 = HEAPU16 = HEAP32 = HEAPU32 = HEAPF32 = HEAPF64 = undefined;
        if (true) {
          delete module.exports;
        }
      };
    },
    6452(module, exports, __webpack_require__) {
      var Buffer = __webpack_require__(8287)["Buffer"];
      var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
      (function(root, factory) {
        if (true) {
          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
          __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
        } else {}
      })(typeof self !== "undefined" ? self : this, (function() {
        const global = typeof self !== "undefined" ? self : this;
        const ArgonType = {
          Argon2d: 0,
          Argon2i: 1,
          Argon2id: 2
        };
        function loadModule(mem) {
          if (loadModule._promise) {
            return loadModule._promise;
          }
          if (loadModule._module) {
            return Promise.resolve(loadModule._module);
          }
          let promise;
          if (global.process && global.process.versions && global.process.versions.node) {
            promise = loadWasmModule().then((Module => new Promise((resolve => {
              Module.postRun = () => resolve(Module);
            }))));
          } else {
            promise = loadWasmBinary().then((wasmBinary => {
              const wasmMemory = mem ? createWasmMemory(mem) : undefined;
              return initWasm(wasmBinary, wasmMemory);
            }));
          }
          loadModule._promise = promise;
          return promise.then((Module => {
            loadModule._module = Module;
            delete loadModule._promise;
            return Module;
          }));
        }
        function initWasm(wasmBinary, wasmMemory) {
          return new Promise((resolve => {
            global.Module = {
              wasmBinary,
              wasmMemory,
              postRun() {
                resolve(Module);
              }
            };
            return loadWasmModule();
          }));
        }
        function loadWasmModule() {
          if (global.loadArgon2WasmModule) {
            return global.loadArgon2WasmModule();
          }
          if (true) {
            return Promise.resolve(__webpack_require__(3905));
          }
        }
        function loadWasmBinary() {
          if (global.loadArgon2WasmBinary) {
            return global.loadArgon2WasmBinary();
          }
          if (true) {
            return Promise.resolve(__webpack_require__(6104)).then((wasmModule => decodeWasmBinary(wasmModule)));
          }
        }
        function decodeWasmBinary(base64) {
          const text = atob(base64);
          const binary = new Uint8Array(new ArrayBuffer(text.length));
          for (let i = 0; i < text.length; i++) {
            binary[i] = text.charCodeAt(i);
          }
          return binary;
        }
        function createWasmMemory(mem) {
          const KB = 1024;
          const MB = 1024 * KB;
          const GB = 1024 * MB;
          const WASM_PAGE_SIZE = 64 * KB;
          const totalMemory = (2 * GB - 64 * KB) / WASM_PAGE_SIZE;
          const initialMemory = Math.min(Math.max(Math.ceil(mem * KB / WASM_PAGE_SIZE), 256) + 256, totalMemory);
          return new WebAssembly.Memory({
            initial: initialMemory,
            maximum: totalMemory
          });
        }
        function allocateArray(Module, arr) {
          return Module.allocate(arr, "i8", Module.ALLOC_NORMAL);
        }
        function allocateArrayStr(Module, arr) {
          const nullTerminatedArray = new Uint8Array([ ...arr, 0 ]);
          return allocateArray(Module, nullTerminatedArray);
        }
        function encodeUtf8(str) {
          if (typeof str !== "string") {
            return str;
          }
          if (typeof TextEncoder === "function") {
            return (new TextEncoder).encode(str);
          } else if (typeof Buffer === "function") {
            return Buffer.from(str);
          } else {
            throw new Error("Don't know how to encode UTF8");
          }
        }
        function argon2Hash(params) {
          const mCost = params.mem || 1024;
          return loadModule(mCost).then((Module => {
            const tCost = params.time || 1;
            const parallelism = params.parallelism || 1;
            const pwdEncoded = encodeUtf8(params.pass);
            const pwd = allocateArrayStr(Module, pwdEncoded);
            const pwdlen = pwdEncoded.length;
            const saltEncoded = encodeUtf8(params.salt);
            const salt = allocateArrayStr(Module, saltEncoded);
            const saltlen = saltEncoded.length;
            const argon2Type = params.type || ArgonType.Argon2d;
            const hash = Module.allocate(new Array(params.hashLen || 24), "i8", Module.ALLOC_NORMAL);
            const secret = params.secret ? allocateArray(Module, params.secret) : 0;
            const secretlen = params.secret ? params.secret.byteLength : 0;
            const ad = params.ad ? allocateArray(Module, params.ad) : 0;
            const adlen = params.ad ? params.ad.byteLength : 0;
            const hashlen = params.hashLen || 24;
            const encodedlen = Module._argon2_encodedlen(tCost, mCost, parallelism, saltlen, hashlen, argon2Type);
            const encoded = Module.allocate(new Array(encodedlen + 1), "i8", Module.ALLOC_NORMAL);
            const version = 19;
            let err;
            let res;
            try {
              res = Module._argon2_hash_ext(tCost, mCost, parallelism, pwd, pwdlen, salt, saltlen, hash, hashlen, encoded, encodedlen, argon2Type, secret, secretlen, ad, adlen, version);
            } catch (e) {
              err = e;
            }
            let result;
            if (res === 0 && !err) {
              let hashStr = "";
              const hashArr = new Uint8Array(hashlen);
              for (let i = 0; i < hashlen; i++) {
                const byte = Module.HEAP8[hash + i];
                hashArr[i] = byte;
                hashStr += ("0" + (255 & byte).toString(16)).slice(-2);
              }
              const encodedStr = Module.UTF8ToString(encoded);
              result = {
                hash: hashArr,
                hashHex: hashStr,
                encoded: encodedStr
              };
            } else {
              try {
                if (!err) {
                  err = Module.UTF8ToString(Module._argon2_error_message(res));
                }
              } catch (e) {}
              result = {
                message: err,
                code: res
              };
            }
            try {
              Module._free(pwd);
              Module._free(salt);
              Module._free(hash);
              Module._free(encoded);
              if (ad) {
                Module._free(ad);
              }
              if (secret) {
                Module._free(secret);
              }
            } catch (e) {}
            if (err) {
              throw result;
            } else {
              return result;
            }
          }));
        }
        function argon2Verify(params) {
          return loadModule().then((Module => {
            const pwdEncoded = encodeUtf8(params.pass);
            const pwd = allocateArrayStr(Module, pwdEncoded);
            const pwdlen = pwdEncoded.length;
            const secret = params.secret ? allocateArray(Module, params.secret) : 0;
            const secretlen = params.secret ? params.secret.byteLength : 0;
            const ad = params.ad ? allocateArray(Module, params.ad) : 0;
            const adlen = params.ad ? params.ad.byteLength : 0;
            const encEncoded = encodeUtf8(params.encoded);
            const enc = allocateArrayStr(Module, encEncoded);
            let argon2Type = params.type;
            if (argon2Type === undefined) {
              let typeStr = params.encoded.split("$")[1];
              if (typeStr) {
                typeStr = typeStr.replace("a", "A");
                argon2Type = ArgonType[typeStr] || ArgonType.Argon2d;
              }
            }
            let err;
            let res;
            try {
              res = Module._argon2_verify_ext(enc, pwd, pwdlen, secret, secretlen, ad, adlen, argon2Type);
            } catch (e) {
              err = e;
            }
            let result;
            if (res || err) {
              try {
                if (!err) {
                  err = Module.UTF8ToString(Module._argon2_error_message(res));
                }
              } catch (e) {}
              result = {
                message: err,
                code: res
              };
            }
            try {
              Module._free(pwd);
              Module._free(enc);
            } catch (e) {}
            if (err) {
              throw result;
            } else {
              return result;
            }
          }));
        }
        function unloadRuntime() {
          if (loadModule._module) {
            loadModule._module.unloadRuntime();
            delete loadModule._promise;
            delete loadModule._module;
          }
        }
        return {
          ArgonType,
          hash: argon2Hash,
          verify: argon2Verify,
          unloadRuntime
        };
      }));
    },
    7568(__unused_webpack_module, exports, __webpack_require__) {
      var asn1 = exports;
      asn1.bignum = __webpack_require__(2344);
      asn1.define = __webpack_require__(7363).define;
      asn1.base = __webpack_require__(9673);
      asn1.constants = __webpack_require__(2153);
      asn1.decoders = __webpack_require__(2853);
      asn1.encoders = __webpack_require__(4669);
    },
    7363(__unused_webpack_module, exports, __webpack_require__) {
      var asn1 = __webpack_require__(7568);
      var inherits = __webpack_require__(6698);
      var api = exports;
      api.define = function define(name, body) {
        return new Entity(name, body);
      };
      function Entity(name, body) {
        this.name = name;
        this.body = body;
        this.decoders = {};
        this.encoders = {};
      }
      Entity.prototype._createNamed = function createNamed(base) {
        var named;
        try {
          named = Object(function webpackMissingModule() {
            var e = new Error("Cannot find module 'vm'");
            e.code = "MODULE_NOT_FOUND";
            throw e;
          }())("(function " + this.name + "(entity) {\n" + "  this._initNamed(entity);\n" + "})");
        } catch (e) {
          named = function(entity) {
            this._initNamed(entity);
          };
        }
        inherits(named, base);
        named.prototype._initNamed = function initnamed(entity) {
          base.call(this, entity);
        };
        return new named(this);
      };
      Entity.prototype._getDecoder = function _getDecoder(enc) {
        enc = enc || "der";
        if (!this.decoders.hasOwnProperty(enc)) this.decoders[enc] = this._createNamed(asn1.decoders[enc]);
        return this.decoders[enc];
      };
      Entity.prototype.decode = function decode(data, enc, options) {
        return this._getDecoder(enc).decode(data, options);
      };
      Entity.prototype._getEncoder = function _getEncoder(enc) {
        enc = enc || "der";
        if (!this.encoders.hasOwnProperty(enc)) this.encoders[enc] = this._createNamed(asn1.encoders[enc]);
        return this.encoders[enc];
      };
      Entity.prototype.encode = function encode(data, enc, reporter) {
        return this._getEncoder(enc).encode(data, reporter);
      };
    },
    7227(__unused_webpack_module, exports, __webpack_require__) {
      var inherits = __webpack_require__(6698);
      var Reporter = __webpack_require__(9673).Reporter;
      var Buffer = __webpack_require__(8287).Buffer;
      function DecoderBuffer(base, options) {
        Reporter.call(this, options);
        if (!Buffer.isBuffer(base)) {
          this.error("Input not Buffer");
          return;
        }
        this.base = base;
        this.offset = 0;
        this.length = base.length;
      }
      inherits(DecoderBuffer, Reporter);
      exports.t = DecoderBuffer;
      DecoderBuffer.prototype.save = function save() {
        return {
          offset: this.offset,
          reporter: Reporter.prototype.save.call(this)
        };
      };
      DecoderBuffer.prototype.restore = function restore(save) {
        var res = new DecoderBuffer(this.base);
        res.offset = save.offset;
        res.length = this.offset;
        this.offset = save.offset;
        Reporter.prototype.restore.call(this, save.reporter);
        return res;
      };
      DecoderBuffer.prototype.isEmpty = function isEmpty() {
        return this.offset === this.length;
      };
      DecoderBuffer.prototype.readUInt8 = function readUInt8(fail) {
        if (this.offset + 1 <= this.length) return this.base.readUInt8(this.offset++, true); else return this.error(fail || "DecoderBuffer overrun");
      };
      DecoderBuffer.prototype.skip = function skip(bytes, fail) {
        if (!(this.offset + bytes <= this.length)) return this.error(fail || "DecoderBuffer overrun");
        var res = new DecoderBuffer(this.base);
        res._reporterState = this._reporterState;
        res.offset = this.offset;
        res.length = this.offset + bytes;
        this.offset += bytes;
        return res;
      };
      DecoderBuffer.prototype.raw = function raw(save) {
        return this.base.slice(save ? save.offset : this.offset, this.length);
      };
      function EncoderBuffer(value, reporter) {
        if (Array.isArray(value)) {
          this.length = 0;
          this.value = value.map((function(item) {
            if (!(item instanceof EncoderBuffer)) item = new EncoderBuffer(item, reporter);
            this.length += item.length;
            return item;
          }), this);
        } else if (typeof value === "number") {
          if (!(0 <= value && value <= 255)) return reporter.error("non-byte EncoderBuffer value");
          this.value = value;
          this.length = 1;
        } else if (typeof value === "string") {
          this.value = value;
          this.length = Buffer.byteLength(value);
        } else if (Buffer.isBuffer(value)) {
          this.value = value;
          this.length = value.length;
        } else {
          return reporter.error("Unsupported type: " + typeof value);
        }
      }
      exports.d = EncoderBuffer;
      EncoderBuffer.prototype.join = function join(out, offset) {
        if (!out) out = new Buffer(this.length);
        if (!offset) offset = 0;
        if (this.length === 0) return out;
        if (Array.isArray(this.value)) {
          this.value.forEach((function(item) {
            item.join(out, offset);
            offset += item.length;
          }));
        } else {
          if (typeof this.value === "number") out[offset] = this.value; else if (typeof this.value === "string") out.write(this.value, offset); else if (Buffer.isBuffer(this.value)) this.value.copy(out, offset);
          offset += this.length;
        }
        return out;
      };
    },
    9673(__unused_webpack_module, exports, __webpack_require__) {
      var base = exports;
      base.Reporter = __webpack_require__(9220).a;
      base.DecoderBuffer = __webpack_require__(7227).t;
      base.EncoderBuffer = __webpack_require__(7227).d;
      base.Node = __webpack_require__(993);
    },
    993(module, __unused_webpack_exports, __webpack_require__) {
      var Reporter = __webpack_require__(9673).Reporter;
      var EncoderBuffer = __webpack_require__(9673).EncoderBuffer;
      var DecoderBuffer = __webpack_require__(9673).DecoderBuffer;
      var assert = __webpack_require__(3349);
      var tags = [ "seq", "seqof", "set", "setof", "objid", "bool", "gentime", "utctime", "null_", "enum", "int", "objDesc", "bitstr", "bmpstr", "charstr", "genstr", "graphstr", "ia5str", "iso646str", "numstr", "octstr", "printstr", "t61str", "unistr", "utf8str", "videostr" ];
      var methods = [ "key", "obj", "use", "optional", "explicit", "implicit", "def", "choice", "any", "contains" ].concat(tags);
      var overrided = [ "_peekTag", "_decodeTag", "_use", "_decodeStr", "_decodeObjid", "_decodeTime", "_decodeNull", "_decodeInt", "_decodeBool", "_decodeList", "_encodeComposite", "_encodeStr", "_encodeObjid", "_encodeTime", "_encodeNull", "_encodeInt", "_encodeBool" ];
      function Node(enc, parent) {
        var state = {};
        this._baseState = state;
        state.enc = enc;
        state.parent = parent || null;
        state.children = null;
        state.tag = null;
        state.args = null;
        state.reverseArgs = null;
        state.choice = null;
        state.optional = false;
        state.any = false;
        state.obj = false;
        state.use = null;
        state.useDecoder = null;
        state.key = null;
        state["default"] = null;
        state.explicit = null;
        state.implicit = null;
        state.contains = null;
        if (!state.parent) {
          state.children = [];
          this._wrap();
        }
      }
      module.exports = Node;
      var stateProps = [ "enc", "parent", "children", "tag", "args", "reverseArgs", "choice", "optional", "any", "obj", "use", "alteredUse", "key", "default", "explicit", "implicit", "contains" ];
      Node.prototype.clone = function clone() {
        var state = this._baseState;
        var cstate = {};
        stateProps.forEach((function(prop) {
          cstate[prop] = state[prop];
        }));
        var res = new this.constructor(cstate.parent);
        res._baseState = cstate;
        return res;
      };
      Node.prototype._wrap = function wrap() {
        var state = this._baseState;
        methods.forEach((function(method) {
          this[method] = function _wrappedMethod() {
            var clone = new this.constructor(this);
            state.children.push(clone);
            return clone[method].apply(clone, arguments);
          };
        }), this);
      };
      Node.prototype._init = function init(body) {
        var state = this._baseState;
        assert(state.parent === null);
        body.call(this);
        state.children = state.children.filter((function(child) {
          return child._baseState.parent === this;
        }), this);
        assert.equal(state.children.length, 1, "Root node can have only one child");
      };
      Node.prototype._useArgs = function useArgs(args) {
        var state = this._baseState;
        var children = args.filter((function(arg) {
          return arg instanceof this.constructor;
        }), this);
        args = args.filter((function(arg) {
          return !(arg instanceof this.constructor);
        }), this);
        if (children.length !== 0) {
          assert(state.children === null);
          state.children = children;
          children.forEach((function(child) {
            child._baseState.parent = this;
          }), this);
        }
        if (args.length !== 0) {
          assert(state.args === null);
          state.args = args;
          state.reverseArgs = args.map((function(arg) {
            if (typeof arg !== "object" || arg.constructor !== Object) return arg;
            var res = {};
            Object.keys(arg).forEach((function(key) {
              if (key == (key | 0)) key |= 0;
              var value = arg[key];
              res[value] = key;
            }));
            return res;
          }));
        }
      };
      overrided.forEach((function(method) {
        Node.prototype[method] = function _overrided() {
          var state = this._baseState;
          throw new Error(method + " not implemented for encoding: " + state.enc);
        };
      }));
      tags.forEach((function(tag) {
        Node.prototype[tag] = function _tagMethod() {
          var state = this._baseState;
          var args = Array.prototype.slice.call(arguments);
          assert(state.tag === null);
          state.tag = tag;
          this._useArgs(args);
          return this;
        };
      }));
      Node.prototype.use = function use(item) {
        assert(item);
        var state = this._baseState;
        assert(state.use === null);
        state.use = item;
        return this;
      };
      Node.prototype.optional = function optional() {
        var state = this._baseState;
        state.optional = true;
        return this;
      };
      Node.prototype.def = function def(val) {
        var state = this._baseState;
        assert(state["default"] === null);
        state["default"] = val;
        state.optional = true;
        return this;
      };
      Node.prototype.explicit = function explicit(num) {
        var state = this._baseState;
        assert(state.explicit === null && state.implicit === null);
        state.explicit = num;
        return this;
      };
      Node.prototype.implicit = function implicit(num) {
        var state = this._baseState;
        assert(state.explicit === null && state.implicit === null);
        state.implicit = num;
        return this;
      };
      Node.prototype.obj = function obj() {
        var state = this._baseState;
        var args = Array.prototype.slice.call(arguments);
        state.obj = true;
        if (args.length !== 0) this._useArgs(args);
        return this;
      };
      Node.prototype.key = function key(newKey) {
        var state = this._baseState;
        assert(state.key === null);
        state.key = newKey;
        return this;
      };
      Node.prototype.any = function any() {
        var state = this._baseState;
        state.any = true;
        return this;
      };
      Node.prototype.choice = function choice(obj) {
        var state = this._baseState;
        assert(state.choice === null);
        state.choice = obj;
        this._useArgs(Object.keys(obj).map((function(key) {
          return obj[key];
        })));
        return this;
      };
      Node.prototype.contains = function contains(item) {
        var state = this._baseState;
        assert(state.use === null);
        state.contains = item;
        return this;
      };
      Node.prototype._decode = function decode(input, options) {
        var state = this._baseState;
        if (state.parent === null) return input.wrapResult(state.children[0]._decode(input, options));
        var result = state["default"];
        var present = true;
        var prevKey = null;
        if (state.key !== null) prevKey = input.enterKey(state.key);
        if (state.optional) {
          var tag = null;
          if (state.explicit !== null) tag = state.explicit; else if (state.implicit !== null) tag = state.implicit; else if (state.tag !== null) tag = state.tag;
          if (tag === null && !state.any) {
            var save = input.save();
            try {
              if (state.choice === null) this._decodeGeneric(state.tag, input, options); else this._decodeChoice(input, options);
              present = true;
            } catch (e) {
              present = false;
            }
            input.restore(save);
          } else {
            present = this._peekTag(input, tag, state.any);
            if (input.isError(present)) return present;
          }
        }
        var prevObj;
        if (state.obj && present) prevObj = input.enterObject();
        if (present) {
          if (state.explicit !== null) {
            var explicit = this._decodeTag(input, state.explicit);
            if (input.isError(explicit)) return explicit;
            input = explicit;
          }
          var start = input.offset;
          if (state.use === null && state.choice === null) {
            if (state.any) var save = input.save();
            var body = this._decodeTag(input, state.implicit !== null ? state.implicit : state.tag, state.any);
            if (input.isError(body)) return body;
            if (state.any) result = input.raw(save); else input = body;
          }
          if (options && options.track && state.tag !== null) options.track(input.path(), start, input.length, "tagged");
          if (options && options.track && state.tag !== null) options.track(input.path(), input.offset, input.length, "content");
          if (state.any) result = result; else if (state.choice === null) result = this._decodeGeneric(state.tag, input, options); else result = this._decodeChoice(input, options);
          if (input.isError(result)) return result;
          if (!state.any && state.choice === null && state.children !== null) {
            state.children.forEach((function decodeChildren(child) {
              child._decode(input, options);
            }));
          }
          if (state.contains && (state.tag === "octstr" || state.tag === "bitstr")) {
            var data = new DecoderBuffer(result);
            result = this._getUse(state.contains, input._reporterState.obj)._decode(data, options);
          }
        }
        if (state.obj && present) result = input.leaveObject(prevObj);
        if (state.key !== null && (result !== null || present === true)) input.leaveKey(prevKey, state.key, result); else if (prevKey !== null) input.exitKey(prevKey);
        return result;
      };
      Node.prototype._decodeGeneric = function decodeGeneric(tag, input, options) {
        var state = this._baseState;
        if (tag === "seq" || tag === "set") return null;
        if (tag === "seqof" || tag === "setof") return this._decodeList(input, tag, state.args[0], options); else if (/str$/.test(tag)) return this._decodeStr(input, tag, options); else if (tag === "objid" && state.args) return this._decodeObjid(input, state.args[0], state.args[1], options); else if (tag === "objid") return this._decodeObjid(input, null, null, options); else if (tag === "gentime" || tag === "utctime") return this._decodeTime(input, tag, options); else if (tag === "null_") return this._decodeNull(input, options); else if (tag === "bool") return this._decodeBool(input, options); else if (tag === "objDesc") return this._decodeStr(input, tag, options); else if (tag === "int" || tag === "enum") return this._decodeInt(input, state.args && state.args[0], options);
        if (state.use !== null) {
          return this._getUse(state.use, input._reporterState.obj)._decode(input, options);
        } else {
          return input.error("unknown tag: " + tag);
        }
      };
      Node.prototype._getUse = function _getUse(entity, obj) {
        var state = this._baseState;
        state.useDecoder = this._use(entity, obj);
        assert(state.useDecoder._baseState.parent === null);
        state.useDecoder = state.useDecoder._baseState.children[0];
        if (state.implicit !== state.useDecoder._baseState.implicit) {
          state.useDecoder = state.useDecoder.clone();
          state.useDecoder._baseState.implicit = state.implicit;
        }
        return state.useDecoder;
      };
      Node.prototype._decodeChoice = function decodeChoice(input, options) {
        var state = this._baseState;
        var result = null;
        var match = false;
        Object.keys(state.choice).some((function(key) {
          var save = input.save();
          var node = state.choice[key];
          try {
            var value = node._decode(input, options);
            if (input.isError(value)) return false;
            result = {
              type: key,
              value
            };
            match = true;
          } catch (e) {
            input.restore(save);
            return false;
          }
          return true;
        }), this);
        if (!match) return input.error("Choice not matched");
        return result;
      };
      Node.prototype._createEncoderBuffer = function createEncoderBuffer(data) {
        return new EncoderBuffer(data, this.reporter);
      };
      Node.prototype._encode = function encode(data, reporter, parent) {
        var state = this._baseState;
        if (state["default"] !== null && state["default"] === data) return;
        var result = this._encodeValue(data, reporter, parent);
        if (result === undefined) return;
        if (this._skipDefault(result, reporter, parent)) return;
        return result;
      };
      Node.prototype._encodeValue = function encode(data, reporter, parent) {
        var state = this._baseState;
        if (state.parent === null) return state.children[0]._encode(data, reporter || new Reporter);
        var result = null;
        this.reporter = reporter;
        if (state.optional && data === undefined) {
          if (state["default"] !== null) data = state["default"]; else return;
        }
        var content = null;
        var primitive = false;
        if (state.any) {
          result = this._createEncoderBuffer(data);
        } else if (state.choice) {
          result = this._encodeChoice(data, reporter);
        } else if (state.contains) {
          content = this._getUse(state.contains, parent)._encode(data, reporter);
          primitive = true;
        } else if (state.children) {
          content = state.children.map((function(child) {
            if (child._baseState.tag === "null_") return child._encode(null, reporter, data);
            if (child._baseState.key === null) return reporter.error("Child should have a key");
            var prevKey = reporter.enterKey(child._baseState.key);
            if (typeof data !== "object") return reporter.error("Child expected, but input is not object");
            var res = child._encode(data[child._baseState.key], reporter, data);
            reporter.leaveKey(prevKey);
            return res;
          }), this).filter((function(child) {
            return child;
          }));
          content = this._createEncoderBuffer(content);
        } else {
          if (state.tag === "seqof" || state.tag === "setof") {
            if (!(state.args && state.args.length === 1)) return reporter.error("Too many args for : " + state.tag);
            if (!Array.isArray(data)) return reporter.error("seqof/setof, but data is not Array");
            var child = this.clone();
            child._baseState.implicit = null;
            content = this._createEncoderBuffer(data.map((function(item) {
              var state = this._baseState;
              return this._getUse(state.args[0], data)._encode(item, reporter);
            }), child));
          } else if (state.use !== null) {
            result = this._getUse(state.use, parent)._encode(data, reporter);
          } else {
            content = this._encodePrimitive(state.tag, data);
            primitive = true;
          }
        }
        var result;
        if (!state.any && state.choice === null) {
          var tag = state.implicit !== null ? state.implicit : state.tag;
          var cls = state.implicit === null ? "universal" : "context";
          if (tag === null) {
            if (state.use === null) reporter.error("Tag could be omitted only for .use()");
          } else {
            if (state.use === null) result = this._encodeComposite(tag, primitive, cls, content);
          }
        }
        if (state.explicit !== null) result = this._encodeComposite(state.explicit, false, "context", result);
        return result;
      };
      Node.prototype._encodeChoice = function encodeChoice(data, reporter) {
        var state = this._baseState;
        var node = state.choice[data.type];
        if (!node) {
          assert(false, data.type + " not found in " + JSON.stringify(Object.keys(state.choice)));
        }
        return node._encode(data.value, reporter);
      };
      Node.prototype._encodePrimitive = function encodePrimitive(tag, data) {
        var state = this._baseState;
        if (/str$/.test(tag)) return this._encodeStr(data, tag); else if (tag === "objid" && state.args) return this._encodeObjid(data, state.reverseArgs[0], state.args[1]); else if (tag === "objid") return this._encodeObjid(data, null, null); else if (tag === "gentime" || tag === "utctime") return this._encodeTime(data, tag); else if (tag === "null_") return this._encodeNull(); else if (tag === "int" || tag === "enum") return this._encodeInt(data, state.args && state.reverseArgs[0]); else if (tag === "bool") return this._encodeBool(data); else if (tag === "objDesc") return this._encodeStr(data, tag); else throw new Error("Unsupported tag: " + tag);
      };
      Node.prototype._isNumstr = function isNumstr(str) {
        return /^[0-9 ]*$/.test(str);
      };
      Node.prototype._isPrintstr = function isPrintstr(str) {
        return /^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(str);
      };
    },
    9220(__unused_webpack_module, exports, __webpack_require__) {
      var inherits = __webpack_require__(6698);
      function Reporter(options) {
        this._reporterState = {
          obj: null,
          path: [],
          options: options || {},
          errors: []
        };
      }
      exports.a = Reporter;
      Reporter.prototype.isError = function isError(obj) {
        return obj instanceof ReporterError;
      };
      Reporter.prototype.save = function save() {
        var state = this._reporterState;
        return {
          obj: state.obj,
          pathLen: state.path.length
        };
      };
      Reporter.prototype.restore = function restore(data) {
        var state = this._reporterState;
        state.obj = data.obj;
        state.path = state.path.slice(0, data.pathLen);
      };
      Reporter.prototype.enterKey = function enterKey(key) {
        return this._reporterState.path.push(key);
      };
      Reporter.prototype.exitKey = function exitKey(index) {
        var state = this._reporterState;
        state.path = state.path.slice(0, index - 1);
      };
      Reporter.prototype.leaveKey = function leaveKey(index, key, value) {
        var state = this._reporterState;
        this.exitKey(index);
        if (state.obj !== null) state.obj[key] = value;
      };
      Reporter.prototype.path = function path() {
        return this._reporterState.path.join("/");
      };
      Reporter.prototype.enterObject = function enterObject() {
        var state = this._reporterState;
        var prev = state.obj;
        state.obj = {};
        return prev;
      };
      Reporter.prototype.leaveObject = function leaveObject(prev) {
        var state = this._reporterState;
        var now = state.obj;
        state.obj = prev;
        return now;
      };
      Reporter.prototype.error = function error(msg) {
        var err;
        var state = this._reporterState;
        var inherited = msg instanceof ReporterError;
        if (inherited) {
          err = msg;
        } else {
          err = new ReporterError(state.path.map((function(elem) {
            return "[" + JSON.stringify(elem) + "]";
          })).join(""), msg.message || msg, msg.stack);
        }
        if (!state.options.partial) throw err;
        if (!inherited) state.errors.push(err);
        return err;
      };
      Reporter.prototype.wrapResult = function wrapResult(result) {
        var state = this._reporterState;
        if (!state.options.partial) return result;
        return {
          result: this.isError(result) ? null : result,
          errors: state.errors
        };
      };
      function ReporterError(path, msg) {
        this.path = path;
        this.rethrow(msg);
      }
      inherits(ReporterError, Error);
      ReporterError.prototype.rethrow = function rethrow(msg) {
        this.message = msg + " at: " + (this.path || "(shallow)");
        if (Error.captureStackTrace) Error.captureStackTrace(this, ReporterError);
        if (!this.stack) {
          try {
            throw new Error(this.message);
          } catch (e) {
            this.stack = e.stack;
          }
        }
        return this;
      };
    },
    4598(__unused_webpack_module, exports, __webpack_require__) {
      var constants = __webpack_require__(2153);
      exports.tagClass = {
        0: "universal",
        1: "application",
        2: "context",
        3: "private"
      };
      exports.tagClassByName = constants._reverse(exports.tagClass);
      exports.tag = {
        0: "end",
        1: "bool",
        2: "int",
        3: "bitstr",
        4: "octstr",
        5: "null_",
        6: "objid",
        7: "objDesc",
        8: "external",
        9: "real",
        10: "enum",
        11: "embed",
        12: "utf8str",
        13: "relativeOid",
        16: "seq",
        17: "set",
        18: "numstr",
        19: "printstr",
        20: "t61str",
        21: "videostr",
        22: "ia5str",
        23: "utctime",
        24: "gentime",
        25: "graphstr",
        26: "iso646str",
        27: "genstr",
        28: "unistr",
        29: "charstr",
        30: "bmpstr"
      };
      exports.tagByName = constants._reverse(exports.tag);
    },
    2153(__unused_webpack_module, exports, __webpack_require__) {
      var constants = exports;
      constants._reverse = function reverse(map) {
        var res = {};
        Object.keys(map).forEach((function(key) {
          if ((key | 0) == key) key = key | 0;
          var value = map[key];
          res[value] = key;
        }));
        return res;
      };
      constants.der = __webpack_require__(4598);
    },
    2010(module, __unused_webpack_exports, __webpack_require__) {
      var inherits = __webpack_require__(6698);
      var asn1 = __webpack_require__(7568);
      var base = asn1.base;
      var bignum = asn1.bignum;
      var der = asn1.constants.der;
      function DERDecoder(entity) {
        this.enc = "der";
        this.name = entity.name;
        this.entity = entity;
        this.tree = new DERNode;
        this.tree._init(entity.body);
      }
      module.exports = DERDecoder;
      DERDecoder.prototype.decode = function decode(data, options) {
        if (!(data instanceof base.DecoderBuffer)) data = new base.DecoderBuffer(data, options);
        return this.tree._decode(data, options);
      };
      function DERNode(parent) {
        base.Node.call(this, "der", parent);
      }
      inherits(DERNode, base.Node);
      DERNode.prototype._peekTag = function peekTag(buffer, tag, any) {
        if (buffer.isEmpty()) return false;
        var state = buffer.save();
        var decodedTag = derDecodeTag(buffer, 'Failed to peek tag: "' + tag + '"');
        if (buffer.isError(decodedTag)) return decodedTag;
        buffer.restore(state);
        return decodedTag.tag === tag || decodedTag.tagStr === tag || decodedTag.tagStr + "of" === tag || any;
      };
      DERNode.prototype._decodeTag = function decodeTag(buffer, tag, any) {
        var decodedTag = derDecodeTag(buffer, 'Failed to decode tag of "' + tag + '"');
        if (buffer.isError(decodedTag)) return decodedTag;
        var len = derDecodeLen(buffer, decodedTag.primitive, 'Failed to get length of "' + tag + '"');
        if (buffer.isError(len)) return len;
        if (!any && decodedTag.tag !== tag && decodedTag.tagStr !== tag && decodedTag.tagStr + "of" !== tag) {
          return buffer.error('Failed to match tag: "' + tag + '"');
        }
        if (decodedTag.primitive || len !== null) return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
        var state = buffer.save();
        var res = this._skipUntilEnd(buffer, 'Failed to skip indefinite length body: "' + this.tag + '"');
        if (buffer.isError(res)) return res;
        len = buffer.offset - state.offset;
        buffer.restore(state);
        return buffer.skip(len, 'Failed to match body of: "' + tag + '"');
      };
      DERNode.prototype._skipUntilEnd = function skipUntilEnd(buffer, fail) {
        while (true) {
          var tag = derDecodeTag(buffer, fail);
          if (buffer.isError(tag)) return tag;
          var len = derDecodeLen(buffer, tag.primitive, fail);
          if (buffer.isError(len)) return len;
          var res;
          if (tag.primitive || len !== null) res = buffer.skip(len); else res = this._skipUntilEnd(buffer, fail);
          if (buffer.isError(res)) return res;
          if (tag.tagStr === "end") break;
        }
      };
      DERNode.prototype._decodeList = function decodeList(buffer, tag, decoder, options) {
        var result = [];
        while (!buffer.isEmpty()) {
          var possibleEnd = this._peekTag(buffer, "end");
          if (buffer.isError(possibleEnd)) return possibleEnd;
          var res = decoder.decode(buffer, "der", options);
          if (buffer.isError(res) && possibleEnd) break;
          result.push(res);
        }
        return result;
      };
      DERNode.prototype._decodeStr = function decodeStr(buffer, tag) {
        if (tag === "bitstr") {
          var unused = buffer.readUInt8();
          if (buffer.isError(unused)) return unused;
          return {
            unused,
            data: buffer.raw()
          };
        } else if (tag === "bmpstr") {
          var raw = buffer.raw();
          if (raw.length % 2 === 1) return buffer.error("Decoding of string type: bmpstr length mismatch");
          var str = "";
          for (var i = 0; i < raw.length / 2; i++) {
            str += String.fromCharCode(raw.readUInt16BE(i * 2));
          }
          return str;
        } else if (tag === "numstr") {
          var numstr = buffer.raw().toString("ascii");
          if (!this._isNumstr(numstr)) {
            return buffer.error("Decoding of string type: " + "numstr unsupported characters");
          }
          return numstr;
        } else if (tag === "octstr") {
          return buffer.raw();
        } else if (tag === "objDesc") {
          return buffer.raw();
        } else if (tag === "printstr") {
          var printstr = buffer.raw().toString("ascii");
          if (!this._isPrintstr(printstr)) {
            return buffer.error("Decoding of string type: " + "printstr unsupported characters");
          }
          return printstr;
        } else if (/str$/.test(tag)) {
          return buffer.raw().toString();
        } else {
          return buffer.error("Decoding of string type: " + tag + " unsupported");
        }
      };
      DERNode.prototype._decodeObjid = function decodeObjid(buffer, values, relative) {
        var result;
        var identifiers = [];
        var ident = 0;
        while (!buffer.isEmpty()) {
          var subident = buffer.readUInt8();
          ident <<= 7;
          ident |= subident & 127;
          if ((subident & 128) === 0) {
            identifiers.push(ident);
            ident = 0;
          }
        }
        if (subident & 128) identifiers.push(ident);
        var first = identifiers[0] / 40 | 0;
        var second = identifiers[0] % 40;
        if (relative) result = identifiers; else result = [ first, second ].concat(identifiers.slice(1));
        if (values) {
          var tmp = values[result.join(" ")];
          if (tmp === undefined) tmp = values[result.join(".")];
          if (tmp !== undefined) result = tmp;
        }
        return result;
      };
      DERNode.prototype._decodeTime = function decodeTime(buffer, tag) {
        var str = buffer.raw().toString();
        if (tag === "gentime") {
          var year = str.slice(0, 4) | 0;
          var mon = str.slice(4, 6) | 0;
          var day = str.slice(6, 8) | 0;
          var hour = str.slice(8, 10) | 0;
          var min = str.slice(10, 12) | 0;
          var sec = str.slice(12, 14) | 0;
        } else if (tag === "utctime") {
          var year = str.slice(0, 2) | 0;
          var mon = str.slice(2, 4) | 0;
          var day = str.slice(4, 6) | 0;
          var hour = str.slice(6, 8) | 0;
          var min = str.slice(8, 10) | 0;
          var sec = str.slice(10, 12) | 0;
          if (year < 70) year = 2e3 + year; else year = 1900 + year;
        } else {
          return buffer.error("Decoding " + tag + " time is not supported yet");
        }
        return Date.UTC(year, mon - 1, day, hour, min, sec, 0);
      };
      DERNode.prototype._decodeNull = function decodeNull(buffer) {
        return null;
      };
      DERNode.prototype._decodeBool = function decodeBool(buffer) {
        var res = buffer.readUInt8();
        if (buffer.isError(res)) return res; else return res !== 0;
      };
      DERNode.prototype._decodeInt = function decodeInt(buffer, values) {
        var raw = buffer.raw();
        var res = new bignum(raw);
        if (values) res = values[res.toString(10)] || res;
        return res;
      };
      DERNode.prototype._use = function use(entity, obj) {
        if (typeof entity === "function") entity = entity(obj);
        return entity._getDecoder("der").tree;
      };
      function derDecodeTag(buf, fail) {
        var tag = buf.readUInt8(fail);
        if (buf.isError(tag)) return tag;
        var cls = der.tagClass[tag >> 6];
        var primitive = (tag & 32) === 0;
        if ((tag & 31) === 31) {
          var oct = tag;
          tag = 0;
          while ((oct & 128) === 128) {
            oct = buf.readUInt8(fail);
            if (buf.isError(oct)) return oct;
            tag <<= 7;
            tag |= oct & 127;
          }
        } else {
          tag &= 31;
        }
        var tagStr = der.tag[tag];
        return {
          cls,
          primitive,
          tag,
          tagStr
        };
      }
      function derDecodeLen(buf, primitive, fail) {
        var len = buf.readUInt8(fail);
        if (buf.isError(len)) return len;
        if (!primitive && len === 128) return null;
        if ((len & 128) === 0) {
          return len;
        }
        var num = len & 127;
        if (num > 4) return buf.error("length octect is too long");
        len = 0;
        for (var i = 0; i < num; i++) {
          len <<= 8;
          var j = buf.readUInt8(fail);
          if (buf.isError(j)) return j;
          len |= j;
        }
        return len;
      }
    },
    2853(__unused_webpack_module, exports, __webpack_require__) {
      var decoders = exports;
      decoders.der = __webpack_require__(2010);
      decoders.pem = __webpack_require__(8903);
    },
    8903(module, __unused_webpack_exports, __webpack_require__) {
      var inherits = __webpack_require__(6698);
      var Buffer = __webpack_require__(8287).Buffer;
      var DERDecoder = __webpack_require__(2010);
      function PEMDecoder(entity) {
        DERDecoder.call(this, entity);
        this.enc = "pem";
      }
      inherits(PEMDecoder, DERDecoder);
      module.exports = PEMDecoder;
      PEMDecoder.prototype.decode = function decode(data, options) {
        var lines = data.toString().split(/[\r\n]+/g);
        var label = options.label.toUpperCase();
        var re = /^-----(BEGIN|END) ([^-]+)-----$/;
        var start = -1;
        var end = -1;
        for (var i = 0; i < lines.length; i++) {
          var match = lines[i].match(re);
          if (match === null) continue;
          if (match[2] !== label) continue;
          if (start === -1) {
            if (match[1] !== "BEGIN") break;
            start = i;
          } else {
            if (match[1] !== "END") break;
            end = i;
            break;
          }
        }
        if (start === -1 || end === -1) throw new Error("PEM section not found for: " + label);
        var base64 = lines.slice(start + 1, end).join("");
        base64.replace(/[^a-z0-9\+\/=]+/gi, "");
        var input = new Buffer(base64, "base64");
        return DERDecoder.prototype.decode.call(this, input, options);
      };
    },
    82(module, __unused_webpack_exports, __webpack_require__) {
      var inherits = __webpack_require__(6698);
      var Buffer = __webpack_require__(8287).Buffer;
      var asn1 = __webpack_require__(7568);
      var base = asn1.base;
      var der = asn1.constants.der;
      function DEREncoder(entity) {
        this.enc = "der";
        this.name = entity.name;
        this.entity = entity;
        this.tree = new DERNode;
        this.tree._init(entity.body);
      }
      module.exports = DEREncoder;
      DEREncoder.prototype.encode = function encode(data, reporter) {
        return this.tree._encode(data, reporter).join();
      };
      function DERNode(parent) {
        base.Node.call(this, "der", parent);
      }
      inherits(DERNode, base.Node);
      DERNode.prototype._encodeComposite = function encodeComposite(tag, primitive, cls, content) {
        var encodedTag = encodeTag(tag, primitive, cls, this.reporter);
        if (content.length < 128) {
          var header = new Buffer(2);
          header[0] = encodedTag;
          header[1] = content.length;
          return this._createEncoderBuffer([ header, content ]);
        }
        var lenOctets = 1;
        for (var i = content.length; i >= 256; i >>= 8) lenOctets++;
        var header = new Buffer(1 + 1 + lenOctets);
        header[0] = encodedTag;
        header[1] = 128 | lenOctets;
        for (var i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) header[i] = j & 255;
        return this._createEncoderBuffer([ header, content ]);
      };
      DERNode.prototype._encodeStr = function encodeStr(str, tag) {
        if (tag === "bitstr") {
          return this._createEncoderBuffer([ str.unused | 0, str.data ]);
        } else if (tag === "bmpstr") {
          var buf = new Buffer(str.length * 2);
          for (var i = 0; i < str.length; i++) {
            buf.writeUInt16BE(str.charCodeAt(i), i * 2);
          }
          return this._createEncoderBuffer(buf);
        } else if (tag === "numstr") {
          if (!this._isNumstr(str)) {
            return this.reporter.error("Encoding of string type: numstr supports " + "only digits and space");
          }
          return this._createEncoderBuffer(str);
        } else if (tag === "printstr") {
          if (!this._isPrintstr(str)) {
            return this.reporter.error("Encoding of string type: printstr supports " + "only latin upper and lower case letters, " + "digits, space, apostrophe, left and rigth " + "parenthesis, plus sign, comma, hyphen, " + "dot, slash, colon, equal sign, " + "question mark");
          }
          return this._createEncoderBuffer(str);
        } else if (/str$/.test(tag)) {
          return this._createEncoderBuffer(str);
        } else if (tag === "objDesc") {
          return this._createEncoderBuffer(str);
        } else {
          return this.reporter.error("Encoding of string type: " + tag + " unsupported");
        }
      };
      DERNode.prototype._encodeObjid = function encodeObjid(id, values, relative) {
        if (typeof id === "string") {
          if (!values) return this.reporter.error("string objid given, but no values map found");
          if (!values.hasOwnProperty(id)) return this.reporter.error("objid not found in values map");
          id = values[id].split(/[\s\.]+/g);
          for (var i = 0; i < id.length; i++) id[i] |= 0;
        } else if (Array.isArray(id)) {
          id = id.slice();
          for (var i = 0; i < id.length; i++) id[i] |= 0;
        }
        if (!Array.isArray(id)) {
          return this.reporter.error("objid() should be either array or string, " + "got: " + JSON.stringify(id));
        }
        if (!relative) {
          if (id[1] >= 40) return this.reporter.error("Second objid identifier OOB");
          id.splice(0, 2, id[0] * 40 + id[1]);
        }
        var size = 0;
        for (var i = 0; i < id.length; i++) {
          var ident = id[i];
          for (size++; ident >= 128; ident >>= 7) size++;
        }
        var objid = new Buffer(size);
        var offset = objid.length - 1;
        for (var i = id.length - 1; i >= 0; i--) {
          var ident = id[i];
          objid[offset--] = ident & 127;
          while ((ident >>= 7) > 0) objid[offset--] = 128 | ident & 127;
        }
        return this._createEncoderBuffer(objid);
      };
      function two(num) {
        if (num < 10) return "0" + num; else return num;
      }
      DERNode.prototype._encodeTime = function encodeTime(time, tag) {
        var str;
        var date = new Date(time);
        if (tag === "gentime") {
          str = [ two(date.getFullYear()), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z" ].join("");
        } else if (tag === "utctime") {
          str = [ two(date.getFullYear() % 100), two(date.getUTCMonth() + 1), two(date.getUTCDate()), two(date.getUTCHours()), two(date.getUTCMinutes()), two(date.getUTCSeconds()), "Z" ].join("");
        } else {
          this.reporter.error("Encoding " + tag + " time is not supported yet");
        }
        return this._encodeStr(str, "octstr");
      };
      DERNode.prototype._encodeNull = function encodeNull() {
        return this._createEncoderBuffer("");
      };
      DERNode.prototype._encodeInt = function encodeInt(num, values) {
        if (typeof num === "string") {
          if (!values) return this.reporter.error("String int or enum given, but no values map");
          if (!values.hasOwnProperty(num)) {
            return this.reporter.error("Values map doesn't contain: " + JSON.stringify(num));
          }
          num = values[num];
        }
        if (typeof num !== "number" && !Buffer.isBuffer(num)) {
          var numArray = num.toArray();
          if (!num.sign && numArray[0] & 128) {
            numArray.unshift(0);
          }
          num = new Buffer(numArray);
        }
        if (Buffer.isBuffer(num)) {
          var size = num.length;
          if (num.length === 0) size++;
          var out = new Buffer(size);
          num.copy(out);
          if (num.length === 0) out[0] = 0;
          return this._createEncoderBuffer(out);
        }
        if (num < 128) return this._createEncoderBuffer(num);
        if (num < 256) return this._createEncoderBuffer([ 0, num ]);
        var size = 1;
        for (var i = num; i >= 256; i >>= 8) size++;
        var out = new Array(size);
        for (var i = out.length - 1; i >= 0; i--) {
          out[i] = num & 255;
          num >>= 8;
        }
        if (out[0] & 128) {
          out.unshift(0);
        }
        return this._createEncoderBuffer(new Buffer(out));
      };
      DERNode.prototype._encodeBool = function encodeBool(value) {
        return this._createEncoderBuffer(value ? 255 : 0);
      };
      DERNode.prototype._use = function use(entity, obj) {
        if (typeof entity === "function") entity = entity(obj);
        return entity._getEncoder("der").tree;
      };
      DERNode.prototype._skipDefault = function skipDefault(dataBuffer, reporter, parent) {
        var state = this._baseState;
        var i;
        if (state["default"] === null) return false;
        var data = dataBuffer.join();
        if (state.defaultBuffer === undefined) state.defaultBuffer = this._encodeValue(state["default"], reporter, parent).join();
        if (data.length !== state.defaultBuffer.length) return false;
        for (i = 0; i < data.length; i++) if (data[i] !== state.defaultBuffer[i]) return false;
        return true;
      };
      function encodeTag(tag, primitive, cls, reporter) {
        var res;
        if (tag === "seqof") tag = "seq"; else if (tag === "setof") tag = "set";
        if (der.tagByName.hasOwnProperty(tag)) res = der.tagByName[tag]; else if (typeof tag === "number" && (tag | 0) === tag) res = tag; else return reporter.error("Unknown tag: " + tag);
        if (res >= 31) return reporter.error("Multi-octet tag encoding unsupported");
        if (!primitive) res |= 32;
        res |= der.tagClassByName[cls || "universal"] << 6;
        return res;
      }
    },
    4669(__unused_webpack_module, exports, __webpack_require__) {
      var encoders = exports;
      encoders.der = __webpack_require__(82);
      encoders.pem = __webpack_require__(735);
    },
    735(module, __unused_webpack_exports, __webpack_require__) {
      var inherits = __webpack_require__(6698);
      var DEREncoder = __webpack_require__(82);
      function PEMEncoder(entity) {
        DEREncoder.call(this, entity);
        this.enc = "pem";
      }
      inherits(PEMEncoder, DEREncoder);
      module.exports = PEMEncoder;
      PEMEncoder.prototype.encode = function encode(data, options) {
        var buf = DEREncoder.prototype.encode.call(this, data);
        var p = buf.toString("base64");
        var out = [ "-----BEGIN " + options.label + "-----" ];
        for (var i = 0; i < p.length; i += 64) out.push(p.slice(i, i + 64));
        out.push("-----END " + options.label + "-----");
        return out.join("\n");
      };
    },
    2344(module, __unused_webpack_exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      (function(module, exports) {
        "use strict";
        function assert(val, msg) {
          if (!val) throw new Error(msg || "Assertion failed");
        }
        function inherits(ctor, superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {};
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor;
          ctor.prototype.constructor = ctor;
        }
        function BN(number, base, endian) {
          if (BN.isBN(number)) {
            return number;
          }
          this.negative = 0;
          this.words = null;
          this.length = 0;
          this.red = null;
          if (number !== null) {
            if (base === "le" || base === "be") {
              endian = base;
              base = 10;
            }
            this._init(number || 0, base || 10, endian || "be");
          }
        }
        if (typeof module === "object") {
          module.exports = BN;
        } else {
          exports.BN = BN;
        }
        BN.BN = BN;
        BN.wordSize = 26;
        var Buffer;
        try {
          if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
            Buffer = window.Buffer;
          } else {
            Buffer = __webpack_require__(8982).Buffer;
          }
        } catch (e) {}
        BN.isBN = function isBN(num) {
          if (num instanceof BN) {
            return true;
          }
          return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
        };
        BN.max = function max(left, right) {
          if (left.cmp(right) > 0) return left;
          return right;
        };
        BN.min = function min(left, right) {
          if (left.cmp(right) < 0) return left;
          return right;
        };
        BN.prototype._init = function init(number, base, endian) {
          if (typeof number === "number") {
            return this._initNumber(number, base, endian);
          }
          if (typeof number === "object") {
            return this._initArray(number, base, endian);
          }
          if (base === "hex") {
            base = 16;
          }
          assert(base === (base | 0) && base >= 2 && base <= 36);
          number = number.toString().replace(/\s+/g, "");
          var start = 0;
          if (number[0] === "-") {
            start++;
            this.negative = 1;
          }
          if (start < number.length) {
            if (base === 16) {
              this._parseHex(number, start, endian);
            } else {
              this._parseBase(number, base, start);
              if (endian === "le") {
                this._initArray(this.toArray(), base, endian);
              }
            }
          }
        };
        BN.prototype._initNumber = function _initNumber(number, base, endian) {
          if (number < 0) {
            this.negative = 1;
            number = -number;
          }
          if (number < 67108864) {
            this.words = [ number & 67108863 ];
            this.length = 1;
          } else if (number < 4503599627370496) {
            this.words = [ number & 67108863, number / 67108864 & 67108863 ];
            this.length = 2;
          } else {
            assert(number < 9007199254740992);
            this.words = [ number & 67108863, number / 67108864 & 67108863, 1 ];
            this.length = 3;
          }
          if (endian !== "le") return;
          this._initArray(this.toArray(), base, endian);
        };
        BN.prototype._initArray = function _initArray(number, base, endian) {
          assert(typeof number.length === "number");
          if (number.length <= 0) {
            this.words = [ 0 ];
            this.length = 1;
            return this;
          }
          this.length = Math.ceil(number.length / 3);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var j, w;
          var off = 0;
          if (endian === "be") {
            for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
              w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          } else if (endian === "le") {
            for (i = 0, j = 0; i < number.length; i += 3) {
              w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          }
          return this.strip();
        };
        function parseHex4Bits(string, index) {
          var c = string.charCodeAt(index);
          if (c >= 65 && c <= 70) {
            return c - 55;
          } else if (c >= 97 && c <= 102) {
            return c - 87;
          } else {
            return c - 48 & 15;
          }
        }
        function parseHexByte(string, lowerBound, index) {
          var r = parseHex4Bits(string, index);
          if (index - 1 >= lowerBound) {
            r |= parseHex4Bits(string, index - 1) << 4;
          }
          return r;
        }
        BN.prototype._parseHex = function _parseHex(number, start, endian) {
          this.length = Math.ceil((number.length - start) / 6);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var off = 0;
          var j = 0;
          var w;
          if (endian === "be") {
            for (i = number.length - 1; i >= start; i -= 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          } else {
            var parseLength = number.length - start;
            for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          }
          this.strip();
        };
        function parseBase(str, start, end, mul) {
          var r = 0;
          var len = Math.min(str.length, end);
          for (var i = start; i < len; i++) {
            var c = str.charCodeAt(i) - 48;
            r *= mul;
            if (c >= 49) {
              r += c - 49 + 10;
            } else if (c >= 17) {
              r += c - 17 + 10;
            } else {
              r += c;
            }
          }
          return r;
        }
        BN.prototype._parseBase = function _parseBase(number, base, start) {
          this.words = [ 0 ];
          this.length = 1;
          for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
            limbLen++;
          }
          limbLen--;
          limbPow = limbPow / base | 0;
          var total = number.length - start;
          var mod = total % limbLen;
          var end = Math.min(total, total - mod) + start;
          var word = 0;
          for (var i = start; i < end; i += limbLen) {
            word = parseBase(number, i, i + limbLen, base);
            this.imuln(limbPow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          if (mod !== 0) {
            var pow = 1;
            word = parseBase(number, i, number.length, base);
            for (i = 0; i < mod; i++) {
              pow *= base;
            }
            this.imuln(pow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          this.strip();
        };
        BN.prototype.copy = function copy(dest) {
          dest.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            dest.words[i] = this.words[i];
          }
          dest.length = this.length;
          dest.negative = this.negative;
          dest.red = this.red;
        };
        BN.prototype.clone = function clone() {
          var r = new BN(null);
          this.copy(r);
          return r;
        };
        BN.prototype._expand = function _expand(size) {
          while (this.length < size) {
            this.words[this.length++] = 0;
          }
          return this;
        };
        BN.prototype.strip = function strip() {
          while (this.length > 1 && this.words[this.length - 1] === 0) {
            this.length--;
          }
          return this._normSign();
        };
        BN.prototype._normSign = function _normSign() {
          if (this.length === 1 && this.words[0] === 0) {
            this.negative = 0;
          }
          return this;
        };
        BN.prototype.inspect = function inspect() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
        };
        var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ];
        var groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];
        var groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ];
        BN.prototype.toString = function toString(base, padding) {
          base = base || 10;
          padding = padding | 0 || 1;
          var out;
          if (base === 16 || base === "hex") {
            out = "";
            var off = 0;
            var carry = 0;
            for (var i = 0; i < this.length; i++) {
              var w = this.words[i];
              var word = ((w << off | carry) & 16777215).toString(16);
              carry = w >>> 24 - off & 16777215;
              off += 2;
              if (off >= 26) {
                off -= 26;
                i--;
              }
              if (carry !== 0 || i !== this.length - 1) {
                out = zeros[6 - word.length] + word + out;
              } else {
                out = word + out;
              }
            }
            if (carry !== 0) {
              out = carry.toString(16) + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          if (base === (base | 0) && base >= 2 && base <= 36) {
            var groupSize = groupSizes[base];
            var groupBase = groupBases[base];
            out = "";
            var c = this.clone();
            c.negative = 0;
            while (!c.isZero()) {
              var r = c.modn(groupBase).toString(base);
              c = c.idivn(groupBase);
              if (!c.isZero()) {
                out = zeros[groupSize - r.length] + r + out;
              } else {
                out = r + out;
              }
            }
            if (this.isZero()) {
              out = "0" + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          assert(false, "Base should be between 2 and 36");
        };
        BN.prototype.toNumber = function toNumber() {
          var ret = this.words[0];
          if (this.length === 2) {
            ret += this.words[1] * 67108864;
          } else if (this.length === 3 && this.words[2] === 1) {
            ret += 4503599627370496 + this.words[1] * 67108864;
          } else if (this.length > 2) {
            assert(false, "Number can only safely store up to 53 bits");
          }
          return this.negative !== 0 ? -ret : ret;
        };
        BN.prototype.toJSON = function toJSON() {
          return this.toString(16);
        };
        BN.prototype.toBuffer = function toBuffer(endian, length) {
          assert(typeof Buffer !== "undefined");
          return this.toArrayLike(Buffer, endian, length);
        };
        BN.prototype.toArray = function toArray(endian, length) {
          return this.toArrayLike(Array, endian, length);
        };
        BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
          var byteLength = this.byteLength();
          var reqLength = length || Math.max(1, byteLength);
          assert(byteLength <= reqLength, "byte array longer than desired length");
          assert(reqLength > 0, "Requested array length <= 0");
          this.strip();
          var littleEndian = endian === "le";
          var res = new ArrayType(reqLength);
          var b, i;
          var q = this.clone();
          if (!littleEndian) {
            for (i = 0; i < reqLength - byteLength; i++) {
              res[i] = 0;
            }
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[reqLength - i - 1] = b;
            }
          } else {
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[i] = b;
            }
            for (;i < reqLength; i++) {
              res[i] = 0;
            }
          }
          return res;
        };
        if (Math.clz32) {
          BN.prototype._countBits = function _countBits(w) {
            return 32 - Math.clz32(w);
          };
        } else {
          BN.prototype._countBits = function _countBits(w) {
            var t = w;
            var r = 0;
            if (t >= 4096) {
              r += 13;
              t >>>= 13;
            }
            if (t >= 64) {
              r += 7;
              t >>>= 7;
            }
            if (t >= 8) {
              r += 4;
              t >>>= 4;
            }
            if (t >= 2) {
              r += 2;
              t >>>= 2;
            }
            return r + t;
          };
        }
        BN.prototype._zeroBits = function _zeroBits(w) {
          if (w === 0) return 26;
          var t = w;
          var r = 0;
          if ((t & 8191) === 0) {
            r += 13;
            t >>>= 13;
          }
          if ((t & 127) === 0) {
            r += 7;
            t >>>= 7;
          }
          if ((t & 15) === 0) {
            r += 4;
            t >>>= 4;
          }
          if ((t & 3) === 0) {
            r += 2;
            t >>>= 2;
          }
          if ((t & 1) === 0) {
            r++;
          }
          return r;
        };
        BN.prototype.bitLength = function bitLength() {
          var w = this.words[this.length - 1];
          var hi = this._countBits(w);
          return (this.length - 1) * 26 + hi;
        };
        function toBitArray(num) {
          var w = new Array(num.bitLength());
          for (var bit = 0; bit < w.length; bit++) {
            var off = bit / 26 | 0;
            var wbit = bit % 26;
            w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
          }
          return w;
        }
        BN.prototype.zeroBits = function zeroBits() {
          if (this.isZero()) return 0;
          var r = 0;
          for (var i = 0; i < this.length; i++) {
            var b = this._zeroBits(this.words[i]);
            r += b;
            if (b !== 26) break;
          }
          return r;
        };
        BN.prototype.byteLength = function byteLength() {
          return Math.ceil(this.bitLength() / 8);
        };
        BN.prototype.toTwos = function toTwos(width) {
          if (this.negative !== 0) {
            return this.abs().inotn(width).iaddn(1);
          }
          return this.clone();
        };
        BN.prototype.fromTwos = function fromTwos(width) {
          if (this.testn(width - 1)) {
            return this.notn(width).iaddn(1).ineg();
          }
          return this.clone();
        };
        BN.prototype.isNeg = function isNeg() {
          return this.negative !== 0;
        };
        BN.prototype.neg = function neg() {
          return this.clone().ineg();
        };
        BN.prototype.ineg = function ineg() {
          if (!this.isZero()) {
            this.negative ^= 1;
          }
          return this;
        };
        BN.prototype.iuor = function iuor(num) {
          while (this.length < num.length) {
            this.words[this.length++] = 0;
          }
          for (var i = 0; i < num.length; i++) {
            this.words[i] = this.words[i] | num.words[i];
          }
          return this.strip();
        };
        BN.prototype.ior = function ior(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuor(num);
        };
        BN.prototype.or = function or(num) {
          if (this.length > num.length) return this.clone().ior(num);
          return num.clone().ior(this);
        };
        BN.prototype.uor = function uor(num) {
          if (this.length > num.length) return this.clone().iuor(num);
          return num.clone().iuor(this);
        };
        BN.prototype.iuand = function iuand(num) {
          var b;
          if (this.length > num.length) {
            b = num;
          } else {
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = this.words[i] & num.words[i];
          }
          this.length = b.length;
          return this.strip();
        };
        BN.prototype.iand = function iand(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuand(num);
        };
        BN.prototype.and = function and(num) {
          if (this.length > num.length) return this.clone().iand(num);
          return num.clone().iand(this);
        };
        BN.prototype.uand = function uand(num) {
          if (this.length > num.length) return this.clone().iuand(num);
          return num.clone().iuand(this);
        };
        BN.prototype.iuxor = function iuxor(num) {
          var a;
          var b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = a.words[i] ^ b.words[i];
          }
          if (this !== a) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = a.length;
          return this.strip();
        };
        BN.prototype.ixor = function ixor(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuxor(num);
        };
        BN.prototype.xor = function xor(num) {
          if (this.length > num.length) return this.clone().ixor(num);
          return num.clone().ixor(this);
        };
        BN.prototype.uxor = function uxor(num) {
          if (this.length > num.length) return this.clone().iuxor(num);
          return num.clone().iuxor(this);
        };
        BN.prototype.inotn = function inotn(width) {
          assert(typeof width === "number" && width >= 0);
          var bytesNeeded = Math.ceil(width / 26) | 0;
          var bitsLeft = width % 26;
          this._expand(bytesNeeded);
          if (bitsLeft > 0) {
            bytesNeeded--;
          }
          for (var i = 0; i < bytesNeeded; i++) {
            this.words[i] = ~this.words[i] & 67108863;
          }
          if (bitsLeft > 0) {
            this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
          }
          return this.strip();
        };
        BN.prototype.notn = function notn(width) {
          return this.clone().inotn(width);
        };
        BN.prototype.setn = function setn(bit, val) {
          assert(typeof bit === "number" && bit >= 0);
          var off = bit / 26 | 0;
          var wbit = bit % 26;
          this._expand(off + 1);
          if (val) {
            this.words[off] = this.words[off] | 1 << wbit;
          } else {
            this.words[off] = this.words[off] & ~(1 << wbit);
          }
          return this.strip();
        };
        BN.prototype.iadd = function iadd(num) {
          var r;
          if (this.negative !== 0 && num.negative === 0) {
            this.negative = 0;
            r = this.isub(num);
            this.negative ^= 1;
            return this._normSign();
          } else if (this.negative === 0 && num.negative !== 0) {
            num.negative = 0;
            r = this.isub(num);
            num.negative = 1;
            return r._normSign();
          }
          var a, b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          this.length = a.length;
          if (carry !== 0) {
            this.words[this.length] = carry;
            this.length++;
          } else if (a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          return this;
        };
        BN.prototype.add = function add(num) {
          var res;
          if (num.negative !== 0 && this.negative === 0) {
            num.negative = 0;
            res = this.sub(num);
            num.negative ^= 1;
            return res;
          } else if (num.negative === 0 && this.negative !== 0) {
            this.negative = 0;
            res = num.sub(this);
            this.negative = 1;
            return res;
          }
          if (this.length > num.length) return this.clone().iadd(num);
          return num.clone().iadd(this);
        };
        BN.prototype.isub = function isub(num) {
          if (num.negative !== 0) {
            num.negative = 0;
            var r = this.iadd(num);
            num.negative = 1;
            return r._normSign();
          } else if (this.negative !== 0) {
            this.negative = 0;
            this.iadd(num);
            this.negative = 1;
            return this._normSign();
          }
          var cmp = this.cmp(num);
          if (cmp === 0) {
            this.negative = 0;
            this.length = 1;
            this.words[0] = 0;
            return this;
          }
          var a, b;
          if (cmp > 0) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          if (carry === 0 && i < a.length && a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = Math.max(this.length, i);
          if (a !== this) {
            this.negative = 1;
          }
          return this.strip();
        };
        BN.prototype.sub = function sub(num) {
          return this.clone().isub(num);
        };
        function smallMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          var len = self.length + num.length | 0;
          out.length = len;
          len = len - 1 | 0;
          var a = self.words[0] | 0;
          var b = num.words[0] | 0;
          var r = a * b;
          var lo = r & 67108863;
          var carry = r / 67108864 | 0;
          out.words[0] = lo;
          for (var k = 1; k < len; k++) {
            var ncarry = carry >>> 26;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j | 0;
              a = self.words[i] | 0;
              b = num.words[j] | 0;
              r = a * b + rword;
              ncarry += r / 67108864 | 0;
              rword = r & 67108863;
            }
            out.words[k] = rword | 0;
            carry = ncarry | 0;
          }
          if (carry !== 0) {
            out.words[k] = carry | 0;
          } else {
            out.length--;
          }
          return out.strip();
        }
        var comb10MulTo = function comb10MulTo(self, num, out) {
          var a = self.words;
          var b = num.words;
          var o = out.words;
          var c = 0;
          var lo;
          var mid;
          var hi;
          var a0 = a[0] | 0;
          var al0 = a0 & 8191;
          var ah0 = a0 >>> 13;
          var a1 = a[1] | 0;
          var al1 = a1 & 8191;
          var ah1 = a1 >>> 13;
          var a2 = a[2] | 0;
          var al2 = a2 & 8191;
          var ah2 = a2 >>> 13;
          var a3 = a[3] | 0;
          var al3 = a3 & 8191;
          var ah3 = a3 >>> 13;
          var a4 = a[4] | 0;
          var al4 = a4 & 8191;
          var ah4 = a4 >>> 13;
          var a5 = a[5] | 0;
          var al5 = a5 & 8191;
          var ah5 = a5 >>> 13;
          var a6 = a[6] | 0;
          var al6 = a6 & 8191;
          var ah6 = a6 >>> 13;
          var a7 = a[7] | 0;
          var al7 = a7 & 8191;
          var ah7 = a7 >>> 13;
          var a8 = a[8] | 0;
          var al8 = a8 & 8191;
          var ah8 = a8 >>> 13;
          var a9 = a[9] | 0;
          var al9 = a9 & 8191;
          var ah9 = a9 >>> 13;
          var b0 = b[0] | 0;
          var bl0 = b0 & 8191;
          var bh0 = b0 >>> 13;
          var b1 = b[1] | 0;
          var bl1 = b1 & 8191;
          var bh1 = b1 >>> 13;
          var b2 = b[2] | 0;
          var bl2 = b2 & 8191;
          var bh2 = b2 >>> 13;
          var b3 = b[3] | 0;
          var bl3 = b3 & 8191;
          var bh3 = b3 >>> 13;
          var b4 = b[4] | 0;
          var bl4 = b4 & 8191;
          var bh4 = b4 >>> 13;
          var b5 = b[5] | 0;
          var bl5 = b5 & 8191;
          var bh5 = b5 >>> 13;
          var b6 = b[6] | 0;
          var bl6 = b6 & 8191;
          var bh6 = b6 >>> 13;
          var b7 = b[7] | 0;
          var bl7 = b7 & 8191;
          var bh7 = b7 >>> 13;
          var b8 = b[8] | 0;
          var bl8 = b8 & 8191;
          var bh8 = b8 >>> 13;
          var b9 = b[9] | 0;
          var bl9 = b9 & 8191;
          var bh9 = b9 >>> 13;
          out.negative = self.negative ^ num.negative;
          out.length = 19;
          lo = Math.imul(al0, bl0);
          mid = Math.imul(al0, bh0);
          mid = mid + Math.imul(ah0, bl0) | 0;
          hi = Math.imul(ah0, bh0);
          var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
          w0 &= 67108863;
          lo = Math.imul(al1, bl0);
          mid = Math.imul(al1, bh0);
          mid = mid + Math.imul(ah1, bl0) | 0;
          hi = Math.imul(ah1, bh0);
          lo = lo + Math.imul(al0, bl1) | 0;
          mid = mid + Math.imul(al0, bh1) | 0;
          mid = mid + Math.imul(ah0, bl1) | 0;
          hi = hi + Math.imul(ah0, bh1) | 0;
          var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
          w1 &= 67108863;
          lo = Math.imul(al2, bl0);
          mid = Math.imul(al2, bh0);
          mid = mid + Math.imul(ah2, bl0) | 0;
          hi = Math.imul(ah2, bh0);
          lo = lo + Math.imul(al1, bl1) | 0;
          mid = mid + Math.imul(al1, bh1) | 0;
          mid = mid + Math.imul(ah1, bl1) | 0;
          hi = hi + Math.imul(ah1, bh1) | 0;
          lo = lo + Math.imul(al0, bl2) | 0;
          mid = mid + Math.imul(al0, bh2) | 0;
          mid = mid + Math.imul(ah0, bl2) | 0;
          hi = hi + Math.imul(ah0, bh2) | 0;
          var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
          w2 &= 67108863;
          lo = Math.imul(al3, bl0);
          mid = Math.imul(al3, bh0);
          mid = mid + Math.imul(ah3, bl0) | 0;
          hi = Math.imul(ah3, bh0);
          lo = lo + Math.imul(al2, bl1) | 0;
          mid = mid + Math.imul(al2, bh1) | 0;
          mid = mid + Math.imul(ah2, bl1) | 0;
          hi = hi + Math.imul(ah2, bh1) | 0;
          lo = lo + Math.imul(al1, bl2) | 0;
          mid = mid + Math.imul(al1, bh2) | 0;
          mid = mid + Math.imul(ah1, bl2) | 0;
          hi = hi + Math.imul(ah1, bh2) | 0;
          lo = lo + Math.imul(al0, bl3) | 0;
          mid = mid + Math.imul(al0, bh3) | 0;
          mid = mid + Math.imul(ah0, bl3) | 0;
          hi = hi + Math.imul(ah0, bh3) | 0;
          var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
          w3 &= 67108863;
          lo = Math.imul(al4, bl0);
          mid = Math.imul(al4, bh0);
          mid = mid + Math.imul(ah4, bl0) | 0;
          hi = Math.imul(ah4, bh0);
          lo = lo + Math.imul(al3, bl1) | 0;
          mid = mid + Math.imul(al3, bh1) | 0;
          mid = mid + Math.imul(ah3, bl1) | 0;
          hi = hi + Math.imul(ah3, bh1) | 0;
          lo = lo + Math.imul(al2, bl2) | 0;
          mid = mid + Math.imul(al2, bh2) | 0;
          mid = mid + Math.imul(ah2, bl2) | 0;
          hi = hi + Math.imul(ah2, bh2) | 0;
          lo = lo + Math.imul(al1, bl3) | 0;
          mid = mid + Math.imul(al1, bh3) | 0;
          mid = mid + Math.imul(ah1, bl3) | 0;
          hi = hi + Math.imul(ah1, bh3) | 0;
          lo = lo + Math.imul(al0, bl4) | 0;
          mid = mid + Math.imul(al0, bh4) | 0;
          mid = mid + Math.imul(ah0, bl4) | 0;
          hi = hi + Math.imul(ah0, bh4) | 0;
          var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
          w4 &= 67108863;
          lo = Math.imul(al5, bl0);
          mid = Math.imul(al5, bh0);
          mid = mid + Math.imul(ah5, bl0) | 0;
          hi = Math.imul(ah5, bh0);
          lo = lo + Math.imul(al4, bl1) | 0;
          mid = mid + Math.imul(al4, bh1) | 0;
          mid = mid + Math.imul(ah4, bl1) | 0;
          hi = hi + Math.imul(ah4, bh1) | 0;
          lo = lo + Math.imul(al3, bl2) | 0;
          mid = mid + Math.imul(al3, bh2) | 0;
          mid = mid + Math.imul(ah3, bl2) | 0;
          hi = hi + Math.imul(ah3, bh2) | 0;
          lo = lo + Math.imul(al2, bl3) | 0;
          mid = mid + Math.imul(al2, bh3) | 0;
          mid = mid + Math.imul(ah2, bl3) | 0;
          hi = hi + Math.imul(ah2, bh3) | 0;
          lo = lo + Math.imul(al1, bl4) | 0;
          mid = mid + Math.imul(al1, bh4) | 0;
          mid = mid + Math.imul(ah1, bl4) | 0;
          hi = hi + Math.imul(ah1, bh4) | 0;
          lo = lo + Math.imul(al0, bl5) | 0;
          mid = mid + Math.imul(al0, bh5) | 0;
          mid = mid + Math.imul(ah0, bl5) | 0;
          hi = hi + Math.imul(ah0, bh5) | 0;
          var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
          w5 &= 67108863;
          lo = Math.imul(al6, bl0);
          mid = Math.imul(al6, bh0);
          mid = mid + Math.imul(ah6, bl0) | 0;
          hi = Math.imul(ah6, bh0);
          lo = lo + Math.imul(al5, bl1) | 0;
          mid = mid + Math.imul(al5, bh1) | 0;
          mid = mid + Math.imul(ah5, bl1) | 0;
          hi = hi + Math.imul(ah5, bh1) | 0;
          lo = lo + Math.imul(al4, bl2) | 0;
          mid = mid + Math.imul(al4, bh2) | 0;
          mid = mid + Math.imul(ah4, bl2) | 0;
          hi = hi + Math.imul(ah4, bh2) | 0;
          lo = lo + Math.imul(al3, bl3) | 0;
          mid = mid + Math.imul(al3, bh3) | 0;
          mid = mid + Math.imul(ah3, bl3) | 0;
          hi = hi + Math.imul(ah3, bh3) | 0;
          lo = lo + Math.imul(al2, bl4) | 0;
          mid = mid + Math.imul(al2, bh4) | 0;
          mid = mid + Math.imul(ah2, bl4) | 0;
          hi = hi + Math.imul(ah2, bh4) | 0;
          lo = lo + Math.imul(al1, bl5) | 0;
          mid = mid + Math.imul(al1, bh5) | 0;
          mid = mid + Math.imul(ah1, bl5) | 0;
          hi = hi + Math.imul(ah1, bh5) | 0;
          lo = lo + Math.imul(al0, bl6) | 0;
          mid = mid + Math.imul(al0, bh6) | 0;
          mid = mid + Math.imul(ah0, bl6) | 0;
          hi = hi + Math.imul(ah0, bh6) | 0;
          var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
          w6 &= 67108863;
          lo = Math.imul(al7, bl0);
          mid = Math.imul(al7, bh0);
          mid = mid + Math.imul(ah7, bl0) | 0;
          hi = Math.imul(ah7, bh0);
          lo = lo + Math.imul(al6, bl1) | 0;
          mid = mid + Math.imul(al6, bh1) | 0;
          mid = mid + Math.imul(ah6, bl1) | 0;
          hi = hi + Math.imul(ah6, bh1) | 0;
          lo = lo + Math.imul(al5, bl2) | 0;
          mid = mid + Math.imul(al5, bh2) | 0;
          mid = mid + Math.imul(ah5, bl2) | 0;
          hi = hi + Math.imul(ah5, bh2) | 0;
          lo = lo + Math.imul(al4, bl3) | 0;
          mid = mid + Math.imul(al4, bh3) | 0;
          mid = mid + Math.imul(ah4, bl3) | 0;
          hi = hi + Math.imul(ah4, bh3) | 0;
          lo = lo + Math.imul(al3, bl4) | 0;
          mid = mid + Math.imul(al3, bh4) | 0;
          mid = mid + Math.imul(ah3, bl4) | 0;
          hi = hi + Math.imul(ah3, bh4) | 0;
          lo = lo + Math.imul(al2, bl5) | 0;
          mid = mid + Math.imul(al2, bh5) | 0;
          mid = mid + Math.imul(ah2, bl5) | 0;
          hi = hi + Math.imul(ah2, bh5) | 0;
          lo = lo + Math.imul(al1, bl6) | 0;
          mid = mid + Math.imul(al1, bh6) | 0;
          mid = mid + Math.imul(ah1, bl6) | 0;
          hi = hi + Math.imul(ah1, bh6) | 0;
          lo = lo + Math.imul(al0, bl7) | 0;
          mid = mid + Math.imul(al0, bh7) | 0;
          mid = mid + Math.imul(ah0, bl7) | 0;
          hi = hi + Math.imul(ah0, bh7) | 0;
          var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
          w7 &= 67108863;
          lo = Math.imul(al8, bl0);
          mid = Math.imul(al8, bh0);
          mid = mid + Math.imul(ah8, bl0) | 0;
          hi = Math.imul(ah8, bh0);
          lo = lo + Math.imul(al7, bl1) | 0;
          mid = mid + Math.imul(al7, bh1) | 0;
          mid = mid + Math.imul(ah7, bl1) | 0;
          hi = hi + Math.imul(ah7, bh1) | 0;
          lo = lo + Math.imul(al6, bl2) | 0;
          mid = mid + Math.imul(al6, bh2) | 0;
          mid = mid + Math.imul(ah6, bl2) | 0;
          hi = hi + Math.imul(ah6, bh2) | 0;
          lo = lo + Math.imul(al5, bl3) | 0;
          mid = mid + Math.imul(al5, bh3) | 0;
          mid = mid + Math.imul(ah5, bl3) | 0;
          hi = hi + Math.imul(ah5, bh3) | 0;
          lo = lo + Math.imul(al4, bl4) | 0;
          mid = mid + Math.imul(al4, bh4) | 0;
          mid = mid + Math.imul(ah4, bl4) | 0;
          hi = hi + Math.imul(ah4, bh4) | 0;
          lo = lo + Math.imul(al3, bl5) | 0;
          mid = mid + Math.imul(al3, bh5) | 0;
          mid = mid + Math.imul(ah3, bl5) | 0;
          hi = hi + Math.imul(ah3, bh5) | 0;
          lo = lo + Math.imul(al2, bl6) | 0;
          mid = mid + Math.imul(al2, bh6) | 0;
          mid = mid + Math.imul(ah2, bl6) | 0;
          hi = hi + Math.imul(ah2, bh6) | 0;
          lo = lo + Math.imul(al1, bl7) | 0;
          mid = mid + Math.imul(al1, bh7) | 0;
          mid = mid + Math.imul(ah1, bl7) | 0;
          hi = hi + Math.imul(ah1, bh7) | 0;
          lo = lo + Math.imul(al0, bl8) | 0;
          mid = mid + Math.imul(al0, bh8) | 0;
          mid = mid + Math.imul(ah0, bl8) | 0;
          hi = hi + Math.imul(ah0, bh8) | 0;
          var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
          w8 &= 67108863;
          lo = Math.imul(al9, bl0);
          mid = Math.imul(al9, bh0);
          mid = mid + Math.imul(ah9, bl0) | 0;
          hi = Math.imul(ah9, bh0);
          lo = lo + Math.imul(al8, bl1) | 0;
          mid = mid + Math.imul(al8, bh1) | 0;
          mid = mid + Math.imul(ah8, bl1) | 0;
          hi = hi + Math.imul(ah8, bh1) | 0;
          lo = lo + Math.imul(al7, bl2) | 0;
          mid = mid + Math.imul(al7, bh2) | 0;
          mid = mid + Math.imul(ah7, bl2) | 0;
          hi = hi + Math.imul(ah7, bh2) | 0;
          lo = lo + Math.imul(al6, bl3) | 0;
          mid = mid + Math.imul(al6, bh3) | 0;
          mid = mid + Math.imul(ah6, bl3) | 0;
          hi = hi + Math.imul(ah6, bh3) | 0;
          lo = lo + Math.imul(al5, bl4) | 0;
          mid = mid + Math.imul(al5, bh4) | 0;
          mid = mid + Math.imul(ah5, bl4) | 0;
          hi = hi + Math.imul(ah5, bh4) | 0;
          lo = lo + Math.imul(al4, bl5) | 0;
          mid = mid + Math.imul(al4, bh5) | 0;
          mid = mid + Math.imul(ah4, bl5) | 0;
          hi = hi + Math.imul(ah4, bh5) | 0;
          lo = lo + Math.imul(al3, bl6) | 0;
          mid = mid + Math.imul(al3, bh6) | 0;
          mid = mid + Math.imul(ah3, bl6) | 0;
          hi = hi + Math.imul(ah3, bh6) | 0;
          lo = lo + Math.imul(al2, bl7) | 0;
          mid = mid + Math.imul(al2, bh7) | 0;
          mid = mid + Math.imul(ah2, bl7) | 0;
          hi = hi + Math.imul(ah2, bh7) | 0;
          lo = lo + Math.imul(al1, bl8) | 0;
          mid = mid + Math.imul(al1, bh8) | 0;
          mid = mid + Math.imul(ah1, bl8) | 0;
          hi = hi + Math.imul(ah1, bh8) | 0;
          lo = lo + Math.imul(al0, bl9) | 0;
          mid = mid + Math.imul(al0, bh9) | 0;
          mid = mid + Math.imul(ah0, bl9) | 0;
          hi = hi + Math.imul(ah0, bh9) | 0;
          var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
          w9 &= 67108863;
          lo = Math.imul(al9, bl1);
          mid = Math.imul(al9, bh1);
          mid = mid + Math.imul(ah9, bl1) | 0;
          hi = Math.imul(ah9, bh1);
          lo = lo + Math.imul(al8, bl2) | 0;
          mid = mid + Math.imul(al8, bh2) | 0;
          mid = mid + Math.imul(ah8, bl2) | 0;
          hi = hi + Math.imul(ah8, bh2) | 0;
          lo = lo + Math.imul(al7, bl3) | 0;
          mid = mid + Math.imul(al7, bh3) | 0;
          mid = mid + Math.imul(ah7, bl3) | 0;
          hi = hi + Math.imul(ah7, bh3) | 0;
          lo = lo + Math.imul(al6, bl4) | 0;
          mid = mid + Math.imul(al6, bh4) | 0;
          mid = mid + Math.imul(ah6, bl4) | 0;
          hi = hi + Math.imul(ah6, bh4) | 0;
          lo = lo + Math.imul(al5, bl5) | 0;
          mid = mid + Math.imul(al5, bh5) | 0;
          mid = mid + Math.imul(ah5, bl5) | 0;
          hi = hi + Math.imul(ah5, bh5) | 0;
          lo = lo + Math.imul(al4, bl6) | 0;
          mid = mid + Math.imul(al4, bh6) | 0;
          mid = mid + Math.imul(ah4, bl6) | 0;
          hi = hi + Math.imul(ah4, bh6) | 0;
          lo = lo + Math.imul(al3, bl7) | 0;
          mid = mid + Math.imul(al3, bh7) | 0;
          mid = mid + Math.imul(ah3, bl7) | 0;
          hi = hi + Math.imul(ah3, bh7) | 0;
          lo = lo + Math.imul(al2, bl8) | 0;
          mid = mid + Math.imul(al2, bh8) | 0;
          mid = mid + Math.imul(ah2, bl8) | 0;
          hi = hi + Math.imul(ah2, bh8) | 0;
          lo = lo + Math.imul(al1, bl9) | 0;
          mid = mid + Math.imul(al1, bh9) | 0;
          mid = mid + Math.imul(ah1, bl9) | 0;
          hi = hi + Math.imul(ah1, bh9) | 0;
          var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
          w10 &= 67108863;
          lo = Math.imul(al9, bl2);
          mid = Math.imul(al9, bh2);
          mid = mid + Math.imul(ah9, bl2) | 0;
          hi = Math.imul(ah9, bh2);
          lo = lo + Math.imul(al8, bl3) | 0;
          mid = mid + Math.imul(al8, bh3) | 0;
          mid = mid + Math.imul(ah8, bl3) | 0;
          hi = hi + Math.imul(ah8, bh3) | 0;
          lo = lo + Math.imul(al7, bl4) | 0;
          mid = mid + Math.imul(al7, bh4) | 0;
          mid = mid + Math.imul(ah7, bl4) | 0;
          hi = hi + Math.imul(ah7, bh4) | 0;
          lo = lo + Math.imul(al6, bl5) | 0;
          mid = mid + Math.imul(al6, bh5) | 0;
          mid = mid + Math.imul(ah6, bl5) | 0;
          hi = hi + Math.imul(ah6, bh5) | 0;
          lo = lo + Math.imul(al5, bl6) | 0;
          mid = mid + Math.imul(al5, bh6) | 0;
          mid = mid + Math.imul(ah5, bl6) | 0;
          hi = hi + Math.imul(ah5, bh6) | 0;
          lo = lo + Math.imul(al4, bl7) | 0;
          mid = mid + Math.imul(al4, bh7) | 0;
          mid = mid + Math.imul(ah4, bl7) | 0;
          hi = hi + Math.imul(ah4, bh7) | 0;
          lo = lo + Math.imul(al3, bl8) | 0;
          mid = mid + Math.imul(al3, bh8) | 0;
          mid = mid + Math.imul(ah3, bl8) | 0;
          hi = hi + Math.imul(ah3, bh8) | 0;
          lo = lo + Math.imul(al2, bl9) | 0;
          mid = mid + Math.imul(al2, bh9) | 0;
          mid = mid + Math.imul(ah2, bl9) | 0;
          hi = hi + Math.imul(ah2, bh9) | 0;
          var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
          w11 &= 67108863;
          lo = Math.imul(al9, bl3);
          mid = Math.imul(al9, bh3);
          mid = mid + Math.imul(ah9, bl3) | 0;
          hi = Math.imul(ah9, bh3);
          lo = lo + Math.imul(al8, bl4) | 0;
          mid = mid + Math.imul(al8, bh4) | 0;
          mid = mid + Math.imul(ah8, bl4) | 0;
          hi = hi + Math.imul(ah8, bh4) | 0;
          lo = lo + Math.imul(al7, bl5) | 0;
          mid = mid + Math.imul(al7, bh5) | 0;
          mid = mid + Math.imul(ah7, bl5) | 0;
          hi = hi + Math.imul(ah7, bh5) | 0;
          lo = lo + Math.imul(al6, bl6) | 0;
          mid = mid + Math.imul(al6, bh6) | 0;
          mid = mid + Math.imul(ah6, bl6) | 0;
          hi = hi + Math.imul(ah6, bh6) | 0;
          lo = lo + Math.imul(al5, bl7) | 0;
          mid = mid + Math.imul(al5, bh7) | 0;
          mid = mid + Math.imul(ah5, bl7) | 0;
          hi = hi + Math.imul(ah5, bh7) | 0;
          lo = lo + Math.imul(al4, bl8) | 0;
          mid = mid + Math.imul(al4, bh8) | 0;
          mid = mid + Math.imul(ah4, bl8) | 0;
          hi = hi + Math.imul(ah4, bh8) | 0;
          lo = lo + Math.imul(al3, bl9) | 0;
          mid = mid + Math.imul(al3, bh9) | 0;
          mid = mid + Math.imul(ah3, bl9) | 0;
          hi = hi + Math.imul(ah3, bh9) | 0;
          var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
          w12 &= 67108863;
          lo = Math.imul(al9, bl4);
          mid = Math.imul(al9, bh4);
          mid = mid + Math.imul(ah9, bl4) | 0;
          hi = Math.imul(ah9, bh4);
          lo = lo + Math.imul(al8, bl5) | 0;
          mid = mid + Math.imul(al8, bh5) | 0;
          mid = mid + Math.imul(ah8, bl5) | 0;
          hi = hi + Math.imul(ah8, bh5) | 0;
          lo = lo + Math.imul(al7, bl6) | 0;
          mid = mid + Math.imul(al7, bh6) | 0;
          mid = mid + Math.imul(ah7, bl6) | 0;
          hi = hi + Math.imul(ah7, bh6) | 0;
          lo = lo + Math.imul(al6, bl7) | 0;
          mid = mid + Math.imul(al6, bh7) | 0;
          mid = mid + Math.imul(ah6, bl7) | 0;
          hi = hi + Math.imul(ah6, bh7) | 0;
          lo = lo + Math.imul(al5, bl8) | 0;
          mid = mid + Math.imul(al5, bh8) | 0;
          mid = mid + Math.imul(ah5, bl8) | 0;
          hi = hi + Math.imul(ah5, bh8) | 0;
          lo = lo + Math.imul(al4, bl9) | 0;
          mid = mid + Math.imul(al4, bh9) | 0;
          mid = mid + Math.imul(ah4, bl9) | 0;
          hi = hi + Math.imul(ah4, bh9) | 0;
          var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
          w13 &= 67108863;
          lo = Math.imul(al9, bl5);
          mid = Math.imul(al9, bh5);
          mid = mid + Math.imul(ah9, bl5) | 0;
          hi = Math.imul(ah9, bh5);
          lo = lo + Math.imul(al8, bl6) | 0;
          mid = mid + Math.imul(al8, bh6) | 0;
          mid = mid + Math.imul(ah8, bl6) | 0;
          hi = hi + Math.imul(ah8, bh6) | 0;
          lo = lo + Math.imul(al7, bl7) | 0;
          mid = mid + Math.imul(al7, bh7) | 0;
          mid = mid + Math.imul(ah7, bl7) | 0;
          hi = hi + Math.imul(ah7, bh7) | 0;
          lo = lo + Math.imul(al6, bl8) | 0;
          mid = mid + Math.imul(al6, bh8) | 0;
          mid = mid + Math.imul(ah6, bl8) | 0;
          hi = hi + Math.imul(ah6, bh8) | 0;
          lo = lo + Math.imul(al5, bl9) | 0;
          mid = mid + Math.imul(al5, bh9) | 0;
          mid = mid + Math.imul(ah5, bl9) | 0;
          hi = hi + Math.imul(ah5, bh9) | 0;
          var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
          w14 &= 67108863;
          lo = Math.imul(al9, bl6);
          mid = Math.imul(al9, bh6);
          mid = mid + Math.imul(ah9, bl6) | 0;
          hi = Math.imul(ah9, bh6);
          lo = lo + Math.imul(al8, bl7) | 0;
          mid = mid + Math.imul(al8, bh7) | 0;
          mid = mid + Math.imul(ah8, bl7) | 0;
          hi = hi + Math.imul(ah8, bh7) | 0;
          lo = lo + Math.imul(al7, bl8) | 0;
          mid = mid + Math.imul(al7, bh8) | 0;
          mid = mid + Math.imul(ah7, bl8) | 0;
          hi = hi + Math.imul(ah7, bh8) | 0;
          lo = lo + Math.imul(al6, bl9) | 0;
          mid = mid + Math.imul(al6, bh9) | 0;
          mid = mid + Math.imul(ah6, bl9) | 0;
          hi = hi + Math.imul(ah6, bh9) | 0;
          var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
          w15 &= 67108863;
          lo = Math.imul(al9, bl7);
          mid = Math.imul(al9, bh7);
          mid = mid + Math.imul(ah9, bl7) | 0;
          hi = Math.imul(ah9, bh7);
          lo = lo + Math.imul(al8, bl8) | 0;
          mid = mid + Math.imul(al8, bh8) | 0;
          mid = mid + Math.imul(ah8, bl8) | 0;
          hi = hi + Math.imul(ah8, bh8) | 0;
          lo = lo + Math.imul(al7, bl9) | 0;
          mid = mid + Math.imul(al7, bh9) | 0;
          mid = mid + Math.imul(ah7, bl9) | 0;
          hi = hi + Math.imul(ah7, bh9) | 0;
          var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
          w16 &= 67108863;
          lo = Math.imul(al9, bl8);
          mid = Math.imul(al9, bh8);
          mid = mid + Math.imul(ah9, bl8) | 0;
          hi = Math.imul(ah9, bh8);
          lo = lo + Math.imul(al8, bl9) | 0;
          mid = mid + Math.imul(al8, bh9) | 0;
          mid = mid + Math.imul(ah8, bl9) | 0;
          hi = hi + Math.imul(ah8, bh9) | 0;
          var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
          w17 &= 67108863;
          lo = Math.imul(al9, bl9);
          mid = Math.imul(al9, bh9);
          mid = mid + Math.imul(ah9, bl9) | 0;
          hi = Math.imul(ah9, bh9);
          var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
          w18 &= 67108863;
          o[0] = w0;
          o[1] = w1;
          o[2] = w2;
          o[3] = w3;
          o[4] = w4;
          o[5] = w5;
          o[6] = w6;
          o[7] = w7;
          o[8] = w8;
          o[9] = w9;
          o[10] = w10;
          o[11] = w11;
          o[12] = w12;
          o[13] = w13;
          o[14] = w14;
          o[15] = w15;
          o[16] = w16;
          o[17] = w17;
          o[18] = w18;
          if (c !== 0) {
            o[19] = c;
            out.length++;
          }
          return out;
        };
        if (!Math.imul) {
          comb10MulTo = smallMulTo;
        }
        function bigMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          out.length = self.length + num.length;
          var carry = 0;
          var hncarry = 0;
          for (var k = 0; k < out.length - 1; k++) {
            var ncarry = hncarry;
            hncarry = 0;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j;
              var a = self.words[i] | 0;
              var b = num.words[j] | 0;
              var r = a * b;
              var lo = r & 67108863;
              ncarry = ncarry + (r / 67108864 | 0) | 0;
              lo = lo + rword | 0;
              rword = lo & 67108863;
              ncarry = ncarry + (lo >>> 26) | 0;
              hncarry += ncarry >>> 26;
              ncarry &= 67108863;
            }
            out.words[k] = rword;
            carry = ncarry;
            ncarry = hncarry;
          }
          if (carry !== 0) {
            out.words[k] = carry;
          } else {
            out.length--;
          }
          return out.strip();
        }
        function jumboMulTo(self, num, out) {
          var fftm = new FFTM;
          return fftm.mulp(self, num, out);
        }
        BN.prototype.mulTo = function mulTo(num, out) {
          var res;
          var len = this.length + num.length;
          if (this.length === 10 && num.length === 10) {
            res = comb10MulTo(this, num, out);
          } else if (len < 63) {
            res = smallMulTo(this, num, out);
          } else if (len < 1024) {
            res = bigMulTo(this, num, out);
          } else {
            res = jumboMulTo(this, num, out);
          }
          return res;
        };
        function FFTM(x, y) {
          this.x = x;
          this.y = y;
        }
        FFTM.prototype.makeRBT = function makeRBT(N) {
          var t = new Array(N);
          var l = BN.prototype._countBits(N) - 1;
          for (var i = 0; i < N; i++) {
            t[i] = this.revBin(i, l, N);
          }
          return t;
        };
        FFTM.prototype.revBin = function revBin(x, l, N) {
          if (x === 0 || x === N - 1) return x;
          var rb = 0;
          for (var i = 0; i < l; i++) {
            rb |= (x & 1) << l - i - 1;
            x >>= 1;
          }
          return rb;
        };
        FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
          for (var i = 0; i < N; i++) {
            rtws[i] = rws[rbt[i]];
            itws[i] = iws[rbt[i]];
          }
        };
        FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
          this.permute(rbt, rws, iws, rtws, itws, N);
          for (var s = 1; s < N; s <<= 1) {
            var l = s << 1;
            var rtwdf = Math.cos(2 * Math.PI / l);
            var itwdf = Math.sin(2 * Math.PI / l);
            for (var p = 0; p < N; p += l) {
              var rtwdf_ = rtwdf;
              var itwdf_ = itwdf;
              for (var j = 0; j < s; j++) {
                var re = rtws[p + j];
                var ie = itws[p + j];
                var ro = rtws[p + j + s];
                var io = itws[p + j + s];
                var rx = rtwdf_ * ro - itwdf_ * io;
                io = rtwdf_ * io + itwdf_ * ro;
                ro = rx;
                rtws[p + j] = re + ro;
                itws[p + j] = ie + io;
                rtws[p + j + s] = re - ro;
                itws[p + j + s] = ie - io;
                if (j !== l) {
                  rx = rtwdf * rtwdf_ - itwdf * itwdf_;
                  itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
                  rtwdf_ = rx;
                }
              }
            }
          }
        };
        FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
          var N = Math.max(m, n) | 1;
          var odd = N & 1;
          var i = 0;
          for (N = N / 2 | 0; N; N = N >>> 1) {
            i++;
          }
          return 1 << i + 1 + odd;
        };
        FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
          if (N <= 1) return;
          for (var i = 0; i < N / 2; i++) {
            var t = rws[i];
            rws[i] = rws[N - i - 1];
            rws[N - i - 1] = t;
            t = iws[i];
            iws[i] = -iws[N - i - 1];
            iws[N - i - 1] = -t;
          }
        };
        FFTM.prototype.normalize13b = function normalize13b(ws, N) {
          var carry = 0;
          for (var i = 0; i < N / 2; i++) {
            var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
            ws[i] = w & 67108863;
            if (w < 67108864) {
              carry = 0;
            } else {
              carry = w / 67108864 | 0;
            }
          }
          return ws;
        };
        FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
          var carry = 0;
          for (var i = 0; i < len; i++) {
            carry = carry + (ws[i] | 0);
            rws[2 * i] = carry & 8191;
            carry = carry >>> 13;
            rws[2 * i + 1] = carry & 8191;
            carry = carry >>> 13;
          }
          for (i = 2 * len; i < N; ++i) {
            rws[i] = 0;
          }
          assert(carry === 0);
          assert((carry & ~8191) === 0);
        };
        FFTM.prototype.stub = function stub(N) {
          var ph = new Array(N);
          for (var i = 0; i < N; i++) {
            ph[i] = 0;
          }
          return ph;
        };
        FFTM.prototype.mulp = function mulp(x, y, out) {
          var N = 2 * this.guessLen13b(x.length, y.length);
          var rbt = this.makeRBT(N);
          var _ = this.stub(N);
          var rws = new Array(N);
          var rwst = new Array(N);
          var iwst = new Array(N);
          var nrws = new Array(N);
          var nrwst = new Array(N);
          var niwst = new Array(N);
          var rmws = out.words;
          rmws.length = N;
          this.convert13b(x.words, x.length, rws, N);
          this.convert13b(y.words, y.length, nrws, N);
          this.transform(rws, _, rwst, iwst, N, rbt);
          this.transform(nrws, _, nrwst, niwst, N, rbt);
          for (var i = 0; i < N; i++) {
            var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
            iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
            rwst[i] = rx;
          }
          this.conjugate(rwst, iwst, N);
          this.transform(rwst, iwst, rmws, _, N, rbt);
          this.conjugate(rmws, _, N);
          this.normalize13b(rmws, N);
          out.negative = x.negative ^ y.negative;
          out.length = x.length + y.length;
          return out.strip();
        };
        BN.prototype.mul = function mul(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return this.mulTo(num, out);
        };
        BN.prototype.mulf = function mulf(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return jumboMulTo(this, num, out);
        };
        BN.prototype.imul = function imul(num) {
          return this.clone().mulTo(num, this);
        };
        BN.prototype.imuln = function imuln(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          var carry = 0;
          for (var i = 0; i < this.length; i++) {
            var w = (this.words[i] | 0) * num;
            var lo = (w & 67108863) + (carry & 67108863);
            carry >>= 26;
            carry += w / 67108864 | 0;
            carry += lo >>> 26;
            this.words[i] = lo & 67108863;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          this.length = num === 0 ? 1 : this.length;
          return this;
        };
        BN.prototype.muln = function muln(num) {
          return this.clone().imuln(num);
        };
        BN.prototype.sqr = function sqr() {
          return this.mul(this);
        };
        BN.prototype.isqr = function isqr() {
          return this.imul(this.clone());
        };
        BN.prototype.pow = function pow(num) {
          var w = toBitArray(num);
          if (w.length === 0) return new BN(1);
          var res = this;
          for (var i = 0; i < w.length; i++, res = res.sqr()) {
            if (w[i] !== 0) break;
          }
          if (++i < w.length) {
            for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
              if (w[i] === 0) continue;
              res = res.mul(q);
            }
          }
          return res;
        };
        BN.prototype.iushln = function iushln(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          var carryMask = 67108863 >>> 26 - r << 26 - r;
          var i;
          if (r !== 0) {
            var carry = 0;
            for (i = 0; i < this.length; i++) {
              var newCarry = this.words[i] & carryMask;
              var c = (this.words[i] | 0) - newCarry << r;
              this.words[i] = c | carry;
              carry = newCarry >>> 26 - r;
            }
            if (carry) {
              this.words[i] = carry;
              this.length++;
            }
          }
          if (s !== 0) {
            for (i = this.length - 1; i >= 0; i--) {
              this.words[i + s] = this.words[i];
            }
            for (i = 0; i < s; i++) {
              this.words[i] = 0;
            }
            this.length += s;
          }
          return this.strip();
        };
        BN.prototype.ishln = function ishln(bits) {
          assert(this.negative === 0);
          return this.iushln(bits);
        };
        BN.prototype.iushrn = function iushrn(bits, hint, extended) {
          assert(typeof bits === "number" && bits >= 0);
          var h;
          if (hint) {
            h = (hint - hint % 26) / 26;
          } else {
            h = 0;
          }
          var r = bits % 26;
          var s = Math.min((bits - r) / 26, this.length);
          var mask = 67108863 ^ 67108863 >>> r << r;
          var maskedWords = extended;
          h -= s;
          h = Math.max(0, h);
          if (maskedWords) {
            for (var i = 0; i < s; i++) {
              maskedWords.words[i] = this.words[i];
            }
            maskedWords.length = s;
          }
          if (s === 0) {} else if (this.length > s) {
            this.length -= s;
            for (i = 0; i < this.length; i++) {
              this.words[i] = this.words[i + s];
            }
          } else {
            this.words[0] = 0;
            this.length = 1;
          }
          var carry = 0;
          for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
            var word = this.words[i] | 0;
            this.words[i] = carry << 26 - r | word >>> r;
            carry = word & mask;
          }
          if (maskedWords && carry !== 0) {
            maskedWords.words[maskedWords.length++] = carry;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.ishrn = function ishrn(bits, hint, extended) {
          assert(this.negative === 0);
          return this.iushrn(bits, hint, extended);
        };
        BN.prototype.shln = function shln(bits) {
          return this.clone().ishln(bits);
        };
        BN.prototype.ushln = function ushln(bits) {
          return this.clone().iushln(bits);
        };
        BN.prototype.shrn = function shrn(bits) {
          return this.clone().ishrn(bits);
        };
        BN.prototype.ushrn = function ushrn(bits) {
          return this.clone().iushrn(bits);
        };
        BN.prototype.testn = function testn(bit) {
          assert(typeof bit === "number" && bit >= 0);
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) return false;
          var w = this.words[s];
          return !!(w & q);
        };
        BN.prototype.imaskn = function imaskn(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          assert(this.negative === 0, "imaskn works only with positive numbers");
          if (this.length <= s) {
            return this;
          }
          if (r !== 0) {
            s++;
          }
          this.length = Math.min(s, this.length);
          if (r !== 0) {
            var mask = 67108863 ^ 67108863 >>> r << r;
            this.words[this.length - 1] &= mask;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.maskn = function maskn(bits) {
          return this.clone().imaskn(bits);
        };
        BN.prototype.iaddn = function iaddn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.isubn(-num);
          if (this.negative !== 0) {
            if (this.length === 1 && (this.words[0] | 0) < num) {
              this.words[0] = num - (this.words[0] | 0);
              this.negative = 0;
              return this;
            }
            this.negative = 0;
            this.isubn(num);
            this.negative = 1;
            return this;
          }
          return this._iaddn(num);
        };
        BN.prototype._iaddn = function _iaddn(num) {
          this.words[0] += num;
          for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
            this.words[i] -= 67108864;
            if (i === this.length - 1) {
              this.words[i + 1] = 1;
            } else {
              this.words[i + 1]++;
            }
          }
          this.length = Math.max(this.length, i + 1);
          return this;
        };
        BN.prototype.isubn = function isubn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.iaddn(-num);
          if (this.negative !== 0) {
            this.negative = 0;
            this.iaddn(num);
            this.negative = 1;
            return this;
          }
          this.words[0] -= num;
          if (this.length === 1 && this.words[0] < 0) {
            this.words[0] = -this.words[0];
            this.negative = 1;
          } else {
            for (var i = 0; i < this.length && this.words[i] < 0; i++) {
              this.words[i] += 67108864;
              this.words[i + 1] -= 1;
            }
          }
          return this.strip();
        };
        BN.prototype.addn = function addn(num) {
          return this.clone().iaddn(num);
        };
        BN.prototype.subn = function subn(num) {
          return this.clone().isubn(num);
        };
        BN.prototype.iabs = function iabs() {
          this.negative = 0;
          return this;
        };
        BN.prototype.abs = function abs() {
          return this.clone().iabs();
        };
        BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
          var len = num.length + shift;
          var i;
          this._expand(len);
          var w;
          var carry = 0;
          for (i = 0; i < num.length; i++) {
            w = (this.words[i + shift] | 0) + carry;
            var right = (num.words[i] | 0) * mul;
            w -= right & 67108863;
            carry = (w >> 26) - (right / 67108864 | 0);
            this.words[i + shift] = w & 67108863;
          }
          for (;i < this.length - shift; i++) {
            w = (this.words[i + shift] | 0) + carry;
            carry = w >> 26;
            this.words[i + shift] = w & 67108863;
          }
          if (carry === 0) return this.strip();
          assert(carry === -1);
          carry = 0;
          for (i = 0; i < this.length; i++) {
            w = -(this.words[i] | 0) + carry;
            carry = w >> 26;
            this.words[i] = w & 67108863;
          }
          this.negative = 1;
          return this.strip();
        };
        BN.prototype._wordDiv = function _wordDiv(num, mode) {
          var shift = this.length - num.length;
          var a = this.clone();
          var b = num;
          var bhi = b.words[b.length - 1] | 0;
          var bhiBits = this._countBits(bhi);
          shift = 26 - bhiBits;
          if (shift !== 0) {
            b = b.ushln(shift);
            a.iushln(shift);
            bhi = b.words[b.length - 1] | 0;
          }
          var m = a.length - b.length;
          var q;
          if (mode !== "mod") {
            q = new BN(null);
            q.length = m + 1;
            q.words = new Array(q.length);
            for (var i = 0; i < q.length; i++) {
              q.words[i] = 0;
            }
          }
          var diff = a.clone()._ishlnsubmul(b, 1, m);
          if (diff.negative === 0) {
            a = diff;
            if (q) {
              q.words[m] = 1;
            }
          }
          for (var j = m - 1; j >= 0; j--) {
            var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
            qj = Math.min(qj / bhi | 0, 67108863);
            a._ishlnsubmul(b, qj, j);
            while (a.negative !== 0) {
              qj--;
              a.negative = 0;
              a._ishlnsubmul(b, 1, j);
              if (!a.isZero()) {
                a.negative ^= 1;
              }
            }
            if (q) {
              q.words[j] = qj;
            }
          }
          if (q) {
            q.strip();
          }
          a.strip();
          if (mode !== "div" && shift !== 0) {
            a.iushrn(shift);
          }
          return {
            div: q || null,
            mod: a
          };
        };
        BN.prototype.divmod = function divmod(num, mode, positive) {
          assert(!num.isZero());
          if (this.isZero()) {
            return {
              div: new BN(0),
              mod: new BN(0)
            };
          }
          var div, mod, res;
          if (this.negative !== 0 && num.negative === 0) {
            res = this.neg().divmod(num, mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.iadd(num);
              }
            }
            return {
              div,
              mod
            };
          }
          if (this.negative === 0 && num.negative !== 0) {
            res = this.divmod(num.neg(), mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            return {
              div,
              mod: res.mod
            };
          }
          if ((this.negative & num.negative) !== 0) {
            res = this.neg().divmod(num.neg(), mode);
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.isub(num);
              }
            }
            return {
              div: res.div,
              mod
            };
          }
          if (num.length > this.length || this.cmp(num) < 0) {
            return {
              div: new BN(0),
              mod: this
            };
          }
          if (num.length === 1) {
            if (mode === "div") {
              return {
                div: this.divn(num.words[0]),
                mod: null
              };
            }
            if (mode === "mod") {
              return {
                div: null,
                mod: new BN(this.modn(num.words[0]))
              };
            }
            return {
              div: this.divn(num.words[0]),
              mod: new BN(this.modn(num.words[0]))
            };
          }
          return this._wordDiv(num, mode);
        };
        BN.prototype.div = function div(num) {
          return this.divmod(num, "div", false).div;
        };
        BN.prototype.mod = function mod(num) {
          return this.divmod(num, "mod", false).mod;
        };
        BN.prototype.umod = function umod(num) {
          return this.divmod(num, "mod", true).mod;
        };
        BN.prototype.divRound = function divRound(num) {
          var dm = this.divmod(num);
          if (dm.mod.isZero()) return dm.div;
          var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
          var half = num.ushrn(1);
          var r2 = num.andln(1);
          var cmp = mod.cmp(half);
          if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
          return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
        };
        BN.prototype.modn = function modn(num) {
          assert(num <= 67108863);
          var p = (1 << 26) % num;
          var acc = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            acc = (p * acc + (this.words[i] | 0)) % num;
          }
          return acc;
        };
        BN.prototype.idivn = function idivn(num) {
          assert(num <= 67108863);
          var carry = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var w = (this.words[i] | 0) + carry * 67108864;
            this.words[i] = w / num | 0;
            carry = w % num;
          }
          return this.strip();
        };
        BN.prototype.divn = function divn(num) {
          return this.clone().idivn(num);
        };
        BN.prototype.egcd = function egcd(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var x = this;
          var y = p.clone();
          if (x.negative !== 0) {
            x = x.umod(p);
          } else {
            x = x.clone();
          }
          var A = new BN(1);
          var B = new BN(0);
          var C = new BN(0);
          var D = new BN(1);
          var g = 0;
          while (x.isEven() && y.isEven()) {
            x.iushrn(1);
            y.iushrn(1);
            ++g;
          }
          var yp = y.clone();
          var xp = x.clone();
          while (!x.isZero()) {
            for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              x.iushrn(i);
              while (i-- > 0) {
                if (A.isOdd() || B.isOdd()) {
                  A.iadd(yp);
                  B.isub(xp);
                }
                A.iushrn(1);
                B.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              y.iushrn(j);
              while (j-- > 0) {
                if (C.isOdd() || D.isOdd()) {
                  C.iadd(yp);
                  D.isub(xp);
                }
                C.iushrn(1);
                D.iushrn(1);
              }
            }
            if (x.cmp(y) >= 0) {
              x.isub(y);
              A.isub(C);
              B.isub(D);
            } else {
              y.isub(x);
              C.isub(A);
              D.isub(B);
            }
          }
          return {
            a: C,
            b: D,
            gcd: y.iushln(g)
          };
        };
        BN.prototype._invmp = function _invmp(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var a = this;
          var b = p.clone();
          if (a.negative !== 0) {
            a = a.umod(p);
          } else {
            a = a.clone();
          }
          var x1 = new BN(1);
          var x2 = new BN(0);
          var delta = b.clone();
          while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
            for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              a.iushrn(i);
              while (i-- > 0) {
                if (x1.isOdd()) {
                  x1.iadd(delta);
                }
                x1.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              b.iushrn(j);
              while (j-- > 0) {
                if (x2.isOdd()) {
                  x2.iadd(delta);
                }
                x2.iushrn(1);
              }
            }
            if (a.cmp(b) >= 0) {
              a.isub(b);
              x1.isub(x2);
            } else {
              b.isub(a);
              x2.isub(x1);
            }
          }
          var res;
          if (a.cmpn(1) === 0) {
            res = x1;
          } else {
            res = x2;
          }
          if (res.cmpn(0) < 0) {
            res.iadd(p);
          }
          return res;
        };
        BN.prototype.gcd = function gcd(num) {
          if (this.isZero()) return num.abs();
          if (num.isZero()) return this.abs();
          var a = this.clone();
          var b = num.clone();
          a.negative = 0;
          b.negative = 0;
          for (var shift = 0; a.isEven() && b.isEven(); shift++) {
            a.iushrn(1);
            b.iushrn(1);
          }
          do {
            while (a.isEven()) {
              a.iushrn(1);
            }
            while (b.isEven()) {
              b.iushrn(1);
            }
            var r = a.cmp(b);
            if (r < 0) {
              var t = a;
              a = b;
              b = t;
            } else if (r === 0 || b.cmpn(1) === 0) {
              break;
            }
            a.isub(b);
          } while (true);
          return b.iushln(shift);
        };
        BN.prototype.invm = function invm(num) {
          return this.egcd(num).a.umod(num);
        };
        BN.prototype.isEven = function isEven() {
          return (this.words[0] & 1) === 0;
        };
        BN.prototype.isOdd = function isOdd() {
          return (this.words[0] & 1) === 1;
        };
        BN.prototype.andln = function andln(num) {
          return this.words[0] & num;
        };
        BN.prototype.bincn = function bincn(bit) {
          assert(typeof bit === "number");
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) {
            this._expand(s + 1);
            this.words[s] |= q;
            return this;
          }
          var carry = q;
          for (var i = s; carry !== 0 && i < this.length; i++) {
            var w = this.words[i] | 0;
            w += carry;
            carry = w >>> 26;
            w &= 67108863;
            this.words[i] = w;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          return this;
        };
        BN.prototype.isZero = function isZero() {
          return this.length === 1 && this.words[0] === 0;
        };
        BN.prototype.cmpn = function cmpn(num) {
          var negative = num < 0;
          if (this.negative !== 0 && !negative) return -1;
          if (this.negative === 0 && negative) return 1;
          this.strip();
          var res;
          if (this.length > 1) {
            res = 1;
          } else {
            if (negative) {
              num = -num;
            }
            assert(num <= 67108863, "Number is too big");
            var w = this.words[0] | 0;
            res = w === num ? 0 : w < num ? -1 : 1;
          }
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.cmp = function cmp(num) {
          if (this.negative !== 0 && num.negative === 0) return -1;
          if (this.negative === 0 && num.negative !== 0) return 1;
          var res = this.ucmp(num);
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.ucmp = function ucmp(num) {
          if (this.length > num.length) return 1;
          if (this.length < num.length) return -1;
          var res = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var a = this.words[i] | 0;
            var b = num.words[i] | 0;
            if (a === b) continue;
            if (a < b) {
              res = -1;
            } else if (a > b) {
              res = 1;
            }
            break;
          }
          return res;
        };
        BN.prototype.gtn = function gtn(num) {
          return this.cmpn(num) === 1;
        };
        BN.prototype.gt = function gt(num) {
          return this.cmp(num) === 1;
        };
        BN.prototype.gten = function gten(num) {
          return this.cmpn(num) >= 0;
        };
        BN.prototype.gte = function gte(num) {
          return this.cmp(num) >= 0;
        };
        BN.prototype.ltn = function ltn(num) {
          return this.cmpn(num) === -1;
        };
        BN.prototype.lt = function lt(num) {
          return this.cmp(num) === -1;
        };
        BN.prototype.lten = function lten(num) {
          return this.cmpn(num) <= 0;
        };
        BN.prototype.lte = function lte(num) {
          return this.cmp(num) <= 0;
        };
        BN.prototype.eqn = function eqn(num) {
          return this.cmpn(num) === 0;
        };
        BN.prototype.eq = function eq(num) {
          return this.cmp(num) === 0;
        };
        BN.red = function red(num) {
          return new Red(num);
        };
        BN.prototype.toRed = function toRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          assert(this.negative === 0, "red works only with positives");
          return ctx.convertTo(this)._forceRed(ctx);
        };
        BN.prototype.fromRed = function fromRed() {
          assert(this.red, "fromRed works only with numbers in reduction context");
          return this.red.convertFrom(this);
        };
        BN.prototype._forceRed = function _forceRed(ctx) {
          this.red = ctx;
          return this;
        };
        BN.prototype.forceRed = function forceRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          return this._forceRed(ctx);
        };
        BN.prototype.redAdd = function redAdd(num) {
          assert(this.red, "redAdd works only with red numbers");
          return this.red.add(this, num);
        };
        BN.prototype.redIAdd = function redIAdd(num) {
          assert(this.red, "redIAdd works only with red numbers");
          return this.red.iadd(this, num);
        };
        BN.prototype.redSub = function redSub(num) {
          assert(this.red, "redSub works only with red numbers");
          return this.red.sub(this, num);
        };
        BN.prototype.redISub = function redISub(num) {
          assert(this.red, "redISub works only with red numbers");
          return this.red.isub(this, num);
        };
        BN.prototype.redShl = function redShl(num) {
          assert(this.red, "redShl works only with red numbers");
          return this.red.shl(this, num);
        };
        BN.prototype.redMul = function redMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.mul(this, num);
        };
        BN.prototype.redIMul = function redIMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.imul(this, num);
        };
        BN.prototype.redSqr = function redSqr() {
          assert(this.red, "redSqr works only with red numbers");
          this.red._verify1(this);
          return this.red.sqr(this);
        };
        BN.prototype.redISqr = function redISqr() {
          assert(this.red, "redISqr works only with red numbers");
          this.red._verify1(this);
          return this.red.isqr(this);
        };
        BN.prototype.redSqrt = function redSqrt() {
          assert(this.red, "redSqrt works only with red numbers");
          this.red._verify1(this);
          return this.red.sqrt(this);
        };
        BN.prototype.redInvm = function redInvm() {
          assert(this.red, "redInvm works only with red numbers");
          this.red._verify1(this);
          return this.red.invm(this);
        };
        BN.prototype.redNeg = function redNeg() {
          assert(this.red, "redNeg works only with red numbers");
          this.red._verify1(this);
          return this.red.neg(this);
        };
        BN.prototype.redPow = function redPow(num) {
          assert(this.red && !num.red, "redPow(normalNum)");
          this.red._verify1(this);
          return this.red.pow(this, num);
        };
        var primes = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };
        function MPrime(name, p) {
          this.name = name;
          this.p = new BN(p, 16);
          this.n = this.p.bitLength();
          this.k = new BN(1).iushln(this.n).isub(this.p);
          this.tmp = this._tmp();
        }
        MPrime.prototype._tmp = function _tmp() {
          var tmp = new BN(null);
          tmp.words = new Array(Math.ceil(this.n / 13));
          return tmp;
        };
        MPrime.prototype.ireduce = function ireduce(num) {
          var r = num;
          var rlen;
          do {
            this.split(r, this.tmp);
            r = this.imulK(r);
            r = r.iadd(this.tmp);
            rlen = r.bitLength();
          } while (rlen > this.n);
          var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
          if (cmp === 0) {
            r.words[0] = 0;
            r.length = 1;
          } else if (cmp > 0) {
            r.isub(this.p);
          } else {
            if (r.strip !== undefined) {
              r.strip();
            } else {
              r._strip();
            }
          }
          return r;
        };
        MPrime.prototype.split = function split(input, out) {
          input.iushrn(this.n, 0, out);
        };
        MPrime.prototype.imulK = function imulK(num) {
          return num.imul(this.k);
        };
        function K256() {
          MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
        }
        inherits(K256, MPrime);
        K256.prototype.split = function split(input, output) {
          var mask = 4194303;
          var outLen = Math.min(input.length, 9);
          for (var i = 0; i < outLen; i++) {
            output.words[i] = input.words[i];
          }
          output.length = outLen;
          if (input.length <= 9) {
            input.words[0] = 0;
            input.length = 1;
            return;
          }
          var prev = input.words[9];
          output.words[output.length++] = prev & mask;
          for (i = 10; i < input.length; i++) {
            var next = input.words[i] | 0;
            input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
            prev = next;
          }
          prev >>>= 22;
          input.words[i - 10] = prev;
          if (prev === 0 && input.length > 10) {
            input.length -= 10;
          } else {
            input.length -= 9;
          }
        };
        K256.prototype.imulK = function imulK(num) {
          num.words[num.length] = 0;
          num.words[num.length + 1] = 0;
          num.length += 2;
          var lo = 0;
          for (var i = 0; i < num.length; i++) {
            var w = num.words[i] | 0;
            lo += w * 977;
            num.words[i] = lo & 67108863;
            lo = w * 64 + (lo / 67108864 | 0);
          }
          if (num.words[num.length - 1] === 0) {
            num.length--;
            if (num.words[num.length - 1] === 0) {
              num.length--;
            }
          }
          return num;
        };
        function P224() {
          MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
        }
        inherits(P224, MPrime);
        function P192() {
          MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
        }
        inherits(P192, MPrime);
        function P25519() {
          MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
        }
        inherits(P25519, MPrime);
        P25519.prototype.imulK = function imulK(num) {
          var carry = 0;
          for (var i = 0; i < num.length; i++) {
            var hi = (num.words[i] | 0) * 19 + carry;
            var lo = hi & 67108863;
            hi >>>= 26;
            num.words[i] = lo;
            carry = hi;
          }
          if (carry !== 0) {
            num.words[num.length++] = carry;
          }
          return num;
        };
        BN._prime = function prime(name) {
          if (primes[name]) return primes[name];
          var prime;
          if (name === "k256") {
            prime = new K256;
          } else if (name === "p224") {
            prime = new P224;
          } else if (name === "p192") {
            prime = new P192;
          } else if (name === "p25519") {
            prime = new P25519;
          } else {
            throw new Error("Unknown prime " + name);
          }
          primes[name] = prime;
          return prime;
        };
        function Red(m) {
          if (typeof m === "string") {
            var prime = BN._prime(m);
            this.m = prime.p;
            this.prime = prime;
          } else {
            assert(m.gtn(1), "modulus must be greater than 1");
            this.m = m;
            this.prime = null;
          }
        }
        Red.prototype._verify1 = function _verify1(a) {
          assert(a.negative === 0, "red works only with positives");
          assert(a.red, "red works only with red numbers");
        };
        Red.prototype._verify2 = function _verify2(a, b) {
          assert((a.negative | b.negative) === 0, "red works only with positives");
          assert(a.red && a.red === b.red, "red works only with red numbers");
        };
        Red.prototype.imod = function imod(a) {
          if (this.prime) return this.prime.ireduce(a)._forceRed(this);
          return a.umod(this.m)._forceRed(this);
        };
        Red.prototype.neg = function neg(a) {
          if (a.isZero()) {
            return a.clone();
          }
          return this.m.sub(a)._forceRed(this);
        };
        Red.prototype.add = function add(a, b) {
          this._verify2(a, b);
          var res = a.add(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.iadd = function iadd(a, b) {
          this._verify2(a, b);
          var res = a.iadd(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res;
        };
        Red.prototype.sub = function sub(a, b) {
          this._verify2(a, b);
          var res = a.sub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.isub = function isub(a, b) {
          this._verify2(a, b);
          var res = a.isub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res;
        };
        Red.prototype.shl = function shl(a, num) {
          this._verify1(a);
          return this.imod(a.ushln(num));
        };
        Red.prototype.imul = function imul(a, b) {
          this._verify2(a, b);
          return this.imod(a.imul(b));
        };
        Red.prototype.mul = function mul(a, b) {
          this._verify2(a, b);
          return this.imod(a.mul(b));
        };
        Red.prototype.isqr = function isqr(a) {
          return this.imul(a, a.clone());
        };
        Red.prototype.sqr = function sqr(a) {
          return this.mul(a, a);
        };
        Red.prototype.sqrt = function sqrt(a) {
          if (a.isZero()) return a.clone();
          var mod3 = this.m.andln(3);
          assert(mod3 % 2 === 1);
          if (mod3 === 3) {
            var pow = this.m.add(new BN(1)).iushrn(2);
            return this.pow(a, pow);
          }
          var q = this.m.subn(1);
          var s = 0;
          while (!q.isZero() && q.andln(1) === 0) {
            s++;
            q.iushrn(1);
          }
          assert(!q.isZero());
          var one = new BN(1).toRed(this);
          var nOne = one.redNeg();
          var lpow = this.m.subn(1).iushrn(1);
          var z = this.m.bitLength();
          z = new BN(2 * z * z).toRed(this);
          while (this.pow(z, lpow).cmp(nOne) !== 0) {
            z.redIAdd(nOne);
          }
          var c = this.pow(z, q);
          var r = this.pow(a, q.addn(1).iushrn(1));
          var t = this.pow(a, q);
          var m = s;
          while (t.cmp(one) !== 0) {
            var tmp = t;
            for (var i = 0; tmp.cmp(one) !== 0; i++) {
              tmp = tmp.redSqr();
            }
            assert(i < m);
            var b = this.pow(c, new BN(1).iushln(m - i - 1));
            r = r.redMul(b);
            c = b.redSqr();
            t = t.redMul(c);
            m = i;
          }
          return r;
        };
        Red.prototype.invm = function invm(a) {
          var inv = a._invmp(this.m);
          if (inv.negative !== 0) {
            inv.negative = 0;
            return this.imod(inv).redNeg();
          } else {
            return this.imod(inv);
          }
        };
        Red.prototype.pow = function pow(a, num) {
          if (num.isZero()) return new BN(1).toRed(this);
          if (num.cmpn(1) === 0) return a.clone();
          var windowSize = 4;
          var wnd = new Array(1 << windowSize);
          wnd[0] = new BN(1).toRed(this);
          wnd[1] = a;
          for (var i = 2; i < wnd.length; i++) {
            wnd[i] = this.mul(wnd[i - 1], a);
          }
          var res = wnd[0];
          var current = 0;
          var currentLen = 0;
          var start = num.bitLength() % 26;
          if (start === 0) {
            start = 26;
          }
          for (i = num.length - 1; i >= 0; i--) {
            var word = num.words[i];
            for (var j = start - 1; j >= 0; j--) {
              var bit = word >> j & 1;
              if (res !== wnd[0]) {
                res = this.sqr(res);
              }
              if (bit === 0 && current === 0) {
                currentLen = 0;
                continue;
              }
              current <<= 1;
              current |= bit;
              currentLen++;
              if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
              res = this.mul(res, wnd[current]);
              currentLen = 0;
              current = 0;
            }
            start = 26;
          }
          return res;
        };
        Red.prototype.convertTo = function convertTo(num) {
          var r = num.umod(this.m);
          return r === num ? r.clone() : r;
        };
        Red.prototype.convertFrom = function convertFrom(num) {
          var res = num.clone();
          res.red = null;
          return res;
        };
        BN.mont = function mont(num) {
          return new Mont(num);
        };
        function Mont(m) {
          Red.call(this, m);
          this.shift = this.m.bitLength();
          if (this.shift % 26 !== 0) {
            this.shift += 26 - this.shift % 26;
          }
          this.r = new BN(1).iushln(this.shift);
          this.r2 = this.imod(this.r.sqr());
          this.rinv = this.r._invmp(this.m);
          this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
          this.minv = this.minv.umod(this.r);
          this.minv = this.r.sub(this.minv);
        }
        inherits(Mont, Red);
        Mont.prototype.convertTo = function convertTo(num) {
          return this.imod(num.ushln(this.shift));
        };
        Mont.prototype.convertFrom = function convertFrom(num) {
          var r = this.imod(num.mul(this.rinv));
          r.red = null;
          return r;
        };
        Mont.prototype.imul = function imul(a, b) {
          if (a.isZero() || b.isZero()) {
            a.words[0] = 0;
            a.length = 1;
            return a;
          }
          var t = a.imul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.mul = function mul(a, b) {
          if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
          var t = a.mul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.invm = function invm(a) {
          var res = this.imod(a._invmp(this.m).mul(this.r2));
          return res._forceRed(this);
        };
      })(false || module, this);
    },
    7526(__unused_webpack_module, exports) {
      "use strict";
      exports.byteLength = byteLength;
      exports.toByteArray = toByteArray;
      exports.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 len = b64.length;
        if (len % 4 > 0) {
          throw new Error("Invalid string. Length must be a multiple of 4");
        }
        var validLen = b64.indexOf("=");
        if (validLen === -1) validLen = len;
        var placeHoldersLen = validLen === len ? 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 len = placeHoldersLen > 0 ? validLen - 4 : validLen;
        var i;
        for (i = 0; i < len; i += 4) {
          tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
          arr[curByte++] = tmp >> 16 & 255;
          arr[curByte++] = tmp >> 8 & 255;
          arr[curByte++] = tmp & 255;
        }
        if (placeHoldersLen === 2) {
          tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
          arr[curByte++] = tmp & 255;
        }
        if (placeHoldersLen === 1) {
          tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 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 i = start; i < end; i += 3) {
          tmp = (uint8[i] << 16 & 16711680) + (uint8[i + 1] << 8 & 65280) + (uint8[i + 2] & 255);
          output.push(tripletToBase64(tmp));
        }
        return output.join("");
      }
      function fromByteArray(uint8) {
        var tmp;
        var len = uint8.length;
        var extraBytes = len % 3;
        var parts = [];
        var maxChunkLength = 16383;
        for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
          parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
        }
        if (extraBytes === 1) {
          tmp = uint8[len - 1];
          parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==");
        } else if (extraBytes === 2) {
          tmp = (uint8[len - 2] << 8) + uint8[len - 1];
          parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=");
        }
        return parts.join("");
      }
    },
    6104(module, exports) {
      module.exports = " ";
    },
    9674(module) {
      "use strict";
      var ALPHABET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l";
      var ALPHABET_MAP = {};
      for (var z = 0; z < ALPHABET.length; z++) {
        var x = ALPHABET.charAt(z);
        if (ALPHABET_MAP[x] !== undefined) throw new TypeError(x + " is ambiguous");
        ALPHABET_MAP[x] = z;
      }
      function polymodStep(pre) {
        var b = pre >> 25;
        return (pre & 33554431) << 5 ^ -(b >> 0 & 1) & 996825010 ^ -(b >> 1 & 1) & 642813549 ^ -(b >> 2 & 1) & 513874426 ^ -(b >> 3 & 1) & 1027748829 ^ -(b >> 4 & 1) & 705979059;
      }
      function prefixChk(prefix) {
        var chk = 1;
        for (var i = 0; i < prefix.length; ++i) {
          var c = prefix.charCodeAt(i);
          if (c < 33 || c > 126) return "Invalid prefix (" + prefix + ")";
          chk = polymodStep(chk) ^ c >> 5;
        }
        chk = polymodStep(chk);
        for (i = 0; i < prefix.length; ++i) {
          var v = prefix.charCodeAt(i);
          chk = polymodStep(chk) ^ v & 31;
        }
        return chk;
      }
      function encode(prefix, words, LIMIT) {
        LIMIT = LIMIT || 90;
        if (prefix.length + 7 + words.length > LIMIT) throw new TypeError("Exceeds length limit");
        prefix = prefix.toLowerCase();
        var chk = prefixChk(prefix);
        if (typeof chk === "string") throw new Error(chk);
        var result = prefix + "1";
        for (var i = 0; i < words.length; ++i) {
          var x = words[i];
          if (x >> 5 !== 0) throw new Error("Non 5-bit word");
          chk = polymodStep(chk) ^ x;
          result += ALPHABET.charAt(x);
        }
        for (i = 0; i < 6; ++i) {
          chk = polymodStep(chk);
        }
        chk ^= 1;
        for (i = 0; i < 6; ++i) {
          var v = chk >> (5 - i) * 5 & 31;
          result += ALPHABET.charAt(v);
        }
        return result;
      }
      function __decode(str, LIMIT) {
        LIMIT = LIMIT || 90;
        if (str.length < 8) return str + " too short";
        if (str.length > LIMIT) return "Exceeds length limit";
        var lowered = str.toLowerCase();
        var uppered = str.toUpperCase();
        if (str !== lowered && str !== uppered) return "Mixed-case string " + str;
        str = lowered;
        var split = str.lastIndexOf("1");
        if (split === -1) return "No separator character for " + str;
        if (split === 0) return "Missing prefix for " + str;
        var prefix = str.slice(0, split);
        var wordChars = str.slice(split + 1);
        if (wordChars.length < 6) return "Data too short";
        var chk = prefixChk(prefix);
        if (typeof chk === "string") return chk;
        var words = [];
        for (var i = 0; i < wordChars.length; ++i) {
          var c = wordChars.charAt(i);
          var v = ALPHABET_MAP[c];
          if (v === undefined) return "Unknown character " + c;
          chk = polymodStep(chk) ^ v;
          if (i + 6 >= wordChars.length) continue;
          words.push(v);
        }
        if (chk !== 1) return "Invalid checksum for " + str;
        return {
          prefix,
          words
        };
      }
      function decodeUnsafe() {
        var res = __decode.apply(null, arguments);
        if (typeof res === "object") return res;
      }
      function decode(str) {
        var res = __decode.apply(null, arguments);
        if (typeof res === "object") return res;
        throw new Error(res);
      }
      function convert(data, inBits, outBits, pad) {
        var value = 0;
        var bits = 0;
        var maxV = (1 << outBits) - 1;
        var result = [];
        for (var i = 0; i < data.length; ++i) {
          value = value << inBits | data[i];
          bits += inBits;
          while (bits >= outBits) {
            bits -= outBits;
            result.push(value >> bits & maxV);
          }
        }
        if (pad) {
          if (bits > 0) {
            result.push(value << outBits - bits & maxV);
          }
        } else {
          if (bits >= inBits) return "Excess padding";
          if (value << outBits - bits & maxV) return "Non-zero padding";
        }
        return result;
      }
      function toWordsUnsafe(bytes) {
        var res = convert(bytes, 8, 5, true);
        if (Array.isArray(res)) return res;
      }
      function toWords(bytes) {
        var res = convert(bytes, 8, 5, true);
        if (Array.isArray(res)) return res;
        throw new Error(res);
      }
      function fromWordsUnsafe(words) {
        var res = convert(words, 5, 8, false);
        if (Array.isArray(res)) return res;
      }
      function fromWords(words) {
        var res = convert(words, 5, 8, false);
        if (Array.isArray(res)) return res;
        throw new Error(res);
      }
      module.exports = {
        decodeUnsafe,
        decode,
        encode,
        toWordsUnsafe,
        toWords,
        fromWordsUnsafe,
        fromWords
      };
    },
    9404(module, __unused_webpack_exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      (function(module, exports) {
        "use strict";
        function assert(val, msg) {
          if (!val) throw new Error(msg || "Assertion failed");
        }
        function inherits(ctor, superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {};
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor;
          ctor.prototype.constructor = ctor;
        }
        function BN(number, base, endian) {
          if (BN.isBN(number)) {
            return number;
          }
          this.negative = 0;
          this.words = null;
          this.length = 0;
          this.red = null;
          if (number !== null) {
            if (base === "le" || base === "be") {
              endian = base;
              base = 10;
            }
            this._init(number || 0, base || 10, endian || "be");
          }
        }
        if (typeof module === "object") {
          module.exports = BN;
        } else {
          exports.BN = BN;
        }
        BN.BN = BN;
        BN.wordSize = 26;
        var Buffer;
        try {
          if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
            Buffer = window.Buffer;
          } else {
            Buffer = __webpack_require__(7790).Buffer;
          }
        } catch (e) {}
        BN.isBN = function isBN(num) {
          if (num instanceof BN) {
            return true;
          }
          return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
        };
        BN.max = function max(left, right) {
          if (left.cmp(right) > 0) return left;
          return right;
        };
        BN.min = function min(left, right) {
          if (left.cmp(right) < 0) return left;
          return right;
        };
        BN.prototype._init = function init(number, base, endian) {
          if (typeof number === "number") {
            return this._initNumber(number, base, endian);
          }
          if (typeof number === "object") {
            return this._initArray(number, base, endian);
          }
          if (base === "hex") {
            base = 16;
          }
          assert(base === (base | 0) && base >= 2 && base <= 36);
          number = number.toString().replace(/\s+/g, "");
          var start = 0;
          if (number[0] === "-") {
            start++;
            this.negative = 1;
          }
          if (start < number.length) {
            if (base === 16) {
              this._parseHex(number, start, endian);
            } else {
              this._parseBase(number, base, start);
              if (endian === "le") {
                this._initArray(this.toArray(), base, endian);
              }
            }
          }
        };
        BN.prototype._initNumber = function _initNumber(number, base, endian) {
          if (number < 0) {
            this.negative = 1;
            number = -number;
          }
          if (number < 67108864) {
            this.words = [ number & 67108863 ];
            this.length = 1;
          } else if (number < 4503599627370496) {
            this.words = [ number & 67108863, number / 67108864 & 67108863 ];
            this.length = 2;
          } else {
            assert(number < 9007199254740992);
            this.words = [ number & 67108863, number / 67108864 & 67108863, 1 ];
            this.length = 3;
          }
          if (endian !== "le") return;
          this._initArray(this.toArray(), base, endian);
        };
        BN.prototype._initArray = function _initArray(number, base, endian) {
          assert(typeof number.length === "number");
          if (number.length <= 0) {
            this.words = [ 0 ];
            this.length = 1;
            return this;
          }
          this.length = Math.ceil(number.length / 3);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var j, w;
          var off = 0;
          if (endian === "be") {
            for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
              w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          } else if (endian === "le") {
            for (i = 0, j = 0; i < number.length; i += 3) {
              w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          }
          return this._strip();
        };
        function parseHex4Bits(string, index) {
          var c = string.charCodeAt(index);
          if (c >= 48 && c <= 57) {
            return c - 48;
          } else if (c >= 65 && c <= 70) {
            return c - 55;
          } else if (c >= 97 && c <= 102) {
            return c - 87;
          } else {
            assert(false, "Invalid character in " + string);
          }
        }
        function parseHexByte(string, lowerBound, index) {
          var r = parseHex4Bits(string, index);
          if (index - 1 >= lowerBound) {
            r |= parseHex4Bits(string, index - 1) << 4;
          }
          return r;
        }
        BN.prototype._parseHex = function _parseHex(number, start, endian) {
          this.length = Math.ceil((number.length - start) / 6);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var off = 0;
          var j = 0;
          var w;
          if (endian === "be") {
            for (i = number.length - 1; i >= start; i -= 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          } else {
            var parseLength = number.length - start;
            for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          }
          this._strip();
        };
        function parseBase(str, start, end, mul) {
          var r = 0;
          var b = 0;
          var len = Math.min(str.length, end);
          for (var i = start; i < len; i++) {
            var c = str.charCodeAt(i) - 48;
            r *= mul;
            if (c >= 49) {
              b = c - 49 + 10;
            } else if (c >= 17) {
              b = c - 17 + 10;
            } else {
              b = c;
            }
            assert(c >= 0 && b < mul, "Invalid character");
            r += b;
          }
          return r;
        }
        BN.prototype._parseBase = function _parseBase(number, base, start) {
          this.words = [ 0 ];
          this.length = 1;
          for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
            limbLen++;
          }
          limbLen--;
          limbPow = limbPow / base | 0;
          var total = number.length - start;
          var mod = total % limbLen;
          var end = Math.min(total, total - mod) + start;
          var word = 0;
          for (var i = start; i < end; i += limbLen) {
            word = parseBase(number, i, i + limbLen, base);
            this.imuln(limbPow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          if (mod !== 0) {
            var pow = 1;
            word = parseBase(number, i, number.length, base);
            for (i = 0; i < mod; i++) {
              pow *= base;
            }
            this.imuln(pow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          this._strip();
        };
        BN.prototype.copy = function copy(dest) {
          dest.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            dest.words[i] = this.words[i];
          }
          dest.length = this.length;
          dest.negative = this.negative;
          dest.red = this.red;
        };
        function move(dest, src) {
          dest.words = src.words;
          dest.length = src.length;
          dest.negative = src.negative;
          dest.red = src.red;
        }
        BN.prototype._move = function _move(dest) {
          move(dest, this);
        };
        BN.prototype.clone = function clone() {
          var r = new BN(null);
          this.copy(r);
          return r;
        };
        BN.prototype._expand = function _expand(size) {
          while (this.length < size) {
            this.words[this.length++] = 0;
          }
          return this;
        };
        BN.prototype._strip = function strip() {
          while (this.length > 1 && this.words[this.length - 1] === 0) {
            this.length--;
          }
          return this._normSign();
        };
        BN.prototype._normSign = function _normSign() {
          if (this.length === 1 && this.words[0] === 0) {
            this.negative = 0;
          }
          return this;
        };
        if (typeof Symbol !== "undefined" && typeof Symbol.for === "function") {
          try {
            BN.prototype[Symbol.for("nodejs.util.inspect.custom")] = inspect;
          } catch (e) {
            BN.prototype.inspect = inspect;
          }
        } else {
          BN.prototype.inspect = inspect;
        }
        function inspect() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
        }
        var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ];
        var groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];
        var groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ];
        BN.prototype.toString = function toString(base, padding) {
          base = base || 10;
          padding = padding | 0 || 1;
          var out;
          if (base === 16 || base === "hex") {
            out = "";
            var off = 0;
            var carry = 0;
            for (var i = 0; i < this.length; i++) {
              var w = this.words[i];
              var word = ((w << off | carry) & 16777215).toString(16);
              carry = w >>> 24 - off & 16777215;
              off += 2;
              if (off >= 26) {
                off -= 26;
                i--;
              }
              if (carry !== 0 || i !== this.length - 1) {
                out = zeros[6 - word.length] + word + out;
              } else {
                out = word + out;
              }
            }
            if (carry !== 0) {
              out = carry.toString(16) + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          if (base === (base | 0) && base >= 2 && base <= 36) {
            var groupSize = groupSizes[base];
            var groupBase = groupBases[base];
            out = "";
            var c = this.clone();
            c.negative = 0;
            while (!c.isZero()) {
              var r = c.modrn(groupBase).toString(base);
              c = c.idivn(groupBase);
              if (!c.isZero()) {
                out = zeros[groupSize - r.length] + r + out;
              } else {
                out = r + out;
              }
            }
            if (this.isZero()) {
              out = "0" + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          assert(false, "Base should be between 2 and 36");
        };
        BN.prototype.toNumber = function toNumber() {
          var ret = this.words[0];
          if (this.length === 2) {
            ret += this.words[1] * 67108864;
          } else if (this.length === 3 && this.words[2] === 1) {
            ret += 4503599627370496 + this.words[1] * 67108864;
          } else if (this.length > 2) {
            assert(false, "Number can only safely store up to 53 bits");
          }
          return this.negative !== 0 ? -ret : ret;
        };
        BN.prototype.toJSON = function toJSON() {
          return this.toString(16, 2);
        };
        if (Buffer) {
          BN.prototype.toBuffer = function toBuffer(endian, length) {
            return this.toArrayLike(Buffer, endian, length);
          };
        }
        BN.prototype.toArray = function toArray(endian, length) {
          return this.toArrayLike(Array, endian, length);
        };
        var allocate = function allocate(ArrayType, size) {
          if (ArrayType.allocUnsafe) {
            return ArrayType.allocUnsafe(size);
          }
          return new ArrayType(size);
        };
        BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
          this._strip();
          var byteLength = this.byteLength();
          var reqLength = length || Math.max(1, byteLength);
          assert(byteLength <= reqLength, "byte array longer than desired length");
          assert(reqLength > 0, "Requested array length <= 0");
          var res = allocate(ArrayType, reqLength);
          var postfix = endian === "le" ? "LE" : "BE";
          this["_toArrayLike" + postfix](res, byteLength);
          return res;
        };
        BN.prototype._toArrayLikeLE = function _toArrayLikeLE(res, byteLength) {
          var position = 0;
          var carry = 0;
          for (var i = 0, shift = 0; i < this.length; i++) {
            var word = this.words[i] << shift | carry;
            res[position++] = word & 255;
            if (position < res.length) {
              res[position++] = word >> 8 & 255;
            }
            if (position < res.length) {
              res[position++] = word >> 16 & 255;
            }
            if (shift === 6) {
              if (position < res.length) {
                res[position++] = word >> 24 & 255;
              }
              carry = 0;
              shift = 0;
            } else {
              carry = word >>> 24;
              shift += 2;
            }
          }
          if (position < res.length) {
            res[position++] = carry;
            while (position < res.length) {
              res[position++] = 0;
            }
          }
        };
        BN.prototype._toArrayLikeBE = function _toArrayLikeBE(res, byteLength) {
          var position = res.length - 1;
          var carry = 0;
          for (var i = 0, shift = 0; i < this.length; i++) {
            var word = this.words[i] << shift | carry;
            res[position--] = word & 255;
            if (position >= 0) {
              res[position--] = word >> 8 & 255;
            }
            if (position >= 0) {
              res[position--] = word >> 16 & 255;
            }
            if (shift === 6) {
              if (position >= 0) {
                res[position--] = word >> 24 & 255;
              }
              carry = 0;
              shift = 0;
            } else {
              carry = word >>> 24;
              shift += 2;
            }
          }
          if (position >= 0) {
            res[position--] = carry;
            while (position >= 0) {
              res[position--] = 0;
            }
          }
        };
        if (Math.clz32) {
          BN.prototype._countBits = function _countBits(w) {
            return 32 - Math.clz32(w);
          };
        } else {
          BN.prototype._countBits = function _countBits(w) {
            var t = w;
            var r = 0;
            if (t >= 4096) {
              r += 13;
              t >>>= 13;
            }
            if (t >= 64) {
              r += 7;
              t >>>= 7;
            }
            if (t >= 8) {
              r += 4;
              t >>>= 4;
            }
            if (t >= 2) {
              r += 2;
              t >>>= 2;
            }
            return r + t;
          };
        }
        BN.prototype._zeroBits = function _zeroBits(w) {
          if (w === 0) return 26;
          var t = w;
          var r = 0;
          if ((t & 8191) === 0) {
            r += 13;
            t >>>= 13;
          }
          if ((t & 127) === 0) {
            r += 7;
            t >>>= 7;
          }
          if ((t & 15) === 0) {
            r += 4;
            t >>>= 4;
          }
          if ((t & 3) === 0) {
            r += 2;
            t >>>= 2;
          }
          if ((t & 1) === 0) {
            r++;
          }
          return r;
        };
        BN.prototype.bitLength = function bitLength() {
          var w = this.words[this.length - 1];
          var hi = this._countBits(w);
          return (this.length - 1) * 26 + hi;
        };
        function toBitArray(num) {
          var w = new Array(num.bitLength());
          for (var bit = 0; bit < w.length; bit++) {
            var off = bit / 26 | 0;
            var wbit = bit % 26;
            w[bit] = num.words[off] >>> wbit & 1;
          }
          return w;
        }
        BN.prototype.zeroBits = function zeroBits() {
          if (this.isZero()) return 0;
          var r = 0;
          for (var i = 0; i < this.length; i++) {
            var b = this._zeroBits(this.words[i]);
            r += b;
            if (b !== 26) break;
          }
          return r;
        };
        BN.prototype.byteLength = function byteLength() {
          return Math.ceil(this.bitLength() / 8);
        };
        BN.prototype.toTwos = function toTwos(width) {
          if (this.negative !== 0) {
            return this.abs().inotn(width).iaddn(1);
          }
          return this.clone();
        };
        BN.prototype.fromTwos = function fromTwos(width) {
          if (this.testn(width - 1)) {
            return this.notn(width).iaddn(1).ineg();
          }
          return this.clone();
        };
        BN.prototype.isNeg = function isNeg() {
          return this.negative !== 0;
        };
        BN.prototype.neg = function neg() {
          return this.clone().ineg();
        };
        BN.prototype.ineg = function ineg() {
          if (!this.isZero()) {
            this.negative ^= 1;
          }
          return this;
        };
        BN.prototype.iuor = function iuor(num) {
          while (this.length < num.length) {
            this.words[this.length++] = 0;
          }
          for (var i = 0; i < num.length; i++) {
            this.words[i] = this.words[i] | num.words[i];
          }
          return this._strip();
        };
        BN.prototype.ior = function ior(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuor(num);
        };
        BN.prototype.or = function or(num) {
          if (this.length > num.length) return this.clone().ior(num);
          return num.clone().ior(this);
        };
        BN.prototype.uor = function uor(num) {
          if (this.length > num.length) return this.clone().iuor(num);
          return num.clone().iuor(this);
        };
        BN.prototype.iuand = function iuand(num) {
          var b;
          if (this.length > num.length) {
            b = num;
          } else {
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = this.words[i] & num.words[i];
          }
          this.length = b.length;
          return this._strip();
        };
        BN.prototype.iand = function iand(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuand(num);
        };
        BN.prototype.and = function and(num) {
          if (this.length > num.length) return this.clone().iand(num);
          return num.clone().iand(this);
        };
        BN.prototype.uand = function uand(num) {
          if (this.length > num.length) return this.clone().iuand(num);
          return num.clone().iuand(this);
        };
        BN.prototype.iuxor = function iuxor(num) {
          var a;
          var b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = a.words[i] ^ b.words[i];
          }
          if (this !== a) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = a.length;
          return this._strip();
        };
        BN.prototype.ixor = function ixor(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuxor(num);
        };
        BN.prototype.xor = function xor(num) {
          if (this.length > num.length) return this.clone().ixor(num);
          return num.clone().ixor(this);
        };
        BN.prototype.uxor = function uxor(num) {
          if (this.length > num.length) return this.clone().iuxor(num);
          return num.clone().iuxor(this);
        };
        BN.prototype.inotn = function inotn(width) {
          assert(typeof width === "number" && width >= 0);
          var bytesNeeded = Math.ceil(width / 26) | 0;
          var bitsLeft = width % 26;
          this._expand(bytesNeeded);
          if (bitsLeft > 0) {
            bytesNeeded--;
          }
          for (var i = 0; i < bytesNeeded; i++) {
            this.words[i] = ~this.words[i] & 67108863;
          }
          if (bitsLeft > 0) {
            this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
          }
          return this._strip();
        };
        BN.prototype.notn = function notn(width) {
          return this.clone().inotn(width);
        };
        BN.prototype.setn = function setn(bit, val) {
          assert(typeof bit === "number" && bit >= 0);
          var off = bit / 26 | 0;
          var wbit = bit % 26;
          this._expand(off + 1);
          if (val) {
            this.words[off] = this.words[off] | 1 << wbit;
          } else {
            this.words[off] = this.words[off] & ~(1 << wbit);
          }
          return this._strip();
        };
        BN.prototype.iadd = function iadd(num) {
          var r;
          if (this.negative !== 0 && num.negative === 0) {
            this.negative = 0;
            r = this.isub(num);
            this.negative ^= 1;
            return this._normSign();
          } else if (this.negative === 0 && num.negative !== 0) {
            num.negative = 0;
            r = this.isub(num);
            num.negative = 1;
            return r._normSign();
          }
          var a, b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          this.length = a.length;
          if (carry !== 0) {
            this.words[this.length] = carry;
            this.length++;
          } else if (a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          return this;
        };
        BN.prototype.add = function add(num) {
          var res;
          if (num.negative !== 0 && this.negative === 0) {
            num.negative = 0;
            res = this.sub(num);
            num.negative ^= 1;
            return res;
          } else if (num.negative === 0 && this.negative !== 0) {
            this.negative = 0;
            res = num.sub(this);
            this.negative = 1;
            return res;
          }
          if (this.length > num.length) return this.clone().iadd(num);
          return num.clone().iadd(this);
        };
        BN.prototype.isub = function isub(num) {
          if (num.negative !== 0) {
            num.negative = 0;
            var r = this.iadd(num);
            num.negative = 1;
            return r._normSign();
          } else if (this.negative !== 0) {
            this.negative = 0;
            this.iadd(num);
            this.negative = 1;
            return this._normSign();
          }
          var cmp = this.cmp(num);
          if (cmp === 0) {
            this.negative = 0;
            this.length = 1;
            this.words[0] = 0;
            return this;
          }
          var a, b;
          if (cmp > 0) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          if (carry === 0 && i < a.length && a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = Math.max(this.length, i);
          if (a !== this) {
            this.negative = 1;
          }
          return this._strip();
        };
        BN.prototype.sub = function sub(num) {
          return this.clone().isub(num);
        };
        function smallMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          var len = self.length + num.length | 0;
          out.length = len;
          len = len - 1 | 0;
          var a = self.words[0] | 0;
          var b = num.words[0] | 0;
          var r = a * b;
          var lo = r & 67108863;
          var carry = r / 67108864 | 0;
          out.words[0] = lo;
          for (var k = 1; k < len; k++) {
            var ncarry = carry >>> 26;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j | 0;
              a = self.words[i] | 0;
              b = num.words[j] | 0;
              r = a * b + rword;
              ncarry += r / 67108864 | 0;
              rword = r & 67108863;
            }
            out.words[k] = rword | 0;
            carry = ncarry | 0;
          }
          if (carry !== 0) {
            out.words[k] = carry | 0;
          } else {
            out.length--;
          }
          return out._strip();
        }
        var comb10MulTo = function comb10MulTo(self, num, out) {
          var a = self.words;
          var b = num.words;
          var o = out.words;
          var c = 0;
          var lo;
          var mid;
          var hi;
          var a0 = a[0] | 0;
          var al0 = a0 & 8191;
          var ah0 = a0 >>> 13;
          var a1 = a[1] | 0;
          var al1 = a1 & 8191;
          var ah1 = a1 >>> 13;
          var a2 = a[2] | 0;
          var al2 = a2 & 8191;
          var ah2 = a2 >>> 13;
          var a3 = a[3] | 0;
          var al3 = a3 & 8191;
          var ah3 = a3 >>> 13;
          var a4 = a[4] | 0;
          var al4 = a4 & 8191;
          var ah4 = a4 >>> 13;
          var a5 = a[5] | 0;
          var al5 = a5 & 8191;
          var ah5 = a5 >>> 13;
          var a6 = a[6] | 0;
          var al6 = a6 & 8191;
          var ah6 = a6 >>> 13;
          var a7 = a[7] | 0;
          var al7 = a7 & 8191;
          var ah7 = a7 >>> 13;
          var a8 = a[8] | 0;
          var al8 = a8 & 8191;
          var ah8 = a8 >>> 13;
          var a9 = a[9] | 0;
          var al9 = a9 & 8191;
          var ah9 = a9 >>> 13;
          var b0 = b[0] | 0;
          var bl0 = b0 & 8191;
          var bh0 = b0 >>> 13;
          var b1 = b[1] | 0;
          var bl1 = b1 & 8191;
          var bh1 = b1 >>> 13;
          var b2 = b[2] | 0;
          var bl2 = b2 & 8191;
          var bh2 = b2 >>> 13;
          var b3 = b[3] | 0;
          var bl3 = b3 & 8191;
          var bh3 = b3 >>> 13;
          var b4 = b[4] | 0;
          var bl4 = b4 & 8191;
          var bh4 = b4 >>> 13;
          var b5 = b[5] | 0;
          var bl5 = b5 & 8191;
          var bh5 = b5 >>> 13;
          var b6 = b[6] | 0;
          var bl6 = b6 & 8191;
          var bh6 = b6 >>> 13;
          var b7 = b[7] | 0;
          var bl7 = b7 & 8191;
          var bh7 = b7 >>> 13;
          var b8 = b[8] | 0;
          var bl8 = b8 & 8191;
          var bh8 = b8 >>> 13;
          var b9 = b[9] | 0;
          var bl9 = b9 & 8191;
          var bh9 = b9 >>> 13;
          out.negative = self.negative ^ num.negative;
          out.length = 19;
          lo = Math.imul(al0, bl0);
          mid = Math.imul(al0, bh0);
          mid = mid + Math.imul(ah0, bl0) | 0;
          hi = Math.imul(ah0, bh0);
          var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
          w0 &= 67108863;
          lo = Math.imul(al1, bl0);
          mid = Math.imul(al1, bh0);
          mid = mid + Math.imul(ah1, bl0) | 0;
          hi = Math.imul(ah1, bh0);
          lo = lo + Math.imul(al0, bl1) | 0;
          mid = mid + Math.imul(al0, bh1) | 0;
          mid = mid + Math.imul(ah0, bl1) | 0;
          hi = hi + Math.imul(ah0, bh1) | 0;
          var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
          w1 &= 67108863;
          lo = Math.imul(al2, bl0);
          mid = Math.imul(al2, bh0);
          mid = mid + Math.imul(ah2, bl0) | 0;
          hi = Math.imul(ah2, bh0);
          lo = lo + Math.imul(al1, bl1) | 0;
          mid = mid + Math.imul(al1, bh1) | 0;
          mid = mid + Math.imul(ah1, bl1) | 0;
          hi = hi + Math.imul(ah1, bh1) | 0;
          lo = lo + Math.imul(al0, bl2) | 0;
          mid = mid + Math.imul(al0, bh2) | 0;
          mid = mid + Math.imul(ah0, bl2) | 0;
          hi = hi + Math.imul(ah0, bh2) | 0;
          var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
          w2 &= 67108863;
          lo = Math.imul(al3, bl0);
          mid = Math.imul(al3, bh0);
          mid = mid + Math.imul(ah3, bl0) | 0;
          hi = Math.imul(ah3, bh0);
          lo = lo + Math.imul(al2, bl1) | 0;
          mid = mid + Math.imul(al2, bh1) | 0;
          mid = mid + Math.imul(ah2, bl1) | 0;
          hi = hi + Math.imul(ah2, bh1) | 0;
          lo = lo + Math.imul(al1, bl2) | 0;
          mid = mid + Math.imul(al1, bh2) | 0;
          mid = mid + Math.imul(ah1, bl2) | 0;
          hi = hi + Math.imul(ah1, bh2) | 0;
          lo = lo + Math.imul(al0, bl3) | 0;
          mid = mid + Math.imul(al0, bh3) | 0;
          mid = mid + Math.imul(ah0, bl3) | 0;
          hi = hi + Math.imul(ah0, bh3) | 0;
          var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
          w3 &= 67108863;
          lo = Math.imul(al4, bl0);
          mid = Math.imul(al4, bh0);
          mid = mid + Math.imul(ah4, bl0) | 0;
          hi = Math.imul(ah4, bh0);
          lo = lo + Math.imul(al3, bl1) | 0;
          mid = mid + Math.imul(al3, bh1) | 0;
          mid = mid + Math.imul(ah3, bl1) | 0;
          hi = hi + Math.imul(ah3, bh1) | 0;
          lo = lo + Math.imul(al2, bl2) | 0;
          mid = mid + Math.imul(al2, bh2) | 0;
          mid = mid + Math.imul(ah2, bl2) | 0;
          hi = hi + Math.imul(ah2, bh2) | 0;
          lo = lo + Math.imul(al1, bl3) | 0;
          mid = mid + Math.imul(al1, bh3) | 0;
          mid = mid + Math.imul(ah1, bl3) | 0;
          hi = hi + Math.imul(ah1, bh3) | 0;
          lo = lo + Math.imul(al0, bl4) | 0;
          mid = mid + Math.imul(al0, bh4) | 0;
          mid = mid + Math.imul(ah0, bl4) | 0;
          hi = hi + Math.imul(ah0, bh4) | 0;
          var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
          w4 &= 67108863;
          lo = Math.imul(al5, bl0);
          mid = Math.imul(al5, bh0);
          mid = mid + Math.imul(ah5, bl0) | 0;
          hi = Math.imul(ah5, bh0);
          lo = lo + Math.imul(al4, bl1) | 0;
          mid = mid + Math.imul(al4, bh1) | 0;
          mid = mid + Math.imul(ah4, bl1) | 0;
          hi = hi + Math.imul(ah4, bh1) | 0;
          lo = lo + Math.imul(al3, bl2) | 0;
          mid = mid + Math.imul(al3, bh2) | 0;
          mid = mid + Math.imul(ah3, bl2) | 0;
          hi = hi + Math.imul(ah3, bh2) | 0;
          lo = lo + Math.imul(al2, bl3) | 0;
          mid = mid + Math.imul(al2, bh3) | 0;
          mid = mid + Math.imul(ah2, bl3) | 0;
          hi = hi + Math.imul(ah2, bh3) | 0;
          lo = lo + Math.imul(al1, bl4) | 0;
          mid = mid + Math.imul(al1, bh4) | 0;
          mid = mid + Math.imul(ah1, bl4) | 0;
          hi = hi + Math.imul(ah1, bh4) | 0;
          lo = lo + Math.imul(al0, bl5) | 0;
          mid = mid + Math.imul(al0, bh5) | 0;
          mid = mid + Math.imul(ah0, bl5) | 0;
          hi = hi + Math.imul(ah0, bh5) | 0;
          var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
          w5 &= 67108863;
          lo = Math.imul(al6, bl0);
          mid = Math.imul(al6, bh0);
          mid = mid + Math.imul(ah6, bl0) | 0;
          hi = Math.imul(ah6, bh0);
          lo = lo + Math.imul(al5, bl1) | 0;
          mid = mid + Math.imul(al5, bh1) | 0;
          mid = mid + Math.imul(ah5, bl1) | 0;
          hi = hi + Math.imul(ah5, bh1) | 0;
          lo = lo + Math.imul(al4, bl2) | 0;
          mid = mid + Math.imul(al4, bh2) | 0;
          mid = mid + Math.imul(ah4, bl2) | 0;
          hi = hi + Math.imul(ah4, bh2) | 0;
          lo = lo + Math.imul(al3, bl3) | 0;
          mid = mid + Math.imul(al3, bh3) | 0;
          mid = mid + Math.imul(ah3, bl3) | 0;
          hi = hi + Math.imul(ah3, bh3) | 0;
          lo = lo + Math.imul(al2, bl4) | 0;
          mid = mid + Math.imul(al2, bh4) | 0;
          mid = mid + Math.imul(ah2, bl4) | 0;
          hi = hi + Math.imul(ah2, bh4) | 0;
          lo = lo + Math.imul(al1, bl5) | 0;
          mid = mid + Math.imul(al1, bh5) | 0;
          mid = mid + Math.imul(ah1, bl5) | 0;
          hi = hi + Math.imul(ah1, bh5) | 0;
          lo = lo + Math.imul(al0, bl6) | 0;
          mid = mid + Math.imul(al0, bh6) | 0;
          mid = mid + Math.imul(ah0, bl6) | 0;
          hi = hi + Math.imul(ah0, bh6) | 0;
          var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
          w6 &= 67108863;
          lo = Math.imul(al7, bl0);
          mid = Math.imul(al7, bh0);
          mid = mid + Math.imul(ah7, bl0) | 0;
          hi = Math.imul(ah7, bh0);
          lo = lo + Math.imul(al6, bl1) | 0;
          mid = mid + Math.imul(al6, bh1) | 0;
          mid = mid + Math.imul(ah6, bl1) | 0;
          hi = hi + Math.imul(ah6, bh1) | 0;
          lo = lo + Math.imul(al5, bl2) | 0;
          mid = mid + Math.imul(al5, bh2) | 0;
          mid = mid + Math.imul(ah5, bl2) | 0;
          hi = hi + Math.imul(ah5, bh2) | 0;
          lo = lo + Math.imul(al4, bl3) | 0;
          mid = mid + Math.imul(al4, bh3) | 0;
          mid = mid + Math.imul(ah4, bl3) | 0;
          hi = hi + Math.imul(ah4, bh3) | 0;
          lo = lo + Math.imul(al3, bl4) | 0;
          mid = mid + Math.imul(al3, bh4) | 0;
          mid = mid + Math.imul(ah3, bl4) | 0;
          hi = hi + Math.imul(ah3, bh4) | 0;
          lo = lo + Math.imul(al2, bl5) | 0;
          mid = mid + Math.imul(al2, bh5) | 0;
          mid = mid + Math.imul(ah2, bl5) | 0;
          hi = hi + Math.imul(ah2, bh5) | 0;
          lo = lo + Math.imul(al1, bl6) | 0;
          mid = mid + Math.imul(al1, bh6) | 0;
          mid = mid + Math.imul(ah1, bl6) | 0;
          hi = hi + Math.imul(ah1, bh6) | 0;
          lo = lo + Math.imul(al0, bl7) | 0;
          mid = mid + Math.imul(al0, bh7) | 0;
          mid = mid + Math.imul(ah0, bl7) | 0;
          hi = hi + Math.imul(ah0, bh7) | 0;
          var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
          w7 &= 67108863;
          lo = Math.imul(al8, bl0);
          mid = Math.imul(al8, bh0);
          mid = mid + Math.imul(ah8, bl0) | 0;
          hi = Math.imul(ah8, bh0);
          lo = lo + Math.imul(al7, bl1) | 0;
          mid = mid + Math.imul(al7, bh1) | 0;
          mid = mid + Math.imul(ah7, bl1) | 0;
          hi = hi + Math.imul(ah7, bh1) | 0;
          lo = lo + Math.imul(al6, bl2) | 0;
          mid = mid + Math.imul(al6, bh2) | 0;
          mid = mid + Math.imul(ah6, bl2) | 0;
          hi = hi + Math.imul(ah6, bh2) | 0;
          lo = lo + Math.imul(al5, bl3) | 0;
          mid = mid + Math.imul(al5, bh3) | 0;
          mid = mid + Math.imul(ah5, bl3) | 0;
          hi = hi + Math.imul(ah5, bh3) | 0;
          lo = lo + Math.imul(al4, bl4) | 0;
          mid = mid + Math.imul(al4, bh4) | 0;
          mid = mid + Math.imul(ah4, bl4) | 0;
          hi = hi + Math.imul(ah4, bh4) | 0;
          lo = lo + Math.imul(al3, bl5) | 0;
          mid = mid + Math.imul(al3, bh5) | 0;
          mid = mid + Math.imul(ah3, bl5) | 0;
          hi = hi + Math.imul(ah3, bh5) | 0;
          lo = lo + Math.imul(al2, bl6) | 0;
          mid = mid + Math.imul(al2, bh6) | 0;
          mid = mid + Math.imul(ah2, bl6) | 0;
          hi = hi + Math.imul(ah2, bh6) | 0;
          lo = lo + Math.imul(al1, bl7) | 0;
          mid = mid + Math.imul(al1, bh7) | 0;
          mid = mid + Math.imul(ah1, bl7) | 0;
          hi = hi + Math.imul(ah1, bh7) | 0;
          lo = lo + Math.imul(al0, bl8) | 0;
          mid = mid + Math.imul(al0, bh8) | 0;
          mid = mid + Math.imul(ah0, bl8) | 0;
          hi = hi + Math.imul(ah0, bh8) | 0;
          var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
          w8 &= 67108863;
          lo = Math.imul(al9, bl0);
          mid = Math.imul(al9, bh0);
          mid = mid + Math.imul(ah9, bl0) | 0;
          hi = Math.imul(ah9, bh0);
          lo = lo + Math.imul(al8, bl1) | 0;
          mid = mid + Math.imul(al8, bh1) | 0;
          mid = mid + Math.imul(ah8, bl1) | 0;
          hi = hi + Math.imul(ah8, bh1) | 0;
          lo = lo + Math.imul(al7, bl2) | 0;
          mid = mid + Math.imul(al7, bh2) | 0;
          mid = mid + Math.imul(ah7, bl2) | 0;
          hi = hi + Math.imul(ah7, bh2) | 0;
          lo = lo + Math.imul(al6, bl3) | 0;
          mid = mid + Math.imul(al6, bh3) | 0;
          mid = mid + Math.imul(ah6, bl3) | 0;
          hi = hi + Math.imul(ah6, bh3) | 0;
          lo = lo + Math.imul(al5, bl4) | 0;
          mid = mid + Math.imul(al5, bh4) | 0;
          mid = mid + Math.imul(ah5, bl4) | 0;
          hi = hi + Math.imul(ah5, bh4) | 0;
          lo = lo + Math.imul(al4, bl5) | 0;
          mid = mid + Math.imul(al4, bh5) | 0;
          mid = mid + Math.imul(ah4, bl5) | 0;
          hi = hi + Math.imul(ah4, bh5) | 0;
          lo = lo + Math.imul(al3, bl6) | 0;
          mid = mid + Math.imul(al3, bh6) | 0;
          mid = mid + Math.imul(ah3, bl6) | 0;
          hi = hi + Math.imul(ah3, bh6) | 0;
          lo = lo + Math.imul(al2, bl7) | 0;
          mid = mid + Math.imul(al2, bh7) | 0;
          mid = mid + Math.imul(ah2, bl7) | 0;
          hi = hi + Math.imul(ah2, bh7) | 0;
          lo = lo + Math.imul(al1, bl8) | 0;
          mid = mid + Math.imul(al1, bh8) | 0;
          mid = mid + Math.imul(ah1, bl8) | 0;
          hi = hi + Math.imul(ah1, bh8) | 0;
          lo = lo + Math.imul(al0, bl9) | 0;
          mid = mid + Math.imul(al0, bh9) | 0;
          mid = mid + Math.imul(ah0, bl9) | 0;
          hi = hi + Math.imul(ah0, bh9) | 0;
          var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
          w9 &= 67108863;
          lo = Math.imul(al9, bl1);
          mid = Math.imul(al9, bh1);
          mid = mid + Math.imul(ah9, bl1) | 0;
          hi = Math.imul(ah9, bh1);
          lo = lo + Math.imul(al8, bl2) | 0;
          mid = mid + Math.imul(al8, bh2) | 0;
          mid = mid + Math.imul(ah8, bl2) | 0;
          hi = hi + Math.imul(ah8, bh2) | 0;
          lo = lo + Math.imul(al7, bl3) | 0;
          mid = mid + Math.imul(al7, bh3) | 0;
          mid = mid + Math.imul(ah7, bl3) | 0;
          hi = hi + Math.imul(ah7, bh3) | 0;
          lo = lo + Math.imul(al6, bl4) | 0;
          mid = mid + Math.imul(al6, bh4) | 0;
          mid = mid + Math.imul(ah6, bl4) | 0;
          hi = hi + Math.imul(ah6, bh4) | 0;
          lo = lo + Math.imul(al5, bl5) | 0;
          mid = mid + Math.imul(al5, bh5) | 0;
          mid = mid + Math.imul(ah5, bl5) | 0;
          hi = hi + Math.imul(ah5, bh5) | 0;
          lo = lo + Math.imul(al4, bl6) | 0;
          mid = mid + Math.imul(al4, bh6) | 0;
          mid = mid + Math.imul(ah4, bl6) | 0;
          hi = hi + Math.imul(ah4, bh6) | 0;
          lo = lo + Math.imul(al3, bl7) | 0;
          mid = mid + Math.imul(al3, bh7) | 0;
          mid = mid + Math.imul(ah3, bl7) | 0;
          hi = hi + Math.imul(ah3, bh7) | 0;
          lo = lo + Math.imul(al2, bl8) | 0;
          mid = mid + Math.imul(al2, bh8) | 0;
          mid = mid + Math.imul(ah2, bl8) | 0;
          hi = hi + Math.imul(ah2, bh8) | 0;
          lo = lo + Math.imul(al1, bl9) | 0;
          mid = mid + Math.imul(al1, bh9) | 0;
          mid = mid + Math.imul(ah1, bl9) | 0;
          hi = hi + Math.imul(ah1, bh9) | 0;
          var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
          w10 &= 67108863;
          lo = Math.imul(al9, bl2);
          mid = Math.imul(al9, bh2);
          mid = mid + Math.imul(ah9, bl2) | 0;
          hi = Math.imul(ah9, bh2);
          lo = lo + Math.imul(al8, bl3) | 0;
          mid = mid + Math.imul(al8, bh3) | 0;
          mid = mid + Math.imul(ah8, bl3) | 0;
          hi = hi + Math.imul(ah8, bh3) | 0;
          lo = lo + Math.imul(al7, bl4) | 0;
          mid = mid + Math.imul(al7, bh4) | 0;
          mid = mid + Math.imul(ah7, bl4) | 0;
          hi = hi + Math.imul(ah7, bh4) | 0;
          lo = lo + Math.imul(al6, bl5) | 0;
          mid = mid + Math.imul(al6, bh5) | 0;
          mid = mid + Math.imul(ah6, bl5) | 0;
          hi = hi + Math.imul(ah6, bh5) | 0;
          lo = lo + Math.imul(al5, bl6) | 0;
          mid = mid + Math.imul(al5, bh6) | 0;
          mid = mid + Math.imul(ah5, bl6) | 0;
          hi = hi + Math.imul(ah5, bh6) | 0;
          lo = lo + Math.imul(al4, bl7) | 0;
          mid = mid + Math.imul(al4, bh7) | 0;
          mid = mid + Math.imul(ah4, bl7) | 0;
          hi = hi + Math.imul(ah4, bh7) | 0;
          lo = lo + Math.imul(al3, bl8) | 0;
          mid = mid + Math.imul(al3, bh8) | 0;
          mid = mid + Math.imul(ah3, bl8) | 0;
          hi = hi + Math.imul(ah3, bh8) | 0;
          lo = lo + Math.imul(al2, bl9) | 0;
          mid = mid + Math.imul(al2, bh9) | 0;
          mid = mid + Math.imul(ah2, bl9) | 0;
          hi = hi + Math.imul(ah2, bh9) | 0;
          var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
          w11 &= 67108863;
          lo = Math.imul(al9, bl3);
          mid = Math.imul(al9, bh3);
          mid = mid + Math.imul(ah9, bl3) | 0;
          hi = Math.imul(ah9, bh3);
          lo = lo + Math.imul(al8, bl4) | 0;
          mid = mid + Math.imul(al8, bh4) | 0;
          mid = mid + Math.imul(ah8, bl4) | 0;
          hi = hi + Math.imul(ah8, bh4) | 0;
          lo = lo + Math.imul(al7, bl5) | 0;
          mid = mid + Math.imul(al7, bh5) | 0;
          mid = mid + Math.imul(ah7, bl5) | 0;
          hi = hi + Math.imul(ah7, bh5) | 0;
          lo = lo + Math.imul(al6, bl6) | 0;
          mid = mid + Math.imul(al6, bh6) | 0;
          mid = mid + Math.imul(ah6, bl6) | 0;
          hi = hi + Math.imul(ah6, bh6) | 0;
          lo = lo + Math.imul(al5, bl7) | 0;
          mid = mid + Math.imul(al5, bh7) | 0;
          mid = mid + Math.imul(ah5, bl7) | 0;
          hi = hi + Math.imul(ah5, bh7) | 0;
          lo = lo + Math.imul(al4, bl8) | 0;
          mid = mid + Math.imul(al4, bh8) | 0;
          mid = mid + Math.imul(ah4, bl8) | 0;
          hi = hi + Math.imul(ah4, bh8) | 0;
          lo = lo + Math.imul(al3, bl9) | 0;
          mid = mid + Math.imul(al3, bh9) | 0;
          mid = mid + Math.imul(ah3, bl9) | 0;
          hi = hi + Math.imul(ah3, bh9) | 0;
          var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
          w12 &= 67108863;
          lo = Math.imul(al9, bl4);
          mid = Math.imul(al9, bh4);
          mid = mid + Math.imul(ah9, bl4) | 0;
          hi = Math.imul(ah9, bh4);
          lo = lo + Math.imul(al8, bl5) | 0;
          mid = mid + Math.imul(al8, bh5) | 0;
          mid = mid + Math.imul(ah8, bl5) | 0;
          hi = hi + Math.imul(ah8, bh5) | 0;
          lo = lo + Math.imul(al7, bl6) | 0;
          mid = mid + Math.imul(al7, bh6) | 0;
          mid = mid + Math.imul(ah7, bl6) | 0;
          hi = hi + Math.imul(ah7, bh6) | 0;
          lo = lo + Math.imul(al6, bl7) | 0;
          mid = mid + Math.imul(al6, bh7) | 0;
          mid = mid + Math.imul(ah6, bl7) | 0;
          hi = hi + Math.imul(ah6, bh7) | 0;
          lo = lo + Math.imul(al5, bl8) | 0;
          mid = mid + Math.imul(al5, bh8) | 0;
          mid = mid + Math.imul(ah5, bl8) | 0;
          hi = hi + Math.imul(ah5, bh8) | 0;
          lo = lo + Math.imul(al4, bl9) | 0;
          mid = mid + Math.imul(al4, bh9) | 0;
          mid = mid + Math.imul(ah4, bl9) | 0;
          hi = hi + Math.imul(ah4, bh9) | 0;
          var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
          w13 &= 67108863;
          lo = Math.imul(al9, bl5);
          mid = Math.imul(al9, bh5);
          mid = mid + Math.imul(ah9, bl5) | 0;
          hi = Math.imul(ah9, bh5);
          lo = lo + Math.imul(al8, bl6) | 0;
          mid = mid + Math.imul(al8, bh6) | 0;
          mid = mid + Math.imul(ah8, bl6) | 0;
          hi = hi + Math.imul(ah8, bh6) | 0;
          lo = lo + Math.imul(al7, bl7) | 0;
          mid = mid + Math.imul(al7, bh7) | 0;
          mid = mid + Math.imul(ah7, bl7) | 0;
          hi = hi + Math.imul(ah7, bh7) | 0;
          lo = lo + Math.imul(al6, bl8) | 0;
          mid = mid + Math.imul(al6, bh8) | 0;
          mid = mid + Math.imul(ah6, bl8) | 0;
          hi = hi + Math.imul(ah6, bh8) | 0;
          lo = lo + Math.imul(al5, bl9) | 0;
          mid = mid + Math.imul(al5, bh9) | 0;
          mid = mid + Math.imul(ah5, bl9) | 0;
          hi = hi + Math.imul(ah5, bh9) | 0;
          var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
          w14 &= 67108863;
          lo = Math.imul(al9, bl6);
          mid = Math.imul(al9, bh6);
          mid = mid + Math.imul(ah9, bl6) | 0;
          hi = Math.imul(ah9, bh6);
          lo = lo + Math.imul(al8, bl7) | 0;
          mid = mid + Math.imul(al8, bh7) | 0;
          mid = mid + Math.imul(ah8, bl7) | 0;
          hi = hi + Math.imul(ah8, bh7) | 0;
          lo = lo + Math.imul(al7, bl8) | 0;
          mid = mid + Math.imul(al7, bh8) | 0;
          mid = mid + Math.imul(ah7, bl8) | 0;
          hi = hi + Math.imul(ah7, bh8) | 0;
          lo = lo + Math.imul(al6, bl9) | 0;
          mid = mid + Math.imul(al6, bh9) | 0;
          mid = mid + Math.imul(ah6, bl9) | 0;
          hi = hi + Math.imul(ah6, bh9) | 0;
          var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
          w15 &= 67108863;
          lo = Math.imul(al9, bl7);
          mid = Math.imul(al9, bh7);
          mid = mid + Math.imul(ah9, bl7) | 0;
          hi = Math.imul(ah9, bh7);
          lo = lo + Math.imul(al8, bl8) | 0;
          mid = mid + Math.imul(al8, bh8) | 0;
          mid = mid + Math.imul(ah8, bl8) | 0;
          hi = hi + Math.imul(ah8, bh8) | 0;
          lo = lo + Math.imul(al7, bl9) | 0;
          mid = mid + Math.imul(al7, bh9) | 0;
          mid = mid + Math.imul(ah7, bl9) | 0;
          hi = hi + Math.imul(ah7, bh9) | 0;
          var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
          w16 &= 67108863;
          lo = Math.imul(al9, bl8);
          mid = Math.imul(al9, bh8);
          mid = mid + Math.imul(ah9, bl8) | 0;
          hi = Math.imul(ah9, bh8);
          lo = lo + Math.imul(al8, bl9) | 0;
          mid = mid + Math.imul(al8, bh9) | 0;
          mid = mid + Math.imul(ah8, bl9) | 0;
          hi = hi + Math.imul(ah8, bh9) | 0;
          var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
          w17 &= 67108863;
          lo = Math.imul(al9, bl9);
          mid = Math.imul(al9, bh9);
          mid = mid + Math.imul(ah9, bl9) | 0;
          hi = Math.imul(ah9, bh9);
          var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
          w18 &= 67108863;
          o[0] = w0;
          o[1] = w1;
          o[2] = w2;
          o[3] = w3;
          o[4] = w4;
          o[5] = w5;
          o[6] = w6;
          o[7] = w7;
          o[8] = w8;
          o[9] = w9;
          o[10] = w10;
          o[11] = w11;
          o[12] = w12;
          o[13] = w13;
          o[14] = w14;
          o[15] = w15;
          o[16] = w16;
          o[17] = w17;
          o[18] = w18;
          if (c !== 0) {
            o[19] = c;
            out.length++;
          }
          return out;
        };
        if (!Math.imul) {
          comb10MulTo = smallMulTo;
        }
        function bigMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          out.length = self.length + num.length;
          var carry = 0;
          var hncarry = 0;
          for (var k = 0; k < out.length - 1; k++) {
            var ncarry = hncarry;
            hncarry = 0;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j;
              var a = self.words[i] | 0;
              var b = num.words[j] | 0;
              var r = a * b;
              var lo = r & 67108863;
              ncarry = ncarry + (r / 67108864 | 0) | 0;
              lo = lo + rword | 0;
              rword = lo & 67108863;
              ncarry = ncarry + (lo >>> 26) | 0;
              hncarry += ncarry >>> 26;
              ncarry &= 67108863;
            }
            out.words[k] = rword;
            carry = ncarry;
            ncarry = hncarry;
          }
          if (carry !== 0) {
            out.words[k] = carry;
          } else {
            out.length--;
          }
          return out._strip();
        }
        function jumboMulTo(self, num, out) {
          return bigMulTo(self, num, out);
        }
        BN.prototype.mulTo = function mulTo(num, out) {
          var res;
          var len = this.length + num.length;
          if (this.length === 10 && num.length === 10) {
            res = comb10MulTo(this, num, out);
          } else if (len < 63) {
            res = smallMulTo(this, num, out);
          } else if (len < 1024) {
            res = bigMulTo(this, num, out);
          } else {
            res = jumboMulTo(this, num, out);
          }
          return res;
        };
        function FFTM(x, y) {
          this.x = x;
          this.y = y;
        }
        FFTM.prototype.makeRBT = function makeRBT(N) {
          var t = new Array(N);
          var l = BN.prototype._countBits(N) - 1;
          for (var i = 0; i < N; i++) {
            t[i] = this.revBin(i, l, N);
          }
          return t;
        };
        FFTM.prototype.revBin = function revBin(x, l, N) {
          if (x === 0 || x === N - 1) return x;
          var rb = 0;
          for (var i = 0; i < l; i++) {
            rb |= (x & 1) << l - i - 1;
            x >>= 1;
          }
          return rb;
        };
        FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
          for (var i = 0; i < N; i++) {
            rtws[i] = rws[rbt[i]];
            itws[i] = iws[rbt[i]];
          }
        };
        FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
          this.permute(rbt, rws, iws, rtws, itws, N);
          for (var s = 1; s < N; s <<= 1) {
            var l = s << 1;
            var rtwdf = Math.cos(2 * Math.PI / l);
            var itwdf = Math.sin(2 * Math.PI / l);
            for (var p = 0; p < N; p += l) {
              var rtwdf_ = rtwdf;
              var itwdf_ = itwdf;
              for (var j = 0; j < s; j++) {
                var re = rtws[p + j];
                var ie = itws[p + j];
                var ro = rtws[p + j + s];
                var io = itws[p + j + s];
                var rx = rtwdf_ * ro - itwdf_ * io;
                io = rtwdf_ * io + itwdf_ * ro;
                ro = rx;
                rtws[p + j] = re + ro;
                itws[p + j] = ie + io;
                rtws[p + j + s] = re - ro;
                itws[p + j + s] = ie - io;
                if (j !== l) {
                  rx = rtwdf * rtwdf_ - itwdf * itwdf_;
                  itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
                  rtwdf_ = rx;
                }
              }
            }
          }
        };
        FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
          var N = Math.max(m, n) | 1;
          var odd = N & 1;
          var i = 0;
          for (N = N / 2 | 0; N; N = N >>> 1) {
            i++;
          }
          return 1 << i + 1 + odd;
        };
        FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
          if (N <= 1) return;
          for (var i = 0; i < N / 2; i++) {
            var t = rws[i];
            rws[i] = rws[N - i - 1];
            rws[N - i - 1] = t;
            t = iws[i];
            iws[i] = -iws[N - i - 1];
            iws[N - i - 1] = -t;
          }
        };
        FFTM.prototype.normalize13b = function normalize13b(ws, N) {
          var carry = 0;
          for (var i = 0; i < N / 2; i++) {
            var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
            ws[i] = w & 67108863;
            if (w < 67108864) {
              carry = 0;
            } else {
              carry = w / 67108864 | 0;
            }
          }
          return ws;
        };
        FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
          var carry = 0;
          for (var i = 0; i < len; i++) {
            carry = carry + (ws[i] | 0);
            rws[2 * i] = carry & 8191;
            carry = carry >>> 13;
            rws[2 * i + 1] = carry & 8191;
            carry = carry >>> 13;
          }
          for (i = 2 * len; i < N; ++i) {
            rws[i] = 0;
          }
          assert(carry === 0);
          assert((carry & ~8191) === 0);
        };
        FFTM.prototype.stub = function stub(N) {
          var ph = new Array(N);
          for (var i = 0; i < N; i++) {
            ph[i] = 0;
          }
          return ph;
        };
        FFTM.prototype.mulp = function mulp(x, y, out) {
          var N = 2 * this.guessLen13b(x.length, y.length);
          var rbt = this.makeRBT(N);
          var _ = this.stub(N);
          var rws = new Array(N);
          var rwst = new Array(N);
          var iwst = new Array(N);
          var nrws = new Array(N);
          var nrwst = new Array(N);
          var niwst = new Array(N);
          var rmws = out.words;
          rmws.length = N;
          this.convert13b(x.words, x.length, rws, N);
          this.convert13b(y.words, y.length, nrws, N);
          this.transform(rws, _, rwst, iwst, N, rbt);
          this.transform(nrws, _, nrwst, niwst, N, rbt);
          for (var i = 0; i < N; i++) {
            var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
            iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
            rwst[i] = rx;
          }
          this.conjugate(rwst, iwst, N);
          this.transform(rwst, iwst, rmws, _, N, rbt);
          this.conjugate(rmws, _, N);
          this.normalize13b(rmws, N);
          out.negative = x.negative ^ y.negative;
          out.length = x.length + y.length;
          return out._strip();
        };
        BN.prototype.mul = function mul(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return this.mulTo(num, out);
        };
        BN.prototype.mulf = function mulf(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return jumboMulTo(this, num, out);
        };
        BN.prototype.imul = function imul(num) {
          return this.clone().mulTo(num, this);
        };
        BN.prototype.imuln = function imuln(num) {
          var isNegNum = num < 0;
          if (isNegNum) num = -num;
          assert(typeof num === "number");
          assert(num < 67108864);
          var carry = 0;
          for (var i = 0; i < this.length; i++) {
            var w = (this.words[i] | 0) * num;
            var lo = (w & 67108863) + (carry & 67108863);
            carry >>= 26;
            carry += w / 67108864 | 0;
            carry += lo >>> 26;
            this.words[i] = lo & 67108863;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          this.length = num === 0 ? 1 : this.length;
          return isNegNum ? this.ineg() : this;
        };
        BN.prototype.muln = function muln(num) {
          return this.clone().imuln(num);
        };
        BN.prototype.sqr = function sqr() {
          return this.mul(this);
        };
        BN.prototype.isqr = function isqr() {
          return this.imul(this.clone());
        };
        BN.prototype.pow = function pow(num) {
          var w = toBitArray(num);
          if (w.length === 0) return new BN(1);
          var res = this;
          for (var i = 0; i < w.length; i++, res = res.sqr()) {
            if (w[i] !== 0) break;
          }
          if (++i < w.length) {
            for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
              if (w[i] === 0) continue;
              res = res.mul(q);
            }
          }
          return res;
        };
        BN.prototype.iushln = function iushln(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          var carryMask = 67108863 >>> 26 - r << 26 - r;
          var i;
          if (r !== 0) {
            var carry = 0;
            for (i = 0; i < this.length; i++) {
              var newCarry = this.words[i] & carryMask;
              var c = (this.words[i] | 0) - newCarry << r;
              this.words[i] = c | carry;
              carry = newCarry >>> 26 - r;
            }
            if (carry) {
              this.words[i] = carry;
              this.length++;
            }
          }
          if (s !== 0) {
            for (i = this.length - 1; i >= 0; i--) {
              this.words[i + s] = this.words[i];
            }
            for (i = 0; i < s; i++) {
              this.words[i] = 0;
            }
            this.length += s;
          }
          return this._strip();
        };
        BN.prototype.ishln = function ishln(bits) {
          assert(this.negative === 0);
          return this.iushln(bits);
        };
        BN.prototype.iushrn = function iushrn(bits, hint, extended) {
          assert(typeof bits === "number" && bits >= 0);
          var h;
          if (hint) {
            h = (hint - hint % 26) / 26;
          } else {
            h = 0;
          }
          var r = bits % 26;
          var s = Math.min((bits - r) / 26, this.length);
          var mask = 67108863 ^ 67108863 >>> r << r;
          var maskedWords = extended;
          h -= s;
          h = Math.max(0, h);
          if (maskedWords) {
            for (var i = 0; i < s; i++) {
              maskedWords.words[i] = this.words[i];
            }
            maskedWords.length = s;
          }
          if (s === 0) {} else if (this.length > s) {
            this.length -= s;
            for (i = 0; i < this.length; i++) {
              this.words[i] = this.words[i + s];
            }
          } else {
            this.words[0] = 0;
            this.length = 1;
          }
          var carry = 0;
          for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
            var word = this.words[i] | 0;
            this.words[i] = carry << 26 - r | word >>> r;
            carry = word & mask;
          }
          if (maskedWords && carry !== 0) {
            maskedWords.words[maskedWords.length++] = carry;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this._strip();
        };
        BN.prototype.ishrn = function ishrn(bits, hint, extended) {
          assert(this.negative === 0);
          return this.iushrn(bits, hint, extended);
        };
        BN.prototype.shln = function shln(bits) {
          return this.clone().ishln(bits);
        };
        BN.prototype.ushln = function ushln(bits) {
          return this.clone().iushln(bits);
        };
        BN.prototype.shrn = function shrn(bits) {
          return this.clone().ishrn(bits);
        };
        BN.prototype.ushrn = function ushrn(bits) {
          return this.clone().iushrn(bits);
        };
        BN.prototype.testn = function testn(bit) {
          assert(typeof bit === "number" && bit >= 0);
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) return false;
          var w = this.words[s];
          return !!(w & q);
        };
        BN.prototype.imaskn = function imaskn(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          assert(this.negative === 0, "imaskn works only with positive numbers");
          if (this.length <= s) {
            return this;
          }
          if (r !== 0) {
            s++;
          }
          this.length = Math.min(s, this.length);
          if (r !== 0) {
            var mask = 67108863 ^ 67108863 >>> r << r;
            this.words[this.length - 1] &= mask;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this._strip();
        };
        BN.prototype.maskn = function maskn(bits) {
          return this.clone().imaskn(bits);
        };
        BN.prototype.iaddn = function iaddn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.isubn(-num);
          if (this.negative !== 0) {
            if (this.length === 1 && (this.words[0] | 0) <= num) {
              this.words[0] = num - (this.words[0] | 0);
              this.negative = 0;
              return this;
            }
            this.negative = 0;
            this.isubn(num);
            this.negative = 1;
            return this;
          }
          return this._iaddn(num);
        };
        BN.prototype._iaddn = function _iaddn(num) {
          this.words[0] += num;
          for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
            this.words[i] -= 67108864;
            if (i === this.length - 1) {
              this.words[i + 1] = 1;
            } else {
              this.words[i + 1]++;
            }
          }
          this.length = Math.max(this.length, i + 1);
          return this;
        };
        BN.prototype.isubn = function isubn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.iaddn(-num);
          if (this.negative !== 0) {
            this.negative = 0;
            this.iaddn(num);
            this.negative = 1;
            return this;
          }
          this.words[0] -= num;
          if (this.length === 1 && this.words[0] < 0) {
            this.words[0] = -this.words[0];
            this.negative = 1;
          } else {
            for (var i = 0; i < this.length && this.words[i] < 0; i++) {
              this.words[i] += 67108864;
              this.words[i + 1] -= 1;
            }
          }
          return this._strip();
        };
        BN.prototype.addn = function addn(num) {
          return this.clone().iaddn(num);
        };
        BN.prototype.subn = function subn(num) {
          return this.clone().isubn(num);
        };
        BN.prototype.iabs = function iabs() {
          this.negative = 0;
          return this;
        };
        BN.prototype.abs = function abs() {
          return this.clone().iabs();
        };
        BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
          var len = num.length + shift;
          var i;
          this._expand(len);
          var w;
          var carry = 0;
          for (i = 0; i < num.length; i++) {
            w = (this.words[i + shift] | 0) + carry;
            var right = (num.words[i] | 0) * mul;
            w -= right & 67108863;
            carry = (w >> 26) - (right / 67108864 | 0);
            this.words[i + shift] = w & 67108863;
          }
          for (;i < this.length - shift; i++) {
            w = (this.words[i + shift] | 0) + carry;
            carry = w >> 26;
            this.words[i + shift] = w & 67108863;
          }
          if (carry === 0) return this._strip();
          assert(carry === -1);
          carry = 0;
          for (i = 0; i < this.length; i++) {
            w = -(this.words[i] | 0) + carry;
            carry = w >> 26;
            this.words[i] = w & 67108863;
          }
          this.negative = 1;
          return this._strip();
        };
        BN.prototype._wordDiv = function _wordDiv(num, mode) {
          var shift = this.length - num.length;
          var a = this.clone();
          var b = num;
          var bhi = b.words[b.length - 1] | 0;
          var bhiBits = this._countBits(bhi);
          shift = 26 - bhiBits;
          if (shift !== 0) {
            b = b.ushln(shift);
            a.iushln(shift);
            bhi = b.words[b.length - 1] | 0;
          }
          var m = a.length - b.length;
          var q;
          if (mode !== "mod") {
            q = new BN(null);
            q.length = m + 1;
            q.words = new Array(q.length);
            for (var i = 0; i < q.length; i++) {
              q.words[i] = 0;
            }
          }
          var diff = a.clone()._ishlnsubmul(b, 1, m);
          if (diff.negative === 0) {
            a = diff;
            if (q) {
              q.words[m] = 1;
            }
          }
          for (var j = m - 1; j >= 0; j--) {
            var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
            qj = Math.min(qj / bhi | 0, 67108863);
            a._ishlnsubmul(b, qj, j);
            while (a.negative !== 0) {
              qj--;
              a.negative = 0;
              a._ishlnsubmul(b, 1, j);
              if (!a.isZero()) {
                a.negative ^= 1;
              }
            }
            if (q) {
              q.words[j] = qj;
            }
          }
          if (q) {
            q._strip();
          }
          a._strip();
          if (mode !== "div" && shift !== 0) {
            a.iushrn(shift);
          }
          return {
            div: q || null,
            mod: a
          };
        };
        BN.prototype.divmod = function divmod(num, mode, positive) {
          assert(!num.isZero());
          if (this.isZero()) {
            return {
              div: new BN(0),
              mod: new BN(0)
            };
          }
          var div, mod, res;
          if (this.negative !== 0 && num.negative === 0) {
            res = this.neg().divmod(num, mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.iadd(num);
              }
            }
            return {
              div,
              mod
            };
          }
          if (this.negative === 0 && num.negative !== 0) {
            res = this.divmod(num.neg(), mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            return {
              div,
              mod: res.mod
            };
          }
          if ((this.negative & num.negative) !== 0) {
            res = this.neg().divmod(num.neg(), mode);
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.isub(num);
              }
            }
            return {
              div: res.div,
              mod
            };
          }
          if (num.length > this.length || this.cmp(num) < 0) {
            return {
              div: new BN(0),
              mod: this
            };
          }
          if (num.length === 1) {
            if (mode === "div") {
              return {
                div: this.divn(num.words[0]),
                mod: null
              };
            }
            if (mode === "mod") {
              return {
                div: null,
                mod: new BN(this.modrn(num.words[0]))
              };
            }
            return {
              div: this.divn(num.words[0]),
              mod: new BN(this.modrn(num.words[0]))
            };
          }
          return this._wordDiv(num, mode);
        };
        BN.prototype.div = function div(num) {
          return this.divmod(num, "div", false).div;
        };
        BN.prototype.mod = function mod(num) {
          return this.divmod(num, "mod", false).mod;
        };
        BN.prototype.umod = function umod(num) {
          return this.divmod(num, "mod", true).mod;
        };
        BN.prototype.divRound = function divRound(num) {
          var dm = this.divmod(num);
          if (dm.mod.isZero()) return dm.div;
          var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
          var half = num.ushrn(1);
          var r2 = num.andln(1);
          var cmp = mod.cmp(half);
          if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
          return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
        };
        BN.prototype.modrn = function modrn(num) {
          var isNegNum = num < 0;
          if (isNegNum) num = -num;
          assert(num <= 67108863);
          var p = (1 << 26) % num;
          var acc = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            acc = (p * acc + (this.words[i] | 0)) % num;
          }
          return isNegNum ? -acc : acc;
        };
        BN.prototype.modn = function modn(num) {
          return this.modrn(num);
        };
        BN.prototype.idivn = function idivn(num) {
          var isNegNum = num < 0;
          if (isNegNum) num = -num;
          assert(num <= 67108863);
          var carry = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var w = (this.words[i] | 0) + carry * 67108864;
            this.words[i] = w / num | 0;
            carry = w % num;
          }
          this._strip();
          return isNegNum ? this.ineg() : this;
        };
        BN.prototype.divn = function divn(num) {
          return this.clone().idivn(num);
        };
        BN.prototype.egcd = function egcd(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var x = this;
          var y = p.clone();
          if (x.negative !== 0) {
            x = x.umod(p);
          } else {
            x = x.clone();
          }
          var A = new BN(1);
          var B = new BN(0);
          var C = new BN(0);
          var D = new BN(1);
          var g = 0;
          while (x.isEven() && y.isEven()) {
            x.iushrn(1);
            y.iushrn(1);
            ++g;
          }
          var yp = y.clone();
          var xp = x.clone();
          while (!x.isZero()) {
            for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              x.iushrn(i);
              while (i-- > 0) {
                if (A.isOdd() || B.isOdd()) {
                  A.iadd(yp);
                  B.isub(xp);
                }
                A.iushrn(1);
                B.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              y.iushrn(j);
              while (j-- > 0) {
                if (C.isOdd() || D.isOdd()) {
                  C.iadd(yp);
                  D.isub(xp);
                }
                C.iushrn(1);
                D.iushrn(1);
              }
            }
            if (x.cmp(y) >= 0) {
              x.isub(y);
              A.isub(C);
              B.isub(D);
            } else {
              y.isub(x);
              C.isub(A);
              D.isub(B);
            }
          }
          return {
            a: C,
            b: D,
            gcd: y.iushln(g)
          };
        };
        BN.prototype._invmp = function _invmp(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var a = this;
          var b = p.clone();
          if (a.negative !== 0) {
            a = a.umod(p);
          } else {
            a = a.clone();
          }
          var x1 = new BN(1);
          var x2 = new BN(0);
          var delta = b.clone();
          while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
            for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              a.iushrn(i);
              while (i-- > 0) {
                if (x1.isOdd()) {
                  x1.iadd(delta);
                }
                x1.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              b.iushrn(j);
              while (j-- > 0) {
                if (x2.isOdd()) {
                  x2.iadd(delta);
                }
                x2.iushrn(1);
              }
            }
            if (a.cmp(b) >= 0) {
              a.isub(b);
              x1.isub(x2);
            } else {
              b.isub(a);
              x2.isub(x1);
            }
          }
          var res;
          if (a.cmpn(1) === 0) {
            res = x1;
          } else {
            res = x2;
          }
          if (res.cmpn(0) < 0) {
            res.iadd(p);
          }
          return res;
        };
        BN.prototype.gcd = function gcd(num) {
          if (this.isZero()) return num.abs();
          if (num.isZero()) return this.abs();
          var a = this.clone();
          var b = num.clone();
          a.negative = 0;
          b.negative = 0;
          for (var shift = 0; a.isEven() && b.isEven(); shift++) {
            a.iushrn(1);
            b.iushrn(1);
          }
          do {
            while (a.isEven()) {
              a.iushrn(1);
            }
            while (b.isEven()) {
              b.iushrn(1);
            }
            var r = a.cmp(b);
            if (r < 0) {
              var t = a;
              a = b;
              b = t;
            } else if (r === 0 || b.cmpn(1) === 0) {
              break;
            }
            a.isub(b);
          } while (true);
          return b.iushln(shift);
        };
        BN.prototype.invm = function invm(num) {
          return this.egcd(num).a.umod(num);
        };
        BN.prototype.isEven = function isEven() {
          return (this.words[0] & 1) === 0;
        };
        BN.prototype.isOdd = function isOdd() {
          return (this.words[0] & 1) === 1;
        };
        BN.prototype.andln = function andln(num) {
          return this.words[0] & num;
        };
        BN.prototype.bincn = function bincn(bit) {
          assert(typeof bit === "number");
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) {
            this._expand(s + 1);
            this.words[s] |= q;
            return this;
          }
          var carry = q;
          for (var i = s; carry !== 0 && i < this.length; i++) {
            var w = this.words[i] | 0;
            w += carry;
            carry = w >>> 26;
            w &= 67108863;
            this.words[i] = w;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          return this;
        };
        BN.prototype.isZero = function isZero() {
          return this.length === 1 && this.words[0] === 0;
        };
        BN.prototype.cmpn = function cmpn(num) {
          var negative = num < 0;
          if (this.negative !== 0 && !negative) return -1;
          if (this.negative === 0 && negative) return 1;
          this._strip();
          var res;
          if (this.length > 1) {
            res = 1;
          } else {
            if (negative) {
              num = -num;
            }
            assert(num <= 67108863, "Number is too big");
            var w = this.words[0] | 0;
            res = w === num ? 0 : w < num ? -1 : 1;
          }
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.cmp = function cmp(num) {
          if (this.negative !== 0 && num.negative === 0) return -1;
          if (this.negative === 0 && num.negative !== 0) return 1;
          var res = this.ucmp(num);
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.ucmp = function ucmp(num) {
          if (this.length > num.length) return 1;
          if (this.length < num.length) return -1;
          var res = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var a = this.words[i] | 0;
            var b = num.words[i] | 0;
            if (a === b) continue;
            if (a < b) {
              res = -1;
            } else if (a > b) {
              res = 1;
            }
            break;
          }
          return res;
        };
        BN.prototype.gtn = function gtn(num) {
          return this.cmpn(num) === 1;
        };
        BN.prototype.gt = function gt(num) {
          return this.cmp(num) === 1;
        };
        BN.prototype.gten = function gten(num) {
          return this.cmpn(num) >= 0;
        };
        BN.prototype.gte = function gte(num) {
          return this.cmp(num) >= 0;
        };
        BN.prototype.ltn = function ltn(num) {
          return this.cmpn(num) === -1;
        };
        BN.prototype.lt = function lt(num) {
          return this.cmp(num) === -1;
        };
        BN.prototype.lten = function lten(num) {
          return this.cmpn(num) <= 0;
        };
        BN.prototype.lte = function lte(num) {
          return this.cmp(num) <= 0;
        };
        BN.prototype.eqn = function eqn(num) {
          return this.cmpn(num) === 0;
        };
        BN.prototype.eq = function eq(num) {
          return this.cmp(num) === 0;
        };
        BN.red = function red(num) {
          return new Red(num);
        };
        BN.prototype.toRed = function toRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          assert(this.negative === 0, "red works only with positives");
          return ctx.convertTo(this)._forceRed(ctx);
        };
        BN.prototype.fromRed = function fromRed() {
          assert(this.red, "fromRed works only with numbers in reduction context");
          return this.red.convertFrom(this);
        };
        BN.prototype._forceRed = function _forceRed(ctx) {
          this.red = ctx;
          return this;
        };
        BN.prototype.forceRed = function forceRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          return this._forceRed(ctx);
        };
        BN.prototype.redAdd = function redAdd(num) {
          assert(this.red, "redAdd works only with red numbers");
          return this.red.add(this, num);
        };
        BN.prototype.redIAdd = function redIAdd(num) {
          assert(this.red, "redIAdd works only with red numbers");
          return this.red.iadd(this, num);
        };
        BN.prototype.redSub = function redSub(num) {
          assert(this.red, "redSub works only with red numbers");
          return this.red.sub(this, num);
        };
        BN.prototype.redISub = function redISub(num) {
          assert(this.red, "redISub works only with red numbers");
          return this.red.isub(this, num);
        };
        BN.prototype.redShl = function redShl(num) {
          assert(this.red, "redShl works only with red numbers");
          return this.red.shl(this, num);
        };
        BN.prototype.redMul = function redMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.mul(this, num);
        };
        BN.prototype.redIMul = function redIMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.imul(this, num);
        };
        BN.prototype.redSqr = function redSqr() {
          assert(this.red, "redSqr works only with red numbers");
          this.red._verify1(this);
          return this.red.sqr(this);
        };
        BN.prototype.redISqr = function redISqr() {
          assert(this.red, "redISqr works only with red numbers");
          this.red._verify1(this);
          return this.red.isqr(this);
        };
        BN.prototype.redSqrt = function redSqrt() {
          assert(this.red, "redSqrt works only with red numbers");
          this.red._verify1(this);
          return this.red.sqrt(this);
        };
        BN.prototype.redInvm = function redInvm() {
          assert(this.red, "redInvm works only with red numbers");
          this.red._verify1(this);
          return this.red.invm(this);
        };
        BN.prototype.redNeg = function redNeg() {
          assert(this.red, "redNeg works only with red numbers");
          this.red._verify1(this);
          return this.red.neg(this);
        };
        BN.prototype.redPow = function redPow(num) {
          assert(this.red && !num.red, "redPow(normalNum)");
          this.red._verify1(this);
          return this.red.pow(this, num);
        };
        var primes = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };
        function MPrime(name, p) {
          this.name = name;
          this.p = new BN(p, 16);
          this.n = this.p.bitLength();
          this.k = new BN(1).iushln(this.n).isub(this.p);
          this.tmp = this._tmp();
        }
        MPrime.prototype._tmp = function _tmp() {
          var tmp = new BN(null);
          tmp.words = new Array(Math.ceil(this.n / 13));
          return tmp;
        };
        MPrime.prototype.ireduce = function ireduce(num) {
          var r = num;
          var rlen;
          do {
            this.split(r, this.tmp);
            r = this.imulK(r);
            r = r.iadd(this.tmp);
            rlen = r.bitLength();
          } while (rlen > this.n);
          var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
          if (cmp === 0) {
            r.words[0] = 0;
            r.length = 1;
          } else if (cmp > 0) {
            r.isub(this.p);
          } else {
            if (r.strip !== undefined) {
              r.strip();
            } else {
              r._strip();
            }
          }
          return r;
        };
        MPrime.prototype.split = function split(input, out) {
          input.iushrn(this.n, 0, out);
        };
        MPrime.prototype.imulK = function imulK(num) {
          return num.imul(this.k);
        };
        function K256() {
          MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
        }
        inherits(K256, MPrime);
        K256.prototype.split = function split(input, output) {
          var mask = 4194303;
          var outLen = Math.min(input.length, 9);
          for (var i = 0; i < outLen; i++) {
            output.words[i] = input.words[i];
          }
          output.length = outLen;
          if (input.length <= 9) {
            input.words[0] = 0;
            input.length = 1;
            return;
          }
          var prev = input.words[9];
          output.words[output.length++] = prev & mask;
          for (i = 10; i < input.length; i++) {
            var next = input.words[i] | 0;
            input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
            prev = next;
          }
          prev >>>= 22;
          input.words[i - 10] = prev;
          if (prev === 0 && input.length > 10) {
            input.length -= 10;
          } else {
            input.length -= 9;
          }
        };
        K256.prototype.imulK = function imulK(num) {
          num.words[num.length] = 0;
          num.words[num.length + 1] = 0;
          num.length += 2;
          var lo = 0;
          for (var i = 0; i < num.length; i++) {
            var w = num.words[i] | 0;
            lo += w * 977;
            num.words[i] = lo & 67108863;
            lo = w * 64 + (lo / 67108864 | 0);
          }
          if (num.words[num.length - 1] === 0) {
            num.length--;
            if (num.words[num.length - 1] === 0) {
              num.length--;
            }
          }
          return num;
        };
        function P224() {
          MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
        }
        inherits(P224, MPrime);
        function P192() {
          MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
        }
        inherits(P192, MPrime);
        function P25519() {
          MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
        }
        inherits(P25519, MPrime);
        P25519.prototype.imulK = function imulK(num) {
          var carry = 0;
          for (var i = 0; i < num.length; i++) {
            var hi = (num.words[i] | 0) * 19 + carry;
            var lo = hi & 67108863;
            hi >>>= 26;
            num.words[i] = lo;
            carry = hi;
          }
          if (carry !== 0) {
            num.words[num.length++] = carry;
          }
          return num;
        };
        BN._prime = function prime(name) {
          if (primes[name]) return primes[name];
          var prime;
          if (name === "k256") {
            prime = new K256;
          } else if (name === "p224") {
            prime = new P224;
          } else if (name === "p192") {
            prime = new P192;
          } else if (name === "p25519") {
            prime = new P25519;
          } else {
            throw new Error("Unknown prime " + name);
          }
          primes[name] = prime;
          return prime;
        };
        function Red(m) {
          if (typeof m === "string") {
            var prime = BN._prime(m);
            this.m = prime.p;
            this.prime = prime;
          } else {
            assert(m.gtn(1), "modulus must be greater than 1");
            this.m = m;
            this.prime = null;
          }
        }
        Red.prototype._verify1 = function _verify1(a) {
          assert(a.negative === 0, "red works only with positives");
          assert(a.red, "red works only with red numbers");
        };
        Red.prototype._verify2 = function _verify2(a, b) {
          assert((a.negative | b.negative) === 0, "red works only with positives");
          assert(a.red && a.red === b.red, "red works only with red numbers");
        };
        Red.prototype.imod = function imod(a) {
          if (this.prime) return this.prime.ireduce(a)._forceRed(this);
          move(a, a.umod(this.m)._forceRed(this));
          return a;
        };
        Red.prototype.neg = function neg(a) {
          if (a.isZero()) {
            return a.clone();
          }
          return this.m.sub(a)._forceRed(this);
        };
        Red.prototype.add = function add(a, b) {
          this._verify2(a, b);
          var res = a.add(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.iadd = function iadd(a, b) {
          this._verify2(a, b);
          var res = a.iadd(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res;
        };
        Red.prototype.sub = function sub(a, b) {
          this._verify2(a, b);
          var res = a.sub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.isub = function isub(a, b) {
          this._verify2(a, b);
          var res = a.isub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res;
        };
        Red.prototype.shl = function shl(a, num) {
          this._verify1(a);
          return this.imod(a.ushln(num));
        };
        Red.prototype.imul = function imul(a, b) {
          this._verify2(a, b);
          return this.imod(a.imul(b));
        };
        Red.prototype.mul = function mul(a, b) {
          this._verify2(a, b);
          return this.imod(a.mul(b));
        };
        Red.prototype.isqr = function isqr(a) {
          return this.imul(a, a.clone());
        };
        Red.prototype.sqr = function sqr(a) {
          return this.mul(a, a);
        };
        Red.prototype.sqrt = function sqrt(a) {
          if (a.isZero()) return a.clone();
          var mod3 = this.m.andln(3);
          assert(mod3 % 2 === 1);
          if (mod3 === 3) {
            var pow = this.m.add(new BN(1)).iushrn(2);
            return this.pow(a, pow);
          }
          var q = this.m.subn(1);
          var s = 0;
          while (!q.isZero() && q.andln(1) === 0) {
            s++;
            q.iushrn(1);
          }
          assert(!q.isZero());
          var one = new BN(1).toRed(this);
          var nOne = one.redNeg();
          var lpow = this.m.subn(1).iushrn(1);
          var z = this.m.bitLength();
          z = new BN(2 * z * z).toRed(this);
          while (this.pow(z, lpow).cmp(nOne) !== 0) {
            z.redIAdd(nOne);
          }
          var c = this.pow(z, q);
          var r = this.pow(a, q.addn(1).iushrn(1));
          var t = this.pow(a, q);
          var m = s;
          while (t.cmp(one) !== 0) {
            var tmp = t;
            for (var i = 0; tmp.cmp(one) !== 0; i++) {
              tmp = tmp.redSqr();
            }
            assert(i < m);
            var b = this.pow(c, new BN(1).iushln(m - i - 1));
            r = r.redMul(b);
            c = b.redSqr();
            t = t.redMul(c);
            m = i;
          }
          return r;
        };
        Red.prototype.invm = function invm(a) {
          var inv = a._invmp(this.m);
          if (inv.negative !== 0) {
            inv.negative = 0;
            return this.imod(inv).redNeg();
          } else {
            return this.imod(inv);
          }
        };
        Red.prototype.pow = function pow(a, num) {
          if (num.isZero()) return new BN(1).toRed(this);
          if (num.cmpn(1) === 0) return a.clone();
          var windowSize = 4;
          var wnd = new Array(1 << windowSize);
          wnd[0] = new BN(1).toRed(this);
          wnd[1] = a;
          for (var i = 2; i < wnd.length; i++) {
            wnd[i] = this.mul(wnd[i - 1], a);
          }
          var res = wnd[0];
          var current = 0;
          var currentLen = 0;
          var start = num.bitLength() % 26;
          if (start === 0) {
            start = 26;
          }
          for (i = num.length - 1; i >= 0; i--) {
            var word = num.words[i];
            for (var j = start - 1; j >= 0; j--) {
              var bit = word >> j & 1;
              if (res !== wnd[0]) {
                res = this.sqr(res);
              }
              if (bit === 0 && current === 0) {
                currentLen = 0;
                continue;
              }
              current <<= 1;
              current |= bit;
              currentLen++;
              if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
              res = this.mul(res, wnd[current]);
              currentLen = 0;
              current = 0;
            }
            start = 26;
          }
          return res;
        };
        Red.prototype.convertTo = function convertTo(num) {
          var r = num.umod(this.m);
          return r === num ? r.clone() : r;
        };
        Red.prototype.convertFrom = function convertFrom(num) {
          var res = num.clone();
          res.red = null;
          return res;
        };
        BN.mont = function mont(num) {
          return new Mont(num);
        };
        function Mont(m) {
          Red.call(this, m);
          this.shift = this.m.bitLength();
          if (this.shift % 26 !== 0) {
            this.shift += 26 - this.shift % 26;
          }
          this.r = new BN(1).iushln(this.shift);
          this.r2 = this.imod(this.r.sqr());
          this.rinv = this.r._invmp(this.m);
          this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
          this.minv = this.minv.umod(this.r);
          this.minv = this.r.sub(this.minv);
        }
        inherits(Mont, Red);
        Mont.prototype.convertTo = function convertTo(num) {
          return this.imod(num.ushln(this.shift));
        };
        Mont.prototype.convertFrom = function convertFrom(num) {
          var r = this.imod(num.mul(this.rinv));
          r.red = null;
          return r;
        };
        Mont.prototype.imul = function imul(a, b) {
          if (a.isZero() || b.isZero()) {
            a.words[0] = 0;
            a.length = 1;
            return a;
          }
          var t = a.imul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.mul = function mul(a, b) {
          if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
          var t = a.mul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.invm = function invm(a) {
          var res = this.imod(a._invmp(this.m).mul(this.r2));
          return res._forceRed(this);
        };
      })(false || module, this);
    },
    5037(module, __unused_webpack_exports, __webpack_require__) {
      var r;
      module.exports = function rand(len) {
        if (!r) r = new Rand(null);
        return r.generate(len);
      };
      function Rand(rand) {
        this.rand = rand;
      }
      module.exports.Rand = Rand;
      Rand.prototype.generate = function generate(len) {
        return this._rand(len);
      };
      Rand.prototype._rand = function _rand(n) {
        if (this.rand.getBytes) return this.rand.getBytes(n);
        var res = new Uint8Array(n);
        for (var i = 0; i < res.length; i++) res[i] = this.rand.getByte();
        return res;
      };
      if (typeof self === "object") {
        if (self.crypto && self.crypto.getRandomValues) {
          Rand.prototype._rand = function _rand(n) {
            var arr = new Uint8Array(n);
            self.crypto.getRandomValues(arr);
            return arr;
          };
        } else if (self.msCrypto && self.msCrypto.getRandomValues) {
          Rand.prototype._rand = function _rand(n) {
            var arr = new Uint8Array(n);
            self.msCrypto.getRandomValues(arr);
            return arr;
          };
        } else if (typeof window === "object") {
          Rand.prototype._rand = function() {
            throw new Error("Not implemented yet");
          };
        }
      } else {
        try {
          var crypto = __webpack_require__(1395);
          if (typeof crypto.randomBytes !== "function") throw new Error("Not supported");
          Rand.prototype._rand = function _rand(n) {
            return crypto.randomBytes(n);
          };
        } catch (e) {}
      }
    },
    462(module, __unused_webpack_exports, __webpack_require__) {
      var Buffer = __webpack_require__(2861).Buffer;
      function asUInt32Array(buf) {
        if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);
        var len = buf.length / 4 | 0;
        var out = new Array(len);
        for (var i = 0; i < len; i++) {
          out[i] = buf.readUInt32BE(i * 4);
        }
        return out;
      }
      function scrubVec(v) {
        for (var i = 0; i < v.length; v++) {
          v[i] = 0;
        }
      }
      function cryptBlock(M, keySchedule, SUB_MIX, SBOX, nRounds) {
        var SUB_MIX0 = SUB_MIX[0];
        var SUB_MIX1 = SUB_MIX[1];
        var SUB_MIX2 = SUB_MIX[2];
        var SUB_MIX3 = SUB_MIX[3];
        var s0 = M[0] ^ keySchedule[0];
        var s1 = M[1] ^ keySchedule[1];
        var s2 = M[2] ^ keySchedule[2];
        var s3 = M[3] ^ keySchedule[3];
        var t0, t1, t2, t3;
        var ksRow = 4;
        for (var round = 1; round < nRounds; round++) {
          t0 = SUB_MIX0[s0 >>> 24] ^ SUB_MIX1[s1 >>> 16 & 255] ^ SUB_MIX2[s2 >>> 8 & 255] ^ SUB_MIX3[s3 & 255] ^ keySchedule[ksRow++];
          t1 = SUB_MIX0[s1 >>> 24] ^ SUB_MIX1[s2 >>> 16 & 255] ^ SUB_MIX2[s3 >>> 8 & 255] ^ SUB_MIX3[s0 & 255] ^ keySchedule[ksRow++];
          t2 = SUB_MIX0[s2 >>> 24] ^ SUB_MIX1[s3 >>> 16 & 255] ^ SUB_MIX2[s0 >>> 8 & 255] ^ SUB_MIX3[s1 & 255] ^ keySchedule[ksRow++];
          t3 = SUB_MIX0[s3 >>> 24] ^ SUB_MIX1[s0 >>> 16 & 255] ^ SUB_MIX2[s1 >>> 8 & 255] ^ SUB_MIX3[s2 & 255] ^ keySchedule[ksRow++];
          s0 = t0;
          s1 = t1;
          s2 = t2;
          s3 = t3;
        }
        t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 255] << 16 | SBOX[s2 >>> 8 & 255] << 8 | SBOX[s3 & 255]) ^ keySchedule[ksRow++];
        t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 255] << 16 | SBOX[s3 >>> 8 & 255] << 8 | SBOX[s0 & 255]) ^ keySchedule[ksRow++];
        t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 255] << 16 | SBOX[s0 >>> 8 & 255] << 8 | SBOX[s1 & 255]) ^ keySchedule[ksRow++];
        t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 255] << 16 | SBOX[s1 >>> 8 & 255] << 8 | SBOX[s2 & 255]) ^ keySchedule[ksRow++];
        t0 = t0 >>> 0;
        t1 = t1 >>> 0;
        t2 = t2 >>> 0;
        t3 = t3 >>> 0;
        return [ t0, t1, t2, t3 ];
      }
      var RCON = [ 0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54 ];
      var G = function() {
        var d = new Array(256);
        for (var j = 0; j < 256; j++) {
          if (j < 128) {
            d[j] = j << 1;
          } else {
            d[j] = j << 1 ^ 283;
          }
        }
        var SBOX = [];
        var INV_SBOX = [];
        var SUB_MIX = [ [], [], [], [] ];
        var INV_SUB_MIX = [ [], [], [], [] ];
        var x = 0;
        var xi = 0;
        for (var i = 0; i < 256; ++i) {
          var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
          sx = sx >>> 8 ^ sx & 255 ^ 99;
          SBOX[x] = sx;
          INV_SBOX[sx] = x;
          var x2 = d[x];
          var x4 = d[x2];
          var x8 = d[x4];
          var t = d[sx] * 257 ^ sx * 16843008;
          SUB_MIX[0][x] = t << 24 | t >>> 8;
          SUB_MIX[1][x] = t << 16 | t >>> 16;
          SUB_MIX[2][x] = t << 8 | t >>> 24;
          SUB_MIX[3][x] = t;
          t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
          INV_SUB_MIX[0][sx] = t << 24 | t >>> 8;
          INV_SUB_MIX[1][sx] = t << 16 | t >>> 16;
          INV_SUB_MIX[2][sx] = t << 8 | t >>> 24;
          INV_SUB_MIX[3][sx] = t;
          if (x === 0) {
            x = xi = 1;
          } else {
            x = x2 ^ d[d[d[x8 ^ x2]]];
            xi ^= d[d[xi]];
          }
        }
        return {
          SBOX,
          INV_SBOX,
          SUB_MIX,
          INV_SUB_MIX
        };
      }();
      function AES(key) {
        this._key = asUInt32Array(key);
        this._reset();
      }
      AES.blockSize = 4 * 4;
      AES.keySize = 256 / 8;
      AES.prototype.blockSize = AES.blockSize;
      AES.prototype.keySize = AES.keySize;
      AES.prototype._reset = function() {
        var keyWords = this._key;
        var keySize = keyWords.length;
        var nRounds = keySize + 6;
        var ksRows = (nRounds + 1) * 4;
        var keySchedule = [];
        for (var k = 0; k < keySize; k++) {
          keySchedule[k] = keyWords[k];
        }
        for (k = keySize; k < ksRows; k++) {
          var t = keySchedule[k - 1];
          if (k % keySize === 0) {
            t = t << 8 | t >>> 24;
            t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255];
            t ^= RCON[k / keySize | 0] << 24;
          } else if (keySize > 6 && k % keySize === 4) {
            t = G.SBOX[t >>> 24] << 24 | G.SBOX[t >>> 16 & 255] << 16 | G.SBOX[t >>> 8 & 255] << 8 | G.SBOX[t & 255];
          }
          keySchedule[k] = keySchedule[k - keySize] ^ t;
        }
        var invKeySchedule = [];
        for (var ik = 0; ik < ksRows; ik++) {
          var ksR = ksRows - ik;
          var tt = keySchedule[ksR - (ik % 4 ? 0 : 4)];
          if (ik < 4 || ksR <= 4) {
            invKeySchedule[ik] = tt;
          } else {
            invKeySchedule[ik] = G.INV_SUB_MIX[0][G.SBOX[tt >>> 24]] ^ G.INV_SUB_MIX[1][G.SBOX[tt >>> 16 & 255]] ^ G.INV_SUB_MIX[2][G.SBOX[tt >>> 8 & 255]] ^ G.INV_SUB_MIX[3][G.SBOX[tt & 255]];
          }
        }
        this._nRounds = nRounds;
        this._keySchedule = keySchedule;
        this._invKeySchedule = invKeySchedule;
      };
      AES.prototype.encryptBlockRaw = function(M) {
        M = asUInt32Array(M);
        return cryptBlock(M, this._keySchedule, G.SUB_MIX, G.SBOX, this._nRounds);
      };
      AES.prototype.encryptBlock = function(M) {
        var out = this.encryptBlockRaw(M);
        var buf = Buffer.allocUnsafe(16);
        buf.writeUInt32BE(out[0], 0);
        buf.writeUInt32BE(out[1], 4);
        buf.writeUInt32BE(out[2], 8);
        buf.writeUInt32BE(out[3], 12);
        return buf;
      };
      AES.prototype.decryptBlock = function(M) {
        M = asUInt32Array(M);
        var m1 = M[1];
        M[1] = M[3];
        M[3] = m1;
        var out = cryptBlock(M, this._invKeySchedule, G.INV_SUB_MIX, G.INV_SBOX, this._nRounds);
        var buf = Buffer.allocUnsafe(16);
        buf.writeUInt32BE(out[0], 0);
        buf.writeUInt32BE(out[3], 4);
        buf.writeUInt32BE(out[2], 8);
        buf.writeUInt32BE(out[1], 12);
        return buf;
      };
      AES.prototype.scrub = function() {
        scrubVec(this._keySchedule);
        scrubVec(this._invKeySchedule);
        scrubVec(this._key);
      };
      module.exports.AES = AES;
    },
    2356(module, __unused_webpack_exports, __webpack_require__) {
      var aes = __webpack_require__(462);
      var Buffer = __webpack_require__(2861).Buffer;
      var Transform = __webpack_require__(6168);
      var inherits = __webpack_require__(6698);
      var GHASH = __webpack_require__(5892);
      var xor = __webpack_require__(295);
      var incr32 = __webpack_require__(5122);
      function xorTest(a, b) {
        var out = 0;
        if (a.length !== b.length) out++;
        var len = Math.min(a.length, b.length);
        for (var i = 0; i < len; ++i) {
          out += a[i] ^ b[i];
        }
        return out;
      }
      function calcIv(self, iv, ck) {
        if (iv.length === 12) {
          self._finID = Buffer.concat([ iv, Buffer.from([ 0, 0, 0, 1 ]) ]);
          return Buffer.concat([ iv, Buffer.from([ 0, 0, 0, 2 ]) ]);
        }
        var ghash = new GHASH(ck);
        var len = iv.length;
        var toPad = len % 16;
        ghash.update(iv);
        if (toPad) {
          toPad = 16 - toPad;
          ghash.update(Buffer.alloc(toPad, 0));
        }
        ghash.update(Buffer.alloc(8, 0));
        var ivBits = len * 8;
        var tail = Buffer.alloc(8);
        tail.writeUIntBE(ivBits, 0, 8);
        ghash.update(tail);
        self._finID = ghash.state;
        var out = Buffer.from(self._finID);
        incr32(out);
        return out;
      }
      function StreamCipher(mode, key, iv, decrypt) {
        Transform.call(this);
        var h = Buffer.alloc(4, 0);
        this._cipher = new aes.AES(key);
        var ck = this._cipher.encryptBlock(h);
        this._ghash = new GHASH(ck);
        iv = calcIv(this, iv, ck);
        this._prev = Buffer.from(iv);
        this._cache = Buffer.allocUnsafe(0);
        this._secCache = Buffer.allocUnsafe(0);
        this._decrypt = decrypt;
        this._alen = 0;
        this._len = 0;
        this._mode = mode;
        this._authTag = null;
        this._called = false;
      }
      inherits(StreamCipher, Transform);
      StreamCipher.prototype._update = function(chunk) {
        if (!this._called && this._alen) {
          var rump = 16 - this._alen % 16;
          if (rump < 16) {
            rump = Buffer.alloc(rump, 0);
            this._ghash.update(rump);
          }
        }
        this._called = true;
        var out = this._mode.encrypt(this, chunk);
        if (this._decrypt) {
          this._ghash.update(chunk);
        } else {
          this._ghash.update(out);
        }
        this._len += chunk.length;
        return out;
      };
      StreamCipher.prototype._final = function() {
        if (this._decrypt && !this._authTag) throw new Error("Unsupported state or unable to authenticate data");
        var tag = xor(this._ghash.final(this._alen * 8, this._len * 8), this._cipher.encryptBlock(this._finID));
        if (this._decrypt && xorTest(tag, this._authTag)) throw new Error("Unsupported state or unable to authenticate data");
        this._authTag = tag;
        this._cipher.scrub();
      };
      StreamCipher.prototype.getAuthTag = function getAuthTag() {
        if (this._decrypt || !Buffer.isBuffer(this._authTag)) throw new Error("Attempting to get auth tag in unsupported state");
        return this._authTag;
      };
      StreamCipher.prototype.setAuthTag = function setAuthTag(tag) {
        if (!this._decrypt) throw new Error("Attempting to set auth tag in unsupported state");
        this._authTag = tag;
      };
      StreamCipher.prototype.setAAD = function setAAD(buf) {
        if (this._called) throw new Error("Attempting to set AAD in unsupported state");
        this._ghash.update(buf);
        this._alen += buf.length;
      };
      module.exports = StreamCipher;
    },
    1241(__unused_webpack_module, exports, __webpack_require__) {
      var ciphers = __webpack_require__(5799);
      var deciphers = __webpack_require__(6171);
      var modes = __webpack_require__(3219);
      function getCiphers() {
        return Object.keys(modes);
      }
      exports.createCipher = exports.Cipher = ciphers.createCipher;
      exports.createCipheriv = exports.Cipheriv = ciphers.createCipheriv;
      exports.createDecipher = exports.Decipher = deciphers.createDecipher;
      exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv;
      exports.listCiphers = exports.getCiphers = getCiphers;
    },
    6171(__unused_webpack_module, exports, __webpack_require__) {
      var AuthCipher = __webpack_require__(2356);
      var Buffer = __webpack_require__(2861).Buffer;
      var MODES = __webpack_require__(530);
      var StreamCipher = __webpack_require__(650);
      var Transform = __webpack_require__(6168);
      var aes = __webpack_require__(462);
      var ebtk = __webpack_require__(8078);
      var inherits = __webpack_require__(6698);
      function Decipher(mode, key, iv) {
        Transform.call(this);
        this._cache = new Splitter;
        this._last = void 0;
        this._cipher = new aes.AES(key);
        this._prev = Buffer.from(iv);
        this._mode = mode;
        this._autopadding = true;
      }
      inherits(Decipher, Transform);
      Decipher.prototype._update = function(data) {
        this._cache.add(data);
        var chunk;
        var thing;
        var out = [];
        while (chunk = this._cache.get(this._autopadding)) {
          thing = this._mode.decrypt(this, chunk);
          out.push(thing);
        }
        return Buffer.concat(out);
      };
      Decipher.prototype._final = function() {
        var chunk = this._cache.flush();
        if (this._autopadding) {
          return unpad(this._mode.decrypt(this, chunk));
        } else if (chunk) {
          throw new Error("data not multiple of block length");
        }
      };
      Decipher.prototype.setAutoPadding = function(setTo) {
        this._autopadding = !!setTo;
        return this;
      };
      function Splitter() {
        this.cache = Buffer.allocUnsafe(0);
      }
      Splitter.prototype.add = function(data) {
        this.cache = Buffer.concat([ this.cache, data ]);
      };
      Splitter.prototype.get = function(autoPadding) {
        var out;
        if (autoPadding) {
          if (this.cache.length > 16) {
            out = this.cache.slice(0, 16);
            this.cache = this.cache.slice(16);
            return out;
          }
        } else {
          if (this.cache.length >= 16) {
            out = this.cache.slice(0, 16);
            this.cache = this.cache.slice(16);
            return out;
          }
        }
        return null;
      };
      Splitter.prototype.flush = function() {
        if (this.cache.length) return this.cache;
      };
      function unpad(last) {
        var padded = last[15];
        if (padded < 1 || padded > 16) {
          throw new Error("unable to decrypt data");
        }
        var i = -1;
        while (++i < padded) {
          if (last[i + (16 - padded)] !== padded) {
            throw new Error("unable to decrypt data");
          }
        }
        if (padded === 16) return;
        return last.slice(0, 16 - padded);
      }
      function createDecipheriv(suite, password, iv) {
        var config = MODES[suite.toLowerCase()];
        if (!config) throw new TypeError("invalid suite type");
        if (typeof iv === "string") iv = Buffer.from(iv);
        if (config.mode !== "GCM" && iv.length !== config.iv) throw new TypeError("invalid iv length " + iv.length);
        if (typeof password === "string") password = Buffer.from(password);
        if (password.length !== config.key / 8) throw new TypeError("invalid key length " + password.length);
        if (config.type === "stream") {
          return new StreamCipher(config.module, password, iv, true);
        } else if (config.type === "auth") {
          return new AuthCipher(config.module, password, iv, true);
        }
        return new Decipher(config.module, password, iv);
      }
      function createDecipher(suite, password) {
        var config = MODES[suite.toLowerCase()];
        if (!config) throw new TypeError("invalid suite type");
        var keys = ebtk(password, false, config.key, config.iv);
        return createDecipheriv(suite, keys.key, keys.iv);
      }
      exports.createDecipher = createDecipher;
      exports.createDecipheriv = createDecipheriv;
    },
    5799(__unused_webpack_module, exports, __webpack_require__) {
      var MODES = __webpack_require__(530);
      var AuthCipher = __webpack_require__(2356);
      var Buffer = __webpack_require__(2861).Buffer;
      var StreamCipher = __webpack_require__(650);
      var Transform = __webpack_require__(6168);
      var aes = __webpack_require__(462);
      var ebtk = __webpack_require__(8078);
      var inherits = __webpack_require__(6698);
      function Cipher(mode, key, iv) {
        Transform.call(this);
        this._cache = new Splitter;
        this._cipher = new aes.AES(key);
        this._prev = Buffer.from(iv);
        this._mode = mode;
        this._autopadding = true;
      }
      inherits(Cipher, Transform);
      Cipher.prototype._update = function(data) {
        this._cache.add(data);
        var chunk;
        var thing;
        var out = [];
        while (chunk = this._cache.get()) {
          thing = this._mode.encrypt(this, chunk);
          out.push(thing);
        }
        return Buffer.concat(out);
      };
      var PADDING = Buffer.alloc(16, 16);
      Cipher.prototype._final = function() {
        var chunk = this._cache.flush();
        if (this._autopadding) {
          chunk = this._mode.encrypt(this, chunk);
          this._cipher.scrub();
          return chunk;
        }
        if (!chunk.equals(PADDING)) {
          this._cipher.scrub();
          throw new Error("data not multiple of block length");
        }
      };
      Cipher.prototype.setAutoPadding = function(setTo) {
        this._autopadding = !!setTo;
        return this;
      };
      function Splitter() {
        this.cache = Buffer.allocUnsafe(0);
      }
      Splitter.prototype.add = function(data) {
        this.cache = Buffer.concat([ this.cache, data ]);
      };
      Splitter.prototype.get = function() {
        if (this.cache.length > 15) {
          var out = this.cache.slice(0, 16);
          this.cache = this.cache.slice(16);
          return out;
        }
        return null;
      };
      Splitter.prototype.flush = function() {
        var len = 16 - this.cache.length;
        var padBuff = Buffer.allocUnsafe(len);
        var i = -1;
        while (++i < len) {
          padBuff.writeUInt8(len, i);
        }
        return Buffer.concat([ this.cache, padBuff ]);
      };
      function createCipheriv(suite, password, iv) {
        var config = MODES[suite.toLowerCase()];
        if (!config) throw new TypeError("invalid suite type");
        if (typeof password === "string") password = Buffer.from(password);
        if (password.length !== config.key / 8) throw new TypeError("invalid key length " + password.length);
        if (typeof iv === "string") iv = Buffer.from(iv);
        if (config.mode !== "GCM" && iv.length !== config.iv) throw new TypeError("invalid iv length " + iv.length);
        if (config.type === "stream") {
          return new StreamCipher(config.module, password, iv);
        } else if (config.type === "auth") {
          return new AuthCipher(config.module, password, iv);
        }
        return new Cipher(config.module, password, iv);
      }
      function createCipher(suite, password) {
        var config = MODES[suite.toLowerCase()];
        if (!config) throw new TypeError("invalid suite type");
        var keys = ebtk(password, false, config.key, config.iv);
        return createCipheriv(suite, keys.key, keys.iv);
      }
      exports.createCipheriv = createCipheriv;
      exports.createCipher = createCipher;
    },
    5892(module, __unused_webpack_exports, __webpack_require__) {
      var Buffer = __webpack_require__(2861).Buffer;
      var ZEROES = Buffer.alloc(16, 0);
      function toArray(buf) {
        return [ buf.readUInt32BE(0), buf.readUInt32BE(4), buf.readUInt32BE(8), buf.readUInt32BE(12) ];
      }
      function fromArray(out) {
        var buf = Buffer.allocUnsafe(16);
        buf.writeUInt32BE(out[0] >>> 0, 0);
        buf.writeUInt32BE(out[1] >>> 0, 4);
        buf.writeUInt32BE(out[2] >>> 0, 8);
        buf.writeUInt32BE(out[3] >>> 0, 12);
        return buf;
      }
      function GHASH(key) {
        this.h = key;
        this.state = Buffer.alloc(16, 0);
        this.cache = Buffer.allocUnsafe(0);
      }
      GHASH.prototype.ghash = function(block) {
        var i = -1;
        while (++i < block.length) {
          this.state[i] ^= block[i];
        }
        this._multiply();
      };
      GHASH.prototype._multiply = function() {
        var Vi = toArray(this.h);
        var Zi = [ 0, 0, 0, 0 ];
        var j, xi, lsbVi;
        var i = -1;
        while (++i < 128) {
          xi = (this.state[~~(i / 8)] & 1 << 7 - i % 8) !== 0;
          if (xi) {
            Zi[0] ^= Vi[0];
            Zi[1] ^= Vi[1];
            Zi[2] ^= Vi[2];
            Zi[3] ^= Vi[3];
          }
          lsbVi = (Vi[3] & 1) !== 0;
          for (j = 3; j > 0; j--) {
            Vi[j] = Vi[j] >>> 1 | (Vi[j - 1] & 1) << 31;
          }
          Vi[0] = Vi[0] >>> 1;
          if (lsbVi) {
            Vi[0] = Vi[0] ^ 225 << 24;
          }
        }
        this.state = fromArray(Zi);
      };
      GHASH.prototype.update = function(buf) {
        this.cache = Buffer.concat([ this.cache, buf ]);
        var chunk;
        while (this.cache.length >= 16) {
          chunk = this.cache.slice(0, 16);
          this.cache = this.cache.slice(16);
          this.ghash(chunk);
        }
      };
      GHASH.prototype.final = function(abl, bl) {
        if (this.cache.length) {
          this.ghash(Buffer.concat([ this.cache, ZEROES ], 16));
        }
        this.ghash(fromArray([ 0, abl, 0, bl ]));
        return this.state;
      };
      module.exports = GHASH;
    },
    5122(module) {
      function incr32(iv) {
        var len = iv.length;
        var item;
        while (len--) {
          item = iv.readUInt8(len);
          if (item === 255) {
            iv.writeUInt8(0, len);
          } else {
            item++;
            iv.writeUInt8(item, len);
            break;
          }
        }
      }
      module.exports = incr32;
    },
    2884(__unused_webpack_module, exports, __webpack_require__) {
      var xor = __webpack_require__(295);
      exports.encrypt = function(self, block) {
        var data = xor(block, self._prev);
        self._prev = self._cipher.encryptBlock(data);
        return self._prev;
      };
      exports.decrypt = function(self, block) {
        var pad = self._prev;
        self._prev = block;
        var out = self._cipher.decryptBlock(block);
        return xor(out, pad);
      };
    },
    6383(__unused_webpack_module, exports, __webpack_require__) {
      var Buffer = __webpack_require__(2861).Buffer;
      var xor = __webpack_require__(295);
      function encryptStart(self, data, decrypt) {
        var len = data.length;
        var out = xor(data, self._cache);
        self._cache = self._cache.slice(len);
        self._prev = Buffer.concat([ self._prev, decrypt ? data : out ]);
        return out;
      }
      exports.encrypt = function(self, data, decrypt) {
        var out = Buffer.allocUnsafe(0);
        var len;
        while (data.length) {
          if (self._cache.length === 0) {
            self._cache = self._cipher.encryptBlock(self._prev);
            self._prev = Buffer.allocUnsafe(0);
          }
          if (self._cache.length <= data.length) {
            len = self._cache.length;
            out = Buffer.concat([ out, encryptStart(self, data.slice(0, len), decrypt) ]);
            data = data.slice(len);
          } else {
            out = Buffer.concat([ out, encryptStart(self, data, decrypt) ]);
            break;
          }
        }
        return out;
      };
    },
    5264(__unused_webpack_module, exports, __webpack_require__) {
      var Buffer = __webpack_require__(2861).Buffer;
      function encryptByte(self, byteParam, decrypt) {
        var pad;
        var i = -1;
        var len = 8;
        var out = 0;
        var bit, value;
        while (++i < len) {
          pad = self._cipher.encryptBlock(self._prev);
          bit = byteParam & 1 << 7 - i ? 128 : 0;
          value = pad[0] ^ bit;
          out += (value & 128) >> i % 8;
          self._prev = shiftIn(self._prev, decrypt ? bit : value);
        }
        return out;
      }
      function shiftIn(buffer, value) {
        var len = buffer.length;
        var i = -1;
        var out = Buffer.allocUnsafe(buffer.length);
        buffer = Buffer.concat([ buffer, Buffer.from([ value ]) ]);
        while (++i < len) {
          out[i] = buffer[i] << 1 | buffer[i + 1] >> 7;
        }
        return out;
      }
      exports.encrypt = function(self, chunk, decrypt) {
        var len = chunk.length;
        var out = Buffer.allocUnsafe(len);
        var i = -1;
        while (++i < len) {
          out[i] = encryptByte(self, chunk[i], decrypt);
        }
        return out;
      };
    },
    6975(__unused_webpack_module, exports, __webpack_require__) {
      var Buffer = __webpack_require__(2861).Buffer;
      function encryptByte(self, byteParam, decrypt) {
        var pad = self._cipher.encryptBlock(self._prev);
        var out = pad[0] ^ byteParam;
        self._prev = Buffer.concat([ self._prev.slice(1), Buffer.from([ decrypt ? byteParam : out ]) ]);
        return out;
      }
      exports.encrypt = function(self, chunk, decrypt) {
        var len = chunk.length;
        var out = Buffer.allocUnsafe(len);
        var i = -1;
        while (++i < len) {
          out[i] = encryptByte(self, chunk[i], decrypt);
        }
        return out;
      };
    },
    3053(__unused_webpack_module, exports, __webpack_require__) {
      var xor = __webpack_require__(295);
      var Buffer = __webpack_require__(2861).Buffer;
      var incr32 = __webpack_require__(5122);
      function getBlock(self) {
        var out = self._cipher.encryptBlockRaw(self._prev);
        incr32(self._prev);
        return out;
      }
      var blockSize = 16;
      exports.encrypt = function(self, chunk) {
        var chunkNum = Math.ceil(chunk.length / blockSize);
        var start = self._cache.length;
        self._cache = Buffer.concat([ self._cache, Buffer.allocUnsafe(chunkNum * blockSize) ]);
        for (var i = 0; i < chunkNum; i++) {
          var out = getBlock(self);
          var offset = start + i * blockSize;
          self._cache.writeUInt32BE(out[0], offset + 0);
          self._cache.writeUInt32BE(out[1], offset + 4);
          self._cache.writeUInt32BE(out[2], offset + 8);
          self._cache.writeUInt32BE(out[3], offset + 12);
        }
        var pad = self._cache.slice(0, chunk.length);
        self._cache = self._cache.slice(chunk.length);
        return xor(chunk, pad);
      };
    },
    2632(__unused_webpack_module, exports) {
      exports.encrypt = function(self, block) {
        return self._cipher.encryptBlock(block);
      };
      exports.decrypt = function(self, block) {
        return self._cipher.decryptBlock(block);
      };
    },
    530(module, __unused_webpack_exports, __webpack_require__) {
      var modeModules = {
        ECB: __webpack_require__(2632),
        CBC: __webpack_require__(2884),
        CFB: __webpack_require__(6383),
        CFB8: __webpack_require__(6975),
        CFB1: __webpack_require__(5264),
        OFB: __webpack_require__(6843),
        CTR: __webpack_require__(3053),
        GCM: __webpack_require__(3053)
      };
      var modes = __webpack_require__(3219);
      for (var key in modes) {
        modes[key].module = modeModules[modes[key].mode];
      }
      module.exports = modes;
    },
    6843(__unused_webpack_module, exports, __webpack_require__) {
      var Buffer = __webpack_require__(8287)["Buffer"];
      var xor = __webpack_require__(295);
      function getBlock(self) {
        self._prev = self._cipher.encryptBlock(self._prev);
        return self._prev;
      }
      exports.encrypt = function(self, chunk) {
        while (self._cache.length < chunk.length) {
          self._cache = Buffer.concat([ self._cache, getBlock(self) ]);
        }
        var pad = self._cache.slice(0, chunk.length);
        self._cache = self._cache.slice(chunk.length);
        return xor(chunk, pad);
      };
    },
    650(module, __unused_webpack_exports, __webpack_require__) {
      var aes = __webpack_require__(462);
      var Buffer = __webpack_require__(2861).Buffer;
      var Transform = __webpack_require__(6168);
      var inherits = __webpack_require__(6698);
      function StreamCipher(mode, key, iv, decrypt) {
        Transform.call(this);
        this._cipher = new aes.AES(key);
        this._prev = Buffer.from(iv);
        this._cache = Buffer.allocUnsafe(0);
        this._secCache = Buffer.allocUnsafe(0);
        this._decrypt = decrypt;
        this._mode = mode;
      }
      inherits(StreamCipher, Transform);
      StreamCipher.prototype._update = function(chunk) {
        return this._mode.encrypt(this, chunk, this._decrypt);
      };
      StreamCipher.prototype._final = function() {
        this._cipher.scrub();
      };
      module.exports = StreamCipher;
    },
    125(__unused_webpack_module, exports, __webpack_require__) {
      var DES = __webpack_require__(4050);
      var aes = __webpack_require__(1241);
      var aesModes = __webpack_require__(530);
      var desModes = __webpack_require__(2438);
      var ebtk = __webpack_require__(8078);
      function createCipher(suite, password) {
        suite = suite.toLowerCase();
        var keyLen, ivLen;
        if (aesModes[suite]) {
          keyLen = aesModes[suite].key;
          ivLen = aesModes[suite].iv;
        } else if (desModes[suite]) {
          keyLen = desModes[suite].key * 8;
          ivLen = desModes[suite].iv;
        } else {
          throw new TypeError("invalid suite type");
        }
        var keys = ebtk(password, false, keyLen, ivLen);
        return createCipheriv(suite, keys.key, keys.iv);
      }
      function createDecipher(suite, password) {
        suite = suite.toLowerCase();
        var keyLen, ivLen;
        if (aesModes[suite]) {
          keyLen = aesModes[suite].key;
          ivLen = aesModes[suite].iv;
        } else if (desModes[suite]) {
          keyLen = desModes[suite].key * 8;
          ivLen = desModes[suite].iv;
        } else {
          throw new TypeError("invalid suite type");
        }
        var keys = ebtk(password, false, keyLen, ivLen);
        return createDecipheriv(suite, keys.key, keys.iv);
      }
      function createCipheriv(suite, key, iv) {
        suite = suite.toLowerCase();
        if (aesModes[suite]) return aes.createCipheriv(suite, key, iv);
        if (desModes[suite]) return new DES({
          key,
          iv,
          mode: suite
        });
        throw new TypeError("invalid suite type");
      }
      function createDecipheriv(suite, key, iv) {
        suite = suite.toLowerCase();
        if (aesModes[suite]) return aes.createDecipheriv(suite, key, iv);
        if (desModes[suite]) return new DES({
          key,
          iv,
          mode: suite,
          decrypt: true
        });
        throw new TypeError("invalid suite type");
      }
      function getCiphers() {
        return Object.keys(desModes).concat(aes.getCiphers());
      }
      exports.createCipher = exports.Cipher = createCipher;
      exports.createCipheriv = exports.Cipheriv = createCipheriv;
      exports.createDecipher = exports.Decipher = createDecipher;
      exports.createDecipheriv = exports.Decipheriv = createDecipheriv;
      exports.listCiphers = exports.getCiphers = getCiphers;
    },
    4050(module, __unused_webpack_exports, __webpack_require__) {
      var CipherBase = __webpack_require__(6168);
      var des = __webpack_require__(9560);
      var inherits = __webpack_require__(6698);
      var Buffer = __webpack_require__(2861).Buffer;
      var modes = {
        "des-ede3-cbc": des.CBC.instantiate(des.EDE),
        "des-ede3": des.EDE,
        "des-ede-cbc": des.CBC.instantiate(des.EDE),
        "des-ede": des.EDE,
        "des-cbc": des.CBC.instantiate(des.DES),
        "des-ecb": des.DES
      };
      modes.des = modes["des-cbc"];
      modes.des3 = modes["des-ede3-cbc"];
      module.exports = DES;
      inherits(DES, CipherBase);
      function DES(opts) {
        CipherBase.call(this);
        var modeName = opts.mode.toLowerCase();
        var mode = modes[modeName];
        var type;
        if (opts.decrypt) {
          type = "decrypt";
        } else {
          type = "encrypt";
        }
        var key = opts.key;
        if (!Buffer.isBuffer(key)) {
          key = Buffer.from(key);
        }
        if (modeName === "des-ede" || modeName === "des-ede-cbc") {
          key = Buffer.concat([ key, key.slice(0, 8) ]);
        }
        var iv = opts.iv;
        if (!Buffer.isBuffer(iv)) {
          iv = Buffer.from(iv);
        }
        this._des = mode.create({
          key,
          iv,
          type
        });
      }
      DES.prototype._update = function(data) {
        return Buffer.from(this._des.update(data));
      };
      DES.prototype._final = function() {
        return Buffer.from(this._des.final());
      };
    },
    2438(__unused_webpack_module, exports) {
      exports["des-ecb"] = {
        key: 8,
        iv: 0
      };
      exports["des-cbc"] = exports.des = {
        key: 8,
        iv: 8
      };
      exports["des-ede3-cbc"] = exports.des3 = {
        key: 24,
        iv: 8
      };
      exports["des-ede3"] = {
        key: 24,
        iv: 0
      };
      exports["des-ede-cbc"] = {
        key: 16,
        iv: 8
      };
      exports["des-ede"] = {
        key: 16,
        iv: 0
      };
    },
    7332(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var BN = __webpack_require__(9404);
      var randomBytes = __webpack_require__(3209);
      var Buffer = __webpack_require__(2861).Buffer;
      function getr(priv) {
        var len = priv.modulus.byteLength();
        var r;
        do {
          r = new BN(randomBytes(len));
        } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));
        return r;
      }
      function blind(priv) {
        var r = getr(priv);
        var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();
        return {
          blinder,
          unblinder: r.invm(priv.modulus)
        };
      }
      function crt(msg, priv) {
        var blinds = blind(priv);
        var len = priv.modulus.byteLength();
        var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus);
        var c1 = blinded.toRed(BN.mont(priv.prime1));
        var c2 = blinded.toRed(BN.mont(priv.prime2));
        var qinv = priv.coefficient;
        var p = priv.prime1;
        var q = priv.prime2;
        var m1 = c1.redPow(priv.exponent1).fromRed();
        var m2 = c2.redPow(priv.exponent2).fromRed();
        var h = m1.isub(m2).imul(qinv).umod(p).imul(q);
        return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, "be", len);
      }
      crt.getr = getr;
      module.exports = crt;
    },
    5715(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = __webpack_require__(2951);
    },
    20(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var createHash = __webpack_require__(7108);
      var stream = __webpack_require__(6737);
      var inherits = __webpack_require__(6698);
      var sign = __webpack_require__(5359);
      var verify = __webpack_require__(4847);
      var algorithms = __webpack_require__(2951);
      Object.keys(algorithms).forEach((function(key) {
        algorithms[key].id = Buffer.from(algorithms[key].id, "hex");
        algorithms[key.toLowerCase()] = algorithms[key];
      }));
      function Sign(algorithm) {
        stream.Writable.call(this);
        var data = algorithms[algorithm];
        if (!data) {
          throw new Error("Unknown message digest");
        }
        this._hashType = data.hash;
        this._hash = createHash(data.hash);
        this._tag = data.id;
        this._signType = data.sign;
      }
      inherits(Sign, stream.Writable);
      Sign.prototype._write = function _write(data, _, done) {
        this._hash.update(data);
        done();
      };
      Sign.prototype.update = function update(data, enc) {
        this._hash.update(typeof data === "string" ? Buffer.from(data, enc) : data);
        return this;
      };
      Sign.prototype.sign = function signMethod(key, enc) {
        this.end();
        var hash = this._hash.digest();
        var sig = sign(hash, key, this._hashType, this._signType, this._tag);
        return enc ? sig.toString(enc) : sig;
      };
      function Verify(algorithm) {
        stream.Writable.call(this);
        var data = algorithms[algorithm];
        if (!data) {
          throw new Error("Unknown message digest");
        }
        this._hash = createHash(data.hash);
        this._tag = data.id;
        this._signType = data.sign;
      }
      inherits(Verify, stream.Writable);
      Verify.prototype._write = function _write(data, _, done) {
        this._hash.update(data);
        done();
      };
      Verify.prototype.update = function update(data, enc) {
        this._hash.update(typeof data === "string" ? Buffer.from(data, enc) : data);
        return this;
      };
      Verify.prototype.verify = function verifyMethod(key, sig, enc) {
        var sigBuffer = typeof sig === "string" ? Buffer.from(sig, enc) : sig;
        this.end();
        var hash = this._hash.digest();
        return verify(sigBuffer, hash, key, this._signType, this._tag);
      };
      function createSign(algorithm) {
        return new Sign(algorithm);
      }
      function createVerify(algorithm) {
        return new Verify(algorithm);
      }
      module.exports = {
        Sign: createSign,
        Verify: createVerify,
        createSign,
        createVerify
      };
    },
    5359(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var createHmac = __webpack_require__(3507);
      var crt = __webpack_require__(7332);
      var EC = __webpack_require__(6729).ec;
      var BN = __webpack_require__(9404);
      var parseKeys = __webpack_require__(8170);
      var curves = __webpack_require__(4589);
      var RSA_PKCS1_PADDING = 1;
      function sign(hash, key, hashType, signType, tag) {
        var priv = parseKeys(key);
        if (priv.curve) {
          if (signType !== "ecdsa" && signType !== "ecdsa/rsa") {
            throw new Error("wrong private key type");
          }
          return ecSign(hash, priv);
        } else if (priv.type === "dsa") {
          if (signType !== "dsa") {
            throw new Error("wrong private key type");
          }
          return dsaSign(hash, priv, hashType);
        }
        if (signType !== "rsa" && signType !== "ecdsa/rsa") {
          throw new Error("wrong private key type");
        }
        if (key.padding !== undefined && key.padding !== RSA_PKCS1_PADDING) {
          throw new Error("illegal or unsupported padding mode");
        }
        hash = Buffer.concat([ tag, hash ]);
        var len = priv.modulus.byteLength();
        var pad = [ 0, 1 ];
        while (hash.length + pad.length + 1 < len) {
          pad.push(255);
        }
        pad.push(0);
        var i = -1;
        while (++i < hash.length) {
          pad.push(hash[i]);
        }
        var out = crt(pad, priv);
        return out;
      }
      function ecSign(hash, priv) {
        var curveId = curves[priv.curve.join(".")];
        if (!curveId) {
          throw new Error("unknown curve " + priv.curve.join("."));
        }
        var curve = new EC(curveId);
        var key = curve.keyFromPrivate(priv.privateKey);
        var out = key.sign(hash);
        return Buffer.from(out.toDER());
      }
      function dsaSign(hash, priv, algo) {
        var x = priv.params.priv_key;
        var p = priv.params.p;
        var q = priv.params.q;
        var g = priv.params.g;
        var r = new BN(0);
        var k;
        var H = bits2int(hash, q).mod(q);
        var s = false;
        var kv = getKey(x, q, hash, algo);
        while (s === false) {
          k = makeKey(q, kv, algo);
          r = makeR(g, k, p, q);
          s = k.invm(q).imul(H.add(x.mul(r))).mod(q);
          if (s.cmpn(0) === 0) {
            s = false;
            r = new BN(0);
          }
        }
        return toDER(r, s);
      }
      function toDER(r, s) {
        r = r.toArray();
        s = s.toArray();
        if (r[0] & 128) {
          r = [ 0 ].concat(r);
        }
        if (s[0] & 128) {
          s = [ 0 ].concat(s);
        }
        var total = r.length + s.length + 4;
        var res = [ 48, total, 2, r.length ];
        res = res.concat(r, [ 2, s.length ], s);
        return Buffer.from(res);
      }
      function getKey(x, q, hash, algo) {
        x = Buffer.from(x.toArray());
        if (x.length < q.byteLength()) {
          var zeros = Buffer.alloc(q.byteLength() - x.length);
          x = Buffer.concat([ zeros, x ]);
        }
        var hlen = hash.length;
        var hbits = bits2octets(hash, q);
        var v = Buffer.alloc(hlen);
        v.fill(1);
        var k = Buffer.alloc(hlen);
        k = createHmac(algo, k).update(v).update(Buffer.from([ 0 ])).update(x).update(hbits).digest();
        v = createHmac(algo, k).update(v).digest();
        k = createHmac(algo, k).update(v).update(Buffer.from([ 1 ])).update(x).update(hbits).digest();
        v = createHmac(algo, k).update(v).digest();
        return {
          k,
          v
        };
      }
      function bits2int(obits, q) {
        var bits = new BN(obits);
        var shift = (obits.length << 3) - q.bitLength();
        if (shift > 0) {
          bits.ishrn(shift);
        }
        return bits;
      }
      function bits2octets(bits, q) {
        bits = bits2int(bits, q);
        bits = bits.mod(q);
        var out = Buffer.from(bits.toArray());
        if (out.length < q.byteLength()) {
          var zeros = Buffer.alloc(q.byteLength() - out.length);
          out = Buffer.concat([ zeros, out ]);
        }
        return out;
      }
      function makeKey(q, kv, algo) {
        var t;
        var k;
        do {
          t = Buffer.alloc(0);
          while (t.length * 8 < q.bitLength()) {
            kv.v = createHmac(algo, kv.k).update(kv.v).digest();
            t = Buffer.concat([ t, kv.v ]);
          }
          k = bits2int(t, q);
          kv.k = createHmac(algo, kv.k).update(kv.v).update(Buffer.from([ 0 ])).digest();
          kv.v = createHmac(algo, kv.k).update(kv.v).digest();
        } while (k.cmp(q) !== -1);
        return k;
      }
      function makeR(g, k, p, q) {
        return g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q);
      }
      module.exports = sign;
      module.exports.getKey = getKey;
      module.exports.makeKey = makeKey;
    },
    4847(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var BN = __webpack_require__(9404);
      var EC = __webpack_require__(6729).ec;
      var parseKeys = __webpack_require__(8170);
      var curves = __webpack_require__(4589);
      function verify(sig, hash, key, signType, tag) {
        var pub = parseKeys(key);
        if (pub.type === "ec") {
          if (signType !== "ecdsa" && signType !== "ecdsa/rsa") {
            throw new Error("wrong public key type");
          }
          return ecVerify(sig, hash, pub);
        } else if (pub.type === "dsa") {
          if (signType !== "dsa") {
            throw new Error("wrong public key type");
          }
          return dsaVerify(sig, hash, pub);
        }
        if (signType !== "rsa" && signType !== "ecdsa/rsa") {
          throw new Error("wrong public key type");
        }
        hash = Buffer.concat([ tag, hash ]);
        var len = pub.modulus.byteLength();
        var pad = [ 1 ];
        var padNum = 0;
        while (hash.length + pad.length + 2 < len) {
          pad.push(255);
          padNum += 1;
        }
        pad.push(0);
        var i = -1;
        while (++i < hash.length) {
          pad.push(hash[i]);
        }
        pad = Buffer.from(pad);
        var red = BN.mont(pub.modulus);
        sig = new BN(sig).toRed(red);
        sig = sig.redPow(new BN(pub.publicExponent));
        sig = Buffer.from(sig.fromRed().toArray());
        var out = padNum < 8 ? 1 : 0;
        len = Math.min(sig.length, pad.length);
        if (sig.length !== pad.length) {
          out = 1;
        }
        i = -1;
        while (++i < len) {
          out |= sig[i] ^ pad[i];
        }
        return out === 0;
      }
      function ecVerify(sig, hash, pub) {
        var curveId = curves[pub.data.algorithm.curve.join(".")];
        if (!curveId) {
          throw new Error("unknown curve " + pub.data.algorithm.curve.join("."));
        }
        var curve = new EC(curveId);
        var pubkey = pub.data.subjectPrivateKey.data;
        return curve.verify(hash, sig, pubkey);
      }
      function dsaVerify(sig, hash, pub) {
        var p = pub.data.p;
        var q = pub.data.q;
        var g = pub.data.g;
        var y = pub.data.pub_key;
        var unpacked = parseKeys.signature.decode(sig, "der");
        var s = unpacked.s;
        var r = unpacked.r;
        checkValue(s, q);
        checkValue(r, q);
        var montp = BN.mont(p);
        var w = s.invm(q);
        var v = g.toRed(montp).redPow(new BN(hash).mul(w).mod(q)).fromRed().mul(y.toRed(montp).redPow(r.mul(w).mod(q)).fromRed()).mod(p).mod(q);
        return v.cmp(r) === 0;
      }
      function checkValue(b, q) {
        if (b.cmpn(0) <= 0) {
          throw new Error("invalid sig");
        }
        if (b.cmp(q) >= 0) {
          throw new Error("invalid sig");
        }
      }
      module.exports = verify;
    },
    2240(module) {
      var toString = {}.toString;
      module.exports = Array.isArray || function(arr) {
        return toString.call(arr) == "[object Array]";
      };
    },
    6248(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var pna = __webpack_require__(3225);
      var objectKeys = Object.keys || function(obj) {
        var keys = [];
        for (var key in obj) {
          keys.push(key);
        }
        return keys;
      };
      module.exports = Duplex;
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      var Readable = __webpack_require__(206);
      var Writable = __webpack_require__(7314);
      util.inherits(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);
        if (options && options.readable === false) this.readable = false;
        if (options && options.writable === false) this.writable = false;
        this.allowHalfOpen = true;
        if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
        this.once("end", onend);
      }
      Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
        enumerable: false,
        get: function() {
          return this._writableState.highWaterMark;
        }
      });
      function onend() {
        if (this.allowHalfOpen || this._writableState.ended) return;
        pna.nextTick(onEndNT, this);
      }
      function onEndNT(self) {
        self.end();
      }
      Object.defineProperty(Duplex.prototype, "destroyed", {
        get: function() {
          if (this._readableState === undefined || this._writableState === undefined) {
            return false;
          }
          return this._readableState.destroyed && this._writableState.destroyed;
        },
        set: function(value) {
          if (this._readableState === undefined || this._writableState === undefined) {
            return;
          }
          this._readableState.destroyed = value;
          this._writableState.destroyed = value;
        }
      });
      Duplex.prototype._destroy = function(err, cb) {
        this.push(null);
        this.end();
        pna.nextTick(cb, err);
      };
    },
    5242(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = PassThrough;
      var Transform = __webpack_require__(1816);
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      util.inherits(PassThrough, Transform);
      function PassThrough(options) {
        if (!(this instanceof PassThrough)) return new PassThrough(options);
        Transform.call(this, options);
      }
      PassThrough.prototype._transform = function(chunk, encoding, cb) {
        cb(null, chunk);
      };
    },
    206(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var pna = __webpack_require__(3225);
      module.exports = Readable;
      var isArray = __webpack_require__(2240);
      var Duplex;
      Readable.ReadableState = ReadableState;
      var EE = __webpack_require__(7007).EventEmitter;
      var EElistenerCount = function(emitter, type) {
        return emitter.listeners(type).length;
      };
      var Stream = __webpack_require__(5567);
      var Buffer = __webpack_require__(4116).Buffer;
      var OurUint8Array = (typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
      function _uint8ArrayToBuffer(chunk) {
        return Buffer.from(chunk);
      }
      function _isUint8Array(obj) {
        return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
      }
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      var debugUtil = __webpack_require__(2668);
      var debug = void 0;
      if (debugUtil && debugUtil.debuglog) {
        debug = debugUtil.debuglog("stream");
      } else {
        debug = function() {};
      }
      var BufferList = __webpack_require__(672);
      var destroyImpl = __webpack_require__(6278);
      var StringDecoder;
      util.inherits(Readable, Stream);
      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 (isArray(emitter._events[event])) emitter._events[event].unshift(fn); else emitter._events[event] = [ fn, emitter._events[event] ];
      }
      function ReadableState(options, stream) {
        Duplex = Duplex || __webpack_require__(6248);
        options = options || {};
        var isDuplex = stream instanceof Duplex;
        this.objectMode = !!options.objectMode;
        if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
        var hwm = options.highWaterMark;
        var readableHwm = options.readableHighWaterMark;
        var defaultHwm = this.objectMode ? 16 : 16 * 1024;
        if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm; else this.highWaterMark = defaultHwm;
        this.highWaterMark = Math.floor(this.highWaterMark);
        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.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 = __webpack_require__(6427).I;
          this.decoder = new StringDecoder(options.encoding);
          this.encoding = options.encoding;
        }
      }
      function Readable(options) {
        Duplex = Duplex || __webpack_require__(6248);
        if (!(this instanceof Readable)) return new Readable(options);
        this._readableState = new ReadableState(options, this);
        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", {
        get: function() {
          if (this._readableState === undefined) {
            return false;
          }
          return this._readableState.destroyed;
        },
        set: function(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) {
        this.push(null);
        cb(err);
      };
      Readable.prototype.push = function(chunk, encoding) {
        var state = this._readableState;
        var skipChunkCheck;
        if (!state.objectMode) {
          if (typeof chunk === "string") {
            encoding = encoding || state.defaultEncoding;
            if (encoding !== state.encoding) {
              chunk = Buffer.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) {
        var state = stream._readableState;
        if (chunk === null) {
          state.reading = false;
          onEofChunk(stream, state);
        } else {
          var er;
          if (!skipChunkCheck) er = chunkInvalid(state, chunk);
          if (er) {
            stream.emit("error", er);
          } else if (state.objectMode || chunk && chunk.length > 0) {
            if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
              chunk = _uint8ArrayToBuffer(chunk);
            }
            if (addToFront) {
              if (state.endEmitted) stream.emit("error", new Error("stream.unshift() after end event")); else addChunk(stream, state, chunk, true);
            } else if (state.ended) {
              stream.emit("error", new Error("stream.push() after EOF"));
            } else {
              state.reading = false;
              if (state.decoder && !encoding) {
                chunk = state.decoder.write(chunk);
                if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); else maybeReadMore(stream, state);
              } else {
                addChunk(stream, state, chunk, false);
              }
            }
          } else if (!addToFront) {
            state.reading = false;
          }
        }
        return needMoreData(state);
      }
      function addChunk(stream, state, chunk, addToFront) {
        if (state.flowing && state.length === 0 && !state.sync) {
          stream.emit("data", chunk);
          stream.read(0);
        } else {
          state.length += state.objectMode ? 1 : chunk.length;
          if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk);
          if (state.needReadable) emitReadable(stream);
        }
        maybeReadMore(stream, state);
      }
      function chunkInvalid(state, chunk) {
        var er;
        if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
          er = new TypeError("Invalid non-string/buffer chunk");
        }
        return er;
      }
      function needMoreData(state) {
        return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
      }
      Readable.prototype.isPaused = function() {
        return this._readableState.flowing === false;
      };
      Readable.prototype.setEncoding = function(enc) {
        if (!StringDecoder) StringDecoder = __webpack_require__(6427).I;
        this._readableState.decoder = new StringDecoder(enc);
        this._readableState.encoding = enc;
        return this;
      };
      var MAX_HWM = 8388608;
      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, state) {
        if (n <= 0 || state.length === 0 && state.ended) return 0;
        if (state.objectMode) return 1;
        if (n !== n) {
          if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length;
        }
        if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
        if (n <= state.length) return n;
        if (!state.ended) {
          state.needReadable = true;
          return 0;
        }
        return state.length;
      }
      Readable.prototype.read = function(n) {
        debug("read", n);
        n = parseInt(n, 10);
        var state = this._readableState;
        var nOrig = n;
        if (n !== 0) state.emittedReadable = false;
        if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
          debug("read: emitReadable", state.length, state.ended);
          if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this);
          return null;
        }
        n = howMuchToRead(n, state);
        if (n === 0 && state.ended) {
          if (state.length === 0) endReadable(this);
          return null;
        }
        var doRead = state.needReadable;
        debug("need readable", doRead);
        if (state.length === 0 || state.length - n < state.highWaterMark) {
          doRead = true;
          debug("length less than watermark", doRead);
        }
        if (state.ended || state.reading) {
          doRead = false;
          debug("reading or ended", doRead);
        } else if (doRead) {
          debug("do read");
          state.reading = true;
          state.sync = true;
          if (state.length === 0) state.needReadable = true;
          this._read(state.highWaterMark);
          state.sync = false;
          if (!state.reading) n = howMuchToRead(nOrig, state);
        }
        var ret;
        if (n > 0) ret = fromList(n, state); else ret = null;
        if (ret === null) {
          state.needReadable = true;
          n = 0;
        } else {
          state.length -= n;
        }
        if (state.length === 0) {
          if (!state.ended) state.needReadable = true;
          if (nOrig !== n && state.ended) endReadable(this);
        }
        if (ret !== null) this.emit("data", ret);
        return ret;
      };
      function onEofChunk(stream, state) {
        if (state.ended) return;
        if (state.decoder) {
          var chunk = state.decoder.end();
          if (chunk && chunk.length) {
            state.buffer.push(chunk);
            state.length += state.objectMode ? 1 : chunk.length;
          }
        }
        state.ended = true;
        emitReadable(stream);
      }
      function emitReadable(stream) {
        var state = stream._readableState;
        state.needReadable = false;
        if (!state.emittedReadable) {
          debug("emitReadable", state.flowing);
          state.emittedReadable = true;
          if (state.sync) pna.nextTick(emitReadable_, stream); else emitReadable_(stream);
        }
      }
      function emitReadable_(stream) {
        debug("emit readable");
        stream.emit("readable");
        flow(stream);
      }
      function maybeReadMore(stream, state) {
        if (!state.readingMore) {
          state.readingMore = true;
          pna.nextTick(maybeReadMore_, stream, state);
        }
      }
      function maybeReadMore_(stream, state) {
        var len = state.length;
        while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
          debug("maybeReadMore read 0");
          stream.read(0);
          if (len === state.length) break; else len = state.length;
        }
        state.readingMore = false;
      }
      Readable.prototype._read = function(n) {
        this.emit("error", new Error("_read() is not implemented"));
      };
      Readable.prototype.pipe = function(dest, pipeOpts) {
        var src = this;
        var state = this._readableState;
        switch (state.pipesCount) {
         case 0:
          state.pipes = dest;
          break;

         case 1:
          state.pipes = [ state.pipes, dest ];
          break;

         default:
          state.pipes.push(dest);
          break;
        }
        state.pipesCount += 1;
        debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
        var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
        var endFn = doEnd ? onend : unpipe;
        if (state.endEmitted) pna.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 (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
        }
        var increasedAwaitDrain = false;
        src.on("data", ondata);
        function ondata(chunk) {
          debug("ondata");
          increasedAwaitDrain = false;
          var ret = dest.write(chunk);
          if (false === ret && !increasedAwaitDrain) {
            if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
              debug("false write response, pause", state.awaitDrain);
              state.awaitDrain++;
              increasedAwaitDrain = true;
            }
            src.pause();
          }
        }
        function onerror(er) {
          debug("onerror", er);
          unpipe();
          dest.removeListener("error", onerror);
          if (EElistenerCount(dest, "error") === 0) dest.emit("error", 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 (!state.flowing) {
          debug("pipe resume");
          src.resume();
        }
        return dest;
      };
      function pipeOnDrain(src) {
        return function() {
          var state = src._readableState;
          debug("pipeOnDrain", state.awaitDrain);
          if (state.awaitDrain) state.awaitDrain--;
          if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
            state.flowing = true;
            flow(src);
          }
        };
      }
      Readable.prototype.unpipe = function(dest) {
        var state = this._readableState;
        var unpipeInfo = {
          hasUnpiped: false
        };
        if (state.pipesCount === 0) return this;
        if (state.pipesCount === 1) {
          if (dest && dest !== state.pipes) return this;
          if (!dest) dest = state.pipes;
          state.pipes = null;
          state.pipesCount = 0;
          state.flowing = false;
          if (dest) dest.emit("unpipe", this, unpipeInfo);
          return this;
        }
        if (!dest) {
          var dests = state.pipes;
          var len = state.pipesCount;
          state.pipes = null;
          state.pipesCount = 0;
          state.flowing = false;
          for (var i = 0; i < len; i++) {
            dests[i].emit("unpipe", this, {
              hasUnpiped: false
            });
          }
          return this;
        }
        var index = indexOf(state.pipes, dest);
        if (index === -1) return this;
        state.pipes.splice(index, 1);
        state.pipesCount -= 1;
        if (state.pipesCount === 1) state.pipes = state.pipes[0];
        dest.emit("unpipe", this, unpipeInfo);
        return this;
      };
      Readable.prototype.on = function(ev, fn) {
        var res = Stream.prototype.on.call(this, ev, fn);
        if (ev === "data") {
          if (this._readableState.flowing !== false) this.resume();
        } else if (ev === "readable") {
          var state = this._readableState;
          if (!state.endEmitted && !state.readableListening) {
            state.readableListening = state.needReadable = true;
            state.emittedReadable = false;
            if (!state.reading) {
              pna.nextTick(nReadingNextTick, this);
            } else if (state.length) {
              emitReadable(this);
            }
          }
        }
        return res;
      };
      Readable.prototype.addListener = Readable.prototype.on;
      function nReadingNextTick(self) {
        debug("readable nexttick read 0");
        self.read(0);
      }
      Readable.prototype.resume = function() {
        var state = this._readableState;
        if (!state.flowing) {
          debug("resume");
          state.flowing = true;
          resume(this, state);
        }
        return this;
      };
      function resume(stream, state) {
        if (!state.resumeScheduled) {
          state.resumeScheduled = true;
          pna.nextTick(resume_, stream, state);
        }
      }
      function resume_(stream, state) {
        if (!state.reading) {
          debug("resume read 0");
          stream.read(0);
        }
        state.resumeScheduled = false;
        state.awaitDrain = 0;
        stream.emit("resume");
        flow(stream);
        if (state.flowing && !state.reading) stream.read(0);
      }
      Readable.prototype.pause = function() {
        debug("call pause flowing=%j", this._readableState.flowing);
        if (false !== this._readableState.flowing) {
          debug("pause");
          this._readableState.flowing = false;
          this.emit("pause");
        }
        return this;
      };
      function flow(stream) {
        var state = stream._readableState;
        debug("flow", state.flowing);
        while (state.flowing && stream.read() !== null) {}
      }
      Readable.prototype.wrap = function(stream) {
        var _this = this;
        var state = this._readableState;
        var paused = false;
        stream.on("end", (function() {
          debug("wrapped end");
          if (state.decoder && !state.ended) {
            var chunk = state.decoder.end();
            if (chunk && chunk.length) _this.push(chunk);
          }
          _this.push(null);
        }));
        stream.on("data", (function(chunk) {
          debug("wrapped data");
          if (state.decoder) chunk = state.decoder.write(chunk);
          if (state.objectMode && (chunk === null || chunk === undefined)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return;
          var ret = _this.push(chunk);
          if (!ret) {
            paused = true;
            stream.pause();
          }
        }));
        for (var i in stream) {
          if (this[i] === undefined && typeof stream[i] === "function") {
            this[i] = function(method) {
              return function() {
                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(n) {
          debug("wrapped _read", n);
          if (paused) {
            paused = false;
            stream.resume();
          }
        };
        return this;
      };
      Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
        enumerable: false,
        get: function() {
          return this._readableState.highWaterMark;
        }
      });
      Readable._fromList = fromList;
      function fromList(n, state) {
        if (state.length === 0) return null;
        var ret;
        if (state.objectMode) ret = state.buffer.shift(); else if (!n || n >= state.length) {
          if (state.decoder) ret = state.buffer.join(""); else if (state.buffer.length === 1) ret = state.buffer.head.data; else ret = state.buffer.concat(state.length);
          state.buffer.clear();
        } else {
          ret = fromListPartial(n, state.buffer, state.decoder);
        }
        return ret;
      }
      function fromListPartial(n, list, hasStrings) {
        var ret;
        if (n < list.head.data.length) {
          ret = list.head.data.slice(0, n);
          list.head.data = list.head.data.slice(n);
        } else if (n === list.head.data.length) {
          ret = list.shift();
        } else {
          ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
        }
        return ret;
      }
      function copyFromBufferString(n, list) {
        var p = list.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) list.head = p.next; else list.head = list.tail = null;
            } else {
              list.head = p;
              p.data = str.slice(nb);
            }
            break;
          }
          ++c;
        }
        list.length -= c;
        return ret;
      }
      function copyFromBuffer(n, list) {
        var ret = Buffer.allocUnsafe(n);
        var p = list.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) list.head = p.next; else list.head = list.tail = null;
            } else {
              list.head = p;
              p.data = buf.slice(nb);
            }
            break;
          }
          ++c;
        }
        list.length -= c;
        return ret;
      }
      function endReadable(stream) {
        var state = stream._readableState;
        if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
        if (!state.endEmitted) {
          state.ended = true;
          pna.nextTick(endReadableNT, state, stream);
        }
      }
      function endReadableNT(state, stream) {
        if (!state.endEmitted && state.length === 0) {
          state.endEmitted = true;
          stream.readable = false;
          stream.emit("end");
        }
      }
      function indexOf(xs, x) {
        for (var i = 0, l = xs.length; i < l; i++) {
          if (xs[i] === x) return i;
        }
        return -1;
      }
    },
    1816(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = Transform;
      var Duplex = __webpack_require__(6248);
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      util.inherits(Transform, Duplex);
      function afterTransform(er, data) {
        var ts = this._transformState;
        ts.transforming = false;
        var cb = ts.writecb;
        if (!cb) {
          return this.emit("error", new Error("write callback called multiple times"));
        }
        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._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) {
        throw new Error("_transform() is not implemented");
      };
      Transform.prototype._write = function(chunk, encoding, cb) {
        var ts = this._transformState;
        ts.writecb = cb;
        ts.writechunk = chunk;
        ts.writeencoding = encoding;
        if (!ts.transforming) {
          var rs = this._readableState;
          if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
        }
      };
      Transform.prototype._read = function(n) {
        var ts = this._transformState;
        if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
          ts.transforming = true;
          this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
        } else {
          ts.needTransform = true;
        }
      };
      Transform.prototype._destroy = function(err, cb) {
        var _this2 = this;
        Duplex.prototype._destroy.call(this, err, (function(err2) {
          cb(err2);
          _this2.emit("close");
        }));
      };
      function done(stream, er, data) {
        if (er) return stream.emit("error", er);
        if (data != null) stream.push(data);
        if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0");
        if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming");
        return stream.push(null);
      }
    },
    7314(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var pna = __webpack_require__(3225);
      module.exports = Writable;
      function WriteReq(chunk, encoding, cb) {
        this.chunk = chunk;
        this.encoding = encoding;
        this.callback = cb;
        this.next = null;
      }
      function CorkedRequest(state) {
        var _this = this;
        this.next = null;
        this.entry = null;
        this.finish = function() {
          onCorkedFinish(_this, state);
        };
      }
      var asyncWrite = !process.browser && [ "v0.10", "v0.9." ].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
      var Duplex;
      Writable.WritableState = WritableState;
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      var internalUtil = {
        deprecate: __webpack_require__(4643)
      };
      var Stream = __webpack_require__(5567);
      var Buffer = __webpack_require__(4116).Buffer;
      var OurUint8Array = (typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
      function _uint8ArrayToBuffer(chunk) {
        return Buffer.from(chunk);
      }
      function _isUint8Array(obj) {
        return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
      }
      var destroyImpl = __webpack_require__(6278);
      util.inherits(Writable, Stream);
      function nop() {}
      function WritableState(options, stream) {
        Duplex = Duplex || __webpack_require__(6248);
        options = options || {};
        var isDuplex = stream instanceof Duplex;
        this.objectMode = !!options.objectMode;
        if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
        var hwm = options.highWaterMark;
        var writableHwm = options.writableHighWaterMark;
        var defaultHwm = this.objectMode ? 16 : 16 * 1024;
        if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm; else this.highWaterMark = defaultHwm;
        this.highWaterMark = Math.floor(this.highWaterMark);
        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.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() {
              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(object) {
            if (realHasInstance.call(this, object)) return true;
            if (this !== Writable) return false;
            return object && object._writableState instanceof WritableState;
          }
        });
      } else {
        realHasInstance = function(object) {
          return object instanceof this;
        };
      }
      function Writable(options) {
        Duplex = Duplex || __webpack_require__(6248);
        if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
          return new Writable(options);
        }
        this._writableState = new WritableState(options, this);
        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() {
        this.emit("error", new Error("Cannot pipe, not readable"));
      };
      function writeAfterEnd(stream, cb) {
        var er = new Error("write after end");
        stream.emit("error", er);
        pna.nextTick(cb, er);
      }
      function validChunk(stream, state, chunk, cb) {
        var valid = true;
        var er = false;
        if (chunk === null) {
          er = new TypeError("May not write null values to stream");
        } else if (typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
          er = new TypeError("Invalid non-string/buffer chunk");
        }
        if (er) {
          stream.emit("error", er);
          pna.nextTick(cb, er);
          valid = false;
        }
        return valid;
      }
      Writable.prototype.write = function(chunk, encoding, cb) {
        var state = this._writableState;
        var ret = false;
        var isBuf = !state.objectMode && _isUint8Array(chunk);
        if (isBuf && !Buffer.isBuffer(chunk)) {
          chunk = _uint8ArrayToBuffer(chunk);
        }
        if (typeof encoding === "function") {
          cb = encoding;
          encoding = null;
        }
        if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state.defaultEncoding;
        if (typeof cb !== "function") cb = nop;
        if (state.ended) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state, chunk, cb)) {
          state.pendingcb++;
          ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
        }
        return ret;
      };
      Writable.prototype.cork = function() {
        var state = this._writableState;
        state.corked++;
      };
      Writable.prototype.uncork = function() {
        var state = this._writableState;
        if (state.corked) {
          state.corked--;
          if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
        }
      };
      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 TypeError("Unknown encoding: " + encoding);
        this._writableState.defaultEncoding = encoding;
        return this;
      };
      function decodeChunk(state, chunk, encoding) {
        if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
          chunk = Buffer.from(chunk, encoding);
        }
        return chunk;
      }
      Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
        enumerable: false,
        get: function() {
          return this._writableState.highWaterMark;
        }
      });
      function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
        if (!isBuf) {
          var newChunk = decodeChunk(state, chunk, encoding);
          if (chunk !== newChunk) {
            isBuf = true;
            encoding = "buffer";
            chunk = newChunk;
          }
        }
        var len = state.objectMode ? 1 : chunk.length;
        state.length += len;
        var ret = state.length < state.highWaterMark;
        if (!ret) state.needDrain = true;
        if (state.writing || state.corked) {
          var last = state.lastBufferedRequest;
          state.lastBufferedRequest = {
            chunk,
            encoding,
            isBuf,
            callback: cb,
            next: null
          };
          if (last) {
            last.next = state.lastBufferedRequest;
          } else {
            state.bufferedRequest = state.lastBufferedRequest;
          }
          state.bufferedRequestCount += 1;
        } else {
          doWrite(stream, state, false, len, chunk, encoding, cb);
        }
        return ret;
      }
      function doWrite(stream, state, writev, len, chunk, encoding, cb) {
        state.writelen = len;
        state.writecb = cb;
        state.writing = true;
        state.sync = true;
        if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite);
        state.sync = false;
      }
      function onwriteError(stream, state, sync, er, cb) {
        --state.pendingcb;
        if (sync) {
          pna.nextTick(cb, er);
          pna.nextTick(finishMaybe, stream, state);
          stream._writableState.errorEmitted = true;
          stream.emit("error", er);
        } else {
          cb(er);
          stream._writableState.errorEmitted = true;
          stream.emit("error", er);
          finishMaybe(stream, state);
        }
      }
      function onwriteStateUpdate(state) {
        state.writing = false;
        state.writecb = null;
        state.length -= state.writelen;
        state.writelen = 0;
      }
      function onwrite(stream, er) {
        var state = stream._writableState;
        var sync = state.sync;
        var cb = state.writecb;
        onwriteStateUpdate(state);
        if (er) onwriteError(stream, state, sync, er, cb); else {
          var finished = needFinish(state);
          if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
            clearBuffer(stream, state);
          }
          if (sync) {
            asyncWrite(afterWrite, stream, state, finished, cb);
          } else {
            afterWrite(stream, state, finished, cb);
          }
        }
      }
      function afterWrite(stream, state, finished, cb) {
        if (!finished) onwriteDrain(stream, state);
        state.pendingcb--;
        cb();
        finishMaybe(stream, state);
      }
      function onwriteDrain(stream, state) {
        if (state.length === 0 && state.needDrain) {
          state.needDrain = false;
          stream.emit("drain");
        }
      }
      function clearBuffer(stream, state) {
        state.bufferProcessing = true;
        var entry = state.bufferedRequest;
        if (stream._writev && entry && entry.next) {
          var l = state.bufferedRequestCount;
          var buffer = new Array(l);
          var holder = state.corkedRequestsFree;
          holder.entry = entry;
          var count = 0;
          var allBuffers = true;
          while (entry) {
            buffer[count] = entry;
            if (!entry.isBuf) allBuffers = false;
            entry = entry.next;
            count += 1;
          }
          buffer.allBuffers = allBuffers;
          doWrite(stream, state, true, state.length, buffer, "", holder.finish);
          state.pendingcb++;
          state.lastBufferedRequest = null;
          if (holder.next) {
            state.corkedRequestsFree = holder.next;
            holder.next = null;
          } else {
            state.corkedRequestsFree = new CorkedRequest(state);
          }
          state.bufferedRequestCount = 0;
        } else {
          while (entry) {
            var chunk = entry.chunk;
            var encoding = entry.encoding;
            var cb = entry.callback;
            var len = state.objectMode ? 1 : chunk.length;
            doWrite(stream, state, false, len, chunk, encoding, cb);
            entry = entry.next;
            state.bufferedRequestCount--;
            if (state.writing) {
              break;
            }
          }
          if (entry === null) state.lastBufferedRequest = null;
        }
        state.bufferedRequest = entry;
        state.bufferProcessing = false;
      }
      Writable.prototype._write = function(chunk, encoding, cb) {
        cb(new Error("_write() is not implemented"));
      };
      Writable.prototype._writev = null;
      Writable.prototype.end = function(chunk, encoding, cb) {
        var state = this._writableState;
        if (typeof chunk === "function") {
          cb = chunk;
          chunk = null;
          encoding = null;
        } else if (typeof encoding === "function") {
          cb = encoding;
          encoding = null;
        }
        if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
        if (state.corked) {
          state.corked = 1;
          this.uncork();
        }
        if (!state.ending) endWritable(this, state, cb);
      };
      function needFinish(state) {
        return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
      }
      function callFinal(stream, state) {
        stream._final((function(err) {
          state.pendingcb--;
          if (err) {
            stream.emit("error", err);
          }
          state.prefinished = true;
          stream.emit("prefinish");
          finishMaybe(stream, state);
        }));
      }
      function prefinish(stream, state) {
        if (!state.prefinished && !state.finalCalled) {
          if (typeof stream._final === "function") {
            state.pendingcb++;
            state.finalCalled = true;
            pna.nextTick(callFinal, stream, state);
          } else {
            state.prefinished = true;
            stream.emit("prefinish");
          }
        }
      }
      function finishMaybe(stream, state) {
        var need = needFinish(state);
        if (need) {
          prefinish(stream, state);
          if (state.pendingcb === 0) {
            state.finished = true;
            stream.emit("finish");
          }
        }
        return need;
      }
      function endWritable(stream, state, cb) {
        state.ending = true;
        finishMaybe(stream, state);
        if (cb) {
          if (state.finished) pna.nextTick(cb); else stream.once("finish", cb);
        }
        state.ended = true;
        stream.writable = false;
      }
      function onCorkedFinish(corkReq, state, err) {
        var entry = corkReq.entry;
        corkReq.entry = null;
        while (entry) {
          var cb = entry.callback;
          state.pendingcb--;
          cb(err);
          entry = entry.next;
        }
        state.corkedRequestsFree.next = corkReq;
      }
      Object.defineProperty(Writable.prototype, "destroyed", {
        get: function() {
          if (this._writableState === undefined) {
            return false;
          }
          return this._writableState.destroyed;
        },
        set: function(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) {
        this.end();
        cb(err);
      };
    },
    672(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }
      var Buffer = __webpack_require__(4116).Buffer;
      var util = __webpack_require__(1638);
      function copyBuffer(src, target, offset) {
        src.copy(target, offset);
      }
      module.exports = function() {
        function BufferList() {
          _classCallCheck(this, BufferList);
          this.head = null;
          this.tail = null;
          this.length = 0;
        }
        BufferList.prototype.push = 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;
        };
        BufferList.prototype.unshift = function unshift(v) {
          var entry = {
            data: v,
            next: this.head
          };
          if (this.length === 0) this.tail = entry;
          this.head = entry;
          ++this.length;
        };
        BufferList.prototype.shift = 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;
        };
        BufferList.prototype.clear = function clear() {
          this.head = this.tail = null;
          this.length = 0;
        };
        BufferList.prototype.join = 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;
        };
        BufferList.prototype.concat = function concat(n) {
          if (this.length === 0) return Buffer.alloc(0);
          var ret = Buffer.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;
        };
        return BufferList;
      }();
      if (util && util.inspect && util.inspect.custom) {
        module.exports.prototype[util.inspect.custom] = function() {
          var obj = util.inspect({
            length: this.length
          });
          return this.constructor.name + " " + obj;
        };
      }
    },
    6278(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var pna = __webpack_require__(3225);
      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) {
              pna.nextTick(emitErrorNT, this, err);
            } else if (!this._writableState.errorEmitted) {
              this._writableState.errorEmitted = true;
              pna.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(err) {
          if (!cb && err) {
            if (!_this._writableState) {
              pna.nextTick(emitErrorNT, _this, err);
            } else if (!_this._writableState.errorEmitted) {
              _this._writableState.errorEmitted = true;
              pna.nextTick(emitErrorNT, _this, err);
            }
          } else if (cb) {
            cb(err);
          }
        }));
        return this;
      }
      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(self, err) {
        self.emit("error", err);
      }
      module.exports = {
        destroy,
        undestroy
      };
    },
    5567(module, __unused_webpack_exports, __webpack_require__) {
      module.exports = __webpack_require__(7007).EventEmitter;
    },
    4116(module, exports, __webpack_require__) {
      var buffer = __webpack_require__(8287);
      var Buffer = buffer.Buffer;
      function copyProps(src, dst) {
        for (var key in src) {
          dst[key] = src[key];
        }
      }
      if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
        module.exports = buffer;
      } else {
        copyProps(buffer, exports);
        exports.Buffer = SafeBuffer;
      }
      function SafeBuffer(arg, encodingOrOffset, length) {
        return Buffer(arg, encodingOrOffset, length);
      }
      copyProps(Buffer, SafeBuffer);
      SafeBuffer.from = function(arg, encodingOrOffset, length) {
        if (typeof arg === "number") {
          throw new TypeError("Argument must not be a number");
        }
        return Buffer(arg, encodingOrOffset, length);
      };
      SafeBuffer.alloc = function(size, fill, encoding) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        var buf = Buffer(size);
        if (fill !== undefined) {
          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 Buffer(size);
      };
      SafeBuffer.allocUnsafeSlow = function(size) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        return buffer.SlowBuffer(size);
      };
    },
    6737(module, exports, __webpack_require__) {
      exports = module.exports = __webpack_require__(206);
      exports.Stream = exports;
      exports.Readable = exports;
      exports.Writable = __webpack_require__(7314);
      exports.Duplex = __webpack_require__(6248);
      exports.Transform = __webpack_require__(1816);
      exports.PassThrough = __webpack_require__(5242);
    },
    6427(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(8393).Buffer;
      var isEncoding = Buffer.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" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
        return nenc || enc;
      }
      exports.I = 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 = Buffer.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 === undefined) 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(self, buf, i) {
        var j = buf.length - 1;
        if (j < i) return 0;
        var nb = utf8CheckByte(buf[j]);
        if (nb >= 0) {
          if (nb > 0) self.lastNeed = nb - 1;
          return nb;
        }
        if (--j < i || nb === -2) return 0;
        nb = utf8CheckByte(buf[j]);
        if (nb >= 0) {
          if (nb > 0) self.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 self.lastNeed = nb - 3;
          }
          return nb;
        }
        return 0;
      }
      function utf8CheckExtraBytes(self, buf, p) {
        if ((buf[0] & 192) !== 128) {
          self.lastNeed = 0;
          return "�";
        }
        if (self.lastNeed > 1 && buf.length > 1) {
          if ((buf[1] & 192) !== 128) {
            self.lastNeed = 1;
            return "�";
          }
          if (self.lastNeed > 2 && buf.length > 2) {
            if ((buf[2] & 192) !== 128) {
              self.lastNeed = 2;
              return "�";
            }
          }
        }
      }
      function utf8FillLast(buf) {
        var p = this.lastTotal - this.lastNeed;
        var r = utf8CheckExtraBytes(this, buf, p);
        if (r !== undefined) 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) : "";
      }
    },
    8393(module, exports, __webpack_require__) {
      var buffer = __webpack_require__(8287);
      var Buffer = buffer.Buffer;
      function copyProps(src, dst) {
        for (var key in src) {
          dst[key] = src[key];
        }
      }
      if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
        module.exports = buffer;
      } else {
        copyProps(buffer, exports);
        exports.Buffer = SafeBuffer;
      }
      function SafeBuffer(arg, encodingOrOffset, length) {
        return Buffer(arg, encodingOrOffset, length);
      }
      copyProps(Buffer, SafeBuffer);
      SafeBuffer.from = function(arg, encodingOrOffset, length) {
        if (typeof arg === "number") {
          throw new TypeError("Argument must not be a number");
        }
        return Buffer(arg, encodingOrOffset, length);
      };
      SafeBuffer.alloc = function(size, fill, encoding) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        var buf = Buffer(size);
        if (fill !== undefined) {
          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 Buffer(size);
      };
      SafeBuffer.allocUnsafeSlow = function(size) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        return buffer.SlowBuffer(size);
      };
    },
    295(module, __unused_webpack_exports, __webpack_require__) {
      var Buffer = __webpack_require__(8287)["Buffer"];
      module.exports = function xor(a, b) {
        var length = Math.min(a.length, b.length);
        var buffer = new Buffer(length);
        for (var i = 0; i < length; ++i) {
          buffer[i] = a[i] ^ b[i];
        }
        return buffer;
      };
    },
    8287(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      const base64 = __webpack_require__(7526);
      const ieee754 = __webpack_require__(251);
      const customInspectSymbol = typeof Symbol === "function" && typeof Symbol["for"] === "function" ? Symbol["for"]("nodejs.util.inspect.custom") : null;
      exports.Buffer = Buffer;
      exports.SlowBuffer = SlowBuffer;
      exports.INSPECT_MAX_BYTES = 50;
      const K_MAX_LENGTH = 2147483647;
      exports.kMaxLength = K_MAX_LENGTH;
      Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
      if (!Buffer.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 {
          const arr = new Uint8Array(1);
          const proto = {
            foo: function() {
              return 42;
            }
          };
          Object.setPrototypeOf(proto, Uint8Array.prototype);
          Object.setPrototypeOf(arr, proto);
          return arr.foo() === 42;
        } catch (e) {
          return false;
        }
      }
      Object.defineProperty(Buffer.prototype, "parent", {
        enumerable: true,
        get: function() {
          if (!Buffer.isBuffer(this)) return undefined;
          return this.buffer;
        }
      });
      Object.defineProperty(Buffer.prototype, "offset", {
        enumerable: true,
        get: function() {
          if (!Buffer.isBuffer(this)) return undefined;
          return this.byteOffset;
        }
      });
      function createBuffer(length) {
        if (length > K_MAX_LENGTH) {
          throw new RangeError('The value "' + length + '" is invalid for option "size"');
        }
        const buf = new Uint8Array(length);
        Object.setPrototypeOf(buf, Buffer.prototype);
        return buf;
      }
      function Buffer(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);
      }
      Buffer.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');
        }
        const valueOf = value.valueOf && value.valueOf();
        if (valueOf != null && valueOf !== value) {
          return Buffer.from(valueOf, encodingOrOffset, length);
        }
        const b = fromObject(value);
        if (b) return b;
        if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
          return Buffer.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);
      }
      Buffer.from = function(value, encodingOrOffset, length) {
        return from(value, encodingOrOffset, length);
      };
      Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype);
      Object.setPrototypeOf(Buffer, 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 !== undefined) {
          return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill);
        }
        return createBuffer(size);
      }
      Buffer.alloc = function(size, fill, encoding) {
        return alloc(size, fill, encoding);
      };
      function allocUnsafe(size) {
        assertSize(size);
        return createBuffer(size < 0 ? 0 : checked(size) | 0);
      }
      Buffer.allocUnsafe = function(size) {
        return allocUnsafe(size);
      };
      Buffer.allocUnsafeSlow = function(size) {
        return allocUnsafe(size);
      };
      function fromString(string, encoding) {
        if (typeof encoding !== "string" || encoding === "") {
          encoding = "utf8";
        }
        if (!Buffer.isEncoding(encoding)) {
          throw new TypeError("Unknown encoding: " + encoding);
        }
        const length = byteLength(string, encoding) | 0;
        let buf = createBuffer(length);
        const actual = buf.write(string, encoding);
        if (actual !== length) {
          buf = buf.slice(0, actual);
        }
        return buf;
      }
      function fromArrayLike(array) {
        const length = array.length < 0 ? 0 : checked(array.length) | 0;
        const buf = createBuffer(length);
        for (let i = 0; i < length; i += 1) {
          buf[i] = array[i] & 255;
        }
        return buf;
      }
      function fromArrayView(arrayView) {
        if (isInstance(arrayView, Uint8Array)) {
          const 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');
        }
        let buf;
        if (byteOffset === undefined && length === undefined) {
          buf = new Uint8Array(array);
        } else if (length === undefined) {
          buf = new Uint8Array(array, byteOffset);
        } else {
          buf = new Uint8Array(array, byteOffset, length);
        }
        Object.setPrototypeOf(buf, Buffer.prototype);
        return buf;
      }
      function fromObject(obj) {
        if (Buffer.isBuffer(obj)) {
          const len = checked(obj.length) | 0;
          const buf = createBuffer(len);
          if (buf.length === 0) {
            return buf;
          }
          obj.copy(buf, 0, 0, len);
          return buf;
        }
        if (obj.length !== undefined) {
          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 Buffer.alloc(+length);
      }
      Buffer.isBuffer = function isBuffer(b) {
        return b != null && b._isBuffer === true && b !== Buffer.prototype;
      };
      Buffer.compare = function compare(a, b) {
        if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength);
        if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength);
        if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
          throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
        }
        if (a === b) return 0;
        let x = a.length;
        let y = b.length;
        for (let 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;
      };
      Buffer.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;
        }
      };
      Buffer.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 Buffer.alloc(0);
        }
        let i;
        if (length === undefined) {
          length = 0;
          for (i = 0; i < list.length; ++i) {
            length += list[i].length;
          }
        }
        const buffer = Buffer.allocUnsafe(length);
        let pos = 0;
        for (i = 0; i < list.length; ++i) {
          let buf = list[i];
          if (isInstance(buf, Uint8Array)) {
            if (pos + buf.length > buffer.length) {
              if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf);
              buf.copy(buffer, pos);
            } else {
              Uint8Array.prototype.set.call(buffer, buf, pos);
            }
          } else if (!Buffer.isBuffer(buf)) {
            throw new TypeError('"list" argument must be an Array of Buffers');
          } else {
            buf.copy(buffer, pos);
          }
          pos += buf.length;
        }
        return buffer;
      };
      function byteLength(string, encoding) {
        if (Buffer.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);
        }
        const len = string.length;
        const mustMatch = arguments.length > 2 && arguments[2] === true;
        if (!mustMatch && len === 0) return 0;
        let 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;
          }
        }
      }
      Buffer.byteLength = byteLength;
      function slowToString(encoding, start, end) {
        let loweredCase = false;
        if (start === undefined || start < 0) {
          start = 0;
        }
        if (start > this.length) {
          return "";
        }
        if (end === undefined || 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;
          }
        }
      }
      Buffer.prototype._isBuffer = true;
      function swap(b, n, m) {
        const i = b[n];
        b[n] = b[m];
        b[m] = i;
      }
      Buffer.prototype.swap16 = function swap16() {
        const len = this.length;
        if (len % 2 !== 0) {
          throw new RangeError("Buffer size must be a multiple of 16-bits");
        }
        for (let i = 0; i < len; i += 2) {
          swap(this, i, i + 1);
        }
        return this;
      };
      Buffer.prototype.swap32 = function swap32() {
        const len = this.length;
        if (len % 4 !== 0) {
          throw new RangeError("Buffer size must be a multiple of 32-bits");
        }
        for (let i = 0; i < len; i += 4) {
          swap(this, i, i + 3);
          swap(this, i + 1, i + 2);
        }
        return this;
      };
      Buffer.prototype.swap64 = function swap64() {
        const len = this.length;
        if (len % 8 !== 0) {
          throw new RangeError("Buffer size must be a multiple of 64-bits");
        }
        for (let 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;
      };
      Buffer.prototype.toString = function toString() {
        const length = this.length;
        if (length === 0) return "";
        if (arguments.length === 0) return utf8Slice(this, 0, length);
        return slowToString.apply(this, arguments);
      };
      Buffer.prototype.toLocaleString = Buffer.prototype.toString;
      Buffer.prototype.equals = function equals(b) {
        if (!Buffer.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
        if (this === b) return true;
        return Buffer.compare(this, b) === 0;
      };
      Buffer.prototype.inspect = function inspect() {
        let str = "";
        const max = exports.INSPECT_MAX_BYTES;
        str = this.toString("hex", 0, max).replace(/(.{2})/g, "$1 ").trim();
        if (this.length > max) str += " ... ";
        return "<Buffer " + str + ">";
      };
      if (customInspectSymbol) {
        Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect;
      }
      Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
        if (isInstance(target, Uint8Array)) {
          target = Buffer.from(target, target.offset, target.byteLength);
        }
        if (!Buffer.isBuffer(target)) {
          throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + "Received type " + typeof target);
        }
        if (start === undefined) {
          start = 0;
        }
        if (end === undefined) {
          end = target ? target.length : 0;
        }
        if (thisStart === undefined) {
          thisStart = 0;
        }
        if (thisEnd === undefined) {
          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;
        let x = thisEnd - thisStart;
        let y = end - start;
        const len = Math.min(x, y);
        const thisCopy = this.slice(thisStart, thisEnd);
        const targetCopy = target.slice(start, end);
        for (let 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(buffer, val, byteOffset, encoding, dir) {
        if (buffer.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 : buffer.length - 1;
        }
        if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
        if (byteOffset >= buffer.length) {
          if (dir) return -1; else byteOffset = buffer.length - 1;
        } else if (byteOffset < 0) {
          if (dir) byteOffset = 0; else return -1;
        }
        if (typeof val === "string") {
          val = Buffer.from(val, encoding);
        }
        if (Buffer.isBuffer(val)) {
          if (val.length === 0) {
            return -1;
          }
          return arrayIndexOf(buffer, 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(buffer, val, byteOffset);
            } else {
              return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
            }
          }
          return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir);
        }
        throw new TypeError("val must be string, number or Buffer");
      }
      function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
        let indexSize = 1;
        let arrLength = arr.length;
        let valLength = val.length;
        if (encoding !== undefined) {
          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, i) {
          if (indexSize === 1) {
            return buf[i];
          } else {
            return buf.readUInt16BE(i * indexSize);
          }
        }
        let i;
        if (dir) {
          let 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--) {
            let found = true;
            for (let j = 0; j < valLength; j++) {
              if (read(arr, i + j) !== read(val, j)) {
                found = false;
                break;
              }
            }
            if (found) return i;
          }
        }
        return -1;
      }
      Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
        return this.indexOf(val, byteOffset, encoding) !== -1;
      };
      Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
        return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
      };
      Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
        return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
      };
      function hexWrite(buf, string, offset, length) {
        offset = Number(offset) || 0;
        const remaining = buf.length - offset;
        if (!length) {
          length = remaining;
        } else {
          length = Number(length);
          if (length > remaining) {
            length = remaining;
          }
        }
        const strLen = string.length;
        if (length > strLen / 2) {
          length = strLen / 2;
        }
        let i;
        for (i = 0; i < length; ++i) {
          const 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);
      }
      Buffer.prototype.write = function write(string, offset, length, encoding) {
        if (offset === undefined) {
          encoding = "utf8";
          length = this.length;
          offset = 0;
        } else if (length === undefined && 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 === undefined) encoding = "utf8";
          } else {
            encoding = length;
            length = undefined;
          }
        } else {
          throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
        }
        const remaining = this.length - offset;
        if (length === undefined || 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";
        let 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;
          }
        }
      };
      Buffer.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);
        const res = [];
        let i = start;
        while (i < end) {
          const firstByte = buf[i];
          let codePoint = null;
          let bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
          if (i + bytesPerSequence <= end) {
            let 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);
      }
      const MAX_ARGUMENTS_LENGTH = 4096;
      function decodeCodePointsArray(codePoints) {
        const len = codePoints.length;
        if (len <= MAX_ARGUMENTS_LENGTH) {
          return String.fromCharCode.apply(String, codePoints);
        }
        let res = "";
        let i = 0;
        while (i < len) {
          res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
        }
        return res;
      }
      function asciiSlice(buf, start, end) {
        let ret = "";
        end = Math.min(buf.length, end);
        for (let i = start; i < end; ++i) {
          ret += String.fromCharCode(buf[i] & 127);
        }
        return ret;
      }
      function latin1Slice(buf, start, end) {
        let ret = "";
        end = Math.min(buf.length, end);
        for (let i = start; i < end; ++i) {
          ret += String.fromCharCode(buf[i]);
        }
        return ret;
      }
      function hexSlice(buf, start, end) {
        const len = buf.length;
        if (!start || start < 0) start = 0;
        if (!end || end < 0 || end > len) end = len;
        let out = "";
        for (let i = start; i < end; ++i) {
          out += hexSliceLookupTable[buf[i]];
        }
        return out;
      }
      function utf16leSlice(buf, start, end) {
        const bytes = buf.slice(start, end);
        let res = "";
        for (let i = 0; i < bytes.length - 1; i += 2) {
          res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
        }
        return res;
      }
      Buffer.prototype.slice = function slice(start, end) {
        const len = this.length;
        start = ~~start;
        end = end === undefined ? len : ~~end;
        if (start < 0) {
          start += len;
          if (start < 0) start = 0;
        } else if (start > len) {
          start = len;
        }
        if (end < 0) {
          end += len;
          if (end < 0) end = 0;
        } else if (end > len) {
          end = len;
        }
        if (end < start) end = start;
        const newBuf = this.subarray(start, end);
        Object.setPrototypeOf(newBuf, Buffer.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");
      }
      Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
        offset = offset >>> 0;
        byteLength = byteLength >>> 0;
        if (!noAssert) checkOffset(offset, byteLength, this.length);
        let val = this[offset];
        let mul = 1;
        let i = 0;
        while (++i < byteLength && (mul *= 256)) {
          val += this[offset + i] * mul;
        }
        return val;
      };
      Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
        offset = offset >>> 0;
        byteLength = byteLength >>> 0;
        if (!noAssert) {
          checkOffset(offset, byteLength, this.length);
        }
        let val = this[offset + --byteLength];
        let mul = 1;
        while (byteLength > 0 && (mul *= 256)) {
          val += this[offset + --byteLength] * mul;
        }
        return val;
      };
      Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 1, this.length);
        return this[offset];
      };
      Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 2, this.length);
        return this[offset] | this[offset + 1] << 8;
      };
      Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 2, this.length);
        return this[offset] << 8 | this[offset + 1];
      };
      Buffer.prototype.readUint32LE = Buffer.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;
      };
      Buffer.prototype.readUint32BE = Buffer.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]);
      };
      Buffer.prototype.readBigUInt64LE = defineBigIntMethod((function readBigUInt64LE(offset) {
        offset = offset >>> 0;
        validateNumber(offset, "offset");
        const first = this[offset];
        const last = this[offset + 7];
        if (first === undefined || last === undefined) {
          boundsError(offset, this.length - 8);
        }
        const lo = first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24;
        const hi = this[++offset] + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + last * 2 ** 24;
        return BigInt(lo) + (BigInt(hi) << BigInt(32));
      }));
      Buffer.prototype.readBigUInt64BE = defineBigIntMethod((function readBigUInt64BE(offset) {
        offset = offset >>> 0;
        validateNumber(offset, "offset");
        const first = this[offset];
        const last = this[offset + 7];
        if (first === undefined || last === undefined) {
          boundsError(offset, this.length - 8);
        }
        const hi = first * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
        const lo = this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last;
        return (BigInt(hi) << BigInt(32)) + BigInt(lo);
      }));
      Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
        offset = offset >>> 0;
        byteLength = byteLength >>> 0;
        if (!noAssert) checkOffset(offset, byteLength, this.length);
        let val = this[offset];
        let mul = 1;
        let i = 0;
        while (++i < byteLength && (mul *= 256)) {
          val += this[offset + i] * mul;
        }
        mul *= 128;
        if (val >= mul) val -= Math.pow(2, 8 * byteLength);
        return val;
      };
      Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
        offset = offset >>> 0;
        byteLength = byteLength >>> 0;
        if (!noAssert) checkOffset(offset, byteLength, this.length);
        let i = byteLength;
        let mul = 1;
        let val = this[offset + --i];
        while (i > 0 && (mul *= 256)) {
          val += this[offset + --i] * mul;
        }
        mul *= 128;
        if (val >= mul) val -= Math.pow(2, 8 * byteLength);
        return val;
      };
      Buffer.prototype.readInt8 = function 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;
      };
      Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 2, this.length);
        const val = this[offset] | this[offset + 1] << 8;
        return val & 32768 ? val | 4294901760 : val;
      };
      Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 2, this.length);
        const val = this[offset + 1] | this[offset] << 8;
        return val & 32768 ? val | 4294901760 : val;
      };
      Buffer.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;
      };
      Buffer.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];
      };
      Buffer.prototype.readBigInt64LE = defineBigIntMethod((function readBigInt64LE(offset) {
        offset = offset >>> 0;
        validateNumber(offset, "offset");
        const first = this[offset];
        const last = this[offset + 7];
        if (first === undefined || last === undefined) {
          boundsError(offset, this.length - 8);
        }
        const val = this[offset + 4] + this[offset + 5] * 2 ** 8 + this[offset + 6] * 2 ** 16 + (last << 24);
        return (BigInt(val) << BigInt(32)) + BigInt(first + this[++offset] * 2 ** 8 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 24);
      }));
      Buffer.prototype.readBigInt64BE = defineBigIntMethod((function readBigInt64BE(offset) {
        offset = offset >>> 0;
        validateNumber(offset, "offset");
        const first = this[offset];
        const last = this[offset + 7];
        if (first === undefined || last === undefined) {
          boundsError(offset, this.length - 8);
        }
        const val = (first << 24) + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + this[++offset];
        return (BigInt(val) << BigInt(32)) + BigInt(this[++offset] * 2 ** 24 + this[++offset] * 2 ** 16 + this[++offset] * 2 ** 8 + last);
      }));
      Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 4, this.length);
        return ieee754.read(this, offset, true, 23, 4);
      };
      Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 4, this.length);
        return ieee754.read(this, offset, false, 23, 4);
      };
      Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 8, this.length);
        return ieee754.read(this, offset, true, 52, 8);
      };
      Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
        offset = offset >>> 0;
        if (!noAssert) checkOffset(offset, 8, this.length);
        return ieee754.read(this, offset, false, 52, 8);
      };
      function checkInt(buf, value, offset, ext, max, min) {
        if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" 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");
      }
      Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
        value = +value;
        offset = offset >>> 0;
        byteLength = byteLength >>> 0;
        if (!noAssert) {
          const maxBytes = Math.pow(2, 8 * byteLength) - 1;
          checkInt(this, value, offset, byteLength, maxBytes, 0);
        }
        let mul = 1;
        let i = 0;
        this[offset] = value & 255;
        while (++i < byteLength && (mul *= 256)) {
          this[offset + i] = value / mul & 255;
        }
        return offset + byteLength;
      };
      Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
        value = +value;
        offset = offset >>> 0;
        byteLength = byteLength >>> 0;
        if (!noAssert) {
          const maxBytes = Math.pow(2, 8 * byteLength) - 1;
          checkInt(this, value, offset, byteLength, maxBytes, 0);
        }
        let i = byteLength - 1;
        let mul = 1;
        this[offset + i] = value & 255;
        while (--i >= 0 && (mul *= 256)) {
          this[offset + i] = value / mul & 255;
        }
        return offset + byteLength;
      };
      Buffer.prototype.writeUint8 = Buffer.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;
      };
      Buffer.prototype.writeUint16LE = Buffer.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;
      };
      Buffer.prototype.writeUint16BE = Buffer.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;
      };
      Buffer.prototype.writeUint32LE = Buffer.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;
      };
      Buffer.prototype.writeUint32BE = Buffer.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;
      };
      function wrtBigUInt64LE(buf, value, offset, min, max) {
        checkIntBI(value, min, max, buf, offset, 7);
        let lo = Number(value & BigInt(4294967295));
        buf[offset++] = lo;
        lo = lo >> 8;
        buf[offset++] = lo;
        lo = lo >> 8;
        buf[offset++] = lo;
        lo = lo >> 8;
        buf[offset++] = lo;
        let hi = Number(value >> BigInt(32) & BigInt(4294967295));
        buf[offset++] = hi;
        hi = hi >> 8;
        buf[offset++] = hi;
        hi = hi >> 8;
        buf[offset++] = hi;
        hi = hi >> 8;
        buf[offset++] = hi;
        return offset;
      }
      function wrtBigUInt64BE(buf, value, offset, min, max) {
        checkIntBI(value, min, max, buf, offset, 7);
        let lo = Number(value & BigInt(4294967295));
        buf[offset + 7] = lo;
        lo = lo >> 8;
        buf[offset + 6] = lo;
        lo = lo >> 8;
        buf[offset + 5] = lo;
        lo = lo >> 8;
        buf[offset + 4] = lo;
        let hi = Number(value >> BigInt(32) & BigInt(4294967295));
        buf[offset + 3] = hi;
        hi = hi >> 8;
        buf[offset + 2] = hi;
        hi = hi >> 8;
        buf[offset + 1] = hi;
        hi = hi >> 8;
        buf[offset] = hi;
        return offset + 8;
      }
      Buffer.prototype.writeBigUInt64LE = defineBigIntMethod((function writeBigUInt64LE(value, offset = 0) {
        return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
      }));
      Buffer.prototype.writeBigUInt64BE = defineBigIntMethod((function writeBigUInt64BE(value, offset = 0) {
        return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt("0xffffffffffffffff"));
      }));
      Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
        value = +value;
        offset = offset >>> 0;
        if (!noAssert) {
          const limit = Math.pow(2, 8 * byteLength - 1);
          checkInt(this, value, offset, byteLength, limit - 1, -limit);
        }
        let i = 0;
        let mul = 1;
        let sub = 0;
        this[offset] = value & 255;
        while (++i < byteLength && (mul *= 256)) {
          if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
            sub = 1;
          }
          this[offset + i] = (value / mul >> 0) - sub & 255;
        }
        return offset + byteLength;
      };
      Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
        value = +value;
        offset = offset >>> 0;
        if (!noAssert) {
          const limit = Math.pow(2, 8 * byteLength - 1);
          checkInt(this, value, offset, byteLength, limit - 1, -limit);
        }
        let i = byteLength - 1;
        let mul = 1;
        let 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 + byteLength;
      };
      Buffer.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;
      };
      Buffer.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;
      };
      Buffer.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;
      };
      Buffer.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;
      };
      Buffer.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;
      };
      Buffer.prototype.writeBigInt64LE = defineBigIntMethod((function writeBigInt64LE(value, offset = 0) {
        return wrtBigUInt64LE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
      }));
      Buffer.prototype.writeBigInt64BE = defineBigIntMethod((function writeBigInt64BE(value, offset = 0) {
        return wrtBigUInt64BE(this, value, offset, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
      }));
      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, 34028234663852886e22, -34028234663852886e22);
        }
        ieee754.write(buf, value, offset, littleEndian, 23, 4);
        return offset + 4;
      }
      Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
        return writeFloat(this, value, offset, true, noAssert);
      };
      Buffer.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, 17976931348623157e292, -17976931348623157e292);
        }
        ieee754.write(buf, value, offset, littleEndian, 52, 8);
        return offset + 8;
      }
      Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
        return writeDouble(this, value, offset, true, noAssert);
      };
      Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
        return writeDouble(this, value, offset, false, noAssert);
      };
      Buffer.prototype.copy = function copy(target, targetStart, start, end) {
        if (!Buffer.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;
        }
        const 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;
      };
      Buffer.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 !== undefined && typeof encoding !== "string") {
            throw new TypeError("encoding must be a string");
          }
          if (typeof encoding === "string" && !Buffer.isEncoding(encoding)) {
            throw new TypeError("Unknown encoding: " + encoding);
          }
          if (val.length === 1) {
            const 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 === undefined ? this.length : end >>> 0;
        if (!val) val = 0;
        let i;
        if (typeof val === "number") {
          for (i = start; i < end; ++i) {
            this[i] = val;
          }
        } else {
          const bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding);
          const 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;
      };
      const errors = {};
      function E(sym, getMessage, Base) {
        errors[sym] = class NodeError extends Base {
          constructor() {
            super();
            Object.defineProperty(this, "message", {
              value: getMessage.apply(this, arguments),
              writable: true,
              configurable: true
            });
            this.name = `${this.name} [${sym}]`;
            this.stack;
            delete this.name;
          }
          get code() {
            return sym;
          }
          set code(value) {
            Object.defineProperty(this, "code", {
              configurable: true,
              enumerable: true,
              value,
              writable: true
            });
          }
          toString() {
            return `${this.name} [${sym}]: ${this.message}`;
          }
        };
      }
      E("ERR_BUFFER_OUT_OF_BOUNDS", (function(name) {
        if (name) {
          return `${name} is outside of buffer bounds`;
        }
        return "Attempt to access memory outside buffer bounds";
      }), RangeError);
      E("ERR_INVALID_ARG_TYPE", (function(name, actual) {
        return `The "${name}" argument must be of type number. Received type ${typeof actual}`;
      }), TypeError);
      E("ERR_OUT_OF_RANGE", (function(str, range, input) {
        let msg = `The value of "${str}" is out of range.`;
        let received = input;
        if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {
          received = addNumericalSeparator(String(input));
        } else if (typeof input === "bigint") {
          received = String(input);
          if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {
            received = addNumericalSeparator(received);
          }
          received += "n";
        }
        msg += ` It must be ${range}. Received ${received}`;
        return msg;
      }), RangeError);
      function addNumericalSeparator(val) {
        let res = "";
        let i = val.length;
        const start = val[0] === "-" ? 1 : 0;
        for (;i >= start + 4; i -= 3) {
          res = `_${val.slice(i - 3, i)}${res}`;
        }
        return `${val.slice(0, i)}${res}`;
      }
      function checkBounds(buf, offset, byteLength) {
        validateNumber(offset, "offset");
        if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {
          boundsError(offset, buf.length - (byteLength + 1));
        }
      }
      function checkIntBI(value, min, max, buf, offset, byteLength) {
        if (value > max || value < min) {
          const n = typeof min === "bigint" ? "n" : "";
          let range;
          if (byteLength > 3) {
            if (min === 0 || min === BigInt(0)) {
              range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`;
            } else {
              range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + `${(byteLength + 1) * 8 - 1}${n}`;
            }
          } else {
            range = `>= ${min}${n} and <= ${max}${n}`;
          }
          throw new errors.ERR_OUT_OF_RANGE("value", range, value);
        }
        checkBounds(buf, offset, byteLength);
      }
      function validateNumber(value, name) {
        if (typeof value !== "number") {
          throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);
        }
      }
      function boundsError(value, length, type) {
        if (Math.floor(value) !== value) {
          validateNumber(value, type);
          throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);
        }
        if (length < 0) {
          throw new errors.ERR_BUFFER_OUT_OF_BOUNDS;
        }
        throw new errors.ERR_OUT_OF_RANGE(type || "offset", `>= ${type ? 1 : 0} and <= ${length}`, value);
      }
      const 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;
        let codePoint;
        const length = string.length;
        let leadSurrogate = null;
        const bytes = [];
        for (let 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) {
        const byteArray = [];
        for (let i = 0; i < str.length; ++i) {
          byteArray.push(str.charCodeAt(i) & 255);
        }
        return byteArray;
      }
      function utf16leToBytes(str, units) {
        let c, hi, lo;
        const byteArray = [];
        for (let 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) {
        let i;
        for (i = 0; i < length; ++i) {
          if (i + offset >= dst.length || i >= src.length) break;
          dst[i + offset] = src[i];
        }
        return i;
      }
      function isInstance(obj, type) {
        return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name;
      }
      function numberIsNaN(obj) {
        return obj !== obj;
      }
      const hexSliceLookupTable = function() {
        const alphabet = "0123456789abcdef";
        const table = new Array(256);
        for (let i = 0; i < 16; ++i) {
          const i16 = i * 16;
          for (let j = 0; j < 16; ++j) {
            table[i16 + j] = alphabet[i] + alphabet[j];
          }
        }
        return table;
      }();
      function defineBigIntMethod(fn) {
        return typeof BigInt === "undefined" ? BufferBigIntNotDefined : fn;
      }
      function BufferBigIntNotDefined() {
        throw new Error("BigInt not supported");
      }
    },
    3144(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var bind = __webpack_require__(6743);
      var $apply = __webpack_require__(1002);
      var $call = __webpack_require__(76);
      var $reflectApply = __webpack_require__(7119);
      module.exports = $reflectApply || bind.call($call, $apply);
    },
    2205(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var bind = __webpack_require__(6743);
      var $apply = __webpack_require__(1002);
      var actualApply = __webpack_require__(3144);
      module.exports = function applyBind() {
        return actualApply(bind, $apply, arguments);
      };
    },
    1002(module) {
      "use strict";
      module.exports = Function.prototype.apply;
    },
    76(module) {
      "use strict";
      module.exports = Function.prototype.call;
    },
    3126(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var bind = __webpack_require__(6743);
      var $TypeError = __webpack_require__(9675);
      var $call = __webpack_require__(76);
      var $actualApply = __webpack_require__(3144);
      module.exports = function callBindBasic(args) {
        if (args.length < 1 || typeof args[0] !== "function") {
          throw new $TypeError("a function is required");
        }
        return $actualApply(bind, $call, args);
      };
    },
    7119(module) {
      "use strict";
      module.exports = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
    },
    487(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var setFunctionLength = __webpack_require__(6897);
      var $defineProperty = __webpack_require__(655);
      var callBindBasic = __webpack_require__(3126);
      var applyBind = __webpack_require__(2205);
      module.exports = function callBind(originalFunction) {
        var func = callBindBasic(arguments);
        var adjustedLength = originalFunction.length - (arguments.length - 1);
        return setFunctionLength(func, 1 + (adjustedLength > 0 ? adjustedLength : 0), true);
      };
      if ($defineProperty) {
        $defineProperty(module.exports, "apply", {
          value: applyBind
        });
      } else {
        module.exports.apply = applyBind;
      }
    },
    6556(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var GetIntrinsic = __webpack_require__(453);
      var callBindBasic = __webpack_require__(3126);
      var $indexOf = callBindBasic([ GetIntrinsic("%String.prototype.indexOf%") ]);
      module.exports = function callBoundIntrinsic(name, allowMissing) {
        var intrinsic = GetIntrinsic(name, !!allowMissing);
        if (typeof intrinsic === "function" && $indexOf(name, ".prototype.") > -1) {
          return callBindBasic([ intrinsic ]);
        }
        return intrinsic;
      };
    },
    6168(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var Transform = __webpack_require__(8310).Transform;
      var StringDecoder = __webpack_require__(3141).I;
      var inherits = __webpack_require__(6698);
      function CipherBase(hashMode) {
        Transform.call(this);
        this.hashMode = typeof hashMode === "string";
        if (this.hashMode) {
          this[hashMode] = this._finalOrDigest;
        } else {
          this["final"] = this._finalOrDigest;
        }
        if (this._final) {
          this.__final = this._final;
          this._final = null;
        }
        this._decoder = null;
        this._encoding = null;
      }
      inherits(CipherBase, Transform);
      var useUint8Array = typeof Uint8Array !== "undefined";
      var useArrayBuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && ArrayBuffer.isView && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT);
      function toBuffer(data, encoding) {
        if (data instanceof Buffer) {
          return data;
        }
        if (typeof data === "string") {
          return Buffer.from(data, encoding);
        }
        if (useArrayBuffer && ArrayBuffer.isView(data)) {
          if (data.byteLength === 0) {
            return Buffer.alloc(0);
          }
          var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
          if (res.byteLength === data.byteLength) {
            return res;
          }
        }
        if (useUint8Array && data instanceof Uint8Array) {
          return Buffer.from(data);
        }
        if (Buffer.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) {
          return Buffer.from(data);
        }
        throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.');
      }
      CipherBase.prototype.update = function(data, inputEnc, outputEnc) {
        var bufferData = toBuffer(data, inputEnc);
        var outData = this._update(bufferData);
        if (this.hashMode) {
          return this;
        }
        if (outputEnc) {
          outData = this._toString(outData, outputEnc);
        }
        return outData;
      };
      CipherBase.prototype.setAutoPadding = function() {};
      CipherBase.prototype.getAuthTag = function() {
        throw new Error("trying to get auth tag in unsupported state");
      };
      CipherBase.prototype.setAuthTag = function() {
        throw new Error("trying to set auth tag in unsupported state");
      };
      CipherBase.prototype.setAAD = function() {
        throw new Error("trying to set aad in unsupported state");
      };
      CipherBase.prototype._transform = function(data, _, next) {
        var err;
        try {
          if (this.hashMode) {
            this._update(data);
          } else {
            this.push(this._update(data));
          }
        } catch (e) {
          err = e;
        } finally {
          next(err);
        }
      };
      CipherBase.prototype._flush = function(done) {
        var err;
        try {
          this.push(this.__final());
        } catch (e) {
          err = e;
        }
        done(err);
      };
      CipherBase.prototype._finalOrDigest = function(outputEnc) {
        var outData = this.__final() || Buffer.alloc(0);
        if (outputEnc) {
          outData = this._toString(outData, outputEnc, true);
        }
        return outData;
      };
      CipherBase.prototype._toString = function(value, enc, fin) {
        if (!this._decoder) {
          this._decoder = new StringDecoder(enc);
          this._encoding = enc;
        }
        if (this._encoding !== enc) {
          throw new Error("can’t switch encodings");
        }
        var out = this._decoder.write(value);
        if (fin) {
          out += this._decoder.end();
        }
        return out;
      };
      module.exports = CipherBase;
    },
    5622(__unused_webpack_module, exports, __webpack_require__) {
      function isArray(arg) {
        if (Array.isArray) {
          return Array.isArray(arg);
        }
        return objectToString(arg) === "[object Array]";
      }
      exports.isArray = isArray;
      function isBoolean(arg) {
        return typeof arg === "boolean";
      }
      exports.isBoolean = isBoolean;
      function isNull(arg) {
        return arg === null;
      }
      exports.isNull = isNull;
      function isNullOrUndefined(arg) {
        return arg == null;
      }
      exports.isNullOrUndefined = isNullOrUndefined;
      function isNumber(arg) {
        return typeof arg === "number";
      }
      exports.isNumber = isNumber;
      function isString(arg) {
        return typeof arg === "string";
      }
      exports.isString = isString;
      function isSymbol(arg) {
        return typeof arg === "symbol";
      }
      exports.isSymbol = isSymbol;
      function isUndefined(arg) {
        return arg === void 0;
      }
      exports.isUndefined = isUndefined;
      function isRegExp(re) {
        return objectToString(re) === "[object RegExp]";
      }
      exports.isRegExp = isRegExp;
      function isObject(arg) {
        return typeof arg === "object" && arg !== null;
      }
      exports.isObject = isObject;
      function isDate(d) {
        return objectToString(d) === "[object Date]";
      }
      exports.isDate = isDate;
      function isError(e) {
        return objectToString(e) === "[object Error]" || e instanceof Error;
      }
      exports.isError = isError;
      function isFunction(arg) {
        return typeof arg === "function";
      }
      exports.isFunction = isFunction;
      function isPrimitive(arg) {
        return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined";
      }
      exports.isPrimitive = isPrimitive;
      exports.isBuffer = __webpack_require__(8287).Buffer.isBuffer;
      function objectToString(o) {
        return Object.prototype.toString.call(o);
      }
    },
    1324(module, __unused_webpack_exports, __webpack_require__) {
      var Buffer = __webpack_require__(8287)["Buffer"];
      var elliptic = __webpack_require__(6729);
      var BN = __webpack_require__(2801);
      module.exports = function createECDH(curve) {
        return new ECDH(curve);
      };
      var aliases = {
        secp256k1: {
          name: "secp256k1",
          byteLength: 32
        },
        secp224r1: {
          name: "p224",
          byteLength: 28
        },
        prime256v1: {
          name: "p256",
          byteLength: 32
        },
        prime192v1: {
          name: "p192",
          byteLength: 24
        },
        ed25519: {
          name: "ed25519",
          byteLength: 32
        },
        secp384r1: {
          name: "p384",
          byteLength: 48
        },
        secp521r1: {
          name: "p521",
          byteLength: 66
        }
      };
      aliases.p224 = aliases.secp224r1;
      aliases.p256 = aliases.secp256r1 = aliases.prime256v1;
      aliases.p192 = aliases.secp192r1 = aliases.prime192v1;
      aliases.p384 = aliases.secp384r1;
      aliases.p521 = aliases.secp521r1;
      function ECDH(curve) {
        this.curveType = aliases[curve];
        if (!this.curveType) {
          this.curveType = {
            name: curve
          };
        }
        this.curve = new elliptic.ec(this.curveType.name);
        this.keys = void 0;
      }
      ECDH.prototype.generateKeys = function(enc, format) {
        this.keys = this.curve.genKeyPair();
        return this.getPublicKey(enc, format);
      };
      ECDH.prototype.computeSecret = function(other, inenc, enc) {
        inenc = inenc || "utf8";
        if (!Buffer.isBuffer(other)) {
          other = new Buffer(other, inenc);
        }
        var otherPub = this.curve.keyFromPublic(other).getPublic();
        var out = otherPub.mul(this.keys.getPrivate()).getX();
        return formatReturnValue(out, enc, this.curveType.byteLength);
      };
      ECDH.prototype.getPublicKey = function(enc, format) {
        var key = this.keys.getPublic(format === "compressed", true);
        if (format === "hybrid") {
          if (key[key.length - 1] % 2) {
            key[0] = 7;
          } else {
            key[0] = 6;
          }
        }
        return formatReturnValue(key, enc);
      };
      ECDH.prototype.getPrivateKey = function(enc) {
        return formatReturnValue(this.keys.getPrivate(), enc);
      };
      ECDH.prototype.setPublicKey = function(pub, enc) {
        enc = enc || "utf8";
        if (!Buffer.isBuffer(pub)) {
          pub = new Buffer(pub, enc);
        }
        this.keys._importPublic(pub);
        return this;
      };
      ECDH.prototype.setPrivateKey = function(priv, enc) {
        enc = enc || "utf8";
        if (!Buffer.isBuffer(priv)) {
          priv = new Buffer(priv, enc);
        }
        var _priv = new BN(priv);
        _priv = _priv.toString(16);
        this.keys = this.curve.genKeyPair();
        this.keys._importPrivate(_priv);
        return this;
      };
      function formatReturnValue(bn, enc, len) {
        if (!Array.isArray(bn)) {
          bn = bn.toArray();
        }
        var buf = new Buffer(bn);
        if (len && buf.length < len) {
          var zeros = new Buffer(len - buf.length);
          zeros.fill(0);
          buf = Buffer.concat([ zeros, buf ]);
        }
        if (!enc) {
          return buf;
        } else {
          return buf.toString(enc);
        }
      }
    },
    2801(module, __unused_webpack_exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      (function(module, exports) {
        "use strict";
        function assert(val, msg) {
          if (!val) throw new Error(msg || "Assertion failed");
        }
        function inherits(ctor, superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {};
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor;
          ctor.prototype.constructor = ctor;
        }
        function BN(number, base, endian) {
          if (BN.isBN(number)) {
            return number;
          }
          this.negative = 0;
          this.words = null;
          this.length = 0;
          this.red = null;
          if (number !== null) {
            if (base === "le" || base === "be") {
              endian = base;
              base = 10;
            }
            this._init(number || 0, base || 10, endian || "be");
          }
        }
        if (typeof module === "object") {
          module.exports = BN;
        } else {
          exports.BN = BN;
        }
        BN.BN = BN;
        BN.wordSize = 26;
        var Buffer;
        try {
          if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
            Buffer = window.Buffer;
          } else {
            Buffer = __webpack_require__(7965).Buffer;
          }
        } catch (e) {}
        BN.isBN = function isBN(num) {
          if (num instanceof BN) {
            return true;
          }
          return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
        };
        BN.max = function max(left, right) {
          if (left.cmp(right) > 0) return left;
          return right;
        };
        BN.min = function min(left, right) {
          if (left.cmp(right) < 0) return left;
          return right;
        };
        BN.prototype._init = function init(number, base, endian) {
          if (typeof number === "number") {
            return this._initNumber(number, base, endian);
          }
          if (typeof number === "object") {
            return this._initArray(number, base, endian);
          }
          if (base === "hex") {
            base = 16;
          }
          assert(base === (base | 0) && base >= 2 && base <= 36);
          number = number.toString().replace(/\s+/g, "");
          var start = 0;
          if (number[0] === "-") {
            start++;
            this.negative = 1;
          }
          if (start < number.length) {
            if (base === 16) {
              this._parseHex(number, start, endian);
            } else {
              this._parseBase(number, base, start);
              if (endian === "le") {
                this._initArray(this.toArray(), base, endian);
              }
            }
          }
        };
        BN.prototype._initNumber = function _initNumber(number, base, endian) {
          if (number < 0) {
            this.negative = 1;
            number = -number;
          }
          if (number < 67108864) {
            this.words = [ number & 67108863 ];
            this.length = 1;
          } else if (number < 4503599627370496) {
            this.words = [ number & 67108863, number / 67108864 & 67108863 ];
            this.length = 2;
          } else {
            assert(number < 9007199254740992);
            this.words = [ number & 67108863, number / 67108864 & 67108863, 1 ];
            this.length = 3;
          }
          if (endian !== "le") return;
          this._initArray(this.toArray(), base, endian);
        };
        BN.prototype._initArray = function _initArray(number, base, endian) {
          assert(typeof number.length === "number");
          if (number.length <= 0) {
            this.words = [ 0 ];
            this.length = 1;
            return this;
          }
          this.length = Math.ceil(number.length / 3);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var j, w;
          var off = 0;
          if (endian === "be") {
            for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
              w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          } else if (endian === "le") {
            for (i = 0, j = 0; i < number.length; i += 3) {
              w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          }
          return this.strip();
        };
        function parseHex4Bits(string, index) {
          var c = string.charCodeAt(index);
          if (c >= 65 && c <= 70) {
            return c - 55;
          } else if (c >= 97 && c <= 102) {
            return c - 87;
          } else {
            return c - 48 & 15;
          }
        }
        function parseHexByte(string, lowerBound, index) {
          var r = parseHex4Bits(string, index);
          if (index - 1 >= lowerBound) {
            r |= parseHex4Bits(string, index - 1) << 4;
          }
          return r;
        }
        BN.prototype._parseHex = function _parseHex(number, start, endian) {
          this.length = Math.ceil((number.length - start) / 6);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var off = 0;
          var j = 0;
          var w;
          if (endian === "be") {
            for (i = number.length - 1; i >= start; i -= 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          } else {
            var parseLength = number.length - start;
            for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          }
          this.strip();
        };
        function parseBase(str, start, end, mul) {
          var r = 0;
          var len = Math.min(str.length, end);
          for (var i = start; i < len; i++) {
            var c = str.charCodeAt(i) - 48;
            r *= mul;
            if (c >= 49) {
              r += c - 49 + 10;
            } else if (c >= 17) {
              r += c - 17 + 10;
            } else {
              r += c;
            }
          }
          return r;
        }
        BN.prototype._parseBase = function _parseBase(number, base, start) {
          this.words = [ 0 ];
          this.length = 1;
          for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
            limbLen++;
          }
          limbLen--;
          limbPow = limbPow / base | 0;
          var total = number.length - start;
          var mod = total % limbLen;
          var end = Math.min(total, total - mod) + start;
          var word = 0;
          for (var i = start; i < end; i += limbLen) {
            word = parseBase(number, i, i + limbLen, base);
            this.imuln(limbPow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          if (mod !== 0) {
            var pow = 1;
            word = parseBase(number, i, number.length, base);
            for (i = 0; i < mod; i++) {
              pow *= base;
            }
            this.imuln(pow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          this.strip();
        };
        BN.prototype.copy = function copy(dest) {
          dest.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            dest.words[i] = this.words[i];
          }
          dest.length = this.length;
          dest.negative = this.negative;
          dest.red = this.red;
        };
        BN.prototype.clone = function clone() {
          var r = new BN(null);
          this.copy(r);
          return r;
        };
        BN.prototype._expand = function _expand(size) {
          while (this.length < size) {
            this.words[this.length++] = 0;
          }
          return this;
        };
        BN.prototype.strip = function strip() {
          while (this.length > 1 && this.words[this.length - 1] === 0) {
            this.length--;
          }
          return this._normSign();
        };
        BN.prototype._normSign = function _normSign() {
          if (this.length === 1 && this.words[0] === 0) {
            this.negative = 0;
          }
          return this;
        };
        BN.prototype.inspect = function inspect() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
        };
        var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ];
        var groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];
        var groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ];
        BN.prototype.toString = function toString(base, padding) {
          base = base || 10;
          padding = padding | 0 || 1;
          var out;
          if (base === 16 || base === "hex") {
            out = "";
            var off = 0;
            var carry = 0;
            for (var i = 0; i < this.length; i++) {
              var w = this.words[i];
              var word = ((w << off | carry) & 16777215).toString(16);
              carry = w >>> 24 - off & 16777215;
              off += 2;
              if (off >= 26) {
                off -= 26;
                i--;
              }
              if (carry !== 0 || i !== this.length - 1) {
                out = zeros[6 - word.length] + word + out;
              } else {
                out = word + out;
              }
            }
            if (carry !== 0) {
              out = carry.toString(16) + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          if (base === (base | 0) && base >= 2 && base <= 36) {
            var groupSize = groupSizes[base];
            var groupBase = groupBases[base];
            out = "";
            var c = this.clone();
            c.negative = 0;
            while (!c.isZero()) {
              var r = c.modn(groupBase).toString(base);
              c = c.idivn(groupBase);
              if (!c.isZero()) {
                out = zeros[groupSize - r.length] + r + out;
              } else {
                out = r + out;
              }
            }
            if (this.isZero()) {
              out = "0" + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          assert(false, "Base should be between 2 and 36");
        };
        BN.prototype.toNumber = function toNumber() {
          var ret = this.words[0];
          if (this.length === 2) {
            ret += this.words[1] * 67108864;
          } else if (this.length === 3 && this.words[2] === 1) {
            ret += 4503599627370496 + this.words[1] * 67108864;
          } else if (this.length > 2) {
            assert(false, "Number can only safely store up to 53 bits");
          }
          return this.negative !== 0 ? -ret : ret;
        };
        BN.prototype.toJSON = function toJSON() {
          return this.toString(16);
        };
        BN.prototype.toBuffer = function toBuffer(endian, length) {
          assert(typeof Buffer !== "undefined");
          return this.toArrayLike(Buffer, endian, length);
        };
        BN.prototype.toArray = function toArray(endian, length) {
          return this.toArrayLike(Array, endian, length);
        };
        BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
          var byteLength = this.byteLength();
          var reqLength = length || Math.max(1, byteLength);
          assert(byteLength <= reqLength, "byte array longer than desired length");
          assert(reqLength > 0, "Requested array length <= 0");
          this.strip();
          var littleEndian = endian === "le";
          var res = new ArrayType(reqLength);
          var b, i;
          var q = this.clone();
          if (!littleEndian) {
            for (i = 0; i < reqLength - byteLength; i++) {
              res[i] = 0;
            }
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[reqLength - i - 1] = b;
            }
          } else {
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[i] = b;
            }
            for (;i < reqLength; i++) {
              res[i] = 0;
            }
          }
          return res;
        };
        if (Math.clz32) {
          BN.prototype._countBits = function _countBits(w) {
            return 32 - Math.clz32(w);
          };
        } else {
          BN.prototype._countBits = function _countBits(w) {
            var t = w;
            var r = 0;
            if (t >= 4096) {
              r += 13;
              t >>>= 13;
            }
            if (t >= 64) {
              r += 7;
              t >>>= 7;
            }
            if (t >= 8) {
              r += 4;
              t >>>= 4;
            }
            if (t >= 2) {
              r += 2;
              t >>>= 2;
            }
            return r + t;
          };
        }
        BN.prototype._zeroBits = function _zeroBits(w) {
          if (w === 0) return 26;
          var t = w;
          var r = 0;
          if ((t & 8191) === 0) {
            r += 13;
            t >>>= 13;
          }
          if ((t & 127) === 0) {
            r += 7;
            t >>>= 7;
          }
          if ((t & 15) === 0) {
            r += 4;
            t >>>= 4;
          }
          if ((t & 3) === 0) {
            r += 2;
            t >>>= 2;
          }
          if ((t & 1) === 0) {
            r++;
          }
          return r;
        };
        BN.prototype.bitLength = function bitLength() {
          var w = this.words[this.length - 1];
          var hi = this._countBits(w);
          return (this.length - 1) * 26 + hi;
        };
        function toBitArray(num) {
          var w = new Array(num.bitLength());
          for (var bit = 0; bit < w.length; bit++) {
            var off = bit / 26 | 0;
            var wbit = bit % 26;
            w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
          }
          return w;
        }
        BN.prototype.zeroBits = function zeroBits() {
          if (this.isZero()) return 0;
          var r = 0;
          for (var i = 0; i < this.length; i++) {
            var b = this._zeroBits(this.words[i]);
            r += b;
            if (b !== 26) break;
          }
          return r;
        };
        BN.prototype.byteLength = function byteLength() {
          return Math.ceil(this.bitLength() / 8);
        };
        BN.prototype.toTwos = function toTwos(width) {
          if (this.negative !== 0) {
            return this.abs().inotn(width).iaddn(1);
          }
          return this.clone();
        };
        BN.prototype.fromTwos = function fromTwos(width) {
          if (this.testn(width - 1)) {
            return this.notn(width).iaddn(1).ineg();
          }
          return this.clone();
        };
        BN.prototype.isNeg = function isNeg() {
          return this.negative !== 0;
        };
        BN.prototype.neg = function neg() {
          return this.clone().ineg();
        };
        BN.prototype.ineg = function ineg() {
          if (!this.isZero()) {
            this.negative ^= 1;
          }
          return this;
        };
        BN.prototype.iuor = function iuor(num) {
          while (this.length < num.length) {
            this.words[this.length++] = 0;
          }
          for (var i = 0; i < num.length; i++) {
            this.words[i] = this.words[i] | num.words[i];
          }
          return this.strip();
        };
        BN.prototype.ior = function ior(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuor(num);
        };
        BN.prototype.or = function or(num) {
          if (this.length > num.length) return this.clone().ior(num);
          return num.clone().ior(this);
        };
        BN.prototype.uor = function uor(num) {
          if (this.length > num.length) return this.clone().iuor(num);
          return num.clone().iuor(this);
        };
        BN.prototype.iuand = function iuand(num) {
          var b;
          if (this.length > num.length) {
            b = num;
          } else {
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = this.words[i] & num.words[i];
          }
          this.length = b.length;
          return this.strip();
        };
        BN.prototype.iand = function iand(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuand(num);
        };
        BN.prototype.and = function and(num) {
          if (this.length > num.length) return this.clone().iand(num);
          return num.clone().iand(this);
        };
        BN.prototype.uand = function uand(num) {
          if (this.length > num.length) return this.clone().iuand(num);
          return num.clone().iuand(this);
        };
        BN.prototype.iuxor = function iuxor(num) {
          var a;
          var b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = a.words[i] ^ b.words[i];
          }
          if (this !== a) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = a.length;
          return this.strip();
        };
        BN.prototype.ixor = function ixor(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuxor(num);
        };
        BN.prototype.xor = function xor(num) {
          if (this.length > num.length) return this.clone().ixor(num);
          return num.clone().ixor(this);
        };
        BN.prototype.uxor = function uxor(num) {
          if (this.length > num.length) return this.clone().iuxor(num);
          return num.clone().iuxor(this);
        };
        BN.prototype.inotn = function inotn(width) {
          assert(typeof width === "number" && width >= 0);
          var bytesNeeded = Math.ceil(width / 26) | 0;
          var bitsLeft = width % 26;
          this._expand(bytesNeeded);
          if (bitsLeft > 0) {
            bytesNeeded--;
          }
          for (var i = 0; i < bytesNeeded; i++) {
            this.words[i] = ~this.words[i] & 67108863;
          }
          if (bitsLeft > 0) {
            this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
          }
          return this.strip();
        };
        BN.prototype.notn = function notn(width) {
          return this.clone().inotn(width);
        };
        BN.prototype.setn = function setn(bit, val) {
          assert(typeof bit === "number" && bit >= 0);
          var off = bit / 26 | 0;
          var wbit = bit % 26;
          this._expand(off + 1);
          if (val) {
            this.words[off] = this.words[off] | 1 << wbit;
          } else {
            this.words[off] = this.words[off] & ~(1 << wbit);
          }
          return this.strip();
        };
        BN.prototype.iadd = function iadd(num) {
          var r;
          if (this.negative !== 0 && num.negative === 0) {
            this.negative = 0;
            r = this.isub(num);
            this.negative ^= 1;
            return this._normSign();
          } else if (this.negative === 0 && num.negative !== 0) {
            num.negative = 0;
            r = this.isub(num);
            num.negative = 1;
            return r._normSign();
          }
          var a, b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          this.length = a.length;
          if (carry !== 0) {
            this.words[this.length] = carry;
            this.length++;
          } else if (a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          return this;
        };
        BN.prototype.add = function add(num) {
          var res;
          if (num.negative !== 0 && this.negative === 0) {
            num.negative = 0;
            res = this.sub(num);
            num.negative ^= 1;
            return res;
          } else if (num.negative === 0 && this.negative !== 0) {
            this.negative = 0;
            res = num.sub(this);
            this.negative = 1;
            return res;
          }
          if (this.length > num.length) return this.clone().iadd(num);
          return num.clone().iadd(this);
        };
        BN.prototype.isub = function isub(num) {
          if (num.negative !== 0) {
            num.negative = 0;
            var r = this.iadd(num);
            num.negative = 1;
            return r._normSign();
          } else if (this.negative !== 0) {
            this.negative = 0;
            this.iadd(num);
            this.negative = 1;
            return this._normSign();
          }
          var cmp = this.cmp(num);
          if (cmp === 0) {
            this.negative = 0;
            this.length = 1;
            this.words[0] = 0;
            return this;
          }
          var a, b;
          if (cmp > 0) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          if (carry === 0 && i < a.length && a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = Math.max(this.length, i);
          if (a !== this) {
            this.negative = 1;
          }
          return this.strip();
        };
        BN.prototype.sub = function sub(num) {
          return this.clone().isub(num);
        };
        function smallMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          var len = self.length + num.length | 0;
          out.length = len;
          len = len - 1 | 0;
          var a = self.words[0] | 0;
          var b = num.words[0] | 0;
          var r = a * b;
          var lo = r & 67108863;
          var carry = r / 67108864 | 0;
          out.words[0] = lo;
          for (var k = 1; k < len; k++) {
            var ncarry = carry >>> 26;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j | 0;
              a = self.words[i] | 0;
              b = num.words[j] | 0;
              r = a * b + rword;
              ncarry += r / 67108864 | 0;
              rword = r & 67108863;
            }
            out.words[k] = rword | 0;
            carry = ncarry | 0;
          }
          if (carry !== 0) {
            out.words[k] = carry | 0;
          } else {
            out.length--;
          }
          return out.strip();
        }
        var comb10MulTo = function comb10MulTo(self, num, out) {
          var a = self.words;
          var b = num.words;
          var o = out.words;
          var c = 0;
          var lo;
          var mid;
          var hi;
          var a0 = a[0] | 0;
          var al0 = a0 & 8191;
          var ah0 = a0 >>> 13;
          var a1 = a[1] | 0;
          var al1 = a1 & 8191;
          var ah1 = a1 >>> 13;
          var a2 = a[2] | 0;
          var al2 = a2 & 8191;
          var ah2 = a2 >>> 13;
          var a3 = a[3] | 0;
          var al3 = a3 & 8191;
          var ah3 = a3 >>> 13;
          var a4 = a[4] | 0;
          var al4 = a4 & 8191;
          var ah4 = a4 >>> 13;
          var a5 = a[5] | 0;
          var al5 = a5 & 8191;
          var ah5 = a5 >>> 13;
          var a6 = a[6] | 0;
          var al6 = a6 & 8191;
          var ah6 = a6 >>> 13;
          var a7 = a[7] | 0;
          var al7 = a7 & 8191;
          var ah7 = a7 >>> 13;
          var a8 = a[8] | 0;
          var al8 = a8 & 8191;
          var ah8 = a8 >>> 13;
          var a9 = a[9] | 0;
          var al9 = a9 & 8191;
          var ah9 = a9 >>> 13;
          var b0 = b[0] | 0;
          var bl0 = b0 & 8191;
          var bh0 = b0 >>> 13;
          var b1 = b[1] | 0;
          var bl1 = b1 & 8191;
          var bh1 = b1 >>> 13;
          var b2 = b[2] | 0;
          var bl2 = b2 & 8191;
          var bh2 = b2 >>> 13;
          var b3 = b[3] | 0;
          var bl3 = b3 & 8191;
          var bh3 = b3 >>> 13;
          var b4 = b[4] | 0;
          var bl4 = b4 & 8191;
          var bh4 = b4 >>> 13;
          var b5 = b[5] | 0;
          var bl5 = b5 & 8191;
          var bh5 = b5 >>> 13;
          var b6 = b[6] | 0;
          var bl6 = b6 & 8191;
          var bh6 = b6 >>> 13;
          var b7 = b[7] | 0;
          var bl7 = b7 & 8191;
          var bh7 = b7 >>> 13;
          var b8 = b[8] | 0;
          var bl8 = b8 & 8191;
          var bh8 = b8 >>> 13;
          var b9 = b[9] | 0;
          var bl9 = b9 & 8191;
          var bh9 = b9 >>> 13;
          out.negative = self.negative ^ num.negative;
          out.length = 19;
          lo = Math.imul(al0, bl0);
          mid = Math.imul(al0, bh0);
          mid = mid + Math.imul(ah0, bl0) | 0;
          hi = Math.imul(ah0, bh0);
          var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
          w0 &= 67108863;
          lo = Math.imul(al1, bl0);
          mid = Math.imul(al1, bh0);
          mid = mid + Math.imul(ah1, bl0) | 0;
          hi = Math.imul(ah1, bh0);
          lo = lo + Math.imul(al0, bl1) | 0;
          mid = mid + Math.imul(al0, bh1) | 0;
          mid = mid + Math.imul(ah0, bl1) | 0;
          hi = hi + Math.imul(ah0, bh1) | 0;
          var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
          w1 &= 67108863;
          lo = Math.imul(al2, bl0);
          mid = Math.imul(al2, bh0);
          mid = mid + Math.imul(ah2, bl0) | 0;
          hi = Math.imul(ah2, bh0);
          lo = lo + Math.imul(al1, bl1) | 0;
          mid = mid + Math.imul(al1, bh1) | 0;
          mid = mid + Math.imul(ah1, bl1) | 0;
          hi = hi + Math.imul(ah1, bh1) | 0;
          lo = lo + Math.imul(al0, bl2) | 0;
          mid = mid + Math.imul(al0, bh2) | 0;
          mid = mid + Math.imul(ah0, bl2) | 0;
          hi = hi + Math.imul(ah0, bh2) | 0;
          var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
          w2 &= 67108863;
          lo = Math.imul(al3, bl0);
          mid = Math.imul(al3, bh0);
          mid = mid + Math.imul(ah3, bl0) | 0;
          hi = Math.imul(ah3, bh0);
          lo = lo + Math.imul(al2, bl1) | 0;
          mid = mid + Math.imul(al2, bh1) | 0;
          mid = mid + Math.imul(ah2, bl1) | 0;
          hi = hi + Math.imul(ah2, bh1) | 0;
          lo = lo + Math.imul(al1, bl2) | 0;
          mid = mid + Math.imul(al1, bh2) | 0;
          mid = mid + Math.imul(ah1, bl2) | 0;
          hi = hi + Math.imul(ah1, bh2) | 0;
          lo = lo + Math.imul(al0, bl3) | 0;
          mid = mid + Math.imul(al0, bh3) | 0;
          mid = mid + Math.imul(ah0, bl3) | 0;
          hi = hi + Math.imul(ah0, bh3) | 0;
          var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
          w3 &= 67108863;
          lo = Math.imul(al4, bl0);
          mid = Math.imul(al4, bh0);
          mid = mid + Math.imul(ah4, bl0) | 0;
          hi = Math.imul(ah4, bh0);
          lo = lo + Math.imul(al3, bl1) | 0;
          mid = mid + Math.imul(al3, bh1) | 0;
          mid = mid + Math.imul(ah3, bl1) | 0;
          hi = hi + Math.imul(ah3, bh1) | 0;
          lo = lo + Math.imul(al2, bl2) | 0;
          mid = mid + Math.imul(al2, bh2) | 0;
          mid = mid + Math.imul(ah2, bl2) | 0;
          hi = hi + Math.imul(ah2, bh2) | 0;
          lo = lo + Math.imul(al1, bl3) | 0;
          mid = mid + Math.imul(al1, bh3) | 0;
          mid = mid + Math.imul(ah1, bl3) | 0;
          hi = hi + Math.imul(ah1, bh3) | 0;
          lo = lo + Math.imul(al0, bl4) | 0;
          mid = mid + Math.imul(al0, bh4) | 0;
          mid = mid + Math.imul(ah0, bl4) | 0;
          hi = hi + Math.imul(ah0, bh4) | 0;
          var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
          w4 &= 67108863;
          lo = Math.imul(al5, bl0);
          mid = Math.imul(al5, bh0);
          mid = mid + Math.imul(ah5, bl0) | 0;
          hi = Math.imul(ah5, bh0);
          lo = lo + Math.imul(al4, bl1) | 0;
          mid = mid + Math.imul(al4, bh1) | 0;
          mid = mid + Math.imul(ah4, bl1) | 0;
          hi = hi + Math.imul(ah4, bh1) | 0;
          lo = lo + Math.imul(al3, bl2) | 0;
          mid = mid + Math.imul(al3, bh2) | 0;
          mid = mid + Math.imul(ah3, bl2) | 0;
          hi = hi + Math.imul(ah3, bh2) | 0;
          lo = lo + Math.imul(al2, bl3) | 0;
          mid = mid + Math.imul(al2, bh3) | 0;
          mid = mid + Math.imul(ah2, bl3) | 0;
          hi = hi + Math.imul(ah2, bh3) | 0;
          lo = lo + Math.imul(al1, bl4) | 0;
          mid = mid + Math.imul(al1, bh4) | 0;
          mid = mid + Math.imul(ah1, bl4) | 0;
          hi = hi + Math.imul(ah1, bh4) | 0;
          lo = lo + Math.imul(al0, bl5) | 0;
          mid = mid + Math.imul(al0, bh5) | 0;
          mid = mid + Math.imul(ah0, bl5) | 0;
          hi = hi + Math.imul(ah0, bh5) | 0;
          var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
          w5 &= 67108863;
          lo = Math.imul(al6, bl0);
          mid = Math.imul(al6, bh0);
          mid = mid + Math.imul(ah6, bl0) | 0;
          hi = Math.imul(ah6, bh0);
          lo = lo + Math.imul(al5, bl1) | 0;
          mid = mid + Math.imul(al5, bh1) | 0;
          mid = mid + Math.imul(ah5, bl1) | 0;
          hi = hi + Math.imul(ah5, bh1) | 0;
          lo = lo + Math.imul(al4, bl2) | 0;
          mid = mid + Math.imul(al4, bh2) | 0;
          mid = mid + Math.imul(ah4, bl2) | 0;
          hi = hi + Math.imul(ah4, bh2) | 0;
          lo = lo + Math.imul(al3, bl3) | 0;
          mid = mid + Math.imul(al3, bh3) | 0;
          mid = mid + Math.imul(ah3, bl3) | 0;
          hi = hi + Math.imul(ah3, bh3) | 0;
          lo = lo + Math.imul(al2, bl4) | 0;
          mid = mid + Math.imul(al2, bh4) | 0;
          mid = mid + Math.imul(ah2, bl4) | 0;
          hi = hi + Math.imul(ah2, bh4) | 0;
          lo = lo + Math.imul(al1, bl5) | 0;
          mid = mid + Math.imul(al1, bh5) | 0;
          mid = mid + Math.imul(ah1, bl5) | 0;
          hi = hi + Math.imul(ah1, bh5) | 0;
          lo = lo + Math.imul(al0, bl6) | 0;
          mid = mid + Math.imul(al0, bh6) | 0;
          mid = mid + Math.imul(ah0, bl6) | 0;
          hi = hi + Math.imul(ah0, bh6) | 0;
          var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
          w6 &= 67108863;
          lo = Math.imul(al7, bl0);
          mid = Math.imul(al7, bh0);
          mid = mid + Math.imul(ah7, bl0) | 0;
          hi = Math.imul(ah7, bh0);
          lo = lo + Math.imul(al6, bl1) | 0;
          mid = mid + Math.imul(al6, bh1) | 0;
          mid = mid + Math.imul(ah6, bl1) | 0;
          hi = hi + Math.imul(ah6, bh1) | 0;
          lo = lo + Math.imul(al5, bl2) | 0;
          mid = mid + Math.imul(al5, bh2) | 0;
          mid = mid + Math.imul(ah5, bl2) | 0;
          hi = hi + Math.imul(ah5, bh2) | 0;
          lo = lo + Math.imul(al4, bl3) | 0;
          mid = mid + Math.imul(al4, bh3) | 0;
          mid = mid + Math.imul(ah4, bl3) | 0;
          hi = hi + Math.imul(ah4, bh3) | 0;
          lo = lo + Math.imul(al3, bl4) | 0;
          mid = mid + Math.imul(al3, bh4) | 0;
          mid = mid + Math.imul(ah3, bl4) | 0;
          hi = hi + Math.imul(ah3, bh4) | 0;
          lo = lo + Math.imul(al2, bl5) | 0;
          mid = mid + Math.imul(al2, bh5) | 0;
          mid = mid + Math.imul(ah2, bl5) | 0;
          hi = hi + Math.imul(ah2, bh5) | 0;
          lo = lo + Math.imul(al1, bl6) | 0;
          mid = mid + Math.imul(al1, bh6) | 0;
          mid = mid + Math.imul(ah1, bl6) | 0;
          hi = hi + Math.imul(ah1, bh6) | 0;
          lo = lo + Math.imul(al0, bl7) | 0;
          mid = mid + Math.imul(al0, bh7) | 0;
          mid = mid + Math.imul(ah0, bl7) | 0;
          hi = hi + Math.imul(ah0, bh7) | 0;
          var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
          w7 &= 67108863;
          lo = Math.imul(al8, bl0);
          mid = Math.imul(al8, bh0);
          mid = mid + Math.imul(ah8, bl0) | 0;
          hi = Math.imul(ah8, bh0);
          lo = lo + Math.imul(al7, bl1) | 0;
          mid = mid + Math.imul(al7, bh1) | 0;
          mid = mid + Math.imul(ah7, bl1) | 0;
          hi = hi + Math.imul(ah7, bh1) | 0;
          lo = lo + Math.imul(al6, bl2) | 0;
          mid = mid + Math.imul(al6, bh2) | 0;
          mid = mid + Math.imul(ah6, bl2) | 0;
          hi = hi + Math.imul(ah6, bh2) | 0;
          lo = lo + Math.imul(al5, bl3) | 0;
          mid = mid + Math.imul(al5, bh3) | 0;
          mid = mid + Math.imul(ah5, bl3) | 0;
          hi = hi + Math.imul(ah5, bh3) | 0;
          lo = lo + Math.imul(al4, bl4) | 0;
          mid = mid + Math.imul(al4, bh4) | 0;
          mid = mid + Math.imul(ah4, bl4) | 0;
          hi = hi + Math.imul(ah4, bh4) | 0;
          lo = lo + Math.imul(al3, bl5) | 0;
          mid = mid + Math.imul(al3, bh5) | 0;
          mid = mid + Math.imul(ah3, bl5) | 0;
          hi = hi + Math.imul(ah3, bh5) | 0;
          lo = lo + Math.imul(al2, bl6) | 0;
          mid = mid + Math.imul(al2, bh6) | 0;
          mid = mid + Math.imul(ah2, bl6) | 0;
          hi = hi + Math.imul(ah2, bh6) | 0;
          lo = lo + Math.imul(al1, bl7) | 0;
          mid = mid + Math.imul(al1, bh7) | 0;
          mid = mid + Math.imul(ah1, bl7) | 0;
          hi = hi + Math.imul(ah1, bh7) | 0;
          lo = lo + Math.imul(al0, bl8) | 0;
          mid = mid + Math.imul(al0, bh8) | 0;
          mid = mid + Math.imul(ah0, bl8) | 0;
          hi = hi + Math.imul(ah0, bh8) | 0;
          var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
          w8 &= 67108863;
          lo = Math.imul(al9, bl0);
          mid = Math.imul(al9, bh0);
          mid = mid + Math.imul(ah9, bl0) | 0;
          hi = Math.imul(ah9, bh0);
          lo = lo + Math.imul(al8, bl1) | 0;
          mid = mid + Math.imul(al8, bh1) | 0;
          mid = mid + Math.imul(ah8, bl1) | 0;
          hi = hi + Math.imul(ah8, bh1) | 0;
          lo = lo + Math.imul(al7, bl2) | 0;
          mid = mid + Math.imul(al7, bh2) | 0;
          mid = mid + Math.imul(ah7, bl2) | 0;
          hi = hi + Math.imul(ah7, bh2) | 0;
          lo = lo + Math.imul(al6, bl3) | 0;
          mid = mid + Math.imul(al6, bh3) | 0;
          mid = mid + Math.imul(ah6, bl3) | 0;
          hi = hi + Math.imul(ah6, bh3) | 0;
          lo = lo + Math.imul(al5, bl4) | 0;
          mid = mid + Math.imul(al5, bh4) | 0;
          mid = mid + Math.imul(ah5, bl4) | 0;
          hi = hi + Math.imul(ah5, bh4) | 0;
          lo = lo + Math.imul(al4, bl5) | 0;
          mid = mid + Math.imul(al4, bh5) | 0;
          mid = mid + Math.imul(ah4, bl5) | 0;
          hi = hi + Math.imul(ah4, bh5) | 0;
          lo = lo + Math.imul(al3, bl6) | 0;
          mid = mid + Math.imul(al3, bh6) | 0;
          mid = mid + Math.imul(ah3, bl6) | 0;
          hi = hi + Math.imul(ah3, bh6) | 0;
          lo = lo + Math.imul(al2, bl7) | 0;
          mid = mid + Math.imul(al2, bh7) | 0;
          mid = mid + Math.imul(ah2, bl7) | 0;
          hi = hi + Math.imul(ah2, bh7) | 0;
          lo = lo + Math.imul(al1, bl8) | 0;
          mid = mid + Math.imul(al1, bh8) | 0;
          mid = mid + Math.imul(ah1, bl8) | 0;
          hi = hi + Math.imul(ah1, bh8) | 0;
          lo = lo + Math.imul(al0, bl9) | 0;
          mid = mid + Math.imul(al0, bh9) | 0;
          mid = mid + Math.imul(ah0, bl9) | 0;
          hi = hi + Math.imul(ah0, bh9) | 0;
          var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
          w9 &= 67108863;
          lo = Math.imul(al9, bl1);
          mid = Math.imul(al9, bh1);
          mid = mid + Math.imul(ah9, bl1) | 0;
          hi = Math.imul(ah9, bh1);
          lo = lo + Math.imul(al8, bl2) | 0;
          mid = mid + Math.imul(al8, bh2) | 0;
          mid = mid + Math.imul(ah8, bl2) | 0;
          hi = hi + Math.imul(ah8, bh2) | 0;
          lo = lo + Math.imul(al7, bl3) | 0;
          mid = mid + Math.imul(al7, bh3) | 0;
          mid = mid + Math.imul(ah7, bl3) | 0;
          hi = hi + Math.imul(ah7, bh3) | 0;
          lo = lo + Math.imul(al6, bl4) | 0;
          mid = mid + Math.imul(al6, bh4) | 0;
          mid = mid + Math.imul(ah6, bl4) | 0;
          hi = hi + Math.imul(ah6, bh4) | 0;
          lo = lo + Math.imul(al5, bl5) | 0;
          mid = mid + Math.imul(al5, bh5) | 0;
          mid = mid + Math.imul(ah5, bl5) | 0;
          hi = hi + Math.imul(ah5, bh5) | 0;
          lo = lo + Math.imul(al4, bl6) | 0;
          mid = mid + Math.imul(al4, bh6) | 0;
          mid = mid + Math.imul(ah4, bl6) | 0;
          hi = hi + Math.imul(ah4, bh6) | 0;
          lo = lo + Math.imul(al3, bl7) | 0;
          mid = mid + Math.imul(al3, bh7) | 0;
          mid = mid + Math.imul(ah3, bl7) | 0;
          hi = hi + Math.imul(ah3, bh7) | 0;
          lo = lo + Math.imul(al2, bl8) | 0;
          mid = mid + Math.imul(al2, bh8) | 0;
          mid = mid + Math.imul(ah2, bl8) | 0;
          hi = hi + Math.imul(ah2, bh8) | 0;
          lo = lo + Math.imul(al1, bl9) | 0;
          mid = mid + Math.imul(al1, bh9) | 0;
          mid = mid + Math.imul(ah1, bl9) | 0;
          hi = hi + Math.imul(ah1, bh9) | 0;
          var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
          w10 &= 67108863;
          lo = Math.imul(al9, bl2);
          mid = Math.imul(al9, bh2);
          mid = mid + Math.imul(ah9, bl2) | 0;
          hi = Math.imul(ah9, bh2);
          lo = lo + Math.imul(al8, bl3) | 0;
          mid = mid + Math.imul(al8, bh3) | 0;
          mid = mid + Math.imul(ah8, bl3) | 0;
          hi = hi + Math.imul(ah8, bh3) | 0;
          lo = lo + Math.imul(al7, bl4) | 0;
          mid = mid + Math.imul(al7, bh4) | 0;
          mid = mid + Math.imul(ah7, bl4) | 0;
          hi = hi + Math.imul(ah7, bh4) | 0;
          lo = lo + Math.imul(al6, bl5) | 0;
          mid = mid + Math.imul(al6, bh5) | 0;
          mid = mid + Math.imul(ah6, bl5) | 0;
          hi = hi + Math.imul(ah6, bh5) | 0;
          lo = lo + Math.imul(al5, bl6) | 0;
          mid = mid + Math.imul(al5, bh6) | 0;
          mid = mid + Math.imul(ah5, bl6) | 0;
          hi = hi + Math.imul(ah5, bh6) | 0;
          lo = lo + Math.imul(al4, bl7) | 0;
          mid = mid + Math.imul(al4, bh7) | 0;
          mid = mid + Math.imul(ah4, bl7) | 0;
          hi = hi + Math.imul(ah4, bh7) | 0;
          lo = lo + Math.imul(al3, bl8) | 0;
          mid = mid + Math.imul(al3, bh8) | 0;
          mid = mid + Math.imul(ah3, bl8) | 0;
          hi = hi + Math.imul(ah3, bh8) | 0;
          lo = lo + Math.imul(al2, bl9) | 0;
          mid = mid + Math.imul(al2, bh9) | 0;
          mid = mid + Math.imul(ah2, bl9) | 0;
          hi = hi + Math.imul(ah2, bh9) | 0;
          var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
          w11 &= 67108863;
          lo = Math.imul(al9, bl3);
          mid = Math.imul(al9, bh3);
          mid = mid + Math.imul(ah9, bl3) | 0;
          hi = Math.imul(ah9, bh3);
          lo = lo + Math.imul(al8, bl4) | 0;
          mid = mid + Math.imul(al8, bh4) | 0;
          mid = mid + Math.imul(ah8, bl4) | 0;
          hi = hi + Math.imul(ah8, bh4) | 0;
          lo = lo + Math.imul(al7, bl5) | 0;
          mid = mid + Math.imul(al7, bh5) | 0;
          mid = mid + Math.imul(ah7, bl5) | 0;
          hi = hi + Math.imul(ah7, bh5) | 0;
          lo = lo + Math.imul(al6, bl6) | 0;
          mid = mid + Math.imul(al6, bh6) | 0;
          mid = mid + Math.imul(ah6, bl6) | 0;
          hi = hi + Math.imul(ah6, bh6) | 0;
          lo = lo + Math.imul(al5, bl7) | 0;
          mid = mid + Math.imul(al5, bh7) | 0;
          mid = mid + Math.imul(ah5, bl7) | 0;
          hi = hi + Math.imul(ah5, bh7) | 0;
          lo = lo + Math.imul(al4, bl8) | 0;
          mid = mid + Math.imul(al4, bh8) | 0;
          mid = mid + Math.imul(ah4, bl8) | 0;
          hi = hi + Math.imul(ah4, bh8) | 0;
          lo = lo + Math.imul(al3, bl9) | 0;
          mid = mid + Math.imul(al3, bh9) | 0;
          mid = mid + Math.imul(ah3, bl9) | 0;
          hi = hi + Math.imul(ah3, bh9) | 0;
          var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
          w12 &= 67108863;
          lo = Math.imul(al9, bl4);
          mid = Math.imul(al9, bh4);
          mid = mid + Math.imul(ah9, bl4) | 0;
          hi = Math.imul(ah9, bh4);
          lo = lo + Math.imul(al8, bl5) | 0;
          mid = mid + Math.imul(al8, bh5) | 0;
          mid = mid + Math.imul(ah8, bl5) | 0;
          hi = hi + Math.imul(ah8, bh5) | 0;
          lo = lo + Math.imul(al7, bl6) | 0;
          mid = mid + Math.imul(al7, bh6) | 0;
          mid = mid + Math.imul(ah7, bl6) | 0;
          hi = hi + Math.imul(ah7, bh6) | 0;
          lo = lo + Math.imul(al6, bl7) | 0;
          mid = mid + Math.imul(al6, bh7) | 0;
          mid = mid + Math.imul(ah6, bl7) | 0;
          hi = hi + Math.imul(ah6, bh7) | 0;
          lo = lo + Math.imul(al5, bl8) | 0;
          mid = mid + Math.imul(al5, bh8) | 0;
          mid = mid + Math.imul(ah5, bl8) | 0;
          hi = hi + Math.imul(ah5, bh8) | 0;
          lo = lo + Math.imul(al4, bl9) | 0;
          mid = mid + Math.imul(al4, bh9) | 0;
          mid = mid + Math.imul(ah4, bl9) | 0;
          hi = hi + Math.imul(ah4, bh9) | 0;
          var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
          w13 &= 67108863;
          lo = Math.imul(al9, bl5);
          mid = Math.imul(al9, bh5);
          mid = mid + Math.imul(ah9, bl5) | 0;
          hi = Math.imul(ah9, bh5);
          lo = lo + Math.imul(al8, bl6) | 0;
          mid = mid + Math.imul(al8, bh6) | 0;
          mid = mid + Math.imul(ah8, bl6) | 0;
          hi = hi + Math.imul(ah8, bh6) | 0;
          lo = lo + Math.imul(al7, bl7) | 0;
          mid = mid + Math.imul(al7, bh7) | 0;
          mid = mid + Math.imul(ah7, bl7) | 0;
          hi = hi + Math.imul(ah7, bh7) | 0;
          lo = lo + Math.imul(al6, bl8) | 0;
          mid = mid + Math.imul(al6, bh8) | 0;
          mid = mid + Math.imul(ah6, bl8) | 0;
          hi = hi + Math.imul(ah6, bh8) | 0;
          lo = lo + Math.imul(al5, bl9) | 0;
          mid = mid + Math.imul(al5, bh9) | 0;
          mid = mid + Math.imul(ah5, bl9) | 0;
          hi = hi + Math.imul(ah5, bh9) | 0;
          var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
          w14 &= 67108863;
          lo = Math.imul(al9, bl6);
          mid = Math.imul(al9, bh6);
          mid = mid + Math.imul(ah9, bl6) | 0;
          hi = Math.imul(ah9, bh6);
          lo = lo + Math.imul(al8, bl7) | 0;
          mid = mid + Math.imul(al8, bh7) | 0;
          mid = mid + Math.imul(ah8, bl7) | 0;
          hi = hi + Math.imul(ah8, bh7) | 0;
          lo = lo + Math.imul(al7, bl8) | 0;
          mid = mid + Math.imul(al7, bh8) | 0;
          mid = mid + Math.imul(ah7, bl8) | 0;
          hi = hi + Math.imul(ah7, bh8) | 0;
          lo = lo + Math.imul(al6, bl9) | 0;
          mid = mid + Math.imul(al6, bh9) | 0;
          mid = mid + Math.imul(ah6, bl9) | 0;
          hi = hi + Math.imul(ah6, bh9) | 0;
          var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
          w15 &= 67108863;
          lo = Math.imul(al9, bl7);
          mid = Math.imul(al9, bh7);
          mid = mid + Math.imul(ah9, bl7) | 0;
          hi = Math.imul(ah9, bh7);
          lo = lo + Math.imul(al8, bl8) | 0;
          mid = mid + Math.imul(al8, bh8) | 0;
          mid = mid + Math.imul(ah8, bl8) | 0;
          hi = hi + Math.imul(ah8, bh8) | 0;
          lo = lo + Math.imul(al7, bl9) | 0;
          mid = mid + Math.imul(al7, bh9) | 0;
          mid = mid + Math.imul(ah7, bl9) | 0;
          hi = hi + Math.imul(ah7, bh9) | 0;
          var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
          w16 &= 67108863;
          lo = Math.imul(al9, bl8);
          mid = Math.imul(al9, bh8);
          mid = mid + Math.imul(ah9, bl8) | 0;
          hi = Math.imul(ah9, bh8);
          lo = lo + Math.imul(al8, bl9) | 0;
          mid = mid + Math.imul(al8, bh9) | 0;
          mid = mid + Math.imul(ah8, bl9) | 0;
          hi = hi + Math.imul(ah8, bh9) | 0;
          var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
          w17 &= 67108863;
          lo = Math.imul(al9, bl9);
          mid = Math.imul(al9, bh9);
          mid = mid + Math.imul(ah9, bl9) | 0;
          hi = Math.imul(ah9, bh9);
          var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
          w18 &= 67108863;
          o[0] = w0;
          o[1] = w1;
          o[2] = w2;
          o[3] = w3;
          o[4] = w4;
          o[5] = w5;
          o[6] = w6;
          o[7] = w7;
          o[8] = w8;
          o[9] = w9;
          o[10] = w10;
          o[11] = w11;
          o[12] = w12;
          o[13] = w13;
          o[14] = w14;
          o[15] = w15;
          o[16] = w16;
          o[17] = w17;
          o[18] = w18;
          if (c !== 0) {
            o[19] = c;
            out.length++;
          }
          return out;
        };
        if (!Math.imul) {
          comb10MulTo = smallMulTo;
        }
        function bigMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          out.length = self.length + num.length;
          var carry = 0;
          var hncarry = 0;
          for (var k = 0; k < out.length - 1; k++) {
            var ncarry = hncarry;
            hncarry = 0;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j;
              var a = self.words[i] | 0;
              var b = num.words[j] | 0;
              var r = a * b;
              var lo = r & 67108863;
              ncarry = ncarry + (r / 67108864 | 0) | 0;
              lo = lo + rword | 0;
              rword = lo & 67108863;
              ncarry = ncarry + (lo >>> 26) | 0;
              hncarry += ncarry >>> 26;
              ncarry &= 67108863;
            }
            out.words[k] = rword;
            carry = ncarry;
            ncarry = hncarry;
          }
          if (carry !== 0) {
            out.words[k] = carry;
          } else {
            out.length--;
          }
          return out.strip();
        }
        function jumboMulTo(self, num, out) {
          var fftm = new FFTM;
          return fftm.mulp(self, num, out);
        }
        BN.prototype.mulTo = function mulTo(num, out) {
          var res;
          var len = this.length + num.length;
          if (this.length === 10 && num.length === 10) {
            res = comb10MulTo(this, num, out);
          } else if (len < 63) {
            res = smallMulTo(this, num, out);
          } else if (len < 1024) {
            res = bigMulTo(this, num, out);
          } else {
            res = jumboMulTo(this, num, out);
          }
          return res;
        };
        function FFTM(x, y) {
          this.x = x;
          this.y = y;
        }
        FFTM.prototype.makeRBT = function makeRBT(N) {
          var t = new Array(N);
          var l = BN.prototype._countBits(N) - 1;
          for (var i = 0; i < N; i++) {
            t[i] = this.revBin(i, l, N);
          }
          return t;
        };
        FFTM.prototype.revBin = function revBin(x, l, N) {
          if (x === 0 || x === N - 1) return x;
          var rb = 0;
          for (var i = 0; i < l; i++) {
            rb |= (x & 1) << l - i - 1;
            x >>= 1;
          }
          return rb;
        };
        FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
          for (var i = 0; i < N; i++) {
            rtws[i] = rws[rbt[i]];
            itws[i] = iws[rbt[i]];
          }
        };
        FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
          this.permute(rbt, rws, iws, rtws, itws, N);
          for (var s = 1; s < N; s <<= 1) {
            var l = s << 1;
            var rtwdf = Math.cos(2 * Math.PI / l);
            var itwdf = Math.sin(2 * Math.PI / l);
            for (var p = 0; p < N; p += l) {
              var rtwdf_ = rtwdf;
              var itwdf_ = itwdf;
              for (var j = 0; j < s; j++) {
                var re = rtws[p + j];
                var ie = itws[p + j];
                var ro = rtws[p + j + s];
                var io = itws[p + j + s];
                var rx = rtwdf_ * ro - itwdf_ * io;
                io = rtwdf_ * io + itwdf_ * ro;
                ro = rx;
                rtws[p + j] = re + ro;
                itws[p + j] = ie + io;
                rtws[p + j + s] = re - ro;
                itws[p + j + s] = ie - io;
                if (j !== l) {
                  rx = rtwdf * rtwdf_ - itwdf * itwdf_;
                  itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
                  rtwdf_ = rx;
                }
              }
            }
          }
        };
        FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
          var N = Math.max(m, n) | 1;
          var odd = N & 1;
          var i = 0;
          for (N = N / 2 | 0; N; N = N >>> 1) {
            i++;
          }
          return 1 << i + 1 + odd;
        };
        FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
          if (N <= 1) return;
          for (var i = 0; i < N / 2; i++) {
            var t = rws[i];
            rws[i] = rws[N - i - 1];
            rws[N - i - 1] = t;
            t = iws[i];
            iws[i] = -iws[N - i - 1];
            iws[N - i - 1] = -t;
          }
        };
        FFTM.prototype.normalize13b = function normalize13b(ws, N) {
          var carry = 0;
          for (var i = 0; i < N / 2; i++) {
            var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
            ws[i] = w & 67108863;
            if (w < 67108864) {
              carry = 0;
            } else {
              carry = w / 67108864 | 0;
            }
          }
          return ws;
        };
        FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
          var carry = 0;
          for (var i = 0; i < len; i++) {
            carry = carry + (ws[i] | 0);
            rws[2 * i] = carry & 8191;
            carry = carry >>> 13;
            rws[2 * i + 1] = carry & 8191;
            carry = carry >>> 13;
          }
          for (i = 2 * len; i < N; ++i) {
            rws[i] = 0;
          }
          assert(carry === 0);
          assert((carry & ~8191) === 0);
        };
        FFTM.prototype.stub = function stub(N) {
          var ph = new Array(N);
          for (var i = 0; i < N; i++) {
            ph[i] = 0;
          }
          return ph;
        };
        FFTM.prototype.mulp = function mulp(x, y, out) {
          var N = 2 * this.guessLen13b(x.length, y.length);
          var rbt = this.makeRBT(N);
          var _ = this.stub(N);
          var rws = new Array(N);
          var rwst = new Array(N);
          var iwst = new Array(N);
          var nrws = new Array(N);
          var nrwst = new Array(N);
          var niwst = new Array(N);
          var rmws = out.words;
          rmws.length = N;
          this.convert13b(x.words, x.length, rws, N);
          this.convert13b(y.words, y.length, nrws, N);
          this.transform(rws, _, rwst, iwst, N, rbt);
          this.transform(nrws, _, nrwst, niwst, N, rbt);
          for (var i = 0; i < N; i++) {
            var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
            iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
            rwst[i] = rx;
          }
          this.conjugate(rwst, iwst, N);
          this.transform(rwst, iwst, rmws, _, N, rbt);
          this.conjugate(rmws, _, N);
          this.normalize13b(rmws, N);
          out.negative = x.negative ^ y.negative;
          out.length = x.length + y.length;
          return out.strip();
        };
        BN.prototype.mul = function mul(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return this.mulTo(num, out);
        };
        BN.prototype.mulf = function mulf(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return jumboMulTo(this, num, out);
        };
        BN.prototype.imul = function imul(num) {
          return this.clone().mulTo(num, this);
        };
        BN.prototype.imuln = function imuln(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          var carry = 0;
          for (var i = 0; i < this.length; i++) {
            var w = (this.words[i] | 0) * num;
            var lo = (w & 67108863) + (carry & 67108863);
            carry >>= 26;
            carry += w / 67108864 | 0;
            carry += lo >>> 26;
            this.words[i] = lo & 67108863;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          this.length = num === 0 ? 1 : this.length;
          return this;
        };
        BN.prototype.muln = function muln(num) {
          return this.clone().imuln(num);
        };
        BN.prototype.sqr = function sqr() {
          return this.mul(this);
        };
        BN.prototype.isqr = function isqr() {
          return this.imul(this.clone());
        };
        BN.prototype.pow = function pow(num) {
          var w = toBitArray(num);
          if (w.length === 0) return new BN(1);
          var res = this;
          for (var i = 0; i < w.length; i++, res = res.sqr()) {
            if (w[i] !== 0) break;
          }
          if (++i < w.length) {
            for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
              if (w[i] === 0) continue;
              res = res.mul(q);
            }
          }
          return res;
        };
        BN.prototype.iushln = function iushln(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          var carryMask = 67108863 >>> 26 - r << 26 - r;
          var i;
          if (r !== 0) {
            var carry = 0;
            for (i = 0; i < this.length; i++) {
              var newCarry = this.words[i] & carryMask;
              var c = (this.words[i] | 0) - newCarry << r;
              this.words[i] = c | carry;
              carry = newCarry >>> 26 - r;
            }
            if (carry) {
              this.words[i] = carry;
              this.length++;
            }
          }
          if (s !== 0) {
            for (i = this.length - 1; i >= 0; i--) {
              this.words[i + s] = this.words[i];
            }
            for (i = 0; i < s; i++) {
              this.words[i] = 0;
            }
            this.length += s;
          }
          return this.strip();
        };
        BN.prototype.ishln = function ishln(bits) {
          assert(this.negative === 0);
          return this.iushln(bits);
        };
        BN.prototype.iushrn = function iushrn(bits, hint, extended) {
          assert(typeof bits === "number" && bits >= 0);
          var h;
          if (hint) {
            h = (hint - hint % 26) / 26;
          } else {
            h = 0;
          }
          var r = bits % 26;
          var s = Math.min((bits - r) / 26, this.length);
          var mask = 67108863 ^ 67108863 >>> r << r;
          var maskedWords = extended;
          h -= s;
          h = Math.max(0, h);
          if (maskedWords) {
            for (var i = 0; i < s; i++) {
              maskedWords.words[i] = this.words[i];
            }
            maskedWords.length = s;
          }
          if (s === 0) {} else if (this.length > s) {
            this.length -= s;
            for (i = 0; i < this.length; i++) {
              this.words[i] = this.words[i + s];
            }
          } else {
            this.words[0] = 0;
            this.length = 1;
          }
          var carry = 0;
          for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
            var word = this.words[i] | 0;
            this.words[i] = carry << 26 - r | word >>> r;
            carry = word & mask;
          }
          if (maskedWords && carry !== 0) {
            maskedWords.words[maskedWords.length++] = carry;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.ishrn = function ishrn(bits, hint, extended) {
          assert(this.negative === 0);
          return this.iushrn(bits, hint, extended);
        };
        BN.prototype.shln = function shln(bits) {
          return this.clone().ishln(bits);
        };
        BN.prototype.ushln = function ushln(bits) {
          return this.clone().iushln(bits);
        };
        BN.prototype.shrn = function shrn(bits) {
          return this.clone().ishrn(bits);
        };
        BN.prototype.ushrn = function ushrn(bits) {
          return this.clone().iushrn(bits);
        };
        BN.prototype.testn = function testn(bit) {
          assert(typeof bit === "number" && bit >= 0);
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) return false;
          var w = this.words[s];
          return !!(w & q);
        };
        BN.prototype.imaskn = function imaskn(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          assert(this.negative === 0, "imaskn works only with positive numbers");
          if (this.length <= s) {
            return this;
          }
          if (r !== 0) {
            s++;
          }
          this.length = Math.min(s, this.length);
          if (r !== 0) {
            var mask = 67108863 ^ 67108863 >>> r << r;
            this.words[this.length - 1] &= mask;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.maskn = function maskn(bits) {
          return this.clone().imaskn(bits);
        };
        BN.prototype.iaddn = function iaddn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.isubn(-num);
          if (this.negative !== 0) {
            if (this.length === 1 && (this.words[0] | 0) < num) {
              this.words[0] = num - (this.words[0] | 0);
              this.negative = 0;
              return this;
            }
            this.negative = 0;
            this.isubn(num);
            this.negative = 1;
            return this;
          }
          return this._iaddn(num);
        };
        BN.prototype._iaddn = function _iaddn(num) {
          this.words[0] += num;
          for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
            this.words[i] -= 67108864;
            if (i === this.length - 1) {
              this.words[i + 1] = 1;
            } else {
              this.words[i + 1]++;
            }
          }
          this.length = Math.max(this.length, i + 1);
          return this;
        };
        BN.prototype.isubn = function isubn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.iaddn(-num);
          if (this.negative !== 0) {
            this.negative = 0;
            this.iaddn(num);
            this.negative = 1;
            return this;
          }
          this.words[0] -= num;
          if (this.length === 1 && this.words[0] < 0) {
            this.words[0] = -this.words[0];
            this.negative = 1;
          } else {
            for (var i = 0; i < this.length && this.words[i] < 0; i++) {
              this.words[i] += 67108864;
              this.words[i + 1] -= 1;
            }
          }
          return this.strip();
        };
        BN.prototype.addn = function addn(num) {
          return this.clone().iaddn(num);
        };
        BN.prototype.subn = function subn(num) {
          return this.clone().isubn(num);
        };
        BN.prototype.iabs = function iabs() {
          this.negative = 0;
          return this;
        };
        BN.prototype.abs = function abs() {
          return this.clone().iabs();
        };
        BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
          var len = num.length + shift;
          var i;
          this._expand(len);
          var w;
          var carry = 0;
          for (i = 0; i < num.length; i++) {
            w = (this.words[i + shift] | 0) + carry;
            var right = (num.words[i] | 0) * mul;
            w -= right & 67108863;
            carry = (w >> 26) - (right / 67108864 | 0);
            this.words[i + shift] = w & 67108863;
          }
          for (;i < this.length - shift; i++) {
            w = (this.words[i + shift] | 0) + carry;
            carry = w >> 26;
            this.words[i + shift] = w & 67108863;
          }
          if (carry === 0) return this.strip();
          assert(carry === -1);
          carry = 0;
          for (i = 0; i < this.length; i++) {
            w = -(this.words[i] | 0) + carry;
            carry = w >> 26;
            this.words[i] = w & 67108863;
          }
          this.negative = 1;
          return this.strip();
        };
        BN.prototype._wordDiv = function _wordDiv(num, mode) {
          var shift = this.length - num.length;
          var a = this.clone();
          var b = num;
          var bhi = b.words[b.length - 1] | 0;
          var bhiBits = this._countBits(bhi);
          shift = 26 - bhiBits;
          if (shift !== 0) {
            b = b.ushln(shift);
            a.iushln(shift);
            bhi = b.words[b.length - 1] | 0;
          }
          var m = a.length - b.length;
          var q;
          if (mode !== "mod") {
            q = new BN(null);
            q.length = m + 1;
            q.words = new Array(q.length);
            for (var i = 0; i < q.length; i++) {
              q.words[i] = 0;
            }
          }
          var diff = a.clone()._ishlnsubmul(b, 1, m);
          if (diff.negative === 0) {
            a = diff;
            if (q) {
              q.words[m] = 1;
            }
          }
          for (var j = m - 1; j >= 0; j--) {
            var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
            qj = Math.min(qj / bhi | 0, 67108863);
            a._ishlnsubmul(b, qj, j);
            while (a.negative !== 0) {
              qj--;
              a.negative = 0;
              a._ishlnsubmul(b, 1, j);
              if (!a.isZero()) {
                a.negative ^= 1;
              }
            }
            if (q) {
              q.words[j] = qj;
            }
          }
          if (q) {
            q.strip();
          }
          a.strip();
          if (mode !== "div" && shift !== 0) {
            a.iushrn(shift);
          }
          return {
            div: q || null,
            mod: a
          };
        };
        BN.prototype.divmod = function divmod(num, mode, positive) {
          assert(!num.isZero());
          if (this.isZero()) {
            return {
              div: new BN(0),
              mod: new BN(0)
            };
          }
          var div, mod, res;
          if (this.negative !== 0 && num.negative === 0) {
            res = this.neg().divmod(num, mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.iadd(num);
              }
            }
            return {
              div,
              mod
            };
          }
          if (this.negative === 0 && num.negative !== 0) {
            res = this.divmod(num.neg(), mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            return {
              div,
              mod: res.mod
            };
          }
          if ((this.negative & num.negative) !== 0) {
            res = this.neg().divmod(num.neg(), mode);
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.isub(num);
              }
            }
            return {
              div: res.div,
              mod
            };
          }
          if (num.length > this.length || this.cmp(num) < 0) {
            return {
              div: new BN(0),
              mod: this
            };
          }
          if (num.length === 1) {
            if (mode === "div") {
              return {
                div: this.divn(num.words[0]),
                mod: null
              };
            }
            if (mode === "mod") {
              return {
                div: null,
                mod: new BN(this.modn(num.words[0]))
              };
            }
            return {
              div: this.divn(num.words[0]),
              mod: new BN(this.modn(num.words[0]))
            };
          }
          return this._wordDiv(num, mode);
        };
        BN.prototype.div = function div(num) {
          return this.divmod(num, "div", false).div;
        };
        BN.prototype.mod = function mod(num) {
          return this.divmod(num, "mod", false).mod;
        };
        BN.prototype.umod = function umod(num) {
          return this.divmod(num, "mod", true).mod;
        };
        BN.prototype.divRound = function divRound(num) {
          var dm = this.divmod(num);
          if (dm.mod.isZero()) return dm.div;
          var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
          var half = num.ushrn(1);
          var r2 = num.andln(1);
          var cmp = mod.cmp(half);
          if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
          return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
        };
        BN.prototype.modn = function modn(num) {
          assert(num <= 67108863);
          var p = (1 << 26) % num;
          var acc = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            acc = (p * acc + (this.words[i] | 0)) % num;
          }
          return acc;
        };
        BN.prototype.idivn = function idivn(num) {
          assert(num <= 67108863);
          var carry = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var w = (this.words[i] | 0) + carry * 67108864;
            this.words[i] = w / num | 0;
            carry = w % num;
          }
          return this.strip();
        };
        BN.prototype.divn = function divn(num) {
          return this.clone().idivn(num);
        };
        BN.prototype.egcd = function egcd(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var x = this;
          var y = p.clone();
          if (x.negative !== 0) {
            x = x.umod(p);
          } else {
            x = x.clone();
          }
          var A = new BN(1);
          var B = new BN(0);
          var C = new BN(0);
          var D = new BN(1);
          var g = 0;
          while (x.isEven() && y.isEven()) {
            x.iushrn(1);
            y.iushrn(1);
            ++g;
          }
          var yp = y.clone();
          var xp = x.clone();
          while (!x.isZero()) {
            for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              x.iushrn(i);
              while (i-- > 0) {
                if (A.isOdd() || B.isOdd()) {
                  A.iadd(yp);
                  B.isub(xp);
                }
                A.iushrn(1);
                B.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              y.iushrn(j);
              while (j-- > 0) {
                if (C.isOdd() || D.isOdd()) {
                  C.iadd(yp);
                  D.isub(xp);
                }
                C.iushrn(1);
                D.iushrn(1);
              }
            }
            if (x.cmp(y) >= 0) {
              x.isub(y);
              A.isub(C);
              B.isub(D);
            } else {
              y.isub(x);
              C.isub(A);
              D.isub(B);
            }
          }
          return {
            a: C,
            b: D,
            gcd: y.iushln(g)
          };
        };
        BN.prototype._invmp = function _invmp(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var a = this;
          var b = p.clone();
          if (a.negative !== 0) {
            a = a.umod(p);
          } else {
            a = a.clone();
          }
          var x1 = new BN(1);
          var x2 = new BN(0);
          var delta = b.clone();
          while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
            for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              a.iushrn(i);
              while (i-- > 0) {
                if (x1.isOdd()) {
                  x1.iadd(delta);
                }
                x1.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              b.iushrn(j);
              while (j-- > 0) {
                if (x2.isOdd()) {
                  x2.iadd(delta);
                }
                x2.iushrn(1);
              }
            }
            if (a.cmp(b) >= 0) {
              a.isub(b);
              x1.isub(x2);
            } else {
              b.isub(a);
              x2.isub(x1);
            }
          }
          var res;
          if (a.cmpn(1) === 0) {
            res = x1;
          } else {
            res = x2;
          }
          if (res.cmpn(0) < 0) {
            res.iadd(p);
          }
          return res;
        };
        BN.prototype.gcd = function gcd(num) {
          if (this.isZero()) return num.abs();
          if (num.isZero()) return this.abs();
          var a = this.clone();
          var b = num.clone();
          a.negative = 0;
          b.negative = 0;
          for (var shift = 0; a.isEven() && b.isEven(); shift++) {
            a.iushrn(1);
            b.iushrn(1);
          }
          do {
            while (a.isEven()) {
              a.iushrn(1);
            }
            while (b.isEven()) {
              b.iushrn(1);
            }
            var r = a.cmp(b);
            if (r < 0) {
              var t = a;
              a = b;
              b = t;
            } else if (r === 0 || b.cmpn(1) === 0) {
              break;
            }
            a.isub(b);
          } while (true);
          return b.iushln(shift);
        };
        BN.prototype.invm = function invm(num) {
          return this.egcd(num).a.umod(num);
        };
        BN.prototype.isEven = function isEven() {
          return (this.words[0] & 1) === 0;
        };
        BN.prototype.isOdd = function isOdd() {
          return (this.words[0] & 1) === 1;
        };
        BN.prototype.andln = function andln(num) {
          return this.words[0] & num;
        };
        BN.prototype.bincn = function bincn(bit) {
          assert(typeof bit === "number");
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) {
            this._expand(s + 1);
            this.words[s] |= q;
            return this;
          }
          var carry = q;
          for (var i = s; carry !== 0 && i < this.length; i++) {
            var w = this.words[i] | 0;
            w += carry;
            carry = w >>> 26;
            w &= 67108863;
            this.words[i] = w;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          return this;
        };
        BN.prototype.isZero = function isZero() {
          return this.length === 1 && this.words[0] === 0;
        };
        BN.prototype.cmpn = function cmpn(num) {
          var negative = num < 0;
          if (this.negative !== 0 && !negative) return -1;
          if (this.negative === 0 && negative) return 1;
          this.strip();
          var res;
          if (this.length > 1) {
            res = 1;
          } else {
            if (negative) {
              num = -num;
            }
            assert(num <= 67108863, "Number is too big");
            var w = this.words[0] | 0;
            res = w === num ? 0 : w < num ? -1 : 1;
          }
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.cmp = function cmp(num) {
          if (this.negative !== 0 && num.negative === 0) return -1;
          if (this.negative === 0 && num.negative !== 0) return 1;
          var res = this.ucmp(num);
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.ucmp = function ucmp(num) {
          if (this.length > num.length) return 1;
          if (this.length < num.length) return -1;
          var res = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var a = this.words[i] | 0;
            var b = num.words[i] | 0;
            if (a === b) continue;
            if (a < b) {
              res = -1;
            } else if (a > b) {
              res = 1;
            }
            break;
          }
          return res;
        };
        BN.prototype.gtn = function gtn(num) {
          return this.cmpn(num) === 1;
        };
        BN.prototype.gt = function gt(num) {
          return this.cmp(num) === 1;
        };
        BN.prototype.gten = function gten(num) {
          return this.cmpn(num) >= 0;
        };
        BN.prototype.gte = function gte(num) {
          return this.cmp(num) >= 0;
        };
        BN.prototype.ltn = function ltn(num) {
          return this.cmpn(num) === -1;
        };
        BN.prototype.lt = function lt(num) {
          return this.cmp(num) === -1;
        };
        BN.prototype.lten = function lten(num) {
          return this.cmpn(num) <= 0;
        };
        BN.prototype.lte = function lte(num) {
          return this.cmp(num) <= 0;
        };
        BN.prototype.eqn = function eqn(num) {
          return this.cmpn(num) === 0;
        };
        BN.prototype.eq = function eq(num) {
          return this.cmp(num) === 0;
        };
        BN.red = function red(num) {
          return new Red(num);
        };
        BN.prototype.toRed = function toRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          assert(this.negative === 0, "red works only with positives");
          return ctx.convertTo(this)._forceRed(ctx);
        };
        BN.prototype.fromRed = function fromRed() {
          assert(this.red, "fromRed works only with numbers in reduction context");
          return this.red.convertFrom(this);
        };
        BN.prototype._forceRed = function _forceRed(ctx) {
          this.red = ctx;
          return this;
        };
        BN.prototype.forceRed = function forceRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          return this._forceRed(ctx);
        };
        BN.prototype.redAdd = function redAdd(num) {
          assert(this.red, "redAdd works only with red numbers");
          return this.red.add(this, num);
        };
        BN.prototype.redIAdd = function redIAdd(num) {
          assert(this.red, "redIAdd works only with red numbers");
          return this.red.iadd(this, num);
        };
        BN.prototype.redSub = function redSub(num) {
          assert(this.red, "redSub works only with red numbers");
          return this.red.sub(this, num);
        };
        BN.prototype.redISub = function redISub(num) {
          assert(this.red, "redISub works only with red numbers");
          return this.red.isub(this, num);
        };
        BN.prototype.redShl = function redShl(num) {
          assert(this.red, "redShl works only with red numbers");
          return this.red.shl(this, num);
        };
        BN.prototype.redMul = function redMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.mul(this, num);
        };
        BN.prototype.redIMul = function redIMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.imul(this, num);
        };
        BN.prototype.redSqr = function redSqr() {
          assert(this.red, "redSqr works only with red numbers");
          this.red._verify1(this);
          return this.red.sqr(this);
        };
        BN.prototype.redISqr = function redISqr() {
          assert(this.red, "redISqr works only with red numbers");
          this.red._verify1(this);
          return this.red.isqr(this);
        };
        BN.prototype.redSqrt = function redSqrt() {
          assert(this.red, "redSqrt works only with red numbers");
          this.red._verify1(this);
          return this.red.sqrt(this);
        };
        BN.prototype.redInvm = function redInvm() {
          assert(this.red, "redInvm works only with red numbers");
          this.red._verify1(this);
          return this.red.invm(this);
        };
        BN.prototype.redNeg = function redNeg() {
          assert(this.red, "redNeg works only with red numbers");
          this.red._verify1(this);
          return this.red.neg(this);
        };
        BN.prototype.redPow = function redPow(num) {
          assert(this.red && !num.red, "redPow(normalNum)");
          this.red._verify1(this);
          return this.red.pow(this, num);
        };
        var primes = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };
        function MPrime(name, p) {
          this.name = name;
          this.p = new BN(p, 16);
          this.n = this.p.bitLength();
          this.k = new BN(1).iushln(this.n).isub(this.p);
          this.tmp = this._tmp();
        }
        MPrime.prototype._tmp = function _tmp() {
          var tmp = new BN(null);
          tmp.words = new Array(Math.ceil(this.n / 13));
          return tmp;
        };
        MPrime.prototype.ireduce = function ireduce(num) {
          var r = num;
          var rlen;
          do {
            this.split(r, this.tmp);
            r = this.imulK(r);
            r = r.iadd(this.tmp);
            rlen = r.bitLength();
          } while (rlen > this.n);
          var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
          if (cmp === 0) {
            r.words[0] = 0;
            r.length = 1;
          } else if (cmp > 0) {
            r.isub(this.p);
          } else {
            if (r.strip !== undefined) {
              r.strip();
            } else {
              r._strip();
            }
          }
          return r;
        };
        MPrime.prototype.split = function split(input, out) {
          input.iushrn(this.n, 0, out);
        };
        MPrime.prototype.imulK = function imulK(num) {
          return num.imul(this.k);
        };
        function K256() {
          MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
        }
        inherits(K256, MPrime);
        K256.prototype.split = function split(input, output) {
          var mask = 4194303;
          var outLen = Math.min(input.length, 9);
          for (var i = 0; i < outLen; i++) {
            output.words[i] = input.words[i];
          }
          output.length = outLen;
          if (input.length <= 9) {
            input.words[0] = 0;
            input.length = 1;
            return;
          }
          var prev = input.words[9];
          output.words[output.length++] = prev & mask;
          for (i = 10; i < input.length; i++) {
            var next = input.words[i] | 0;
            input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
            prev = next;
          }
          prev >>>= 22;
          input.words[i - 10] = prev;
          if (prev === 0 && input.length > 10) {
            input.length -= 10;
          } else {
            input.length -= 9;
          }
        };
        K256.prototype.imulK = function imulK(num) {
          num.words[num.length] = 0;
          num.words[num.length + 1] = 0;
          num.length += 2;
          var lo = 0;
          for (var i = 0; i < num.length; i++) {
            var w = num.words[i] | 0;
            lo += w * 977;
            num.words[i] = lo & 67108863;
            lo = w * 64 + (lo / 67108864 | 0);
          }
          if (num.words[num.length - 1] === 0) {
            num.length--;
            if (num.words[num.length - 1] === 0) {
              num.length--;
            }
          }
          return num;
        };
        function P224() {
          MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
        }
        inherits(P224, MPrime);
        function P192() {
          MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
        }
        inherits(P192, MPrime);
        function P25519() {
          MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
        }
        inherits(P25519, MPrime);
        P25519.prototype.imulK = function imulK(num) {
          var carry = 0;
          for (var i = 0; i < num.length; i++) {
            var hi = (num.words[i] | 0) * 19 + carry;
            var lo = hi & 67108863;
            hi >>>= 26;
            num.words[i] = lo;
            carry = hi;
          }
          if (carry !== 0) {
            num.words[num.length++] = carry;
          }
          return num;
        };
        BN._prime = function prime(name) {
          if (primes[name]) return primes[name];
          var prime;
          if (name === "k256") {
            prime = new K256;
          } else if (name === "p224") {
            prime = new P224;
          } else if (name === "p192") {
            prime = new P192;
          } else if (name === "p25519") {
            prime = new P25519;
          } else {
            throw new Error("Unknown prime " + name);
          }
          primes[name] = prime;
          return prime;
        };
        function Red(m) {
          if (typeof m === "string") {
            var prime = BN._prime(m);
            this.m = prime.p;
            this.prime = prime;
          } else {
            assert(m.gtn(1), "modulus must be greater than 1");
            this.m = m;
            this.prime = null;
          }
        }
        Red.prototype._verify1 = function _verify1(a) {
          assert(a.negative === 0, "red works only with positives");
          assert(a.red, "red works only with red numbers");
        };
        Red.prototype._verify2 = function _verify2(a, b) {
          assert((a.negative | b.negative) === 0, "red works only with positives");
          assert(a.red && a.red === b.red, "red works only with red numbers");
        };
        Red.prototype.imod = function imod(a) {
          if (this.prime) return this.prime.ireduce(a)._forceRed(this);
          return a.umod(this.m)._forceRed(this);
        };
        Red.prototype.neg = function neg(a) {
          if (a.isZero()) {
            return a.clone();
          }
          return this.m.sub(a)._forceRed(this);
        };
        Red.prototype.add = function add(a, b) {
          this._verify2(a, b);
          var res = a.add(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.iadd = function iadd(a, b) {
          this._verify2(a, b);
          var res = a.iadd(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res;
        };
        Red.prototype.sub = function sub(a, b) {
          this._verify2(a, b);
          var res = a.sub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.isub = function isub(a, b) {
          this._verify2(a, b);
          var res = a.isub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res;
        };
        Red.prototype.shl = function shl(a, num) {
          this._verify1(a);
          return this.imod(a.ushln(num));
        };
        Red.prototype.imul = function imul(a, b) {
          this._verify2(a, b);
          return this.imod(a.imul(b));
        };
        Red.prototype.mul = function mul(a, b) {
          this._verify2(a, b);
          return this.imod(a.mul(b));
        };
        Red.prototype.isqr = function isqr(a) {
          return this.imul(a, a.clone());
        };
        Red.prototype.sqr = function sqr(a) {
          return this.mul(a, a);
        };
        Red.prototype.sqrt = function sqrt(a) {
          if (a.isZero()) return a.clone();
          var mod3 = this.m.andln(3);
          assert(mod3 % 2 === 1);
          if (mod3 === 3) {
            var pow = this.m.add(new BN(1)).iushrn(2);
            return this.pow(a, pow);
          }
          var q = this.m.subn(1);
          var s = 0;
          while (!q.isZero() && q.andln(1) === 0) {
            s++;
            q.iushrn(1);
          }
          assert(!q.isZero());
          var one = new BN(1).toRed(this);
          var nOne = one.redNeg();
          var lpow = this.m.subn(1).iushrn(1);
          var z = this.m.bitLength();
          z = new BN(2 * z * z).toRed(this);
          while (this.pow(z, lpow).cmp(nOne) !== 0) {
            z.redIAdd(nOne);
          }
          var c = this.pow(z, q);
          var r = this.pow(a, q.addn(1).iushrn(1));
          var t = this.pow(a, q);
          var m = s;
          while (t.cmp(one) !== 0) {
            var tmp = t;
            for (var i = 0; tmp.cmp(one) !== 0; i++) {
              tmp = tmp.redSqr();
            }
            assert(i < m);
            var b = this.pow(c, new BN(1).iushln(m - i - 1));
            r = r.redMul(b);
            c = b.redSqr();
            t = t.redMul(c);
            m = i;
          }
          return r;
        };
        Red.prototype.invm = function invm(a) {
          var inv = a._invmp(this.m);
          if (inv.negative !== 0) {
            inv.negative = 0;
            return this.imod(inv).redNeg();
          } else {
            return this.imod(inv);
          }
        };
        Red.prototype.pow = function pow(a, num) {
          if (num.isZero()) return new BN(1).toRed(this);
          if (num.cmpn(1) === 0) return a.clone();
          var windowSize = 4;
          var wnd = new Array(1 << windowSize);
          wnd[0] = new BN(1).toRed(this);
          wnd[1] = a;
          for (var i = 2; i < wnd.length; i++) {
            wnd[i] = this.mul(wnd[i - 1], a);
          }
          var res = wnd[0];
          var current = 0;
          var currentLen = 0;
          var start = num.bitLength() % 26;
          if (start === 0) {
            start = 26;
          }
          for (i = num.length - 1; i >= 0; i--) {
            var word = num.words[i];
            for (var j = start - 1; j >= 0; j--) {
              var bit = word >> j & 1;
              if (res !== wnd[0]) {
                res = this.sqr(res);
              }
              if (bit === 0 && current === 0) {
                currentLen = 0;
                continue;
              }
              current <<= 1;
              current |= bit;
              currentLen++;
              if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
              res = this.mul(res, wnd[current]);
              currentLen = 0;
              current = 0;
            }
            start = 26;
          }
          return res;
        };
        Red.prototype.convertTo = function convertTo(num) {
          var r = num.umod(this.m);
          return r === num ? r.clone() : r;
        };
        Red.prototype.convertFrom = function convertFrom(num) {
          var res = num.clone();
          res.red = null;
          return res;
        };
        BN.mont = function mont(num) {
          return new Mont(num);
        };
        function Mont(m) {
          Red.call(this, m);
          this.shift = this.m.bitLength();
          if (this.shift % 26 !== 0) {
            this.shift += 26 - this.shift % 26;
          }
          this.r = new BN(1).iushln(this.shift);
          this.r2 = this.imod(this.r.sqr());
          this.rinv = this.r._invmp(this.m);
          this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
          this.minv = this.minv.umod(this.r);
          this.minv = this.r.sub(this.minv);
        }
        inherits(Mont, Red);
        Mont.prototype.convertTo = function convertTo(num) {
          return this.imod(num.ushln(this.shift));
        };
        Mont.prototype.convertFrom = function convertFrom(num) {
          var r = this.imod(num.mul(this.rinv));
          r.red = null;
          return r;
        };
        Mont.prototype.imul = function imul(a, b) {
          if (a.isZero() || b.isZero()) {
            a.words[0] = 0;
            a.length = 1;
            return a;
          }
          var t = a.imul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.mul = function mul(a, b) {
          if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
          var t = a.mul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.invm = function invm(a) {
          var res = this.imod(a._invmp(this.m).mul(this.r2));
          return res._forceRed(this);
        };
      })(false || module, this);
    },
    7108(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var MD5 = __webpack_require__(8276);
      var RIPEMD160 = __webpack_require__(6011);
      var sha = __webpack_require__(2802);
      var Base = __webpack_require__(6168);
      function Hash(hash) {
        Base.call(this, "digest");
        this._hash = hash;
      }
      inherits(Hash, Base);
      Hash.prototype._update = function(data) {
        this._hash.update(data);
      };
      Hash.prototype._final = function() {
        return this._hash.digest();
      };
      module.exports = function createHash(alg) {
        alg = alg.toLowerCase();
        if (alg === "md5") return new MD5;
        if (alg === "rmd160" || alg === "ripemd160") return new RIPEMD160;
        return new Hash(sha(alg));
      };
    },
    320(module, __unused_webpack_exports, __webpack_require__) {
      var MD5 = __webpack_require__(8276);
      module.exports = function(buffer) {
        return (new MD5).update(buffer).digest();
      };
    },
    3507(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var Legacy = __webpack_require__(1800);
      var Base = __webpack_require__(6168);
      var Buffer = __webpack_require__(2861).Buffer;
      var md5 = __webpack_require__(320);
      var RIPEMD160 = __webpack_require__(6011);
      var sha = __webpack_require__(2802);
      var ZEROS = Buffer.alloc(128);
      function Hmac(alg, key) {
        Base.call(this, "digest");
        if (typeof key === "string") {
          key = Buffer.from(key);
        }
        var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64;
        this._alg = alg;
        this._key = key;
        if (key.length > blocksize) {
          var hash = alg === "rmd160" ? new RIPEMD160 : sha(alg);
          key = hash.update(key).digest();
        } else if (key.length < blocksize) {
          key = Buffer.concat([ key, ZEROS ], blocksize);
        }
        var ipad = this._ipad = Buffer.allocUnsafe(blocksize);
        var opad = this._opad = Buffer.allocUnsafe(blocksize);
        for (var i = 0; i < blocksize; i++) {
          ipad[i] = key[i] ^ 54;
          opad[i] = key[i] ^ 92;
        }
        this._hash = alg === "rmd160" ? new RIPEMD160 : sha(alg);
        this._hash.update(ipad);
      }
      inherits(Hmac, Base);
      Hmac.prototype._update = function(data) {
        this._hash.update(data);
      };
      Hmac.prototype._final = function() {
        var h = this._hash.digest();
        var hash = this._alg === "rmd160" ? new RIPEMD160 : sha(this._alg);
        return hash.update(this._opad).update(h).digest();
      };
      module.exports = function createHmac(alg, key) {
        alg = alg.toLowerCase();
        if (alg === "rmd160" || alg === "ripemd160") {
          return new Hmac("rmd160", key);
        }
        if (alg === "md5") {
          return new Legacy(md5, key);
        }
        return new Hmac(alg, key);
      };
    },
    1800(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var Buffer = __webpack_require__(2861).Buffer;
      var Base = __webpack_require__(6168);
      var ZEROS = Buffer.alloc(128);
      var blocksize = 64;
      function Hmac(alg, key) {
        Base.call(this, "digest");
        if (typeof key === "string") {
          key = Buffer.from(key);
        }
        this._alg = alg;
        this._key = key;
        if (key.length > blocksize) {
          key = alg(key);
        } else if (key.length < blocksize) {
          key = Buffer.concat([ key, ZEROS ], blocksize);
        }
        var ipad = this._ipad = Buffer.allocUnsafe(blocksize);
        var opad = this._opad = Buffer.allocUnsafe(blocksize);
        for (var i = 0; i < blocksize; i++) {
          ipad[i] = key[i] ^ 54;
          opad[i] = key[i] ^ 92;
        }
        this._hash = [ ipad ];
      }
      inherits(Hmac, Base);
      Hmac.prototype._update = function(data) {
        this._hash.push(data);
      };
      Hmac.prototype._final = function() {
        var h = this._alg(Buffer.concat(this._hash));
        return this._alg(Buffer.concat([ this._opad, h ]));
      };
      module.exports = Hmac;
    },
    1565(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = __webpack_require__(3209);
      exports.createHash = exports.Hash = __webpack_require__(7108);
      exports.createHmac = exports.Hmac = __webpack_require__(3507);
      var algos = __webpack_require__(5715);
      var algoKeys = Object.keys(algos);
      var hashes = [ "sha1", "sha224", "sha256", "sha384", "sha512", "md5", "rmd160" ].concat(algoKeys);
      exports.getHashes = function() {
        return hashes;
      };
      var p = __webpack_require__(8396);
      exports.pbkdf2 = p.pbkdf2;
      exports.pbkdf2Sync = p.pbkdf2Sync;
      var aes = __webpack_require__(125);
      exports.Cipher = aes.Cipher;
      exports.createCipher = aes.createCipher;
      exports.Cipheriv = aes.Cipheriv;
      exports.createCipheriv = aes.createCipheriv;
      exports.Decipher = aes.Decipher;
      exports.createDecipher = aes.createDecipher;
      exports.Decipheriv = aes.Decipheriv;
      exports.createDecipheriv = aes.createDecipheriv;
      exports.getCiphers = aes.getCiphers;
      exports.listCiphers = aes.listCiphers;
      var dh = __webpack_require__(5380);
      exports.DiffieHellmanGroup = dh.DiffieHellmanGroup;
      exports.createDiffieHellmanGroup = dh.createDiffieHellmanGroup;
      exports.getDiffieHellman = dh.getDiffieHellman;
      exports.createDiffieHellman = dh.createDiffieHellman;
      exports.DiffieHellman = dh.DiffieHellman;
      var sign = __webpack_require__(20);
      exports.createSign = sign.createSign;
      exports.Sign = sign.Sign;
      exports.createVerify = sign.createVerify;
      exports.Verify = sign.Verify;
      exports.createECDH = __webpack_require__(1324);
      var publicEncrypt = __webpack_require__(7168);
      exports.publicEncrypt = publicEncrypt.publicEncrypt;
      exports.privateEncrypt = publicEncrypt.privateEncrypt;
      exports.publicDecrypt = publicEncrypt.publicDecrypt;
      exports.privateDecrypt = publicEncrypt.privateDecrypt;
      var rf = __webpack_require__(6983);
      exports.randomFill = rf.randomFill;
      exports.randomFillSync = rf.randomFillSync;
      exports.createCredentials = function() {
        throw new Error("sorry, createCredentials is not implemented yet\nwe accept pull requests\nhttps://github.com/browserify/crypto-browserify");
      };
      exports.constants = {
        DH_CHECK_P_NOT_SAFE_PRIME: 2,
        DH_CHECK_P_NOT_PRIME: 1,
        DH_UNABLE_TO_CHECK_GENERATOR: 4,
        DH_NOT_SUITABLE_GENERATOR: 8,
        NPN_ENABLED: 1,
        ALPN_ENABLED: 1,
        RSA_PKCS1_PADDING: 1,
        RSA_SSLV23_PADDING: 2,
        RSA_NO_PADDING: 3,
        RSA_PKCS1_OAEP_PADDING: 4,
        RSA_X931_PADDING: 5,
        RSA_PKCS1_PSS_PADDING: 6,
        POINT_CONVERSION_COMPRESSED: 2,
        POINT_CONVERSION_UNCOMPRESSED: 4,
        POINT_CONVERSION_HYBRID: 6
      };
    },
    4353(module) {
      !function(t, e) {
        true ? module.exports = e() : 0;
      }(this, (function() {
        "use strict";
        var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", c = "month", f = "quarter", h = "year", d = "date", l = "Invalid Date", $ = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = {
          name: "en",
          weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
          months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
          ordinal: function(t) {
            var e = [ "th", "st", "nd", "rd" ], n = t % 100;
            return "[" + t + (e[(n - 20) % 10] || e[n] || e[0]) + "]";
          }
        }, m = function(t, e, n) {
          var r = String(t);
          return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
        }, v = {
          s: m,
          z: function(t) {
            var e = -t.utcOffset(), n = Math.abs(e), r = Math.floor(n / 60), i = n % 60;
            return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
          },
          m: function t(e, n) {
            if (e.date() < n.date()) return -t(n, e);
            var r = 12 * (n.year() - e.year()) + (n.month() - e.month()), i = e.clone().add(r, c), s = n - i < 0, u = e.clone().add(r + (s ? -1 : 1), c);
            return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
          },
          a: function(t) {
            return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
          },
          p: function(t) {
            return {
              M: c,
              y: h,
              w: o,
              d: a,
              D: d,
              h: u,
              m: s,
              s: i,
              ms: r,
              Q: f
            }[t] || String(t || "").toLowerCase().replace(/s$/, "");
          },
          u: function(t) {
            return void 0 === t;
          }
        }, g = "en", D = {};
        D[g] = M;
        var p = "$isDayjsObject", S = function(t) {
          return t instanceof _ || !(!t || !t[p]);
        }, w = function t(e, n, r) {
          var i;
          if (!e) return g;
          if ("string" == typeof e) {
            var s = e.toLowerCase();
            D[s] && (i = s), n && (D[s] = n, i = s);
            var u = e.split("-");
            if (!i && u.length > 1) return t(u[0]);
          } else {
            var a = e.name;
            D[a] = e, i = a;
          }
          return !r && i && (g = i), i || !r && g;
        }, O = function(t, e) {
          if (S(t)) return t.clone();
          var n = "object" == typeof e ? e : {};
          return n.date = t, n.args = arguments, new _(n);
        }, b = v;
        b.l = w, b.i = S, b.w = function(t, e) {
          return O(t, {
            locale: e.$L,
            utc: e.$u,
            x: e.$x,
            $offset: e.$offset
          });
        };
        var _ = function() {
          function M(t) {
            this.$L = w(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, 
            this[p] = !0;
          }
          var m = M.prototype;
          return m.parse = function(t) {
            this.$d = function(t) {
              var e = t.date, n = t.utc;
              if (null === e) return new Date(NaN);
              if (b.u(e)) return new Date;
              if (e instanceof Date) return new Date(e);
              if ("string" == typeof e && !/Z$/i.test(e)) {
                var r = e.match($);
                if (r) {
                  var i = r[2] - 1 || 0, s = (r[7] || "0").substring(0, 3);
                  return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
                }
              }
              return new Date(e);
            }(t), this.init();
          }, m.init = function() {
            var t = this.$d;
            this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), 
            this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
          }, m.$utils = function() {
            return b;
          }, m.isValid = function() {
            return !(this.$d.toString() === l);
          }, m.isSame = function(t, e) {
            var n = O(t);
            return this.startOf(e) <= n && n <= this.endOf(e);
          }, m.isAfter = function(t, e) {
            return O(t) < this.startOf(e);
          }, m.isBefore = function(t, e) {
            return this.endOf(e) < O(t);
          }, m.$g = function(t, e, n) {
            return b.u(t) ? this[e] : this.set(n, t);
          }, m.unix = function() {
            return Math.floor(this.valueOf() / 1e3);
          }, m.valueOf = function() {
            return this.$d.getTime();
          }, m.startOf = function(t, e) {
            var n = this, r = !!b.u(e) || e, f = b.p(t), l = function(t, e) {
              var i = b.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
              return r ? i : i.endOf(a);
            }, $ = function(t, e) {
              return b.w(n.toDate()[t].apply(n.toDate("s"), (r ? [ 0, 0, 0, 0 ] : [ 23, 59, 59, 999 ]).slice(e)), n);
            }, y = this.$W, M = this.$M, m = this.$D, v = "set" + (this.$u ? "UTC" : "");
            switch (f) {
             case h:
              return r ? l(1, 0) : l(31, 11);

             case c:
              return r ? l(1, M) : l(0, M + 1);

             case o:
              var g = this.$locale().weekStart || 0, D = (y < g ? y + 7 : y) - g;
              return l(r ? m - D : m + (6 - D), M);

             case a:
             case d:
              return $(v + "Hours", 0);

             case u:
              return $(v + "Minutes", 1);

             case s:
              return $(v + "Seconds", 2);

             case i:
              return $(v + "Milliseconds", 3);

             default:
              return this.clone();
            }
          }, m.endOf = function(t) {
            return this.startOf(t, !1);
          }, m.$set = function(t, e) {
            var n, o = b.p(t), f = "set" + (this.$u ? "UTC" : ""), l = (n = {}, n[a] = f + "Date", 
            n[d] = f + "Date", n[c] = f + "Month", n[h] = f + "FullYear", n[u] = f + "Hours", 
            n[s] = f + "Minutes", n[i] = f + "Seconds", n[r] = f + "Milliseconds", n)[o], $ = o === a ? this.$D + (e - this.$W) : e;
            if (o === c || o === h) {
              var y = this.clone().set(d, 1);
              y.$d[l]($), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
            } else l && this.$d[l]($);
            return this.init(), this;
          }, m.set = function(t, e) {
            return this.clone().$set(t, e);
          }, m.get = function(t) {
            return this[b.p(t)]();
          }, m.add = function(r, f) {
            var d, l = this;
            r = Number(r);
            var $ = b.p(f), y = function(t) {
              var e = O(l);
              return b.w(e.date(e.date() + Math.round(t * r)), l);
            };
            if ($ === c) return this.set(c, this.$M + r);
            if ($ === h) return this.set(h, this.$y + r);
            if ($ === a) return y(1);
            if ($ === o) return y(7);
            var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[$] || 1, m = this.$d.getTime() + r * M;
            return b.w(m, this);
          }, m.subtract = function(t, e) {
            return this.add(-1 * t, e);
          }, m.format = function(t) {
            var e = this, n = this.$locale();
            if (!this.isValid()) return n.invalidDate || l;
            var r = t || "YYYY-MM-DDTHH:mm:ssZ", i = b.z(this), s = this.$H, u = this.$m, a = this.$M, o = n.weekdays, c = n.months, f = n.meridiem, h = function(t, n, i, s) {
              return t && (t[n] || t(e, r)) || i[n].slice(0, s);
            }, d = function(t) {
              return b.s(s % 12 || 12, t, "0");
            }, $ = f || function(t, e, n) {
              var r = t < 12 ? "AM" : "PM";
              return n ? r.toLowerCase() : r;
            };
            return r.replace(y, (function(t, r) {
              return r || function(t) {
                switch (t) {
                 case "YY":
                  return String(e.$y).slice(-2);

                 case "YYYY":
                  return b.s(e.$y, 4, "0");

                 case "M":
                  return a + 1;

                 case "MM":
                  return b.s(a + 1, 2, "0");

                 case "MMM":
                  return h(n.monthsShort, a, c, 3);

                 case "MMMM":
                  return h(c, a);

                 case "D":
                  return e.$D;

                 case "DD":
                  return b.s(e.$D, 2, "0");

                 case "d":
                  return String(e.$W);

                 case "dd":
                  return h(n.weekdaysMin, e.$W, o, 2);

                 case "ddd":
                  return h(n.weekdaysShort, e.$W, o, 3);

                 case "dddd":
                  return o[e.$W];

                 case "H":
                  return String(s);

                 case "HH":
                  return b.s(s, 2, "0");

                 case "h":
                  return d(1);

                 case "hh":
                  return d(2);

                 case "a":
                  return $(s, u, !0);

                 case "A":
                  return $(s, u, !1);

                 case "m":
                  return String(u);

                 case "mm":
                  return b.s(u, 2, "0");

                 case "s":
                  return String(e.$s);

                 case "ss":
                  return b.s(e.$s, 2, "0");

                 case "SSS":
                  return b.s(e.$ms, 3, "0");

                 case "Z":
                  return i;
                }
                return null;
              }(t) || i.replace(":", "");
            }));
          }, m.utcOffset = function() {
            return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
          }, m.diff = function(r, d, l) {
            var $, y = this, M = b.p(d), m = O(r), v = (m.utcOffset() - this.utcOffset()) * e, g = this - m, D = function() {
              return b.m(y, m);
            };
            switch (M) {
             case h:
              $ = D() / 12;
              break;

             case c:
              $ = D();
              break;

             case f:
              $ = D() / 3;
              break;

             case o:
              $ = (g - v) / 6048e5;
              break;

             case a:
              $ = (g - v) / 864e5;
              break;

             case u:
              $ = g / n;
              break;

             case s:
              $ = g / e;
              break;

             case i:
              $ = g / t;
              break;

             default:
              $ = g;
            }
            return l ? $ : b.a($);
          }, m.daysInMonth = function() {
            return this.endOf(c).$D;
          }, m.$locale = function() {
            return D[this.$L];
          }, m.locale = function(t, e) {
            if (!t) return this.$L;
            var n = this.clone(), r = w(t, e, !0);
            return r && (n.$L = r), n;
          }, m.clone = function() {
            return b.w(this.$d, this);
          }, m.toDate = function() {
            return new Date(this.valueOf());
          }, m.toJSON = function() {
            return this.isValid() ? this.toISOString() : null;
          }, m.toISOString = function() {
            return this.$d.toISOString();
          }, m.toString = function() {
            return this.$d.toUTCString();
          }, M;
        }(), k = _.prototype;
        return O.prototype = k, [ [ "$ms", r ], [ "$s", i ], [ "$m", s ], [ "$H", u ], [ "$W", a ], [ "$M", c ], [ "$y", h ], [ "$D", d ] ].forEach((function(t) {
          k[t[1]] = function(e) {
            return this.$g(e, t[0], t[1]);
          };
        })), O.extend = function(t, e) {
          return t.$i || (t(e, _, O), t.$i = !0), O;
        }, O.locale = w, O.isDayjs = S, O.unix = function(t) {
          return O(1e3 * t);
        }, O.en = D[g], O.Ls = D, O.p = {}, O;
      }));
    },
    41(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var $defineProperty = __webpack_require__(655);
      var $SyntaxError = __webpack_require__(8068);
      var $TypeError = __webpack_require__(9675);
      var gopd = __webpack_require__(5795);
      module.exports = function defineDataProperty(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 = !!gopd && gopd(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.");
        }
      };
    },
    9560(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      exports.utils = __webpack_require__(7626);
      exports.Cipher = __webpack_require__(2808);
      exports.DES = __webpack_require__(2211);
      exports.CBC = __webpack_require__(3389);
      exports.EDE = __webpack_require__(5279);
    },
    3389(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var assert = __webpack_require__(3349);
      var inherits = __webpack_require__(6698);
      var proto = {};
      function CBCState(iv) {
        assert.equal(iv.length, 8, "Invalid IV length");
        this.iv = new Array(8);
        for (var i = 0; i < this.iv.length; i++) this.iv[i] = iv[i];
      }
      function instantiate(Base) {
        function CBC(options) {
          Base.call(this, options);
          this._cbcInit();
        }
        inherits(CBC, Base);
        var keys = Object.keys(proto);
        for (var i = 0; i < keys.length; i++) {
          var key = keys[i];
          CBC.prototype[key] = proto[key];
        }
        CBC.create = function create(options) {
          return new CBC(options);
        };
        return CBC;
      }
      exports.instantiate = instantiate;
      proto._cbcInit = function _cbcInit() {
        var state = new CBCState(this.options.iv);
        this._cbcState = state;
      };
      proto._update = function _update(inp, inOff, out, outOff) {
        var state = this._cbcState;
        var superProto = this.constructor.super_.prototype;
        var iv = state.iv;
        if (this.type === "encrypt") {
          for (var i = 0; i < this.blockSize; i++) iv[i] ^= inp[inOff + i];
          superProto._update.call(this, iv, 0, out, outOff);
          for (var i = 0; i < this.blockSize; i++) iv[i] = out[outOff + i];
        } else {
          superProto._update.call(this, inp, inOff, out, outOff);
          for (var i = 0; i < this.blockSize; i++) out[outOff + i] ^= iv[i];
          for (var i = 0; i < this.blockSize; i++) iv[i] = inp[inOff + i];
        }
      };
    },
    2808(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var assert = __webpack_require__(3349);
      function Cipher(options) {
        this.options = options;
        this.type = this.options.type;
        this.blockSize = 8;
        this._init();
        this.buffer = new Array(this.blockSize);
        this.bufferOff = 0;
        this.padding = options.padding !== false;
      }
      module.exports = Cipher;
      Cipher.prototype._init = function _init() {};
      Cipher.prototype.update = function update(data) {
        if (data.length === 0) return [];
        if (this.type === "decrypt") return this._updateDecrypt(data); else return this._updateEncrypt(data);
      };
      Cipher.prototype._buffer = function _buffer(data, off) {
        var min = Math.min(this.buffer.length - this.bufferOff, data.length - off);
        for (var i = 0; i < min; i++) this.buffer[this.bufferOff + i] = data[off + i];
        this.bufferOff += min;
        return min;
      };
      Cipher.prototype._flushBuffer = function _flushBuffer(out, off) {
        this._update(this.buffer, 0, out, off);
        this.bufferOff = 0;
        return this.blockSize;
      };
      Cipher.prototype._updateEncrypt = function _updateEncrypt(data) {
        var inputOff = 0;
        var outputOff = 0;
        var count = (this.bufferOff + data.length) / this.blockSize | 0;
        var out = new Array(count * this.blockSize);
        if (this.bufferOff !== 0) {
          inputOff += this._buffer(data, inputOff);
          if (this.bufferOff === this.buffer.length) outputOff += this._flushBuffer(out, outputOff);
        }
        var max = data.length - (data.length - inputOff) % this.blockSize;
        for (;inputOff < max; inputOff += this.blockSize) {
          this._update(data, inputOff, out, outputOff);
          outputOff += this.blockSize;
        }
        for (;inputOff < data.length; inputOff++, this.bufferOff++) this.buffer[this.bufferOff] = data[inputOff];
        return out;
      };
      Cipher.prototype._updateDecrypt = function _updateDecrypt(data) {
        var inputOff = 0;
        var outputOff = 0;
        var count = Math.ceil((this.bufferOff + data.length) / this.blockSize) - 1;
        var out = new Array(count * this.blockSize);
        for (;count > 0; count--) {
          inputOff += this._buffer(data, inputOff);
          outputOff += this._flushBuffer(out, outputOff);
        }
        inputOff += this._buffer(data, inputOff);
        return out;
      };
      Cipher.prototype.final = function final(buffer) {
        var first;
        if (buffer) first = this.update(buffer);
        var last;
        if (this.type === "encrypt") last = this._finalEncrypt(); else last = this._finalDecrypt();
        if (first) return first.concat(last); else return last;
      };
      Cipher.prototype._pad = function _pad(buffer, off) {
        if (off === 0) return false;
        while (off < buffer.length) buffer[off++] = 0;
        return true;
      };
      Cipher.prototype._finalEncrypt = function _finalEncrypt() {
        if (!this._pad(this.buffer, this.bufferOff)) return [];
        var out = new Array(this.blockSize);
        this._update(this.buffer, 0, out, 0);
        return out;
      };
      Cipher.prototype._unpad = function _unpad(buffer) {
        return buffer;
      };
      Cipher.prototype._finalDecrypt = function _finalDecrypt() {
        assert.equal(this.bufferOff, this.blockSize, "Not enough data to decrypt");
        var out = new Array(this.blockSize);
        this._flushBuffer(out, 0);
        return this._unpad(out);
      };
    },
    2211(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var assert = __webpack_require__(3349);
      var inherits = __webpack_require__(6698);
      var utils = __webpack_require__(7626);
      var Cipher = __webpack_require__(2808);
      function DESState() {
        this.tmp = new Array(2);
        this.keys = null;
      }
      function DES(options) {
        Cipher.call(this, options);
        var state = new DESState;
        this._desState = state;
        this.deriveKeys(state, options.key);
      }
      inherits(DES, Cipher);
      module.exports = DES;
      DES.create = function create(options) {
        return new DES(options);
      };
      var shiftTable = [ 1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1 ];
      DES.prototype.deriveKeys = function deriveKeys(state, key) {
        state.keys = new Array(16 * 2);
        assert.equal(key.length, this.blockSize, "Invalid key length");
        var kL = utils.readUInt32BE(key, 0);
        var kR = utils.readUInt32BE(key, 4);
        utils.pc1(kL, kR, state.tmp, 0);
        kL = state.tmp[0];
        kR = state.tmp[1];
        for (var i = 0; i < state.keys.length; i += 2) {
          var shift = shiftTable[i >>> 1];
          kL = utils.r28shl(kL, shift);
          kR = utils.r28shl(kR, shift);
          utils.pc2(kL, kR, state.keys, i);
        }
      };
      DES.prototype._update = function _update(inp, inOff, out, outOff) {
        var state = this._desState;
        var l = utils.readUInt32BE(inp, inOff);
        var r = utils.readUInt32BE(inp, inOff + 4);
        utils.ip(l, r, state.tmp, 0);
        l = state.tmp[0];
        r = state.tmp[1];
        if (this.type === "encrypt") this._encrypt(state, l, r, state.tmp, 0); else this._decrypt(state, l, r, state.tmp, 0);
        l = state.tmp[0];
        r = state.tmp[1];
        utils.writeUInt32BE(out, l, outOff);
        utils.writeUInt32BE(out, r, outOff + 4);
      };
      DES.prototype._pad = function _pad(buffer, off) {
        if (this.padding === false) {
          return false;
        }
        var value = buffer.length - off;
        for (var i = off; i < buffer.length; i++) buffer[i] = value;
        return true;
      };
      DES.prototype._unpad = function _unpad(buffer) {
        if (this.padding === false) {
          return buffer;
        }
        var pad = buffer[buffer.length - 1];
        for (var i = buffer.length - pad; i < buffer.length; i++) assert.equal(buffer[i], pad);
        return buffer.slice(0, buffer.length - pad);
      };
      DES.prototype._encrypt = function _encrypt(state, lStart, rStart, out, off) {
        var l = lStart;
        var r = rStart;
        for (var i = 0; i < state.keys.length; i += 2) {
          var keyL = state.keys[i];
          var keyR = state.keys[i + 1];
          utils.expand(r, state.tmp, 0);
          keyL ^= state.tmp[0];
          keyR ^= state.tmp[1];
          var s = utils.substitute(keyL, keyR);
          var f = utils.permute(s);
          var t = r;
          r = (l ^ f) >>> 0;
          l = t;
        }
        utils.rip(r, l, out, off);
      };
      DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) {
        var l = rStart;
        var r = lStart;
        for (var i = state.keys.length - 2; i >= 0; i -= 2) {
          var keyL = state.keys[i];
          var keyR = state.keys[i + 1];
          utils.expand(l, state.tmp, 0);
          keyL ^= state.tmp[0];
          keyR ^= state.tmp[1];
          var s = utils.substitute(keyL, keyR);
          var f = utils.permute(s);
          var t = l;
          l = (r ^ f) >>> 0;
          r = t;
        }
        utils.rip(l, r, out, off);
      };
    },
    5279(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var assert = __webpack_require__(3349);
      var inherits = __webpack_require__(6698);
      var Cipher = __webpack_require__(2808);
      var DES = __webpack_require__(2211);
      function EDEState(type, key) {
        assert.equal(key.length, 24, "Invalid key length");
        var k1 = key.slice(0, 8);
        var k2 = key.slice(8, 16);
        var k3 = key.slice(16, 24);
        if (type === "encrypt") {
          this.ciphers = [ DES.create({
            type: "encrypt",
            key: k1
          }), DES.create({
            type: "decrypt",
            key: k2
          }), DES.create({
            type: "encrypt",
            key: k3
          }) ];
        } else {
          this.ciphers = [ DES.create({
            type: "decrypt",
            key: k3
          }), DES.create({
            type: "encrypt",
            key: k2
          }), DES.create({
            type: "decrypt",
            key: k1
          }) ];
        }
      }
      function EDE(options) {
        Cipher.call(this, options);
        var state = new EDEState(this.type, this.options.key);
        this._edeState = state;
      }
      inherits(EDE, Cipher);
      module.exports = EDE;
      EDE.create = function create(options) {
        return new EDE(options);
      };
      EDE.prototype._update = function _update(inp, inOff, out, outOff) {
        var state = this._edeState;
        state.ciphers[0]._update(inp, inOff, out, outOff);
        state.ciphers[1]._update(out, outOff, out, outOff);
        state.ciphers[2]._update(out, outOff, out, outOff);
      };
      EDE.prototype._pad = DES.prototype._pad;
      EDE.prototype._unpad = DES.prototype._unpad;
    },
    7626(__unused_webpack_module, exports) {
      "use strict";
      exports.readUInt32BE = function readUInt32BE(bytes, off) {
        var res = bytes[0 + off] << 24 | bytes[1 + off] << 16 | bytes[2 + off] << 8 | bytes[3 + off];
        return res >>> 0;
      };
      exports.writeUInt32BE = function writeUInt32BE(bytes, value, off) {
        bytes[0 + off] = value >>> 24;
        bytes[1 + off] = value >>> 16 & 255;
        bytes[2 + off] = value >>> 8 & 255;
        bytes[3 + off] = value & 255;
      };
      exports.ip = function ip(inL, inR, out, off) {
        var outL = 0;
        var outR = 0;
        for (var i = 6; i >= 0; i -= 2) {
          for (var j = 0; j <= 24; j += 8) {
            outL <<= 1;
            outL |= inR >>> j + i & 1;
          }
          for (var j = 0; j <= 24; j += 8) {
            outL <<= 1;
            outL |= inL >>> j + i & 1;
          }
        }
        for (var i = 6; i >= 0; i -= 2) {
          for (var j = 1; j <= 25; j += 8) {
            outR <<= 1;
            outR |= inR >>> j + i & 1;
          }
          for (var j = 1; j <= 25; j += 8) {
            outR <<= 1;
            outR |= inL >>> j + i & 1;
          }
        }
        out[off + 0] = outL >>> 0;
        out[off + 1] = outR >>> 0;
      };
      exports.rip = function rip(inL, inR, out, off) {
        var outL = 0;
        var outR = 0;
        for (var i = 0; i < 4; i++) {
          for (var j = 24; j >= 0; j -= 8) {
            outL <<= 1;
            outL |= inR >>> j + i & 1;
            outL <<= 1;
            outL |= inL >>> j + i & 1;
          }
        }
        for (var i = 4; i < 8; i++) {
          for (var j = 24; j >= 0; j -= 8) {
            outR <<= 1;
            outR |= inR >>> j + i & 1;
            outR <<= 1;
            outR |= inL >>> j + i & 1;
          }
        }
        out[off + 0] = outL >>> 0;
        out[off + 1] = outR >>> 0;
      };
      exports.pc1 = function pc1(inL, inR, out, off) {
        var outL = 0;
        var outR = 0;
        for (var i = 7; i >= 5; i--) {
          for (var j = 0; j <= 24; j += 8) {
            outL <<= 1;
            outL |= inR >> j + i & 1;
          }
          for (var j = 0; j <= 24; j += 8) {
            outL <<= 1;
            outL |= inL >> j + i & 1;
          }
        }
        for (var j = 0; j <= 24; j += 8) {
          outL <<= 1;
          outL |= inR >> j + i & 1;
        }
        for (var i = 1; i <= 3; i++) {
          for (var j = 0; j <= 24; j += 8) {
            outR <<= 1;
            outR |= inR >> j + i & 1;
          }
          for (var j = 0; j <= 24; j += 8) {
            outR <<= 1;
            outR |= inL >> j + i & 1;
          }
        }
        for (var j = 0; j <= 24; j += 8) {
          outR <<= 1;
          outR |= inL >> j + i & 1;
        }
        out[off + 0] = outL >>> 0;
        out[off + 1] = outR >>> 0;
      };
      exports.r28shl = function r28shl(num, shift) {
        return num << shift & 268435455 | num >>> 28 - shift;
      };
      var pc2table = [ 14, 11, 17, 4, 27, 23, 25, 0, 13, 22, 7, 18, 5, 9, 16, 24, 2, 20, 12, 21, 1, 8, 15, 26, 15, 4, 25, 19, 9, 1, 26, 16, 5, 11, 23, 8, 12, 7, 17, 0, 22, 3, 10, 14, 6, 20, 27, 24 ];
      exports.pc2 = function pc2(inL, inR, out, off) {
        var outL = 0;
        var outR = 0;
        var len = pc2table.length >>> 1;
        for (var i = 0; i < len; i++) {
          outL <<= 1;
          outL |= inL >>> pc2table[i] & 1;
        }
        for (var i = len; i < pc2table.length; i++) {
          outR <<= 1;
          outR |= inR >>> pc2table[i] & 1;
        }
        out[off + 0] = outL >>> 0;
        out[off + 1] = outR >>> 0;
      };
      exports.expand = function expand(r, out, off) {
        var outL = 0;
        var outR = 0;
        outL = (r & 1) << 5 | r >>> 27;
        for (var i = 23; i >= 15; i -= 4) {
          outL <<= 6;
          outL |= r >>> i & 63;
        }
        for (var i = 11; i >= 3; i -= 4) {
          outR |= r >>> i & 63;
          outR <<= 6;
        }
        outR |= (r & 31) << 1 | r >>> 31;
        out[off + 0] = outL >>> 0;
        out[off + 1] = outR >>> 0;
      };
      var sTable = [ 14, 0, 4, 15, 13, 7, 1, 4, 2, 14, 15, 2, 11, 13, 8, 1, 3, 10, 10, 6, 6, 12, 12, 11, 5, 9, 9, 5, 0, 3, 7, 8, 4, 15, 1, 12, 14, 8, 8, 2, 13, 4, 6, 9, 2, 1, 11, 7, 15, 5, 12, 11, 9, 3, 7, 14, 3, 10, 10, 0, 5, 6, 0, 13, 15, 3, 1, 13, 8, 4, 14, 7, 6, 15, 11, 2, 3, 8, 4, 14, 9, 12, 7, 0, 2, 1, 13, 10, 12, 6, 0, 9, 5, 11, 10, 5, 0, 13, 14, 8, 7, 10, 11, 1, 10, 3, 4, 15, 13, 4, 1, 2, 5, 11, 8, 6, 12, 7, 6, 12, 9, 0, 3, 5, 2, 14, 15, 9, 10, 13, 0, 7, 9, 0, 14, 9, 6, 3, 3, 4, 15, 6, 5, 10, 1, 2, 13, 8, 12, 5, 7, 14, 11, 12, 4, 11, 2, 15, 8, 1, 13, 1, 6, 10, 4, 13, 9, 0, 8, 6, 15, 9, 3, 8, 0, 7, 11, 4, 1, 15, 2, 14, 12, 3, 5, 11, 10, 5, 14, 2, 7, 12, 7, 13, 13, 8, 14, 11, 3, 5, 0, 6, 6, 15, 9, 0, 10, 3, 1, 4, 2, 7, 8, 2, 5, 12, 11, 1, 12, 10, 4, 14, 15, 9, 10, 3, 6, 15, 9, 0, 0, 6, 12, 10, 11, 1, 7, 13, 13, 8, 15, 9, 1, 4, 3, 5, 14, 11, 5, 12, 2, 7, 8, 2, 4, 14, 2, 14, 12, 11, 4, 2, 1, 12, 7, 4, 10, 7, 11, 13, 6, 1, 8, 5, 5, 0, 3, 15, 15, 10, 13, 3, 0, 9, 14, 8, 9, 6, 4, 11, 2, 8, 1, 12, 11, 7, 10, 1, 13, 14, 7, 2, 8, 13, 15, 6, 9, 15, 12, 0, 5, 9, 6, 10, 3, 4, 0, 5, 14, 3, 12, 10, 1, 15, 10, 4, 15, 2, 9, 7, 2, 12, 6, 9, 8, 5, 0, 6, 13, 1, 3, 13, 4, 14, 14, 0, 7, 11, 5, 3, 11, 8, 9, 4, 14, 3, 15, 2, 5, 12, 2, 9, 8, 5, 12, 15, 3, 10, 7, 11, 0, 14, 4, 1, 10, 7, 1, 6, 13, 0, 11, 8, 6, 13, 4, 13, 11, 0, 2, 11, 14, 7, 15, 4, 0, 9, 8, 1, 13, 10, 3, 14, 12, 3, 9, 5, 7, 12, 5, 2, 10, 15, 6, 8, 1, 6, 1, 6, 4, 11, 11, 13, 13, 8, 12, 1, 3, 4, 7, 10, 14, 7, 10, 9, 15, 5, 6, 0, 8, 15, 0, 14, 5, 2, 9, 3, 2, 12, 13, 1, 2, 15, 8, 13, 4, 8, 6, 10, 15, 3, 11, 7, 1, 4, 10, 12, 9, 5, 3, 6, 14, 11, 5, 0, 0, 14, 12, 9, 7, 2, 7, 2, 11, 1, 4, 14, 1, 7, 9, 4, 12, 10, 14, 8, 2, 13, 0, 15, 6, 12, 10, 9, 13, 0, 15, 3, 3, 5, 5, 6, 8, 11 ];
      exports.substitute = function substitute(inL, inR) {
        var out = 0;
        for (var i = 0; i < 4; i++) {
          var b = inL >>> 18 - i * 6 & 63;
          var sb = sTable[i * 64 + b];
          out <<= 4;
          out |= sb;
        }
        for (var i = 0; i < 4; i++) {
          var b = inR >>> 18 - i * 6 & 63;
          var sb = sTable[4 * 64 + i * 64 + b];
          out <<= 4;
          out |= sb;
        }
        return out >>> 0;
      };
      var permuteTable = [ 16, 25, 12, 11, 3, 20, 4, 15, 31, 17, 9, 6, 27, 14, 1, 22, 30, 24, 8, 18, 0, 5, 29, 23, 13, 19, 2, 26, 10, 21, 28, 7 ];
      exports.permute = function permute(num) {
        var out = 0;
        for (var i = 0; i < permuteTable.length; i++) {
          out <<= 1;
          out |= num >>> permuteTable[i] & 1;
        }
        return out >>> 0;
      };
      exports.padSplit = function padSplit(num, size, group) {
        var str = num.toString(2);
        while (str.length < size) str = "0" + str;
        var out = [];
        for (var i = 0; i < size; i += group) out.push(str.slice(i, i + group));
        return out.join(" ");
      };
    },
    5380(__unused_webpack_module, exports, __webpack_require__) {
      var Buffer = __webpack_require__(8287)["Buffer"];
      var generatePrime = __webpack_require__(4934);
      var primes = __webpack_require__(3241);
      var DH = __webpack_require__(4910);
      function getDiffieHellman(mod) {
        var prime = new Buffer(primes[mod].prime, "hex");
        var gen = new Buffer(primes[mod].gen, "hex");
        return new DH(prime, gen);
      }
      var ENCODINGS = {
        binary: true,
        hex: true,
        base64: true
      };
      function createDiffieHellman(prime, enc, generator, genc) {
        if (Buffer.isBuffer(enc) || ENCODINGS[enc] === undefined) {
          return createDiffieHellman(prime, "binary", enc, generator);
        }
        enc = enc || "binary";
        genc = genc || "binary";
        generator = generator || new Buffer([ 2 ]);
        if (!Buffer.isBuffer(generator)) {
          generator = new Buffer(generator, genc);
        }
        if (typeof prime === "number") {
          return new DH(generatePrime(prime, generator), generator, true);
        }
        if (!Buffer.isBuffer(prime)) {
          prime = new Buffer(prime, enc);
        }
        return new DH(prime, generator, true);
      }
      exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffieHellman = getDiffieHellman;
      exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman;
    },
    4910(module, __unused_webpack_exports, __webpack_require__) {
      var Buffer = __webpack_require__(8287)["Buffer"];
      var BN = __webpack_require__(6473);
      var MillerRabin = __webpack_require__(2244);
      var millerRabin = new MillerRabin;
      var TWENTYFOUR = new BN(24);
      var ELEVEN = new BN(11);
      var TEN = new BN(10);
      var THREE = new BN(3);
      var SEVEN = new BN(7);
      var primes = __webpack_require__(4934);
      var randomBytes = __webpack_require__(3209);
      module.exports = DH;
      function setPublicKey(pub, enc) {
        enc = enc || "utf8";
        if (!Buffer.isBuffer(pub)) {
          pub = new Buffer(pub, enc);
        }
        this._pub = new BN(pub);
        return this;
      }
      function setPrivateKey(priv, enc) {
        enc = enc || "utf8";
        if (!Buffer.isBuffer(priv)) {
          priv = new Buffer(priv, enc);
        }
        this._priv = new BN(priv);
        return this;
      }
      var primeCache = {};
      function checkPrime(prime, generator) {
        var gen = generator.toString("hex");
        var hex = [ gen, prime.toString(16) ].join("_");
        if (hex in primeCache) {
          return primeCache[hex];
        }
        var error = 0;
        if (prime.isEven() || !primes.simpleSieve || !primes.fermatTest(prime) || !millerRabin.test(prime)) {
          error += 1;
          if (gen === "02" || gen === "05") {
            error += 8;
          } else {
            error += 4;
          }
          primeCache[hex] = error;
          return error;
        }
        if (!millerRabin.test(prime.shrn(1))) {
          error += 2;
        }
        var rem;
        switch (gen) {
         case "02":
          if (prime.mod(TWENTYFOUR).cmp(ELEVEN)) {
            error += 8;
          }
          break;

         case "05":
          rem = prime.mod(TEN);
          if (rem.cmp(THREE) && rem.cmp(SEVEN)) {
            error += 8;
          }
          break;

         default:
          error += 4;
        }
        primeCache[hex] = error;
        return error;
      }
      function DH(prime, generator, malleable) {
        this.setGenerator(generator);
        this.__prime = new BN(prime);
        this._prime = BN.mont(this.__prime);
        this._primeLen = prime.length;
        this._pub = undefined;
        this._priv = undefined;
        this._primeCode = undefined;
        if (malleable) {
          this.setPublicKey = setPublicKey;
          this.setPrivateKey = setPrivateKey;
        } else {
          this._primeCode = 8;
        }
      }
      Object.defineProperty(DH.prototype, "verifyError", {
        enumerable: true,
        get: function() {
          if (typeof this._primeCode !== "number") {
            this._primeCode = checkPrime(this.__prime, this.__gen);
          }
          return this._primeCode;
        }
      });
      DH.prototype.generateKeys = function() {
        if (!this._priv) {
          this._priv = new BN(randomBytes(this._primeLen));
        }
        this._pub = this._gen.toRed(this._prime).redPow(this._priv).fromRed();
        return this.getPublicKey();
      };
      DH.prototype.computeSecret = function(other) {
        other = new BN(other);
        other = other.toRed(this._prime);
        var secret = other.redPow(this._priv).fromRed();
        var out = new Buffer(secret.toArray());
        var prime = this.getPrime();
        if (out.length < prime.length) {
          var front = new Buffer(prime.length - out.length);
          front.fill(0);
          out = Buffer.concat([ front, out ]);
        }
        return out;
      };
      DH.prototype.getPublicKey = function getPublicKey(enc) {
        return formatReturnValue(this._pub, enc);
      };
      DH.prototype.getPrivateKey = function getPrivateKey(enc) {
        return formatReturnValue(this._priv, enc);
      };
      DH.prototype.getPrime = function(enc) {
        return formatReturnValue(this.__prime, enc);
      };
      DH.prototype.getGenerator = function(enc) {
        return formatReturnValue(this._gen, enc);
      };
      DH.prototype.setGenerator = function(gen, enc) {
        enc = enc || "utf8";
        if (!Buffer.isBuffer(gen)) {
          gen = new Buffer(gen, enc);
        }
        this.__gen = gen;
        this._gen = new BN(gen);
        return this;
      };
      function formatReturnValue(bn, enc) {
        var buf = new Buffer(bn.toArray());
        if (!enc) {
          return buf;
        } else {
          return buf.toString(enc);
        }
      }
    },
    4934(module, __unused_webpack_exports, __webpack_require__) {
      var randomBytes = __webpack_require__(3209);
      module.exports = findPrime;
      findPrime.simpleSieve = simpleSieve;
      findPrime.fermatTest = fermatTest;
      var BN = __webpack_require__(6473);
      var TWENTYFOUR = new BN(24);
      var MillerRabin = __webpack_require__(2244);
      var millerRabin = new MillerRabin;
      var ONE = new BN(1);
      var TWO = new BN(2);
      var FIVE = new BN(5);
      var SIXTEEN = new BN(16);
      var EIGHT = new BN(8);
      var TEN = new BN(10);
      var THREE = new BN(3);
      var SEVEN = new BN(7);
      var ELEVEN = new BN(11);
      var FOUR = new BN(4);
      var TWELVE = new BN(12);
      var primes = null;
      function _getPrimes() {
        if (primes !== null) return primes;
        var limit = 1048576;
        var res = [];
        res[0] = 2;
        for (var i = 1, k = 3; k < limit; k += 2) {
          var sqrt = Math.ceil(Math.sqrt(k));
          for (var j = 0; j < i && res[j] <= sqrt; j++) if (k % res[j] === 0) break;
          if (i !== j && res[j] <= sqrt) continue;
          res[i++] = k;
        }
        primes = res;
        return res;
      }
      function simpleSieve(p) {
        var primes = _getPrimes();
        for (var i = 0; i < primes.length; i++) if (p.modn(primes[i]) === 0) {
          if (p.cmpn(primes[i]) === 0) {
            return true;
          } else {
            return false;
          }
        }
        return true;
      }
      function fermatTest(p) {
        var red = BN.mont(p);
        return TWO.toRed(red).redPow(p.subn(1)).fromRed().cmpn(1) === 0;
      }
      function findPrime(bits, gen) {
        if (bits < 16) {
          if (gen === 2 || gen === 5) {
            return new BN([ 140, 123 ]);
          } else {
            return new BN([ 140, 39 ]);
          }
        }
        gen = new BN(gen);
        var num, n2;
        while (true) {
          num = new BN(randomBytes(Math.ceil(bits / 8)));
          while (num.bitLength() > bits) {
            num.ishrn(1);
          }
          if (num.isEven()) {
            num.iadd(ONE);
          }
          if (!num.testn(1)) {
            num.iadd(TWO);
          }
          if (!gen.cmp(TWO)) {
            while (num.mod(TWENTYFOUR).cmp(ELEVEN)) {
              num.iadd(FOUR);
            }
          } else if (!gen.cmp(FIVE)) {
            while (num.mod(TEN).cmp(THREE)) {
              num.iadd(FOUR);
            }
          }
          n2 = num.shrn(1);
          if (simpleSieve(n2) && simpleSieve(num) && fermatTest(n2) && fermatTest(num) && millerRabin.test(n2) && millerRabin.test(num)) {
            return num;
          }
        }
      }
    },
    6473(module, __unused_webpack_exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      (function(module, exports) {
        "use strict";
        function assert(val, msg) {
          if (!val) throw new Error(msg || "Assertion failed");
        }
        function inherits(ctor, superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {};
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor;
          ctor.prototype.constructor = ctor;
        }
        function BN(number, base, endian) {
          if (BN.isBN(number)) {
            return number;
          }
          this.negative = 0;
          this.words = null;
          this.length = 0;
          this.red = null;
          if (number !== null) {
            if (base === "le" || base === "be") {
              endian = base;
              base = 10;
            }
            this._init(number || 0, base || 10, endian || "be");
          }
        }
        if (typeof module === "object") {
          module.exports = BN;
        } else {
          exports.BN = BN;
        }
        BN.BN = BN;
        BN.wordSize = 26;
        var Buffer;
        try {
          if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
            Buffer = window.Buffer;
          } else {
            Buffer = __webpack_require__(6089).Buffer;
          }
        } catch (e) {}
        BN.isBN = function isBN(num) {
          if (num instanceof BN) {
            return true;
          }
          return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
        };
        BN.max = function max(left, right) {
          if (left.cmp(right) > 0) return left;
          return right;
        };
        BN.min = function min(left, right) {
          if (left.cmp(right) < 0) return left;
          return right;
        };
        BN.prototype._init = function init(number, base, endian) {
          if (typeof number === "number") {
            return this._initNumber(number, base, endian);
          }
          if (typeof number === "object") {
            return this._initArray(number, base, endian);
          }
          if (base === "hex") {
            base = 16;
          }
          assert(base === (base | 0) && base >= 2 && base <= 36);
          number = number.toString().replace(/\s+/g, "");
          var start = 0;
          if (number[0] === "-") {
            start++;
            this.negative = 1;
          }
          if (start < number.length) {
            if (base === 16) {
              this._parseHex(number, start, endian);
            } else {
              this._parseBase(number, base, start);
              if (endian === "le") {
                this._initArray(this.toArray(), base, endian);
              }
            }
          }
        };
        BN.prototype._initNumber = function _initNumber(number, base, endian) {
          if (number < 0) {
            this.negative = 1;
            number = -number;
          }
          if (number < 67108864) {
            this.words = [ number & 67108863 ];
            this.length = 1;
          } else if (number < 4503599627370496) {
            this.words = [ number & 67108863, number / 67108864 & 67108863 ];
            this.length = 2;
          } else {
            assert(number < 9007199254740992);
            this.words = [ number & 67108863, number / 67108864 & 67108863, 1 ];
            this.length = 3;
          }
          if (endian !== "le") return;
          this._initArray(this.toArray(), base, endian);
        };
        BN.prototype._initArray = function _initArray(number, base, endian) {
          assert(typeof number.length === "number");
          if (number.length <= 0) {
            this.words = [ 0 ];
            this.length = 1;
            return this;
          }
          this.length = Math.ceil(number.length / 3);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var j, w;
          var off = 0;
          if (endian === "be") {
            for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
              w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          } else if (endian === "le") {
            for (i = 0, j = 0; i < number.length; i += 3) {
              w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          }
          return this.strip();
        };
        function parseHex4Bits(string, index) {
          var c = string.charCodeAt(index);
          if (c >= 65 && c <= 70) {
            return c - 55;
          } else if (c >= 97 && c <= 102) {
            return c - 87;
          } else {
            return c - 48 & 15;
          }
        }
        function parseHexByte(string, lowerBound, index) {
          var r = parseHex4Bits(string, index);
          if (index - 1 >= lowerBound) {
            r |= parseHex4Bits(string, index - 1) << 4;
          }
          return r;
        }
        BN.prototype._parseHex = function _parseHex(number, start, endian) {
          this.length = Math.ceil((number.length - start) / 6);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var off = 0;
          var j = 0;
          var w;
          if (endian === "be") {
            for (i = number.length - 1; i >= start; i -= 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          } else {
            var parseLength = number.length - start;
            for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          }
          this.strip();
        };
        function parseBase(str, start, end, mul) {
          var r = 0;
          var len = Math.min(str.length, end);
          for (var i = start; i < len; i++) {
            var c = str.charCodeAt(i) - 48;
            r *= mul;
            if (c >= 49) {
              r += c - 49 + 10;
            } else if (c >= 17) {
              r += c - 17 + 10;
            } else {
              r += c;
            }
          }
          return r;
        }
        BN.prototype._parseBase = function _parseBase(number, base, start) {
          this.words = [ 0 ];
          this.length = 1;
          for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
            limbLen++;
          }
          limbLen--;
          limbPow = limbPow / base | 0;
          var total = number.length - start;
          var mod = total % limbLen;
          var end = Math.min(total, total - mod) + start;
          var word = 0;
          for (var i = start; i < end; i += limbLen) {
            word = parseBase(number, i, i + limbLen, base);
            this.imuln(limbPow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          if (mod !== 0) {
            var pow = 1;
            word = parseBase(number, i, number.length, base);
            for (i = 0; i < mod; i++) {
              pow *= base;
            }
            this.imuln(pow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          this.strip();
        };
        BN.prototype.copy = function copy(dest) {
          dest.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            dest.words[i] = this.words[i];
          }
          dest.length = this.length;
          dest.negative = this.negative;
          dest.red = this.red;
        };
        BN.prototype.clone = function clone() {
          var r = new BN(null);
          this.copy(r);
          return r;
        };
        BN.prototype._expand = function _expand(size) {
          while (this.length < size) {
            this.words[this.length++] = 0;
          }
          return this;
        };
        BN.prototype.strip = function strip() {
          while (this.length > 1 && this.words[this.length - 1] === 0) {
            this.length--;
          }
          return this._normSign();
        };
        BN.prototype._normSign = function _normSign() {
          if (this.length === 1 && this.words[0] === 0) {
            this.negative = 0;
          }
          return this;
        };
        BN.prototype.inspect = function inspect() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
        };
        var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ];
        var groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];
        var groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ];
        BN.prototype.toString = function toString(base, padding) {
          base = base || 10;
          padding = padding | 0 || 1;
          var out;
          if (base === 16 || base === "hex") {
            out = "";
            var off = 0;
            var carry = 0;
            for (var i = 0; i < this.length; i++) {
              var w = this.words[i];
              var word = ((w << off | carry) & 16777215).toString(16);
              carry = w >>> 24 - off & 16777215;
              off += 2;
              if (off >= 26) {
                off -= 26;
                i--;
              }
              if (carry !== 0 || i !== this.length - 1) {
                out = zeros[6 - word.length] + word + out;
              } else {
                out = word + out;
              }
            }
            if (carry !== 0) {
              out = carry.toString(16) + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          if (base === (base | 0) && base >= 2 && base <= 36) {
            var groupSize = groupSizes[base];
            var groupBase = groupBases[base];
            out = "";
            var c = this.clone();
            c.negative = 0;
            while (!c.isZero()) {
              var r = c.modn(groupBase).toString(base);
              c = c.idivn(groupBase);
              if (!c.isZero()) {
                out = zeros[groupSize - r.length] + r + out;
              } else {
                out = r + out;
              }
            }
            if (this.isZero()) {
              out = "0" + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          assert(false, "Base should be between 2 and 36");
        };
        BN.prototype.toNumber = function toNumber() {
          var ret = this.words[0];
          if (this.length === 2) {
            ret += this.words[1] * 67108864;
          } else if (this.length === 3 && this.words[2] === 1) {
            ret += 4503599627370496 + this.words[1] * 67108864;
          } else if (this.length > 2) {
            assert(false, "Number can only safely store up to 53 bits");
          }
          return this.negative !== 0 ? -ret : ret;
        };
        BN.prototype.toJSON = function toJSON() {
          return this.toString(16);
        };
        BN.prototype.toBuffer = function toBuffer(endian, length) {
          assert(typeof Buffer !== "undefined");
          return this.toArrayLike(Buffer, endian, length);
        };
        BN.prototype.toArray = function toArray(endian, length) {
          return this.toArrayLike(Array, endian, length);
        };
        BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
          var byteLength = this.byteLength();
          var reqLength = length || Math.max(1, byteLength);
          assert(byteLength <= reqLength, "byte array longer than desired length");
          assert(reqLength > 0, "Requested array length <= 0");
          this.strip();
          var littleEndian = endian === "le";
          var res = new ArrayType(reqLength);
          var b, i;
          var q = this.clone();
          if (!littleEndian) {
            for (i = 0; i < reqLength - byteLength; i++) {
              res[i] = 0;
            }
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[reqLength - i - 1] = b;
            }
          } else {
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[i] = b;
            }
            for (;i < reqLength; i++) {
              res[i] = 0;
            }
          }
          return res;
        };
        if (Math.clz32) {
          BN.prototype._countBits = function _countBits(w) {
            return 32 - Math.clz32(w);
          };
        } else {
          BN.prototype._countBits = function _countBits(w) {
            var t = w;
            var r = 0;
            if (t >= 4096) {
              r += 13;
              t >>>= 13;
            }
            if (t >= 64) {
              r += 7;
              t >>>= 7;
            }
            if (t >= 8) {
              r += 4;
              t >>>= 4;
            }
            if (t >= 2) {
              r += 2;
              t >>>= 2;
            }
            return r + t;
          };
        }
        BN.prototype._zeroBits = function _zeroBits(w) {
          if (w === 0) return 26;
          var t = w;
          var r = 0;
          if ((t & 8191) === 0) {
            r += 13;
            t >>>= 13;
          }
          if ((t & 127) === 0) {
            r += 7;
            t >>>= 7;
          }
          if ((t & 15) === 0) {
            r += 4;
            t >>>= 4;
          }
          if ((t & 3) === 0) {
            r += 2;
            t >>>= 2;
          }
          if ((t & 1) === 0) {
            r++;
          }
          return r;
        };
        BN.prototype.bitLength = function bitLength() {
          var w = this.words[this.length - 1];
          var hi = this._countBits(w);
          return (this.length - 1) * 26 + hi;
        };
        function toBitArray(num) {
          var w = new Array(num.bitLength());
          for (var bit = 0; bit < w.length; bit++) {
            var off = bit / 26 | 0;
            var wbit = bit % 26;
            w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
          }
          return w;
        }
        BN.prototype.zeroBits = function zeroBits() {
          if (this.isZero()) return 0;
          var r = 0;
          for (var i = 0; i < this.length; i++) {
            var b = this._zeroBits(this.words[i]);
            r += b;
            if (b !== 26) break;
          }
          return r;
        };
        BN.prototype.byteLength = function byteLength() {
          return Math.ceil(this.bitLength() / 8);
        };
        BN.prototype.toTwos = function toTwos(width) {
          if (this.negative !== 0) {
            return this.abs().inotn(width).iaddn(1);
          }
          return this.clone();
        };
        BN.prototype.fromTwos = function fromTwos(width) {
          if (this.testn(width - 1)) {
            return this.notn(width).iaddn(1).ineg();
          }
          return this.clone();
        };
        BN.prototype.isNeg = function isNeg() {
          return this.negative !== 0;
        };
        BN.prototype.neg = function neg() {
          return this.clone().ineg();
        };
        BN.prototype.ineg = function ineg() {
          if (!this.isZero()) {
            this.negative ^= 1;
          }
          return this;
        };
        BN.prototype.iuor = function iuor(num) {
          while (this.length < num.length) {
            this.words[this.length++] = 0;
          }
          for (var i = 0; i < num.length; i++) {
            this.words[i] = this.words[i] | num.words[i];
          }
          return this.strip();
        };
        BN.prototype.ior = function ior(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuor(num);
        };
        BN.prototype.or = function or(num) {
          if (this.length > num.length) return this.clone().ior(num);
          return num.clone().ior(this);
        };
        BN.prototype.uor = function uor(num) {
          if (this.length > num.length) return this.clone().iuor(num);
          return num.clone().iuor(this);
        };
        BN.prototype.iuand = function iuand(num) {
          var b;
          if (this.length > num.length) {
            b = num;
          } else {
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = this.words[i] & num.words[i];
          }
          this.length = b.length;
          return this.strip();
        };
        BN.prototype.iand = function iand(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuand(num);
        };
        BN.prototype.and = function and(num) {
          if (this.length > num.length) return this.clone().iand(num);
          return num.clone().iand(this);
        };
        BN.prototype.uand = function uand(num) {
          if (this.length > num.length) return this.clone().iuand(num);
          return num.clone().iuand(this);
        };
        BN.prototype.iuxor = function iuxor(num) {
          var a;
          var b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = a.words[i] ^ b.words[i];
          }
          if (this !== a) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = a.length;
          return this.strip();
        };
        BN.prototype.ixor = function ixor(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuxor(num);
        };
        BN.prototype.xor = function xor(num) {
          if (this.length > num.length) return this.clone().ixor(num);
          return num.clone().ixor(this);
        };
        BN.prototype.uxor = function uxor(num) {
          if (this.length > num.length) return this.clone().iuxor(num);
          return num.clone().iuxor(this);
        };
        BN.prototype.inotn = function inotn(width) {
          assert(typeof width === "number" && width >= 0);
          var bytesNeeded = Math.ceil(width / 26) | 0;
          var bitsLeft = width % 26;
          this._expand(bytesNeeded);
          if (bitsLeft > 0) {
            bytesNeeded--;
          }
          for (var i = 0; i < bytesNeeded; i++) {
            this.words[i] = ~this.words[i] & 67108863;
          }
          if (bitsLeft > 0) {
            this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
          }
          return this.strip();
        };
        BN.prototype.notn = function notn(width) {
          return this.clone().inotn(width);
        };
        BN.prototype.setn = function setn(bit, val) {
          assert(typeof bit === "number" && bit >= 0);
          var off = bit / 26 | 0;
          var wbit = bit % 26;
          this._expand(off + 1);
          if (val) {
            this.words[off] = this.words[off] | 1 << wbit;
          } else {
            this.words[off] = this.words[off] & ~(1 << wbit);
          }
          return this.strip();
        };
        BN.prototype.iadd = function iadd(num) {
          var r;
          if (this.negative !== 0 && num.negative === 0) {
            this.negative = 0;
            r = this.isub(num);
            this.negative ^= 1;
            return this._normSign();
          } else if (this.negative === 0 && num.negative !== 0) {
            num.negative = 0;
            r = this.isub(num);
            num.negative = 1;
            return r._normSign();
          }
          var a, b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          this.length = a.length;
          if (carry !== 0) {
            this.words[this.length] = carry;
            this.length++;
          } else if (a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          return this;
        };
        BN.prototype.add = function add(num) {
          var res;
          if (num.negative !== 0 && this.negative === 0) {
            num.negative = 0;
            res = this.sub(num);
            num.negative ^= 1;
            return res;
          } else if (num.negative === 0 && this.negative !== 0) {
            this.negative = 0;
            res = num.sub(this);
            this.negative = 1;
            return res;
          }
          if (this.length > num.length) return this.clone().iadd(num);
          return num.clone().iadd(this);
        };
        BN.prototype.isub = function isub(num) {
          if (num.negative !== 0) {
            num.negative = 0;
            var r = this.iadd(num);
            num.negative = 1;
            return r._normSign();
          } else if (this.negative !== 0) {
            this.negative = 0;
            this.iadd(num);
            this.negative = 1;
            return this._normSign();
          }
          var cmp = this.cmp(num);
          if (cmp === 0) {
            this.negative = 0;
            this.length = 1;
            this.words[0] = 0;
            return this;
          }
          var a, b;
          if (cmp > 0) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          if (carry === 0 && i < a.length && a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = Math.max(this.length, i);
          if (a !== this) {
            this.negative = 1;
          }
          return this.strip();
        };
        BN.prototype.sub = function sub(num) {
          return this.clone().isub(num);
        };
        function smallMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          var len = self.length + num.length | 0;
          out.length = len;
          len = len - 1 | 0;
          var a = self.words[0] | 0;
          var b = num.words[0] | 0;
          var r = a * b;
          var lo = r & 67108863;
          var carry = r / 67108864 | 0;
          out.words[0] = lo;
          for (var k = 1; k < len; k++) {
            var ncarry = carry >>> 26;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j | 0;
              a = self.words[i] | 0;
              b = num.words[j] | 0;
              r = a * b + rword;
              ncarry += r / 67108864 | 0;
              rword = r & 67108863;
            }
            out.words[k] = rword | 0;
            carry = ncarry | 0;
          }
          if (carry !== 0) {
            out.words[k] = carry | 0;
          } else {
            out.length--;
          }
          return out.strip();
        }
        var comb10MulTo = function comb10MulTo(self, num, out) {
          var a = self.words;
          var b = num.words;
          var o = out.words;
          var c = 0;
          var lo;
          var mid;
          var hi;
          var a0 = a[0] | 0;
          var al0 = a0 & 8191;
          var ah0 = a0 >>> 13;
          var a1 = a[1] | 0;
          var al1 = a1 & 8191;
          var ah1 = a1 >>> 13;
          var a2 = a[2] | 0;
          var al2 = a2 & 8191;
          var ah2 = a2 >>> 13;
          var a3 = a[3] | 0;
          var al3 = a3 & 8191;
          var ah3 = a3 >>> 13;
          var a4 = a[4] | 0;
          var al4 = a4 & 8191;
          var ah4 = a4 >>> 13;
          var a5 = a[5] | 0;
          var al5 = a5 & 8191;
          var ah5 = a5 >>> 13;
          var a6 = a[6] | 0;
          var al6 = a6 & 8191;
          var ah6 = a6 >>> 13;
          var a7 = a[7] | 0;
          var al7 = a7 & 8191;
          var ah7 = a7 >>> 13;
          var a8 = a[8] | 0;
          var al8 = a8 & 8191;
          var ah8 = a8 >>> 13;
          var a9 = a[9] | 0;
          var al9 = a9 & 8191;
          var ah9 = a9 >>> 13;
          var b0 = b[0] | 0;
          var bl0 = b0 & 8191;
          var bh0 = b0 >>> 13;
          var b1 = b[1] | 0;
          var bl1 = b1 & 8191;
          var bh1 = b1 >>> 13;
          var b2 = b[2] | 0;
          var bl2 = b2 & 8191;
          var bh2 = b2 >>> 13;
          var b3 = b[3] | 0;
          var bl3 = b3 & 8191;
          var bh3 = b3 >>> 13;
          var b4 = b[4] | 0;
          var bl4 = b4 & 8191;
          var bh4 = b4 >>> 13;
          var b5 = b[5] | 0;
          var bl5 = b5 & 8191;
          var bh5 = b5 >>> 13;
          var b6 = b[6] | 0;
          var bl6 = b6 & 8191;
          var bh6 = b6 >>> 13;
          var b7 = b[7] | 0;
          var bl7 = b7 & 8191;
          var bh7 = b7 >>> 13;
          var b8 = b[8] | 0;
          var bl8 = b8 & 8191;
          var bh8 = b8 >>> 13;
          var b9 = b[9] | 0;
          var bl9 = b9 & 8191;
          var bh9 = b9 >>> 13;
          out.negative = self.negative ^ num.negative;
          out.length = 19;
          lo = Math.imul(al0, bl0);
          mid = Math.imul(al0, bh0);
          mid = mid + Math.imul(ah0, bl0) | 0;
          hi = Math.imul(ah0, bh0);
          var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
          w0 &= 67108863;
          lo = Math.imul(al1, bl0);
          mid = Math.imul(al1, bh0);
          mid = mid + Math.imul(ah1, bl0) | 0;
          hi = Math.imul(ah1, bh0);
          lo = lo + Math.imul(al0, bl1) | 0;
          mid = mid + Math.imul(al0, bh1) | 0;
          mid = mid + Math.imul(ah0, bl1) | 0;
          hi = hi + Math.imul(ah0, bh1) | 0;
          var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
          w1 &= 67108863;
          lo = Math.imul(al2, bl0);
          mid = Math.imul(al2, bh0);
          mid = mid + Math.imul(ah2, bl0) | 0;
          hi = Math.imul(ah2, bh0);
          lo = lo + Math.imul(al1, bl1) | 0;
          mid = mid + Math.imul(al1, bh1) | 0;
          mid = mid + Math.imul(ah1, bl1) | 0;
          hi = hi + Math.imul(ah1, bh1) | 0;
          lo = lo + Math.imul(al0, bl2) | 0;
          mid = mid + Math.imul(al0, bh2) | 0;
          mid = mid + Math.imul(ah0, bl2) | 0;
          hi = hi + Math.imul(ah0, bh2) | 0;
          var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
          w2 &= 67108863;
          lo = Math.imul(al3, bl0);
          mid = Math.imul(al3, bh0);
          mid = mid + Math.imul(ah3, bl0) | 0;
          hi = Math.imul(ah3, bh0);
          lo = lo + Math.imul(al2, bl1) | 0;
          mid = mid + Math.imul(al2, bh1) | 0;
          mid = mid + Math.imul(ah2, bl1) | 0;
          hi = hi + Math.imul(ah2, bh1) | 0;
          lo = lo + Math.imul(al1, bl2) | 0;
          mid = mid + Math.imul(al1, bh2) | 0;
          mid = mid + Math.imul(ah1, bl2) | 0;
          hi = hi + Math.imul(ah1, bh2) | 0;
          lo = lo + Math.imul(al0, bl3) | 0;
          mid = mid + Math.imul(al0, bh3) | 0;
          mid = mid + Math.imul(ah0, bl3) | 0;
          hi = hi + Math.imul(ah0, bh3) | 0;
          var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
          w3 &= 67108863;
          lo = Math.imul(al4, bl0);
          mid = Math.imul(al4, bh0);
          mid = mid + Math.imul(ah4, bl0) | 0;
          hi = Math.imul(ah4, bh0);
          lo = lo + Math.imul(al3, bl1) | 0;
          mid = mid + Math.imul(al3, bh1) | 0;
          mid = mid + Math.imul(ah3, bl1) | 0;
          hi = hi + Math.imul(ah3, bh1) | 0;
          lo = lo + Math.imul(al2, bl2) | 0;
          mid = mid + Math.imul(al2, bh2) | 0;
          mid = mid + Math.imul(ah2, bl2) | 0;
          hi = hi + Math.imul(ah2, bh2) | 0;
          lo = lo + Math.imul(al1, bl3) | 0;
          mid = mid + Math.imul(al1, bh3) | 0;
          mid = mid + Math.imul(ah1, bl3) | 0;
          hi = hi + Math.imul(ah1, bh3) | 0;
          lo = lo + Math.imul(al0, bl4) | 0;
          mid = mid + Math.imul(al0, bh4) | 0;
          mid = mid + Math.imul(ah0, bl4) | 0;
          hi = hi + Math.imul(ah0, bh4) | 0;
          var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
          w4 &= 67108863;
          lo = Math.imul(al5, bl0);
          mid = Math.imul(al5, bh0);
          mid = mid + Math.imul(ah5, bl0) | 0;
          hi = Math.imul(ah5, bh0);
          lo = lo + Math.imul(al4, bl1) | 0;
          mid = mid + Math.imul(al4, bh1) | 0;
          mid = mid + Math.imul(ah4, bl1) | 0;
          hi = hi + Math.imul(ah4, bh1) | 0;
          lo = lo + Math.imul(al3, bl2) | 0;
          mid = mid + Math.imul(al3, bh2) | 0;
          mid = mid + Math.imul(ah3, bl2) | 0;
          hi = hi + Math.imul(ah3, bh2) | 0;
          lo = lo + Math.imul(al2, bl3) | 0;
          mid = mid + Math.imul(al2, bh3) | 0;
          mid = mid + Math.imul(ah2, bl3) | 0;
          hi = hi + Math.imul(ah2, bh3) | 0;
          lo = lo + Math.imul(al1, bl4) | 0;
          mid = mid + Math.imul(al1, bh4) | 0;
          mid = mid + Math.imul(ah1, bl4) | 0;
          hi = hi + Math.imul(ah1, bh4) | 0;
          lo = lo + Math.imul(al0, bl5) | 0;
          mid = mid + Math.imul(al0, bh5) | 0;
          mid = mid + Math.imul(ah0, bl5) | 0;
          hi = hi + Math.imul(ah0, bh5) | 0;
          var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
          w5 &= 67108863;
          lo = Math.imul(al6, bl0);
          mid = Math.imul(al6, bh0);
          mid = mid + Math.imul(ah6, bl0) | 0;
          hi = Math.imul(ah6, bh0);
          lo = lo + Math.imul(al5, bl1) | 0;
          mid = mid + Math.imul(al5, bh1) | 0;
          mid = mid + Math.imul(ah5, bl1) | 0;
          hi = hi + Math.imul(ah5, bh1) | 0;
          lo = lo + Math.imul(al4, bl2) | 0;
          mid = mid + Math.imul(al4, bh2) | 0;
          mid = mid + Math.imul(ah4, bl2) | 0;
          hi = hi + Math.imul(ah4, bh2) | 0;
          lo = lo + Math.imul(al3, bl3) | 0;
          mid = mid + Math.imul(al3, bh3) | 0;
          mid = mid + Math.imul(ah3, bl3) | 0;
          hi = hi + Math.imul(ah3, bh3) | 0;
          lo = lo + Math.imul(al2, bl4) | 0;
          mid = mid + Math.imul(al2, bh4) | 0;
          mid = mid + Math.imul(ah2, bl4) | 0;
          hi = hi + Math.imul(ah2, bh4) | 0;
          lo = lo + Math.imul(al1, bl5) | 0;
          mid = mid + Math.imul(al1, bh5) | 0;
          mid = mid + Math.imul(ah1, bl5) | 0;
          hi = hi + Math.imul(ah1, bh5) | 0;
          lo = lo + Math.imul(al0, bl6) | 0;
          mid = mid + Math.imul(al0, bh6) | 0;
          mid = mid + Math.imul(ah0, bl6) | 0;
          hi = hi + Math.imul(ah0, bh6) | 0;
          var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
          w6 &= 67108863;
          lo = Math.imul(al7, bl0);
          mid = Math.imul(al7, bh0);
          mid = mid + Math.imul(ah7, bl0) | 0;
          hi = Math.imul(ah7, bh0);
          lo = lo + Math.imul(al6, bl1) | 0;
          mid = mid + Math.imul(al6, bh1) | 0;
          mid = mid + Math.imul(ah6, bl1) | 0;
          hi = hi + Math.imul(ah6, bh1) | 0;
          lo = lo + Math.imul(al5, bl2) | 0;
          mid = mid + Math.imul(al5, bh2) | 0;
          mid = mid + Math.imul(ah5, bl2) | 0;
          hi = hi + Math.imul(ah5, bh2) | 0;
          lo = lo + Math.imul(al4, bl3) | 0;
          mid = mid + Math.imul(al4, bh3) | 0;
          mid = mid + Math.imul(ah4, bl3) | 0;
          hi = hi + Math.imul(ah4, bh3) | 0;
          lo = lo + Math.imul(al3, bl4) | 0;
          mid = mid + Math.imul(al3, bh4) | 0;
          mid = mid + Math.imul(ah3, bl4) | 0;
          hi = hi + Math.imul(ah3, bh4) | 0;
          lo = lo + Math.imul(al2, bl5) | 0;
          mid = mid + Math.imul(al2, bh5) | 0;
          mid = mid + Math.imul(ah2, bl5) | 0;
          hi = hi + Math.imul(ah2, bh5) | 0;
          lo = lo + Math.imul(al1, bl6) | 0;
          mid = mid + Math.imul(al1, bh6) | 0;
          mid = mid + Math.imul(ah1, bl6) | 0;
          hi = hi + Math.imul(ah1, bh6) | 0;
          lo = lo + Math.imul(al0, bl7) | 0;
          mid = mid + Math.imul(al0, bh7) | 0;
          mid = mid + Math.imul(ah0, bl7) | 0;
          hi = hi + Math.imul(ah0, bh7) | 0;
          var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
          w7 &= 67108863;
          lo = Math.imul(al8, bl0);
          mid = Math.imul(al8, bh0);
          mid = mid + Math.imul(ah8, bl0) | 0;
          hi = Math.imul(ah8, bh0);
          lo = lo + Math.imul(al7, bl1) | 0;
          mid = mid + Math.imul(al7, bh1) | 0;
          mid = mid + Math.imul(ah7, bl1) | 0;
          hi = hi + Math.imul(ah7, bh1) | 0;
          lo = lo + Math.imul(al6, bl2) | 0;
          mid = mid + Math.imul(al6, bh2) | 0;
          mid = mid + Math.imul(ah6, bl2) | 0;
          hi = hi + Math.imul(ah6, bh2) | 0;
          lo = lo + Math.imul(al5, bl3) | 0;
          mid = mid + Math.imul(al5, bh3) | 0;
          mid = mid + Math.imul(ah5, bl3) | 0;
          hi = hi + Math.imul(ah5, bh3) | 0;
          lo = lo + Math.imul(al4, bl4) | 0;
          mid = mid + Math.imul(al4, bh4) | 0;
          mid = mid + Math.imul(ah4, bl4) | 0;
          hi = hi + Math.imul(ah4, bh4) | 0;
          lo = lo + Math.imul(al3, bl5) | 0;
          mid = mid + Math.imul(al3, bh5) | 0;
          mid = mid + Math.imul(ah3, bl5) | 0;
          hi = hi + Math.imul(ah3, bh5) | 0;
          lo = lo + Math.imul(al2, bl6) | 0;
          mid = mid + Math.imul(al2, bh6) | 0;
          mid = mid + Math.imul(ah2, bl6) | 0;
          hi = hi + Math.imul(ah2, bh6) | 0;
          lo = lo + Math.imul(al1, bl7) | 0;
          mid = mid + Math.imul(al1, bh7) | 0;
          mid = mid + Math.imul(ah1, bl7) | 0;
          hi = hi + Math.imul(ah1, bh7) | 0;
          lo = lo + Math.imul(al0, bl8) | 0;
          mid = mid + Math.imul(al0, bh8) | 0;
          mid = mid + Math.imul(ah0, bl8) | 0;
          hi = hi + Math.imul(ah0, bh8) | 0;
          var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
          w8 &= 67108863;
          lo = Math.imul(al9, bl0);
          mid = Math.imul(al9, bh0);
          mid = mid + Math.imul(ah9, bl0) | 0;
          hi = Math.imul(ah9, bh0);
          lo = lo + Math.imul(al8, bl1) | 0;
          mid = mid + Math.imul(al8, bh1) | 0;
          mid = mid + Math.imul(ah8, bl1) | 0;
          hi = hi + Math.imul(ah8, bh1) | 0;
          lo = lo + Math.imul(al7, bl2) | 0;
          mid = mid + Math.imul(al7, bh2) | 0;
          mid = mid + Math.imul(ah7, bl2) | 0;
          hi = hi + Math.imul(ah7, bh2) | 0;
          lo = lo + Math.imul(al6, bl3) | 0;
          mid = mid + Math.imul(al6, bh3) | 0;
          mid = mid + Math.imul(ah6, bl3) | 0;
          hi = hi + Math.imul(ah6, bh3) | 0;
          lo = lo + Math.imul(al5, bl4) | 0;
          mid = mid + Math.imul(al5, bh4) | 0;
          mid = mid + Math.imul(ah5, bl4) | 0;
          hi = hi + Math.imul(ah5, bh4) | 0;
          lo = lo + Math.imul(al4, bl5) | 0;
          mid = mid + Math.imul(al4, bh5) | 0;
          mid = mid + Math.imul(ah4, bl5) | 0;
          hi = hi + Math.imul(ah4, bh5) | 0;
          lo = lo + Math.imul(al3, bl6) | 0;
          mid = mid + Math.imul(al3, bh6) | 0;
          mid = mid + Math.imul(ah3, bl6) | 0;
          hi = hi + Math.imul(ah3, bh6) | 0;
          lo = lo + Math.imul(al2, bl7) | 0;
          mid = mid + Math.imul(al2, bh7) | 0;
          mid = mid + Math.imul(ah2, bl7) | 0;
          hi = hi + Math.imul(ah2, bh7) | 0;
          lo = lo + Math.imul(al1, bl8) | 0;
          mid = mid + Math.imul(al1, bh8) | 0;
          mid = mid + Math.imul(ah1, bl8) | 0;
          hi = hi + Math.imul(ah1, bh8) | 0;
          lo = lo + Math.imul(al0, bl9) | 0;
          mid = mid + Math.imul(al0, bh9) | 0;
          mid = mid + Math.imul(ah0, bl9) | 0;
          hi = hi + Math.imul(ah0, bh9) | 0;
          var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
          w9 &= 67108863;
          lo = Math.imul(al9, bl1);
          mid = Math.imul(al9, bh1);
          mid = mid + Math.imul(ah9, bl1) | 0;
          hi = Math.imul(ah9, bh1);
          lo = lo + Math.imul(al8, bl2) | 0;
          mid = mid + Math.imul(al8, bh2) | 0;
          mid = mid + Math.imul(ah8, bl2) | 0;
          hi = hi + Math.imul(ah8, bh2) | 0;
          lo = lo + Math.imul(al7, bl3) | 0;
          mid = mid + Math.imul(al7, bh3) | 0;
          mid = mid + Math.imul(ah7, bl3) | 0;
          hi = hi + Math.imul(ah7, bh3) | 0;
          lo = lo + Math.imul(al6, bl4) | 0;
          mid = mid + Math.imul(al6, bh4) | 0;
          mid = mid + Math.imul(ah6, bl4) | 0;
          hi = hi + Math.imul(ah6, bh4) | 0;
          lo = lo + Math.imul(al5, bl5) | 0;
          mid = mid + Math.imul(al5, bh5) | 0;
          mid = mid + Math.imul(ah5, bl5) | 0;
          hi = hi + Math.imul(ah5, bh5) | 0;
          lo = lo + Math.imul(al4, bl6) | 0;
          mid = mid + Math.imul(al4, bh6) | 0;
          mid = mid + Math.imul(ah4, bl6) | 0;
          hi = hi + Math.imul(ah4, bh6) | 0;
          lo = lo + Math.imul(al3, bl7) | 0;
          mid = mid + Math.imul(al3, bh7) | 0;
          mid = mid + Math.imul(ah3, bl7) | 0;
          hi = hi + Math.imul(ah3, bh7) | 0;
          lo = lo + Math.imul(al2, bl8) | 0;
          mid = mid + Math.imul(al2, bh8) | 0;
          mid = mid + Math.imul(ah2, bl8) | 0;
          hi = hi + Math.imul(ah2, bh8) | 0;
          lo = lo + Math.imul(al1, bl9) | 0;
          mid = mid + Math.imul(al1, bh9) | 0;
          mid = mid + Math.imul(ah1, bl9) | 0;
          hi = hi + Math.imul(ah1, bh9) | 0;
          var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
          w10 &= 67108863;
          lo = Math.imul(al9, bl2);
          mid = Math.imul(al9, bh2);
          mid = mid + Math.imul(ah9, bl2) | 0;
          hi = Math.imul(ah9, bh2);
          lo = lo + Math.imul(al8, bl3) | 0;
          mid = mid + Math.imul(al8, bh3) | 0;
          mid = mid + Math.imul(ah8, bl3) | 0;
          hi = hi + Math.imul(ah8, bh3) | 0;
          lo = lo + Math.imul(al7, bl4) | 0;
          mid = mid + Math.imul(al7, bh4) | 0;
          mid = mid + Math.imul(ah7, bl4) | 0;
          hi = hi + Math.imul(ah7, bh4) | 0;
          lo = lo + Math.imul(al6, bl5) | 0;
          mid = mid + Math.imul(al6, bh5) | 0;
          mid = mid + Math.imul(ah6, bl5) | 0;
          hi = hi + Math.imul(ah6, bh5) | 0;
          lo = lo + Math.imul(al5, bl6) | 0;
          mid = mid + Math.imul(al5, bh6) | 0;
          mid = mid + Math.imul(ah5, bl6) | 0;
          hi = hi + Math.imul(ah5, bh6) | 0;
          lo = lo + Math.imul(al4, bl7) | 0;
          mid = mid + Math.imul(al4, bh7) | 0;
          mid = mid + Math.imul(ah4, bl7) | 0;
          hi = hi + Math.imul(ah4, bh7) | 0;
          lo = lo + Math.imul(al3, bl8) | 0;
          mid = mid + Math.imul(al3, bh8) | 0;
          mid = mid + Math.imul(ah3, bl8) | 0;
          hi = hi + Math.imul(ah3, bh8) | 0;
          lo = lo + Math.imul(al2, bl9) | 0;
          mid = mid + Math.imul(al2, bh9) | 0;
          mid = mid + Math.imul(ah2, bl9) | 0;
          hi = hi + Math.imul(ah2, bh9) | 0;
          var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
          w11 &= 67108863;
          lo = Math.imul(al9, bl3);
          mid = Math.imul(al9, bh3);
          mid = mid + Math.imul(ah9, bl3) | 0;
          hi = Math.imul(ah9, bh3);
          lo = lo + Math.imul(al8, bl4) | 0;
          mid = mid + Math.imul(al8, bh4) | 0;
          mid = mid + Math.imul(ah8, bl4) | 0;
          hi = hi + Math.imul(ah8, bh4) | 0;
          lo = lo + Math.imul(al7, bl5) | 0;
          mid = mid + Math.imul(al7, bh5) | 0;
          mid = mid + Math.imul(ah7, bl5) | 0;
          hi = hi + Math.imul(ah7, bh5) | 0;
          lo = lo + Math.imul(al6, bl6) | 0;
          mid = mid + Math.imul(al6, bh6) | 0;
          mid = mid + Math.imul(ah6, bl6) | 0;
          hi = hi + Math.imul(ah6, bh6) | 0;
          lo = lo + Math.imul(al5, bl7) | 0;
          mid = mid + Math.imul(al5, bh7) | 0;
          mid = mid + Math.imul(ah5, bl7) | 0;
          hi = hi + Math.imul(ah5, bh7) | 0;
          lo = lo + Math.imul(al4, bl8) | 0;
          mid = mid + Math.imul(al4, bh8) | 0;
          mid = mid + Math.imul(ah4, bl8) | 0;
          hi = hi + Math.imul(ah4, bh8) | 0;
          lo = lo + Math.imul(al3, bl9) | 0;
          mid = mid + Math.imul(al3, bh9) | 0;
          mid = mid + Math.imul(ah3, bl9) | 0;
          hi = hi + Math.imul(ah3, bh9) | 0;
          var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
          w12 &= 67108863;
          lo = Math.imul(al9, bl4);
          mid = Math.imul(al9, bh4);
          mid = mid + Math.imul(ah9, bl4) | 0;
          hi = Math.imul(ah9, bh4);
          lo = lo + Math.imul(al8, bl5) | 0;
          mid = mid + Math.imul(al8, bh5) | 0;
          mid = mid + Math.imul(ah8, bl5) | 0;
          hi = hi + Math.imul(ah8, bh5) | 0;
          lo = lo + Math.imul(al7, bl6) | 0;
          mid = mid + Math.imul(al7, bh6) | 0;
          mid = mid + Math.imul(ah7, bl6) | 0;
          hi = hi + Math.imul(ah7, bh6) | 0;
          lo = lo + Math.imul(al6, bl7) | 0;
          mid = mid + Math.imul(al6, bh7) | 0;
          mid = mid + Math.imul(ah6, bl7) | 0;
          hi = hi + Math.imul(ah6, bh7) | 0;
          lo = lo + Math.imul(al5, bl8) | 0;
          mid = mid + Math.imul(al5, bh8) | 0;
          mid = mid + Math.imul(ah5, bl8) | 0;
          hi = hi + Math.imul(ah5, bh8) | 0;
          lo = lo + Math.imul(al4, bl9) | 0;
          mid = mid + Math.imul(al4, bh9) | 0;
          mid = mid + Math.imul(ah4, bl9) | 0;
          hi = hi + Math.imul(ah4, bh9) | 0;
          var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
          w13 &= 67108863;
          lo = Math.imul(al9, bl5);
          mid = Math.imul(al9, bh5);
          mid = mid + Math.imul(ah9, bl5) | 0;
          hi = Math.imul(ah9, bh5);
          lo = lo + Math.imul(al8, bl6) | 0;
          mid = mid + Math.imul(al8, bh6) | 0;
          mid = mid + Math.imul(ah8, bl6) | 0;
          hi = hi + Math.imul(ah8, bh6) | 0;
          lo = lo + Math.imul(al7, bl7) | 0;
          mid = mid + Math.imul(al7, bh7) | 0;
          mid = mid + Math.imul(ah7, bl7) | 0;
          hi = hi + Math.imul(ah7, bh7) | 0;
          lo = lo + Math.imul(al6, bl8) | 0;
          mid = mid + Math.imul(al6, bh8) | 0;
          mid = mid + Math.imul(ah6, bl8) | 0;
          hi = hi + Math.imul(ah6, bh8) | 0;
          lo = lo + Math.imul(al5, bl9) | 0;
          mid = mid + Math.imul(al5, bh9) | 0;
          mid = mid + Math.imul(ah5, bl9) | 0;
          hi = hi + Math.imul(ah5, bh9) | 0;
          var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
          w14 &= 67108863;
          lo = Math.imul(al9, bl6);
          mid = Math.imul(al9, bh6);
          mid = mid + Math.imul(ah9, bl6) | 0;
          hi = Math.imul(ah9, bh6);
          lo = lo + Math.imul(al8, bl7) | 0;
          mid = mid + Math.imul(al8, bh7) | 0;
          mid = mid + Math.imul(ah8, bl7) | 0;
          hi = hi + Math.imul(ah8, bh7) | 0;
          lo = lo + Math.imul(al7, bl8) | 0;
          mid = mid + Math.imul(al7, bh8) | 0;
          mid = mid + Math.imul(ah7, bl8) | 0;
          hi = hi + Math.imul(ah7, bh8) | 0;
          lo = lo + Math.imul(al6, bl9) | 0;
          mid = mid + Math.imul(al6, bh9) | 0;
          mid = mid + Math.imul(ah6, bl9) | 0;
          hi = hi + Math.imul(ah6, bh9) | 0;
          var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
          w15 &= 67108863;
          lo = Math.imul(al9, bl7);
          mid = Math.imul(al9, bh7);
          mid = mid + Math.imul(ah9, bl7) | 0;
          hi = Math.imul(ah9, bh7);
          lo = lo + Math.imul(al8, bl8) | 0;
          mid = mid + Math.imul(al8, bh8) | 0;
          mid = mid + Math.imul(ah8, bl8) | 0;
          hi = hi + Math.imul(ah8, bh8) | 0;
          lo = lo + Math.imul(al7, bl9) | 0;
          mid = mid + Math.imul(al7, bh9) | 0;
          mid = mid + Math.imul(ah7, bl9) | 0;
          hi = hi + Math.imul(ah7, bh9) | 0;
          var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
          w16 &= 67108863;
          lo = Math.imul(al9, bl8);
          mid = Math.imul(al9, bh8);
          mid = mid + Math.imul(ah9, bl8) | 0;
          hi = Math.imul(ah9, bh8);
          lo = lo + Math.imul(al8, bl9) | 0;
          mid = mid + Math.imul(al8, bh9) | 0;
          mid = mid + Math.imul(ah8, bl9) | 0;
          hi = hi + Math.imul(ah8, bh9) | 0;
          var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
          w17 &= 67108863;
          lo = Math.imul(al9, bl9);
          mid = Math.imul(al9, bh9);
          mid = mid + Math.imul(ah9, bl9) | 0;
          hi = Math.imul(ah9, bh9);
          var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
          w18 &= 67108863;
          o[0] = w0;
          o[1] = w1;
          o[2] = w2;
          o[3] = w3;
          o[4] = w4;
          o[5] = w5;
          o[6] = w6;
          o[7] = w7;
          o[8] = w8;
          o[9] = w9;
          o[10] = w10;
          o[11] = w11;
          o[12] = w12;
          o[13] = w13;
          o[14] = w14;
          o[15] = w15;
          o[16] = w16;
          o[17] = w17;
          o[18] = w18;
          if (c !== 0) {
            o[19] = c;
            out.length++;
          }
          return out;
        };
        if (!Math.imul) {
          comb10MulTo = smallMulTo;
        }
        function bigMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          out.length = self.length + num.length;
          var carry = 0;
          var hncarry = 0;
          for (var k = 0; k < out.length - 1; k++) {
            var ncarry = hncarry;
            hncarry = 0;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j;
              var a = self.words[i] | 0;
              var b = num.words[j] | 0;
              var r = a * b;
              var lo = r & 67108863;
              ncarry = ncarry + (r / 67108864 | 0) | 0;
              lo = lo + rword | 0;
              rword = lo & 67108863;
              ncarry = ncarry + (lo >>> 26) | 0;
              hncarry += ncarry >>> 26;
              ncarry &= 67108863;
            }
            out.words[k] = rword;
            carry = ncarry;
            ncarry = hncarry;
          }
          if (carry !== 0) {
            out.words[k] = carry;
          } else {
            out.length--;
          }
          return out.strip();
        }
        function jumboMulTo(self, num, out) {
          var fftm = new FFTM;
          return fftm.mulp(self, num, out);
        }
        BN.prototype.mulTo = function mulTo(num, out) {
          var res;
          var len = this.length + num.length;
          if (this.length === 10 && num.length === 10) {
            res = comb10MulTo(this, num, out);
          } else if (len < 63) {
            res = smallMulTo(this, num, out);
          } else if (len < 1024) {
            res = bigMulTo(this, num, out);
          } else {
            res = jumboMulTo(this, num, out);
          }
          return res;
        };
        function FFTM(x, y) {
          this.x = x;
          this.y = y;
        }
        FFTM.prototype.makeRBT = function makeRBT(N) {
          var t = new Array(N);
          var l = BN.prototype._countBits(N) - 1;
          for (var i = 0; i < N; i++) {
            t[i] = this.revBin(i, l, N);
          }
          return t;
        };
        FFTM.prototype.revBin = function revBin(x, l, N) {
          if (x === 0 || x === N - 1) return x;
          var rb = 0;
          for (var i = 0; i < l; i++) {
            rb |= (x & 1) << l - i - 1;
            x >>= 1;
          }
          return rb;
        };
        FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
          for (var i = 0; i < N; i++) {
            rtws[i] = rws[rbt[i]];
            itws[i] = iws[rbt[i]];
          }
        };
        FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
          this.permute(rbt, rws, iws, rtws, itws, N);
          for (var s = 1; s < N; s <<= 1) {
            var l = s << 1;
            var rtwdf = Math.cos(2 * Math.PI / l);
            var itwdf = Math.sin(2 * Math.PI / l);
            for (var p = 0; p < N; p += l) {
              var rtwdf_ = rtwdf;
              var itwdf_ = itwdf;
              for (var j = 0; j < s; j++) {
                var re = rtws[p + j];
                var ie = itws[p + j];
                var ro = rtws[p + j + s];
                var io = itws[p + j + s];
                var rx = rtwdf_ * ro - itwdf_ * io;
                io = rtwdf_ * io + itwdf_ * ro;
                ro = rx;
                rtws[p + j] = re + ro;
                itws[p + j] = ie + io;
                rtws[p + j + s] = re - ro;
                itws[p + j + s] = ie - io;
                if (j !== l) {
                  rx = rtwdf * rtwdf_ - itwdf * itwdf_;
                  itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
                  rtwdf_ = rx;
                }
              }
            }
          }
        };
        FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
          var N = Math.max(m, n) | 1;
          var odd = N & 1;
          var i = 0;
          for (N = N / 2 | 0; N; N = N >>> 1) {
            i++;
          }
          return 1 << i + 1 + odd;
        };
        FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
          if (N <= 1) return;
          for (var i = 0; i < N / 2; i++) {
            var t = rws[i];
            rws[i] = rws[N - i - 1];
            rws[N - i - 1] = t;
            t = iws[i];
            iws[i] = -iws[N - i - 1];
            iws[N - i - 1] = -t;
          }
        };
        FFTM.prototype.normalize13b = function normalize13b(ws, N) {
          var carry = 0;
          for (var i = 0; i < N / 2; i++) {
            var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
            ws[i] = w & 67108863;
            if (w < 67108864) {
              carry = 0;
            } else {
              carry = w / 67108864 | 0;
            }
          }
          return ws;
        };
        FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
          var carry = 0;
          for (var i = 0; i < len; i++) {
            carry = carry + (ws[i] | 0);
            rws[2 * i] = carry & 8191;
            carry = carry >>> 13;
            rws[2 * i + 1] = carry & 8191;
            carry = carry >>> 13;
          }
          for (i = 2 * len; i < N; ++i) {
            rws[i] = 0;
          }
          assert(carry === 0);
          assert((carry & ~8191) === 0);
        };
        FFTM.prototype.stub = function stub(N) {
          var ph = new Array(N);
          for (var i = 0; i < N; i++) {
            ph[i] = 0;
          }
          return ph;
        };
        FFTM.prototype.mulp = function mulp(x, y, out) {
          var N = 2 * this.guessLen13b(x.length, y.length);
          var rbt = this.makeRBT(N);
          var _ = this.stub(N);
          var rws = new Array(N);
          var rwst = new Array(N);
          var iwst = new Array(N);
          var nrws = new Array(N);
          var nrwst = new Array(N);
          var niwst = new Array(N);
          var rmws = out.words;
          rmws.length = N;
          this.convert13b(x.words, x.length, rws, N);
          this.convert13b(y.words, y.length, nrws, N);
          this.transform(rws, _, rwst, iwst, N, rbt);
          this.transform(nrws, _, nrwst, niwst, N, rbt);
          for (var i = 0; i < N; i++) {
            var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
            iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
            rwst[i] = rx;
          }
          this.conjugate(rwst, iwst, N);
          this.transform(rwst, iwst, rmws, _, N, rbt);
          this.conjugate(rmws, _, N);
          this.normalize13b(rmws, N);
          out.negative = x.negative ^ y.negative;
          out.length = x.length + y.length;
          return out.strip();
        };
        BN.prototype.mul = function mul(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return this.mulTo(num, out);
        };
        BN.prototype.mulf = function mulf(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return jumboMulTo(this, num, out);
        };
        BN.prototype.imul = function imul(num) {
          return this.clone().mulTo(num, this);
        };
        BN.prototype.imuln = function imuln(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          var carry = 0;
          for (var i = 0; i < this.length; i++) {
            var w = (this.words[i] | 0) * num;
            var lo = (w & 67108863) + (carry & 67108863);
            carry >>= 26;
            carry += w / 67108864 | 0;
            carry += lo >>> 26;
            this.words[i] = lo & 67108863;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          this.length = num === 0 ? 1 : this.length;
          return this;
        };
        BN.prototype.muln = function muln(num) {
          return this.clone().imuln(num);
        };
        BN.prototype.sqr = function sqr() {
          return this.mul(this);
        };
        BN.prototype.isqr = function isqr() {
          return this.imul(this.clone());
        };
        BN.prototype.pow = function pow(num) {
          var w = toBitArray(num);
          if (w.length === 0) return new BN(1);
          var res = this;
          for (var i = 0; i < w.length; i++, res = res.sqr()) {
            if (w[i] !== 0) break;
          }
          if (++i < w.length) {
            for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
              if (w[i] === 0) continue;
              res = res.mul(q);
            }
          }
          return res;
        };
        BN.prototype.iushln = function iushln(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          var carryMask = 67108863 >>> 26 - r << 26 - r;
          var i;
          if (r !== 0) {
            var carry = 0;
            for (i = 0; i < this.length; i++) {
              var newCarry = this.words[i] & carryMask;
              var c = (this.words[i] | 0) - newCarry << r;
              this.words[i] = c | carry;
              carry = newCarry >>> 26 - r;
            }
            if (carry) {
              this.words[i] = carry;
              this.length++;
            }
          }
          if (s !== 0) {
            for (i = this.length - 1; i >= 0; i--) {
              this.words[i + s] = this.words[i];
            }
            for (i = 0; i < s; i++) {
              this.words[i] = 0;
            }
            this.length += s;
          }
          return this.strip();
        };
        BN.prototype.ishln = function ishln(bits) {
          assert(this.negative === 0);
          return this.iushln(bits);
        };
        BN.prototype.iushrn = function iushrn(bits, hint, extended) {
          assert(typeof bits === "number" && bits >= 0);
          var h;
          if (hint) {
            h = (hint - hint % 26) / 26;
          } else {
            h = 0;
          }
          var r = bits % 26;
          var s = Math.min((bits - r) / 26, this.length);
          var mask = 67108863 ^ 67108863 >>> r << r;
          var maskedWords = extended;
          h -= s;
          h = Math.max(0, h);
          if (maskedWords) {
            for (var i = 0; i < s; i++) {
              maskedWords.words[i] = this.words[i];
            }
            maskedWords.length = s;
          }
          if (s === 0) {} else if (this.length > s) {
            this.length -= s;
            for (i = 0; i < this.length; i++) {
              this.words[i] = this.words[i + s];
            }
          } else {
            this.words[0] = 0;
            this.length = 1;
          }
          var carry = 0;
          for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
            var word = this.words[i] | 0;
            this.words[i] = carry << 26 - r | word >>> r;
            carry = word & mask;
          }
          if (maskedWords && carry !== 0) {
            maskedWords.words[maskedWords.length++] = carry;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.ishrn = function ishrn(bits, hint, extended) {
          assert(this.negative === 0);
          return this.iushrn(bits, hint, extended);
        };
        BN.prototype.shln = function shln(bits) {
          return this.clone().ishln(bits);
        };
        BN.prototype.ushln = function ushln(bits) {
          return this.clone().iushln(bits);
        };
        BN.prototype.shrn = function shrn(bits) {
          return this.clone().ishrn(bits);
        };
        BN.prototype.ushrn = function ushrn(bits) {
          return this.clone().iushrn(bits);
        };
        BN.prototype.testn = function testn(bit) {
          assert(typeof bit === "number" && bit >= 0);
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) return false;
          var w = this.words[s];
          return !!(w & q);
        };
        BN.prototype.imaskn = function imaskn(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          assert(this.negative === 0, "imaskn works only with positive numbers");
          if (this.length <= s) {
            return this;
          }
          if (r !== 0) {
            s++;
          }
          this.length = Math.min(s, this.length);
          if (r !== 0) {
            var mask = 67108863 ^ 67108863 >>> r << r;
            this.words[this.length - 1] &= mask;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.maskn = function maskn(bits) {
          return this.clone().imaskn(bits);
        };
        BN.prototype.iaddn = function iaddn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.isubn(-num);
          if (this.negative !== 0) {
            if (this.length === 1 && (this.words[0] | 0) < num) {
              this.words[0] = num - (this.words[0] | 0);
              this.negative = 0;
              return this;
            }
            this.negative = 0;
            this.isubn(num);
            this.negative = 1;
            return this;
          }
          return this._iaddn(num);
        };
        BN.prototype._iaddn = function _iaddn(num) {
          this.words[0] += num;
          for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
            this.words[i] -= 67108864;
            if (i === this.length - 1) {
              this.words[i + 1] = 1;
            } else {
              this.words[i + 1]++;
            }
          }
          this.length = Math.max(this.length, i + 1);
          return this;
        };
        BN.prototype.isubn = function isubn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.iaddn(-num);
          if (this.negative !== 0) {
            this.negative = 0;
            this.iaddn(num);
            this.negative = 1;
            return this;
          }
          this.words[0] -= num;
          if (this.length === 1 && this.words[0] < 0) {
            this.words[0] = -this.words[0];
            this.negative = 1;
          } else {
            for (var i = 0; i < this.length && this.words[i] < 0; i++) {
              this.words[i] += 67108864;
              this.words[i + 1] -= 1;
            }
          }
          return this.strip();
        };
        BN.prototype.addn = function addn(num) {
          return this.clone().iaddn(num);
        };
        BN.prototype.subn = function subn(num) {
          return this.clone().isubn(num);
        };
        BN.prototype.iabs = function iabs() {
          this.negative = 0;
          return this;
        };
        BN.prototype.abs = function abs() {
          return this.clone().iabs();
        };
        BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
          var len = num.length + shift;
          var i;
          this._expand(len);
          var w;
          var carry = 0;
          for (i = 0; i < num.length; i++) {
            w = (this.words[i + shift] | 0) + carry;
            var right = (num.words[i] | 0) * mul;
            w -= right & 67108863;
            carry = (w >> 26) - (right / 67108864 | 0);
            this.words[i + shift] = w & 67108863;
          }
          for (;i < this.length - shift; i++) {
            w = (this.words[i + shift] | 0) + carry;
            carry = w >> 26;
            this.words[i + shift] = w & 67108863;
          }
          if (carry === 0) return this.strip();
          assert(carry === -1);
          carry = 0;
          for (i = 0; i < this.length; i++) {
            w = -(this.words[i] | 0) + carry;
            carry = w >> 26;
            this.words[i] = w & 67108863;
          }
          this.negative = 1;
          return this.strip();
        };
        BN.prototype._wordDiv = function _wordDiv(num, mode) {
          var shift = this.length - num.length;
          var a = this.clone();
          var b = num;
          var bhi = b.words[b.length - 1] | 0;
          var bhiBits = this._countBits(bhi);
          shift = 26 - bhiBits;
          if (shift !== 0) {
            b = b.ushln(shift);
            a.iushln(shift);
            bhi = b.words[b.length - 1] | 0;
          }
          var m = a.length - b.length;
          var q;
          if (mode !== "mod") {
            q = new BN(null);
            q.length = m + 1;
            q.words = new Array(q.length);
            for (var i = 0; i < q.length; i++) {
              q.words[i] = 0;
            }
          }
          var diff = a.clone()._ishlnsubmul(b, 1, m);
          if (diff.negative === 0) {
            a = diff;
            if (q) {
              q.words[m] = 1;
            }
          }
          for (var j = m - 1; j >= 0; j--) {
            var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
            qj = Math.min(qj / bhi | 0, 67108863);
            a._ishlnsubmul(b, qj, j);
            while (a.negative !== 0) {
              qj--;
              a.negative = 0;
              a._ishlnsubmul(b, 1, j);
              if (!a.isZero()) {
                a.negative ^= 1;
              }
            }
            if (q) {
              q.words[j] = qj;
            }
          }
          if (q) {
            q.strip();
          }
          a.strip();
          if (mode !== "div" && shift !== 0) {
            a.iushrn(shift);
          }
          return {
            div: q || null,
            mod: a
          };
        };
        BN.prototype.divmod = function divmod(num, mode, positive) {
          assert(!num.isZero());
          if (this.isZero()) {
            return {
              div: new BN(0),
              mod: new BN(0)
            };
          }
          var div, mod, res;
          if (this.negative !== 0 && num.negative === 0) {
            res = this.neg().divmod(num, mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.iadd(num);
              }
            }
            return {
              div,
              mod
            };
          }
          if (this.negative === 0 && num.negative !== 0) {
            res = this.divmod(num.neg(), mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            return {
              div,
              mod: res.mod
            };
          }
          if ((this.negative & num.negative) !== 0) {
            res = this.neg().divmod(num.neg(), mode);
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.isub(num);
              }
            }
            return {
              div: res.div,
              mod
            };
          }
          if (num.length > this.length || this.cmp(num) < 0) {
            return {
              div: new BN(0),
              mod: this
            };
          }
          if (num.length === 1) {
            if (mode === "div") {
              return {
                div: this.divn(num.words[0]),
                mod: null
              };
            }
            if (mode === "mod") {
              return {
                div: null,
                mod: new BN(this.modn(num.words[0]))
              };
            }
            return {
              div: this.divn(num.words[0]),
              mod: new BN(this.modn(num.words[0]))
            };
          }
          return this._wordDiv(num, mode);
        };
        BN.prototype.div = function div(num) {
          return this.divmod(num, "div", false).div;
        };
        BN.prototype.mod = function mod(num) {
          return this.divmod(num, "mod", false).mod;
        };
        BN.prototype.umod = function umod(num) {
          return this.divmod(num, "mod", true).mod;
        };
        BN.prototype.divRound = function divRound(num) {
          var dm = this.divmod(num);
          if (dm.mod.isZero()) return dm.div;
          var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
          var half = num.ushrn(1);
          var r2 = num.andln(1);
          var cmp = mod.cmp(half);
          if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
          return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
        };
        BN.prototype.modn = function modn(num) {
          assert(num <= 67108863);
          var p = (1 << 26) % num;
          var acc = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            acc = (p * acc + (this.words[i] | 0)) % num;
          }
          return acc;
        };
        BN.prototype.idivn = function idivn(num) {
          assert(num <= 67108863);
          var carry = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var w = (this.words[i] | 0) + carry * 67108864;
            this.words[i] = w / num | 0;
            carry = w % num;
          }
          return this.strip();
        };
        BN.prototype.divn = function divn(num) {
          return this.clone().idivn(num);
        };
        BN.prototype.egcd = function egcd(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var x = this;
          var y = p.clone();
          if (x.negative !== 0) {
            x = x.umod(p);
          } else {
            x = x.clone();
          }
          var A = new BN(1);
          var B = new BN(0);
          var C = new BN(0);
          var D = new BN(1);
          var g = 0;
          while (x.isEven() && y.isEven()) {
            x.iushrn(1);
            y.iushrn(1);
            ++g;
          }
          var yp = y.clone();
          var xp = x.clone();
          while (!x.isZero()) {
            for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              x.iushrn(i);
              while (i-- > 0) {
                if (A.isOdd() || B.isOdd()) {
                  A.iadd(yp);
                  B.isub(xp);
                }
                A.iushrn(1);
                B.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              y.iushrn(j);
              while (j-- > 0) {
                if (C.isOdd() || D.isOdd()) {
                  C.iadd(yp);
                  D.isub(xp);
                }
                C.iushrn(1);
                D.iushrn(1);
              }
            }
            if (x.cmp(y) >= 0) {
              x.isub(y);
              A.isub(C);
              B.isub(D);
            } else {
              y.isub(x);
              C.isub(A);
              D.isub(B);
            }
          }
          return {
            a: C,
            b: D,
            gcd: y.iushln(g)
          };
        };
        BN.prototype._invmp = function _invmp(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var a = this;
          var b = p.clone();
          if (a.negative !== 0) {
            a = a.umod(p);
          } else {
            a = a.clone();
          }
          var x1 = new BN(1);
          var x2 = new BN(0);
          var delta = b.clone();
          while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
            for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              a.iushrn(i);
              while (i-- > 0) {
                if (x1.isOdd()) {
                  x1.iadd(delta);
                }
                x1.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              b.iushrn(j);
              while (j-- > 0) {
                if (x2.isOdd()) {
                  x2.iadd(delta);
                }
                x2.iushrn(1);
              }
            }
            if (a.cmp(b) >= 0) {
              a.isub(b);
              x1.isub(x2);
            } else {
              b.isub(a);
              x2.isub(x1);
            }
          }
          var res;
          if (a.cmpn(1) === 0) {
            res = x1;
          } else {
            res = x2;
          }
          if (res.cmpn(0) < 0) {
            res.iadd(p);
          }
          return res;
        };
        BN.prototype.gcd = function gcd(num) {
          if (this.isZero()) return num.abs();
          if (num.isZero()) return this.abs();
          var a = this.clone();
          var b = num.clone();
          a.negative = 0;
          b.negative = 0;
          for (var shift = 0; a.isEven() && b.isEven(); shift++) {
            a.iushrn(1);
            b.iushrn(1);
          }
          do {
            while (a.isEven()) {
              a.iushrn(1);
            }
            while (b.isEven()) {
              b.iushrn(1);
            }
            var r = a.cmp(b);
            if (r < 0) {
              var t = a;
              a = b;
              b = t;
            } else if (r === 0 || b.cmpn(1) === 0) {
              break;
            }
            a.isub(b);
          } while (true);
          return b.iushln(shift);
        };
        BN.prototype.invm = function invm(num) {
          return this.egcd(num).a.umod(num);
        };
        BN.prototype.isEven = function isEven() {
          return (this.words[0] & 1) === 0;
        };
        BN.prototype.isOdd = function isOdd() {
          return (this.words[0] & 1) === 1;
        };
        BN.prototype.andln = function andln(num) {
          return this.words[0] & num;
        };
        BN.prototype.bincn = function bincn(bit) {
          assert(typeof bit === "number");
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) {
            this._expand(s + 1);
            this.words[s] |= q;
            return this;
          }
          var carry = q;
          for (var i = s; carry !== 0 && i < this.length; i++) {
            var w = this.words[i] | 0;
            w += carry;
            carry = w >>> 26;
            w &= 67108863;
            this.words[i] = w;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          return this;
        };
        BN.prototype.isZero = function isZero() {
          return this.length === 1 && this.words[0] === 0;
        };
        BN.prototype.cmpn = function cmpn(num) {
          var negative = num < 0;
          if (this.negative !== 0 && !negative) return -1;
          if (this.negative === 0 && negative) return 1;
          this.strip();
          var res;
          if (this.length > 1) {
            res = 1;
          } else {
            if (negative) {
              num = -num;
            }
            assert(num <= 67108863, "Number is too big");
            var w = this.words[0] | 0;
            res = w === num ? 0 : w < num ? -1 : 1;
          }
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.cmp = function cmp(num) {
          if (this.negative !== 0 && num.negative === 0) return -1;
          if (this.negative === 0 && num.negative !== 0) return 1;
          var res = this.ucmp(num);
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.ucmp = function ucmp(num) {
          if (this.length > num.length) return 1;
          if (this.length < num.length) return -1;
          var res = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var a = this.words[i] | 0;
            var b = num.words[i] | 0;
            if (a === b) continue;
            if (a < b) {
              res = -1;
            } else if (a > b) {
              res = 1;
            }
            break;
          }
          return res;
        };
        BN.prototype.gtn = function gtn(num) {
          return this.cmpn(num) === 1;
        };
        BN.prototype.gt = function gt(num) {
          return this.cmp(num) === 1;
        };
        BN.prototype.gten = function gten(num) {
          return this.cmpn(num) >= 0;
        };
        BN.prototype.gte = function gte(num) {
          return this.cmp(num) >= 0;
        };
        BN.prototype.ltn = function ltn(num) {
          return this.cmpn(num) === -1;
        };
        BN.prototype.lt = function lt(num) {
          return this.cmp(num) === -1;
        };
        BN.prototype.lten = function lten(num) {
          return this.cmpn(num) <= 0;
        };
        BN.prototype.lte = function lte(num) {
          return this.cmp(num) <= 0;
        };
        BN.prototype.eqn = function eqn(num) {
          return this.cmpn(num) === 0;
        };
        BN.prototype.eq = function eq(num) {
          return this.cmp(num) === 0;
        };
        BN.red = function red(num) {
          return new Red(num);
        };
        BN.prototype.toRed = function toRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          assert(this.negative === 0, "red works only with positives");
          return ctx.convertTo(this)._forceRed(ctx);
        };
        BN.prototype.fromRed = function fromRed() {
          assert(this.red, "fromRed works only with numbers in reduction context");
          return this.red.convertFrom(this);
        };
        BN.prototype._forceRed = function _forceRed(ctx) {
          this.red = ctx;
          return this;
        };
        BN.prototype.forceRed = function forceRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          return this._forceRed(ctx);
        };
        BN.prototype.redAdd = function redAdd(num) {
          assert(this.red, "redAdd works only with red numbers");
          return this.red.add(this, num);
        };
        BN.prototype.redIAdd = function redIAdd(num) {
          assert(this.red, "redIAdd works only with red numbers");
          return this.red.iadd(this, num);
        };
        BN.prototype.redSub = function redSub(num) {
          assert(this.red, "redSub works only with red numbers");
          return this.red.sub(this, num);
        };
        BN.prototype.redISub = function redISub(num) {
          assert(this.red, "redISub works only with red numbers");
          return this.red.isub(this, num);
        };
        BN.prototype.redShl = function redShl(num) {
          assert(this.red, "redShl works only with red numbers");
          return this.red.shl(this, num);
        };
        BN.prototype.redMul = function redMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.mul(this, num);
        };
        BN.prototype.redIMul = function redIMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.imul(this, num);
        };
        BN.prototype.redSqr = function redSqr() {
          assert(this.red, "redSqr works only with red numbers");
          this.red._verify1(this);
          return this.red.sqr(this);
        };
        BN.prototype.redISqr = function redISqr() {
          assert(this.red, "redISqr works only with red numbers");
          this.red._verify1(this);
          return this.red.isqr(this);
        };
        BN.prototype.redSqrt = function redSqrt() {
          assert(this.red, "redSqrt works only with red numbers");
          this.red._verify1(this);
          return this.red.sqrt(this);
        };
        BN.prototype.redInvm = function redInvm() {
          assert(this.red, "redInvm works only with red numbers");
          this.red._verify1(this);
          return this.red.invm(this);
        };
        BN.prototype.redNeg = function redNeg() {
          assert(this.red, "redNeg works only with red numbers");
          this.red._verify1(this);
          return this.red.neg(this);
        };
        BN.prototype.redPow = function redPow(num) {
          assert(this.red && !num.red, "redPow(normalNum)");
          this.red._verify1(this);
          return this.red.pow(this, num);
        };
        var primes = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };
        function MPrime(name, p) {
          this.name = name;
          this.p = new BN(p, 16);
          this.n = this.p.bitLength();
          this.k = new BN(1).iushln(this.n).isub(this.p);
          this.tmp = this._tmp();
        }
        MPrime.prototype._tmp = function _tmp() {
          var tmp = new BN(null);
          tmp.words = new Array(Math.ceil(this.n / 13));
          return tmp;
        };
        MPrime.prototype.ireduce = function ireduce(num) {
          var r = num;
          var rlen;
          do {
            this.split(r, this.tmp);
            r = this.imulK(r);
            r = r.iadd(this.tmp);
            rlen = r.bitLength();
          } while (rlen > this.n);
          var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
          if (cmp === 0) {
            r.words[0] = 0;
            r.length = 1;
          } else if (cmp > 0) {
            r.isub(this.p);
          } else {
            if (r.strip !== undefined) {
              r.strip();
            } else {
              r._strip();
            }
          }
          return r;
        };
        MPrime.prototype.split = function split(input, out) {
          input.iushrn(this.n, 0, out);
        };
        MPrime.prototype.imulK = function imulK(num) {
          return num.imul(this.k);
        };
        function K256() {
          MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
        }
        inherits(K256, MPrime);
        K256.prototype.split = function split(input, output) {
          var mask = 4194303;
          var outLen = Math.min(input.length, 9);
          for (var i = 0; i < outLen; i++) {
            output.words[i] = input.words[i];
          }
          output.length = outLen;
          if (input.length <= 9) {
            input.words[0] = 0;
            input.length = 1;
            return;
          }
          var prev = input.words[9];
          output.words[output.length++] = prev & mask;
          for (i = 10; i < input.length; i++) {
            var next = input.words[i] | 0;
            input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
            prev = next;
          }
          prev >>>= 22;
          input.words[i - 10] = prev;
          if (prev === 0 && input.length > 10) {
            input.length -= 10;
          } else {
            input.length -= 9;
          }
        };
        K256.prototype.imulK = function imulK(num) {
          num.words[num.length] = 0;
          num.words[num.length + 1] = 0;
          num.length += 2;
          var lo = 0;
          for (var i = 0; i < num.length; i++) {
            var w = num.words[i] | 0;
            lo += w * 977;
            num.words[i] = lo & 67108863;
            lo = w * 64 + (lo / 67108864 | 0);
          }
          if (num.words[num.length - 1] === 0) {
            num.length--;
            if (num.words[num.length - 1] === 0) {
              num.length--;
            }
          }
          return num;
        };
        function P224() {
          MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
        }
        inherits(P224, MPrime);
        function P192() {
          MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
        }
        inherits(P192, MPrime);
        function P25519() {
          MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
        }
        inherits(P25519, MPrime);
        P25519.prototype.imulK = function imulK(num) {
          var carry = 0;
          for (var i = 0; i < num.length; i++) {
            var hi = (num.words[i] | 0) * 19 + carry;
            var lo = hi & 67108863;
            hi >>>= 26;
            num.words[i] = lo;
            carry = hi;
          }
          if (carry !== 0) {
            num.words[num.length++] = carry;
          }
          return num;
        };
        BN._prime = function prime(name) {
          if (primes[name]) return primes[name];
          var prime;
          if (name === "k256") {
            prime = new K256;
          } else if (name === "p224") {
            prime = new P224;
          } else if (name === "p192") {
            prime = new P192;
          } else if (name === "p25519") {
            prime = new P25519;
          } else {
            throw new Error("Unknown prime " + name);
          }
          primes[name] = prime;
          return prime;
        };
        function Red(m) {
          if (typeof m === "string") {
            var prime = BN._prime(m);
            this.m = prime.p;
            this.prime = prime;
          } else {
            assert(m.gtn(1), "modulus must be greater than 1");
            this.m = m;
            this.prime = null;
          }
        }
        Red.prototype._verify1 = function _verify1(a) {
          assert(a.negative === 0, "red works only with positives");
          assert(a.red, "red works only with red numbers");
        };
        Red.prototype._verify2 = function _verify2(a, b) {
          assert((a.negative | b.negative) === 0, "red works only with positives");
          assert(a.red && a.red === b.red, "red works only with red numbers");
        };
        Red.prototype.imod = function imod(a) {
          if (this.prime) return this.prime.ireduce(a)._forceRed(this);
          return a.umod(this.m)._forceRed(this);
        };
        Red.prototype.neg = function neg(a) {
          if (a.isZero()) {
            return a.clone();
          }
          return this.m.sub(a)._forceRed(this);
        };
        Red.prototype.add = function add(a, b) {
          this._verify2(a, b);
          var res = a.add(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.iadd = function iadd(a, b) {
          this._verify2(a, b);
          var res = a.iadd(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res;
        };
        Red.prototype.sub = function sub(a, b) {
          this._verify2(a, b);
          var res = a.sub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.isub = function isub(a, b) {
          this._verify2(a, b);
          var res = a.isub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res;
        };
        Red.prototype.shl = function shl(a, num) {
          this._verify1(a);
          return this.imod(a.ushln(num));
        };
        Red.prototype.imul = function imul(a, b) {
          this._verify2(a, b);
          return this.imod(a.imul(b));
        };
        Red.prototype.mul = function mul(a, b) {
          this._verify2(a, b);
          return this.imod(a.mul(b));
        };
        Red.prototype.isqr = function isqr(a) {
          return this.imul(a, a.clone());
        };
        Red.prototype.sqr = function sqr(a) {
          return this.mul(a, a);
        };
        Red.prototype.sqrt = function sqrt(a) {
          if (a.isZero()) return a.clone();
          var mod3 = this.m.andln(3);
          assert(mod3 % 2 === 1);
          if (mod3 === 3) {
            var pow = this.m.add(new BN(1)).iushrn(2);
            return this.pow(a, pow);
          }
          var q = this.m.subn(1);
          var s = 0;
          while (!q.isZero() && q.andln(1) === 0) {
            s++;
            q.iushrn(1);
          }
          assert(!q.isZero());
          var one = new BN(1).toRed(this);
          var nOne = one.redNeg();
          var lpow = this.m.subn(1).iushrn(1);
          var z = this.m.bitLength();
          z = new BN(2 * z * z).toRed(this);
          while (this.pow(z, lpow).cmp(nOne) !== 0) {
            z.redIAdd(nOne);
          }
          var c = this.pow(z, q);
          var r = this.pow(a, q.addn(1).iushrn(1));
          var t = this.pow(a, q);
          var m = s;
          while (t.cmp(one) !== 0) {
            var tmp = t;
            for (var i = 0; tmp.cmp(one) !== 0; i++) {
              tmp = tmp.redSqr();
            }
            assert(i < m);
            var b = this.pow(c, new BN(1).iushln(m - i - 1));
            r = r.redMul(b);
            c = b.redSqr();
            t = t.redMul(c);
            m = i;
          }
          return r;
        };
        Red.prototype.invm = function invm(a) {
          var inv = a._invmp(this.m);
          if (inv.negative !== 0) {
            inv.negative = 0;
            return this.imod(inv).redNeg();
          } else {
            return this.imod(inv);
          }
        };
        Red.prototype.pow = function pow(a, num) {
          if (num.isZero()) return new BN(1).toRed(this);
          if (num.cmpn(1) === 0) return a.clone();
          var windowSize = 4;
          var wnd = new Array(1 << windowSize);
          wnd[0] = new BN(1).toRed(this);
          wnd[1] = a;
          for (var i = 2; i < wnd.length; i++) {
            wnd[i] = this.mul(wnd[i - 1], a);
          }
          var res = wnd[0];
          var current = 0;
          var currentLen = 0;
          var start = num.bitLength() % 26;
          if (start === 0) {
            start = 26;
          }
          for (i = num.length - 1; i >= 0; i--) {
            var word = num.words[i];
            for (var j = start - 1; j >= 0; j--) {
              var bit = word >> j & 1;
              if (res !== wnd[0]) {
                res = this.sqr(res);
              }
              if (bit === 0 && current === 0) {
                currentLen = 0;
                continue;
              }
              current <<= 1;
              current |= bit;
              currentLen++;
              if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
              res = this.mul(res, wnd[current]);
              currentLen = 0;
              current = 0;
            }
            start = 26;
          }
          return res;
        };
        Red.prototype.convertTo = function convertTo(num) {
          var r = num.umod(this.m);
          return r === num ? r.clone() : r;
        };
        Red.prototype.convertFrom = function convertFrom(num) {
          var res = num.clone();
          res.red = null;
          return res;
        };
        BN.mont = function mont(num) {
          return new Mont(num);
        };
        function Mont(m) {
          Red.call(this, m);
          this.shift = this.m.bitLength();
          if (this.shift % 26 !== 0) {
            this.shift += 26 - this.shift % 26;
          }
          this.r = new BN(1).iushln(this.shift);
          this.r2 = this.imod(this.r.sqr());
          this.rinv = this.r._invmp(this.m);
          this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
          this.minv = this.minv.umod(this.r);
          this.minv = this.r.sub(this.minv);
        }
        inherits(Mont, Red);
        Mont.prototype.convertTo = function convertTo(num) {
          return this.imod(num.ushln(this.shift));
        };
        Mont.prototype.convertFrom = function convertFrom(num) {
          var r = this.imod(num.mul(this.rinv));
          r.red = null;
          return r;
        };
        Mont.prototype.imul = function imul(a, b) {
          if (a.isZero() || b.isZero()) {
            a.words[0] = 0;
            a.length = 1;
            return a;
          }
          var t = a.imul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.mul = function mul(a, b) {
          if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
          var t = a.mul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.invm = function invm(a) {
          var res = this.imod(a._invmp(this.m).mul(this.r2));
          return res._forceRed(this);
        };
      })(false || module, this);
    },
    6052(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
      "use strict";
      __webpack_require__.r(__webpack_exports__);
      __webpack_require__.d(__webpack_exports__, {
        createDilithium: () => d
      });
      var process = __webpack_require__(5606);
      var Buffer = __webpack_require__(8287)["Buffer"];
      var e = {
        944: (e, t, r) => {
          var o, n = (o = (o = "undefined" != typeof document && document.currentScript ? document.currentScript.src : void 0) || "/index.js", 
          function(e) {
            var t, n, i = void 0 !== (e = e || {}) ? e : {};
            i.ready = new Promise((function(e, r) {
              t = e, n = r;
            })), Object.getOwnPropertyDescriptor(i.ready, "_malloc") || (Object.defineProperty(i.ready, "_malloc", {
              configurable: !0,
              get: function() {
                Ee("You are getting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "_malloc", {
              configurable: !0,
              set: function() {
                Ee("You are setting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "_free") || (Object.defineProperty(i.ready, "_free", {
              configurable: !0,
              get: function() {
                Ee("You are getting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "_free", {
              configurable: !0,
              set: function() {
                Ee("You are setting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "_SHA3_256") || (Object.defineProperty(i.ready, "_SHA3_256", {
              configurable: !0,
              get: function() {
                Ee("You are getting _SHA3_256 on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "_SHA3_256", {
              configurable: !0,
              set: function() {
                Ee("You are setting _SHA3_256 on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "_randombytes") || (Object.defineProperty(i.ready, "_randombytes", {
              configurable: !0,
              get: function() {
                Ee("You are getting _randombytes on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "_randombytes", {
              configurable: !0,
              set: function() {
                Ee("You are setting _randombytes on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "_dilithium_keygen") || (Object.defineProperty(i.ready, "_dilithium_keygen", {
              configurable: !0,
              get: function() {
                Ee("You are getting _dilithium_keygen on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "_dilithium_keygen", {
              configurable: !0,
              set: function() {
                Ee("You are setting _dilithium_keygen on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "_dilithium_sign") || (Object.defineProperty(i.ready, "_dilithium_sign", {
              configurable: !0,
              get: function() {
                Ee("You are getting _dilithium_sign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "_dilithium_sign", {
              configurable: !0,
              set: function() {
                Ee("You are setting _dilithium_sign on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "_dilithium_verify") || (Object.defineProperty(i.ready, "_dilithium_verify", {
              configurable: !0,
              get: function() {
                Ee("You are getting _dilithium_verify on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "_dilithium_verify", {
              configurable: !0,
              set: function() {
                Ee("You are setting _dilithium_verify on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "___stdio_exit") || (Object.defineProperty(i.ready, "___stdio_exit", {
              configurable: !0,
              get: function() {
                Ee("You are getting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "___stdio_exit", {
              configurable: !0,
              set: function() {
                Ee("You are setting ___stdio_exit on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            })), Object.getOwnPropertyDescriptor(i.ready, "onRuntimeInitialized") || (Object.defineProperty(i.ready, "onRuntimeInitialized", {
              configurable: !0,
              get: function() {
                Ee("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }), Object.defineProperty(i.ready, "onRuntimeInitialized", {
              configurable: !0,
              set: function() {
                Ee("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");
              }
            }));
            var a = Object.assign({}, i), s = [], d = "object" == typeof window, c = "function" == typeof importScripts, l = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node, p = !d && !l && !c;
            if (i.ENVIRONMENT) throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)");
            var E, u, f, h, O, g, m = "";
            if (l) {
              if ("object" != typeof process) throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
              m = c ? r(507).dirname(m) + "/" : "//", g = () => {
                O || (h = r(175), O = r(507));
              }, E = function(e, t) {
                return g(), e = O.normalize(e), h.readFileSync(e, t ? void 0 : "utf8");
              }, f = e => {
                var t = E(e, !0);
                return t.buffer || (t = new Uint8Array(t)), I(t.buffer), t;
              }, u = (e, t, r) => {
                g(), e = O.normalize(e), h.readFile(e, (function(e, o) {
                  e ? r(e) : t(o.buffer);
                }));
              }, process.argv.length > 1 && process.argv[1].replace(/\\/g, "/"), s = process.argv.slice(2), 
              process.on("uncaughtException", (function(e) {
                if (!(e instanceof Ke)) throw e;
              })), process.on("unhandledRejection", (function(e) {
                throw e;
              })), i.inspect = function() {
                return "[Emscripten Module object]";
              };
            } else if (p) {
              if ("object" == typeof process || "object" == typeof window || "function" == typeof importScripts) throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
              "undefined" != typeof read && (E = function(e) {
                return read(e);
              }), f = function(e) {
                let t;
                return "function" == typeof readbuffer ? new Uint8Array(readbuffer(e)) : (t = read(e, "binary"), 
                I("object" == typeof t), t);
              }, u = function(e, t, r) {
                setTimeout((() => t(f(e))), 0);
              }, "undefined" != typeof scriptArgs ? s = scriptArgs : void 0 !== arguments && (s = arguments), 
              "undefined" != typeof print && ("undefined" == typeof console && (console = {}), 
              console.log = print, console.warn = console.error = "undefined" != typeof printErr ? printErr : print);
            } else {
              if (!d && !c) throw new Error("environment detection error");
              if (c ? m = self.location.href : "undefined" != typeof document && document.currentScript && (m = document.currentScript.src), 
              o && (m = o), m = 0 !== m.indexOf("blob:") ? m.substr(0, m.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", 
              "object" != typeof window && "function" != typeof importScripts) throw new Error("not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)");
              E = e => {
                var t = new XMLHttpRequest;
                return t.open("GET", e, !1), t.send(null), t.responseText;
              }, c && (f = e => {
                var t = new XMLHttpRequest;
                return t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);
              }), u = (e, t, r) => {
                var o = new XMLHttpRequest;
                o.open("GET", e, !0), o.responseType = "arraybuffer", o.onload = () => {
                  200 == o.status || 0 == o.status && o.response ? t(o.response) : r();
                }, o.onerror = r, o.send(null);
              };
            }
            var w, T = i.print || console.log.bind(console), y = i.printErr || console.warn.bind(console);
            function _(e) {
              _.shown || (_.shown = {}), _.shown[e] || (_.shown[e] = 1, y(e));
            }
            Object.assign(i, a), a = null, i.arguments && (s = i.arguments), Object.getOwnPropertyDescriptor(i, "arguments") || Object.defineProperty(i, "arguments", {
              configurable: !0,
              get: function() {
                Ee("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), i.thisProgram && i.thisProgram, Object.getOwnPropertyDescriptor(i, "thisProgram") || Object.defineProperty(i, "thisProgram", {
              configurable: !0,
              get: function() {
                Ee("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), i.quit && i.quit, Object.getOwnPropertyDescriptor(i, "quit") || Object.defineProperty(i, "quit", {
              configurable: !0,
              get: function() {
                Ee("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), I(void 0 === i.memoryInitializerPrefixURL, "Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead"), 
            I(void 0 === i.pthreadMainPrefixURL, "Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead"), 
            I(void 0 === i.cdInitializerPrefixURL, "Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead"), 
            I(void 0 === i.filePackagePrefixURL, "Module.filePackagePrefixURL option was removed, use Module.locateFile instead"), 
            I(void 0 === i.read, "Module.read option was removed (modify read_ in JS)"), I(void 0 === i.readAsync, "Module.readAsync option was removed (modify readAsync in JS)"), 
            I(void 0 === i.readBinary, "Module.readBinary option was removed (modify readBinary in JS)"), 
            I(void 0 === i.setWindowTitle, "Module.setWindowTitle option was removed (modify setWindowTitle in JS)"), 
            I(void 0 === i.TOTAL_MEMORY, "Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY"), 
            Object.getOwnPropertyDescriptor(i, "read") || Object.defineProperty(i, "read", {
              configurable: !0,
              get: function() {
                Ee("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), Object.getOwnPropertyDescriptor(i, "readAsync") || Object.defineProperty(i, "readAsync", {
              configurable: !0,
              get: function() {
                Ee("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), Object.getOwnPropertyDescriptor(i, "readBinary") || Object.defineProperty(i, "readBinary", {
              configurable: !0,
              get: function() {
                Ee("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), Object.getOwnPropertyDescriptor(i, "setWindowTitle") || Object.defineProperty(i, "setWindowTitle", {
              configurable: !0,
              get: function() {
                Ee("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), I(!p, "shell environment detected but not enabled at build time.  Add 'shell' to `-s ENVIRONMENT` to enable."), 
            i.wasmBinary && (w = i.wasmBinary), Object.getOwnPropertyDescriptor(i, "wasmBinary") || Object.defineProperty(i, "wasmBinary", {
              configurable: !0,
              get: function() {
                Ee("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            });
            var D;
            i.noExitRuntime;
            function b(e, t, r = "i8", o) {
              if ("*" === r.charAt(r.length - 1) && (r = "i32"), o) switch (r) {
               case "i1":
               case "i8":
                U[0 | e] = t;
                break;

               case "i16":
                x[e >> 1] = t;
                break;

               case "i32":
                C[e >> 2] = t;
                break;

               case "i64":
                L[e >> 3] = BigInt(t);
                break;

               case "float":
                H[e >> 2] = t;
                break;

               case "double":
                X[e >> 3] = t;
                break;

               default:
                Ee("invalid type for setValue: " + r);
              } else switch (r) {
               case "i1":
               case "i8":
                M(0 | e, 0 | t, 1);
                break;

               case "i16":
                M(0 | e, 0 | t, 2);
                break;

               case "i32":
                M(0 | e, 0 | t, 4);
                break;

               case "i64":
                M(0 | e, 0 | t, 8);
                break;

               case "float":
                R(0 | e, Math.fround(t), 4);
                break;

               case "double":
                R(0 | e, +t, 8);
                break;

               default:
                Ee("invalid type for setValue: " + r);
              }
            }
            function v(e, t = "i8", r) {
              if ("*" === t.charAt(t.length - 1) && (t = "i32"), r) switch (t) {
               case "i1":
               case "i8":
                return U[0 | e];

               case "i16":
                return x[e >> 1];

               case "i32":
                return C[e >> 2];

               case "i64":
                return Number(L[e >> 3]);

               case "float":
                return H[e >> 2];

               case "double":
                return Number(X[e >> 3]);

               default:
                Ee("invalid type for getValue: " + t);
              } else switch (t) {
               case "i1":
               case "i8":
                return 0 | S(0 | e, 1, 0);

               case "i16":
                return 0 | S(0 | e, 2, 0);

               case "i32":
                return 0 | S(0 | e, 4, 0);

               case "i64":
                return 0 | S(0 | e, 8, 0);

               case "float":
                return Math.fround(A(0 | e, 4, 0));

               case "double":
                return +A(0 | e, 8, 0);

               default:
                Ee("invalid type for getValue: " + t);
              }
              return null;
            }
            function P(e, t) {
              switch (e) {
               case 1:
                return "i8";

               case 2:
                return "i16";

               case 4:
                return t ? "float" : "i32";

               case 8:
                return t ? "double" : "i64";

               default:
                I(0);
              }
            }
            function M(e, t, r, o) {
              if (e <= 0 && Ee("segmentation fault storing " + r + " bytes to address " + e), 
              e % r != 0 && Ee("alignment error storing to address " + e + ", which was expected to be aligned to a multiple of " + r), 
              oe && !ne) {
                var n = Le() >>> 0;
                e + r > n && Ee("segmentation fault, exceeded the top of the available dynamic heap when storing " + r + " bytes to address " + e + ". DYNAMICTOP=" + n), 
                I(n >= Qe()), I(n <= U.length);
              }
              return b(e, t, P(r, o), 1), t;
            }
            function R(e, t, r) {
              return M(e, t, r, !0);
            }
            function S(e, t, r, o) {
              if (e <= 0 && Ee("segmentation fault loading " + t + " bytes from address " + e), 
              e % t != 0 && Ee("alignment error loading from address " + e + ", which was expected to be aligned to a multiple of " + t), 
              oe && !ne) {
                var n = Le() >>> 0;
                e + t > n && Ee("segmentation fault, exceeded the top of the available dynamic heap when loading " + t + " bytes from address " + e + ". DYNAMICTOP=" + n), 
                I(n >= Qe()), I(n <= U.length);
              }
              var i, a, s = P(t, o), d = v(e, s, 1);
              return r && (i = d, a = parseInt(s.substr(1), 10), d = i >= 0 ? i : a <= 32 ? 2 * Math.abs(1 << a - 1) + i : Math.pow(2, a) + i), 
              d;
            }
            function A(e, t, r) {
              return S(e, t, r, !0);
            }
            Object.getOwnPropertyDescriptor(i, "noExitRuntime") || Object.defineProperty(i, "noExitRuntime", {
              configurable: !0,
              get: function() {
                Ee("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), "object" != typeof WebAssembly && Ee("no native wasm support detected");
            var F = !1;
            function I(e, t) {
              e || Ee("Assertion failed" + (t ? ": " + t : ""));
            }
            function k(e, t, r, o, n) {
              var a = {
                string: function(e) {
                  var t = 0;
                  if (null != e && 0 !== e) {
                    var r = 1 + (e.length << 2);
                    W(e, t = We(r), r);
                  }
                  return t;
                },
                array: function(e) {
                  var t = We(e.length);
                  return function(e, t) {
                    I(e.length >= 0, "writeArrayToMemory array must have a length (should be an array or typed array)"), 
                    U.set(e, t);
                  }(e, t), t;
                }
              }, s = function(e) {
                var t = i["_" + e];
                return I(t, "Cannot call unknown function " + e + ", make sure it is exported"), 
                t;
              }(e), d = [], c = 0;
              if (I("array" !== t, 'Return type should not be "array".'), o) for (var l = 0; l < o.length; l++) {
                var p = a[r[l]];
                p ? (0 === c && (c = Ye()), d[l] = p(o[l])) : d[l] = o[l];
              }
              var E = s.apply(null, d);
              return E = function(e) {
                return 0 !== c && ze(c), function(e) {
                  return "string" === t ? Y(e) : "boolean" === t ? Boolean(e) : e;
                }(e);
              }(E);
            }
            var N, U, j, x, C, H, L, X, Q = "undefined" != typeof TextDecoder ? new TextDecoder("utf8") : void 0;
            function B(e, t, r) {
              for (var o = t + r, n = t; e[n] && !(n >= o); ) ++n;
              if (n - t > 16 && e.subarray && Q) return Q.decode(e.subarray(t, n));
              for (var i = ""; t < n; ) {
                var a = e[t++];
                if (128 & a) {
                  var s = 63 & e[t++];
                  if (192 != (224 & a)) {
                    var d = 63 & e[t++];
                    if (224 == (240 & a) ? a = (15 & a) << 12 | s << 6 | d : (240 != (248 & a) && _("Invalid UTF-8 leading byte 0x" + a.toString(16) + " encountered when deserializing a UTF-8 string in wasm memory to a JS string!"), 
                    a = (7 & a) << 18 | s << 12 | d << 6 | 63 & e[t++]), a < 65536) i += String.fromCharCode(a); else {
                      var c = a - 65536;
                      i += String.fromCharCode(55296 | c >> 10, 56320 | 1023 & c);
                    }
                  } else i += String.fromCharCode((31 & a) << 6 | s);
                } else i += String.fromCharCode(a);
              }
              return i;
            }
            function Y(e, t) {
              return e ? B(j, e, t) : "";
            }
            function z(e, t, r, o) {
              if (!(o > 0)) return 0;
              for (var n = r, i = r + o - 1, a = 0; a < e.length; ++a) {
                var s = e.charCodeAt(a);
                if (s >= 55296 && s <= 57343 && (s = 65536 + ((1023 & s) << 10) | 1023 & e.charCodeAt(++a)), 
                s <= 127) {
                  if (r >= i) break;
                  t[r++] = s;
                } else if (s <= 2047) {
                  if (r + 1 >= i) break;
                  t[r++] = 192 | s >> 6, t[r++] = 128 | 63 & s;
                } else if (s <= 65535) {
                  if (r + 2 >= i) break;
                  t[r++] = 224 | s >> 12, t[r++] = 128 | s >> 6 & 63, t[r++] = 128 | 63 & s;
                } else {
                  if (r + 3 >= i) break;
                  s > 1114111 && _("Invalid Unicode code point 0x" + s.toString(16) + " encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF)."), 
                  t[r++] = 240 | s >> 18, t[r++] = 128 | s >> 12 & 63, t[r++] = 128 | s >> 6 & 63, 
                  t[r++] = 128 | 63 & s;
                }
              }
              return t[r] = 0, r - n;
            }
            function W(e, t, r) {
              return I("number" == typeof r, "stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!"), 
              z(e, j, t, r);
            }
            function K(e) {
              for (var t = 0, r = 0; r < e.length; ++r) {
                var o = e.charCodeAt(r);
                o >= 55296 && o <= 57343 && (o = 65536 + ((1023 & o) << 10) | 1023 & e.charCodeAt(++r)), 
                o <= 127 ? ++t : t += o <= 2047 ? 2 : o <= 65535 ? 3 : 4;
              }
              return t;
            }
            function V(e) {
              N = e, i.HEAP8 = U = new Int8Array(e), i.HEAP16 = x = new Int16Array(e), i.HEAP32 = C = new Int32Array(e), 
              i.HEAPU8 = j = new Uint8Array(e), i.HEAPU16 = new Uint16Array(e), i.HEAPU32 = new Uint32Array(e), 
              i.HEAPF32 = H = new Float32Array(e), i.HEAPF64 = X = new Float64Array(e), i.HEAP64 = L = new BigInt64Array(e), 
              i.HEAPU64 = new BigUint64Array(e);
            }
            "undefined" != typeof TextDecoder && new TextDecoder("utf-16le");
            var G = 5242880;
            i.TOTAL_STACK && I(G === i.TOTAL_STACK, "the stack size can no longer be determined at runtime");
            var q, Z = i.INITIAL_MEMORY || 16777216;
            function J() {
              var e = Be();
              I(!(3 & e)), M(e + 4 | 0, 34821223, 4), M(e + 8 | 0, -1984246274, 4);
            }
            function $() {
              if (!F) {
                var e = Be(), t = S(e + 4 | 0, 4, 1) >>> 0, r = S(e + 8 | 0, 4, 1) >>> 0;
                34821223 == t && 2310721022 == r || Ee("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x" + r.toString(16) + " 0x" + t.toString(16));
              }
            }
            Object.getOwnPropertyDescriptor(i, "INITIAL_MEMORY") || Object.defineProperty(i, "INITIAL_MEMORY", {
              configurable: !0,
              get: function() {
                Ee("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");
              }
            }), I(Z >= G, "INITIAL_MEMORY should be larger than TOTAL_STACK, was " + Z + "! (TOTAL_STACK=" + G + ")"), 
            I("undefined" != typeof Int32Array && "undefined" != typeof Float64Array && null != Int32Array.prototype.subarray && null != Int32Array.prototype.set, "JS engine does not provide full typed array support"), 
            I(!i.wasmMemory, "Use of `wasmMemory` detected.  Use -s IMPORTED_MEMORY to define wasmMemory externally"), 
            I(16777216 == Z, "Detected runtime INITIAL_MEMORY setting.  Use -s IMPORTED_MEMORY to define wasmMemory dynamically"), 
            function() {
              var e = new Int16Array(1), t = new Int8Array(e.buffer);
              if (e[0] = 25459, 115 !== t[0] || 99 !== t[1]) throw "Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)";
            }();
            var ee = [], te = [], re = [], oe = !1, ne = !1;
            I(Math.imul, "This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), 
            I(Math.fround, "This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), 
            I(Math.clz32, "This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill"), 
            I(Math.trunc, "This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");
            var ie = 0, ae = null, se = null, de = {};
            function ce(e) {
              for (var t = e; ;) {
                if (!de[e]) return e;
                e = t + Math.random();
              }
            }
            function le(e) {
              ie++, i.monitorRunDependencies && i.monitorRunDependencies(ie), e ? (I(!de[e]), 
              de[e] = 1, null === ae && "undefined" != typeof setInterval && (ae = setInterval((function() {
                if (F) return clearInterval(ae), void (ae = null);
                var e = !1;
                for (var t in de) e || (e = !0, y("still waiting on run dependencies:")), y("dependency: " + t);
                e && y("(end of list)");
              }), 1e4))) : y("warning: run dependency added without ID");
            }
            function pe(e) {
              if (ie--, i.monitorRunDependencies && i.monitorRunDependencies(ie), e ? (I(de[e]), 
              delete de[e]) : y("warning: run dependency removed without ID"), 0 == ie && (null !== ae && (clearInterval(ae), 
              ae = null), se)) {
                var t = se;
                se = null, t();
              }
            }
            function Ee(e) {
              i.onAbort && i.onAbort(e), y(e = "Aborted(" + e + ")"), F = !0;
              var t = new WebAssembly.RuntimeError(e);
              throw n(t), t;
            }
            i.preloadedImages = {}, i.preloadedAudios = {};
            var ue, fe, he = "data:application/octet-stream;base64,";
            function Oe(e) {
              return e.startsWith(he);
            }
            function ge(e) {
              return e.startsWith("file://");
            }
            function me(e, t) {
              return function() {
                var r = e, o = t;
                return t || (o = i.asm), I(oe, "native function `" + r + "` called before runtime initialization"), 
                I(!ne, "native function `" + r + "` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)"), 
                o[e] || I(o[e], "exported native function `" + r + "` not found"), o[e].apply(null, arguments);
              };
            }
            function we(e) {
              try {
                if (e == ue && w) return new Uint8Array(w);
                if (f) return f(e);
                throw "both async and sync fetching of the wasm failed";
              } catch (e) {
                Ee(e);
              }
            }
            function Te(e) {
              for (;e.length > 0; ) {
                var t = e.shift();
                if ("function" != typeof t) {
                  var r = t.func;
                  "number" == typeof r ? void 0 === t.arg ? De(r)() : De(r)(t.arg) : r(void 0 === t.arg ? null : t.arg);
                } else t(i);
              }
            }
            function ye(e) {
              return e.replace(/\b_Z[\w\d_]+/g, (function(e) {
                var t, r = (t = e, _("warning: build with  -s DEMANGLE_SUPPORT=1  to link in libcxxabi demangling"), 
                t);
                return e === r ? e : r + " [" + e + "]";
              }));
            }
            Oe(ue = "dilithium.wasm") || (fe = ue, ue = i.locateFile ? i.locateFile(fe, m) : m + fe);
            var _e = [];
            function De(e) {
              var t = _e[e];
              return t || (e >= _e.length && (_e.length = e + 1), _e[e] = t = q.get(e)), I(q.get(e) == t, "JavaScript-side Wasm function table mirror is out of date!"), 
              t;
            }
            var be = {
              splitPath: function(e) {
                return /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);
              },
              normalizeArray: function(e, t) {
                for (var r = 0, o = e.length - 1; o >= 0; o--) {
                  var n = e[o];
                  "." === n ? e.splice(o, 1) : ".." === n ? (e.splice(o, 1), r++) : r && (e.splice(o, 1), 
                  r--);
                }
                if (t) for (;r; r--) e.unshift("..");
                return e;
              },
              normalize: function(e) {
                var t = "/" === e.charAt(0), r = "/" === e.substr(-1);
                return (e = be.normalizeArray(e.split("/").filter((function(e) {
                  return !!e;
                })), !t).join("/")) || t || (e = "."), e && r && (e += "/"), (t ? "/" : "") + e;
              },
              dirname: function(e) {
                var t = be.splitPath(e), r = t[0], o = t[1];
                return r || o ? (o && (o = o.substr(0, o.length - 1)), r + o) : ".";
              },
              basename: function(e) {
                if ("/" === e) return "/";
                var t = (e = (e = be.normalize(e)).replace(/\/$/, "")).lastIndexOf("/");
                return -1 === t ? e : e.substr(t + 1);
              },
              extname: function(e) {
                return be.splitPath(e)[3];
              },
              join: function() {
                var e = Array.prototype.slice.call(arguments, 0);
                return be.normalize(e.join("/"));
              },
              join2: function(e, t) {
                return be.normalize(e + "/" + t);
              }
            }, ve = {
              resolve: function() {
                for (var e = "", t = !1, r = arguments.length - 1; r >= -1 && !t; r--) {
                  var o = r >= 0 ? arguments[r] : Ae.cwd();
                  if ("string" != typeof o) throw new TypeError("Arguments to path.resolve must be strings");
                  if (!o) return "";
                  e = o + "/" + e, t = "/" === o.charAt(0);
                }
                return (t ? "/" : "") + (e = be.normalizeArray(e.split("/").filter((function(e) {
                  return !!e;
                })), !t).join("/")) || ".";
              },
              relative: function(e, t) {
                function r(e) {
                  for (var t = 0; t < e.length && "" === e[t]; t++) ;
                  for (var r = e.length - 1; r >= 0 && "" === e[r]; r--) ;
                  return t > r ? [] : e.slice(t, r - t + 1);
                }
                e = ve.resolve(e).substr(1), t = ve.resolve(t).substr(1);
                for (var o = r(e.split("/")), n = r(t.split("/")), i = Math.min(o.length, n.length), a = i, s = 0; s < i; s++) if (o[s] !== n[s]) {
                  a = s;
                  break;
                }
                var d = [];
                for (s = a; s < o.length; s++) d.push("..");
                return (d = d.concat(n.slice(a))).join("/");
              }
            }, Pe = {
              ttys: [],
              init: function() {},
              shutdown: function() {},
              register: function(e, t) {
                Pe.ttys[e] = {
                  input: [],
                  output: [],
                  ops: t
                }, Ae.registerDevice(e, Pe.stream_ops);
              },
              stream_ops: {
                open: function(e) {
                  var t = Pe.ttys[e.node.rdev];
                  if (!t) throw new Ae.ErrnoError(43);
                  e.tty = t, e.seekable = !1;
                },
                close: function(e) {
                  e.tty.ops.flush(e.tty);
                },
                flush: function(e) {
                  e.tty.ops.flush(e.tty);
                },
                read: function(e, t, r, o, n) {
                  if (!e.tty || !e.tty.ops.get_char) throw new Ae.ErrnoError(60);
                  for (var i = 0, a = 0; a < o; a++) {
                    var s;
                    try {
                      s = e.tty.ops.get_char(e.tty);
                    } catch (e) {
                      throw new Ae.ErrnoError(29);
                    }
                    if (void 0 === s && 0 === i) throw new Ae.ErrnoError(6);
                    if (null == s) break;
                    i++, t[r + a] = s;
                  }
                  return i && (e.node.timestamp = Date.now()), i;
                },
                write: function(e, t, r, o, n) {
                  if (!e.tty || !e.tty.ops.put_char) throw new Ae.ErrnoError(60);
                  try {
                    for (var i = 0; i < o; i++) e.tty.ops.put_char(e.tty, t[r + i]);
                  } catch (e) {
                    throw new Ae.ErrnoError(29);
                  }
                  return o && (e.node.timestamp = Date.now()), i;
                }
              },
              default_tty_ops: {
                get_char: function(e) {
                  if (!e.input.length) {
                    var t = null;
                    if (l) {
                      var r = Buffer.alloc(256), o = 0;
                      try {
                        o = h.readSync(process.stdin.fd, r, 0, 256, -1);
                      } catch (e) {
                        if (!e.toString().includes("EOF")) throw e;
                        o = 0;
                      }
                      t = o > 0 ? r.slice(0, o).toString("utf-8") : null;
                    } else "undefined" != typeof window && "function" == typeof window.prompt ? null !== (t = window.prompt("Input: ")) && (t += "\n") : "function" == typeof readline && null !== (t = readline()) && (t += "\n");
                    if (!t) return null;
                    e.input = je(t, !0);
                  }
                  return e.input.shift();
                },
                put_char: function(e, t) {
                  null === t || 10 === t ? (T(B(e.output, 0)), e.output = []) : 0 != t && e.output.push(t);
                },
                flush: function(e) {
                  e.output && e.output.length > 0 && (T(B(e.output, 0)), e.output = []);
                }
              },
              default_tty1_ops: {
                put_char: function(e, t) {
                  null === t || 10 === t ? (y(B(e.output, 0)), e.output = []) : 0 != t && e.output.push(t);
                },
                flush: function(e) {
                  e.output && e.output.length > 0 && (y(B(e.output, 0)), e.output = []);
                }
              }
            }, Me = {
              ops_table: null,
              mount: function(e) {
                return Me.createNode(null, "/", 16895, 0);
              },
              createNode: function(e, t, r, o) {
                if (Ae.isBlkdev(r) || Ae.isFIFO(r)) throw new Ae.ErrnoError(63);
                Me.ops_table || (Me.ops_table = {
                  dir: {
                    node: {
                      getattr: Me.node_ops.getattr,
                      setattr: Me.node_ops.setattr,
                      lookup: Me.node_ops.lookup,
                      mknod: Me.node_ops.mknod,
                      rename: Me.node_ops.rename,
                      unlink: Me.node_ops.unlink,
                      rmdir: Me.node_ops.rmdir,
                      readdir: Me.node_ops.readdir,
                      symlink: Me.node_ops.symlink
                    },
                    stream: {
                      llseek: Me.stream_ops.llseek
                    }
                  },
                  file: {
                    node: {
                      getattr: Me.node_ops.getattr,
                      setattr: Me.node_ops.setattr
                    },
                    stream: {
                      llseek: Me.stream_ops.llseek,
                      read: Me.stream_ops.read,
                      write: Me.stream_ops.write,
                      allocate: Me.stream_ops.allocate,
                      mmap: Me.stream_ops.mmap,
                      msync: Me.stream_ops.msync
                    }
                  },
                  link: {
                    node: {
                      getattr: Me.node_ops.getattr,
                      setattr: Me.node_ops.setattr,
                      readlink: Me.node_ops.readlink
                    },
                    stream: {}
                  },
                  chrdev: {
                    node: {
                      getattr: Me.node_ops.getattr,
                      setattr: Me.node_ops.setattr
                    },
                    stream: Ae.chrdev_stream_ops
                  }
                });
                var n = Ae.createNode(e, t, r, o);
                return Ae.isDir(n.mode) ? (n.node_ops = Me.ops_table.dir.node, n.stream_ops = Me.ops_table.dir.stream, 
                n.contents = {}) : Ae.isFile(n.mode) ? (n.node_ops = Me.ops_table.file.node, n.stream_ops = Me.ops_table.file.stream, 
                n.usedBytes = 0, n.contents = null) : Ae.isLink(n.mode) ? (n.node_ops = Me.ops_table.link.node, 
                n.stream_ops = Me.ops_table.link.stream) : Ae.isChrdev(n.mode) && (n.node_ops = Me.ops_table.chrdev.node, 
                n.stream_ops = Me.ops_table.chrdev.stream), n.timestamp = Date.now(), e && (e.contents[t] = n, 
                e.timestamp = n.timestamp), n;
              },
              getFileDataAsTypedArray: function(e) {
                return e.contents ? e.contents.subarray ? e.contents.subarray(0, e.usedBytes) : new Uint8Array(e.contents) : new Uint8Array(0);
              },
              expandFileStorage: function(e, t) {
                var r = e.contents ? e.contents.length : 0;
                if (!(r >= t)) {
                  t = Math.max(t, r * (r < 1048576 ? 2 : 1.125) >>> 0), 0 != r && (t = Math.max(t, 256));
                  var o = e.contents;
                  e.contents = new Uint8Array(t), e.usedBytes > 0 && e.contents.set(o.subarray(0, e.usedBytes), 0);
                }
              },
              resizeFileStorage: function(e, t) {
                if (e.usedBytes != t) if (0 == t) e.contents = null, e.usedBytes = 0; else {
                  var r = e.contents;
                  e.contents = new Uint8Array(t), r && e.contents.set(r.subarray(0, Math.min(t, e.usedBytes))), 
                  e.usedBytes = t;
                }
              },
              node_ops: {
                getattr: function(e) {
                  var t = {};
                  return t.dev = Ae.isChrdev(e.mode) ? e.id : 1, t.ino = e.id, t.mode = e.mode, t.nlink = 1, 
                  t.uid = 0, t.gid = 0, t.rdev = e.rdev, Ae.isDir(e.mode) ? t.size = 4096 : Ae.isFile(e.mode) ? t.size = e.usedBytes : Ae.isLink(e.mode) ? t.size = e.link.length : t.size = 0, 
                  t.atime = new Date(e.timestamp), t.mtime = new Date(e.timestamp), t.ctime = new Date(e.timestamp), 
                  t.blksize = 4096, t.blocks = Math.ceil(t.size / t.blksize), t;
                },
                setattr: function(e, t) {
                  void 0 !== t.mode && (e.mode = t.mode), void 0 !== t.timestamp && (e.timestamp = t.timestamp), 
                  void 0 !== t.size && Me.resizeFileStorage(e, t.size);
                },
                lookup: function(e, t) {
                  throw Ae.genericErrors[44];
                },
                mknod: function(e, t, r, o) {
                  return Me.createNode(e, t, r, o);
                },
                rename: function(e, t, r) {
                  if (Ae.isDir(e.mode)) {
                    var o;
                    try {
                      o = Ae.lookupNode(t, r);
                    } catch (e) {}
                    if (o) for (var n in o.contents) throw new Ae.ErrnoError(55);
                  }
                  delete e.parent.contents[e.name], e.parent.timestamp = Date.now(), e.name = r, t.contents[r] = e, 
                  t.timestamp = e.parent.timestamp, e.parent = t;
                },
                unlink: function(e, t) {
                  delete e.contents[t], e.timestamp = Date.now();
                },
                rmdir: function(e, t) {
                  var r = Ae.lookupNode(e, t);
                  for (var o in r.contents) throw new Ae.ErrnoError(55);
                  delete e.contents[t], e.timestamp = Date.now();
                },
                readdir: function(e) {
                  var t = [ ".", ".." ];
                  for (var r in e.contents) e.contents.hasOwnProperty(r) && t.push(r);
                  return t;
                },
                symlink: function(e, t, r) {
                  var o = Me.createNode(e, t, 41471, 0);
                  return o.link = r, o;
                },
                readlink: function(e) {
                  if (!Ae.isLink(e.mode)) throw new Ae.ErrnoError(28);
                  return e.link;
                }
              },
              stream_ops: {
                read: function(e, t, r, o, n) {
                  var i = e.node.contents;
                  if (n >= e.node.usedBytes) return 0;
                  var a = Math.min(e.node.usedBytes - n, o);
                  if (I(a >= 0), a > 8 && i.subarray) t.set(i.subarray(n, n + a), r); else for (var s = 0; s < a; s++) t[r + s] = i[n + s];
                  return a;
                },
                write: function(e, t, r, o, n, i) {
                  if (I(!(t instanceof ArrayBuffer)), t.buffer === U.buffer && (i = !1), !o) return 0;
                  var a = e.node;
                  if (a.timestamp = Date.now(), t.subarray && (!a.contents || a.contents.subarray)) {
                    if (i) return I(0 === n, "canOwn must imply no weird position inside the file"), 
                    a.contents = t.subarray(r, r + o), a.usedBytes = o, o;
                    if (0 === a.usedBytes && 0 === n) return a.contents = t.slice(r, r + o), a.usedBytes = o, 
                    o;
                    if (n + o <= a.usedBytes) return a.contents.set(t.subarray(r, r + o), n), o;
                  }
                  if (Me.expandFileStorage(a, n + o), a.contents.subarray && t.subarray) a.contents.set(t.subarray(r, r + o), n); else for (var s = 0; s < o; s++) a.contents[n + s] = t[r + s];
                  return a.usedBytes = Math.max(a.usedBytes, n + o), o;
                },
                llseek: function(e, t, r) {
                  var o = t;
                  if (1 === r ? o += e.position : 2 === r && Ae.isFile(e.node.mode) && (o += e.node.usedBytes), 
                  o < 0) throw new Ae.ErrnoError(28);
                  return o;
                },
                allocate: function(e, t, r) {
                  Me.expandFileStorage(e.node, t + r), e.node.usedBytes = Math.max(e.node.usedBytes, t + r);
                },
                mmap: function(e, t, r, o, n, i) {
                  if (0 !== t) throw new Ae.ErrnoError(28);
                  if (!Ae.isFile(e.node.mode)) throw new Ae.ErrnoError(43);
                  var a, s, d = e.node.contents;
                  if (2 & i || d.buffer !== N) {
                    if ((o > 0 || o + r < d.length) && (d = d.subarray ? d.subarray(o, o + r) : Array.prototype.slice.call(d, o, o + r)), 
                    s = !0, !(a = void Ee("internal error: mmapAlloc called but `emscripten_builtin_memalign` native symbol not exported"))) throw new Ae.ErrnoError(48);
                    U.set(d, a);
                  } else s = !1, a = d.byteOffset;
                  return {
                    ptr: a,
                    allocated: s
                  };
                },
                msync: function(e, t, r, o, n) {
                  if (!Ae.isFile(e.node.mode)) throw new Ae.ErrnoError(43);
                  return 2 & n || Me.stream_ops.write(e, t, 0, o, r, !1), 0;
                }
              }
            }, Re = {
              0: "Success",
              1: "Arg list too long",
              2: "Permission denied",
              3: "Address already in use",
              4: "Address not available",
              5: "Address family not supported by protocol family",
              6: "No more processes",
              7: "Socket already connected",
              8: "Bad file number",
              9: "Trying to read unreadable message",
              10: "Mount device busy",
              11: "Operation canceled",
              12: "No children",
              13: "Connection aborted",
              14: "Connection refused",
              15: "Connection reset by peer",
              16: "File locking deadlock error",
              17: "Destination address required",
              18: "Math arg out of domain of func",
              19: "Quota exceeded",
              20: "File exists",
              21: "Bad address",
              22: "File too large",
              23: "Host is unreachable",
              24: "Identifier removed",
              25: "Illegal byte sequence",
              26: "Connection already in progress",
              27: "Interrupted system call",
              28: "Invalid argument",
              29: "I/O error",
              30: "Socket is already connected",
              31: "Is a directory",
              32: "Too many symbolic links",
              33: "Too many open files",
              34: "Too many links",
              35: "Message too long",
              36: "Multihop attempted",
              37: "File or path name too long",
              38: "Network interface is not configured",
              39: "Connection reset by network",
              40: "Network is unreachable",
              41: "Too many open files in system",
              42: "No buffer space available",
              43: "No such device",
              44: "No such file or directory",
              45: "Exec format error",
              46: "No record locks available",
              47: "The link has been severed",
              48: "Not enough core",
              49: "No message of desired type",
              50: "Protocol not available",
              51: "No space left on device",
              52: "Function not implemented",
              53: "Socket is not connected",
              54: "Not a directory",
              55: "Directory not empty",
              56: "State not recoverable",
              57: "Socket operation on non-socket",
              59: "Not a typewriter",
              60: "No such device or address",
              61: "Value too large for defined data type",
              62: "Previous owner died",
              63: "Not super-user",
              64: "Broken pipe",
              65: "Protocol error",
              66: "Unknown protocol",
              67: "Protocol wrong type for socket",
              68: "Math result not representable",
              69: "Read only file system",
              70: "Illegal seek",
              71: "No such process",
              72: "Stale file handle",
              73: "Connection timed out",
              74: "Text file busy",
              75: "Cross-device link",
              100: "Device not a stream",
              101: "Bad font file fmt",
              102: "Invalid slot",
              103: "Invalid request code",
              104: "No anode",
              105: "Block device required",
              106: "Channel number out of range",
              107: "Level 3 halted",
              108: "Level 3 reset",
              109: "Link number out of range",
              110: "Protocol driver not attached",
              111: "No CSI structure available",
              112: "Level 2 halted",
              113: "Invalid exchange",
              114: "Invalid request descriptor",
              115: "Exchange full",
              116: "No data (for no delay io)",
              117: "Timer expired",
              118: "Out of streams resources",
              119: "Machine is not on the network",
              120: "Package not installed",
              121: "The object is remote",
              122: "Advertise error",
              123: "Srmount error",
              124: "Communication error on send",
              125: "Cross mount point (not really error)",
              126: "Given log. name not unique",
              127: "f.d. invalid for this operation",
              128: "Remote address changed",
              129: "Can   access a needed shared lib",
              130: "Accessing a corrupted shared lib",
              131: ".lib section in a.out corrupted",
              132: "Attempting to link in too many libs",
              133: "Attempting to exec a shared library",
              135: "Streams pipe error",
              136: "Too many users",
              137: "Socket type not supported",
              138: "Not supported",
              139: "Protocol family not supported",
              140: "Can't send after socket shutdown",
              141: "Too many references",
              142: "Host is down",
              148: "No medium (in tape drive)",
              156: "Level 2 not synchronized"
            }, Se = {}, Ae = {
              root: null,
              mounts: [],
              devices: {},
              streams: [],
              nextInode: 1,
              nameTable: null,
              currentPath: "/",
              initialized: !1,
              ignorePermissions: !0,
              ErrnoError: null,
              genericErrors: {},
              filesystems: null,
              syncFSRequests: 0,
              lookupPath: (e, t = {}) => {
                if (!(e = ve.resolve(Ae.cwd(), e))) return {
                  path: "",
                  node: null
                };
                var r = {
                  follow_mount: !0,
                  recurse_count: 0
                };
                for (var o in r) void 0 === t[o] && (t[o] = r[o]);
                if (t.recurse_count > 8) throw new Ae.ErrnoError(32);
                for (var n = be.normalizeArray(e.split("/").filter((e => !!e)), !1), i = Ae.root, a = "/", s = 0; s < n.length; s++) {
                  var d = s === n.length - 1;
                  if (d && t.parent) break;
                  if (i = Ae.lookupNode(i, n[s]), a = be.join2(a, n[s]), Ae.isMountpoint(i) && (!d || d && t.follow_mount) && (i = i.mounted.root), 
                  !d || t.follow) for (var c = 0; Ae.isLink(i.mode); ) {
                    var l = Ae.readlink(a);
                    if (a = ve.resolve(be.dirname(a), l), i = Ae.lookupPath(a, {
                      recurse_count: t.recurse_count
                    }).node, c++ > 40) throw new Ae.ErrnoError(32);
                  }
                }
                return {
                  path: a,
                  node: i
                };
              },
              getPath: e => {
                for (var t; ;) {
                  if (Ae.isRoot(e)) {
                    var r = e.mount.mountpoint;
                    return t ? "/" !== r[r.length - 1] ? r + "/" + t : r + t : r;
                  }
                  t = t ? e.name + "/" + t : e.name, e = e.parent;
                }
              },
              hashName: (e, t) => {
                for (var r = 0, o = 0; o < t.length; o++) r = (r << 5) - r + t.charCodeAt(o) | 0;
                return (e + r >>> 0) % Ae.nameTable.length;
              },
              hashAddNode: e => {
                var t = Ae.hashName(e.parent.id, e.name);
                e.name_next = Ae.nameTable[t], Ae.nameTable[t] = e;
              },
              hashRemoveNode: e => {
                var t = Ae.hashName(e.parent.id, e.name);
                if (Ae.nameTable[t] === e) Ae.nameTable[t] = e.name_next; else for (var r = Ae.nameTable[t]; r; ) {
                  if (r.name_next === e) {
                    r.name_next = e.name_next;
                    break;
                  }
                  r = r.name_next;
                }
              },
              lookupNode: (e, t) => {
                var r = Ae.mayLookup(e);
                if (r) throw new Ae.ErrnoError(r, e);
                for (var o = Ae.hashName(e.id, t), n = Ae.nameTable[o]; n; n = n.name_next) {
                  var i = n.name;
                  if (n.parent.id === e.id && i === t) return n;
                }
                return Ae.lookup(e, t);
              },
              createNode: (e, t, r, o) => {
                I("object" == typeof e);
                var n = new Ae.FSNode(e, t, r, o);
                return Ae.hashAddNode(n), n;
              },
              destroyNode: e => {
                Ae.hashRemoveNode(e);
              },
              isRoot: e => e === e.parent,
              isMountpoint: e => !!e.mounted,
              isFile: e => 32768 == (61440 & e),
              isDir: e => 16384 == (61440 & e),
              isLink: e => 40960 == (61440 & e),
              isChrdev: e => 8192 == (61440 & e),
              isBlkdev: e => 24576 == (61440 & e),
              isFIFO: e => 4096 == (61440 & e),
              isSocket: e => !(49152 & ~e),
              flagModes: {
                r: 0,
                "r+": 2,
                w: 577,
                "w+": 578,
                a: 1089,
                "a+": 1090
              },
              modeStringToFlags: e => {
                var t = Ae.flagModes[e];
                if (void 0 === t) throw new Error("Unknown file open mode: " + e);
                return t;
              },
              flagsToPermissionString: e => {
                var t = [ "r", "w", "rw" ][3 & e];
                return 512 & e && (t += "w"), t;
              },
              nodePermissions: (e, t) => Ae.ignorePermissions || (!t.includes("r") || 292 & e.mode) && (!t.includes("w") || 146 & e.mode) && (!t.includes("x") || 73 & e.mode) ? 0 : 2,
              mayLookup: e => {
                var t = Ae.nodePermissions(e, "x");
                return t || (e.node_ops.lookup ? 0 : 2);
              },
              mayCreate: (e, t) => {
                try {
                  return Ae.lookupNode(e, t), 20;
                } catch (e) {}
                return Ae.nodePermissions(e, "wx");
              },
              mayDelete: (e, t, r) => {
                var o;
                try {
                  o = Ae.lookupNode(e, t);
                } catch (e) {
                  return e.errno;
                }
                var n = Ae.nodePermissions(e, "wx");
                if (n) return n;
                if (r) {
                  if (!Ae.isDir(o.mode)) return 54;
                  if (Ae.isRoot(o) || Ae.getPath(o) === Ae.cwd()) return 10;
                } else if (Ae.isDir(o.mode)) return 31;
                return 0;
              },
              mayOpen: (e, t) => e ? Ae.isLink(e.mode) ? 32 : Ae.isDir(e.mode) && ("r" !== Ae.flagsToPermissionString(t) || 512 & t) ? 31 : Ae.nodePermissions(e, Ae.flagsToPermissionString(t)) : 44,
              MAX_OPEN_FDS: 4096,
              nextfd: (e = 0, t = Ae.MAX_OPEN_FDS) => {
                for (var r = e; r <= t; r++) if (!Ae.streams[r]) return r;
                throw new Ae.ErrnoError(33);
              },
              getStream: e => Ae.streams[e],
              createStream: (e, t, r) => {
                Ae.FSStream || (Ae.FSStream = function() {}, Ae.FSStream.prototype = {
                  object: {
                    get: function() {
                      return this.node;
                    },
                    set: function(e) {
                      this.node = e;
                    }
                  },
                  isRead: {
                    get: function() {
                      return 1 != (2097155 & this.flags);
                    }
                  },
                  isWrite: {
                    get: function() {
                      return !!(2097155 & this.flags);
                    }
                  },
                  isAppend: {
                    get: function() {
                      return 1024 & this.flags;
                    }
                  }
                }), e = Object.assign(new Ae.FSStream, e);
                var o = Ae.nextfd(t, r);
                return e.fd = o, Ae.streams[o] = e, e;
              },
              closeStream: e => {
                Ae.streams[e] = null;
              },
              chrdev_stream_ops: {
                open: e => {
                  var t = Ae.getDevice(e.node.rdev);
                  e.stream_ops = t.stream_ops, e.stream_ops.open && e.stream_ops.open(e);
                },
                llseek: () => {
                  throw new Ae.ErrnoError(70);
                }
              },
              major: e => e >> 8,
              minor: e => 255 & e,
              makedev: (e, t) => e << 8 | t,
              registerDevice: (e, t) => {
                Ae.devices[e] = {
                  stream_ops: t
                };
              },
              getDevice: e => Ae.devices[e],
              getMounts: e => {
                for (var t = [], r = [ e ]; r.length; ) {
                  var o = r.pop();
                  t.push(o), r.push.apply(r, o.mounts);
                }
                return t;
              },
              syncfs: (e, t) => {
                "function" == typeof e && (t = e, e = !1), Ae.syncFSRequests++, Ae.syncFSRequests > 1 && y("warning: " + Ae.syncFSRequests + " FS.syncfs operations in flight at once, probably just doing extra work");
                var r = Ae.getMounts(Ae.root.mount), o = 0;
                function n(e) {
                  return I(Ae.syncFSRequests > 0), Ae.syncFSRequests--, t(e);
                }
                function i(e) {
                  if (e) return i.errored ? void 0 : (i.errored = !0, n(e));
                  ++o >= r.length && n(null);
                }
                r.forEach((t => {
                  if (!t.type.syncfs) return i(null);
                  t.type.syncfs(t, e, i);
                }));
              },
              mount: (e, t, r) => {
                if ("string" == typeof e) throw e;
                var o, n = "/" === r, i = !r;
                if (n && Ae.root) throw new Ae.ErrnoError(10);
                if (!n && !i) {
                  var a = Ae.lookupPath(r, {
                    follow_mount: !1
                  });
                  if (r = a.path, o = a.node, Ae.isMountpoint(o)) throw new Ae.ErrnoError(10);
                  if (!Ae.isDir(o.mode)) throw new Ae.ErrnoError(54);
                }
                var s = {
                  type: e,
                  opts: t,
                  mountpoint: r,
                  mounts: []
                }, d = e.mount(s);
                return d.mount = s, s.root = d, n ? Ae.root = d : o && (o.mounted = s, o.mount && o.mount.mounts.push(s)), 
                d;
              },
              unmount: e => {
                var t = Ae.lookupPath(e, {
                  follow_mount: !1
                });
                if (!Ae.isMountpoint(t.node)) throw new Ae.ErrnoError(28);
                var r = t.node, o = r.mounted, n = Ae.getMounts(o);
                Object.keys(Ae.nameTable).forEach((e => {
                  for (var t = Ae.nameTable[e]; t; ) {
                    var r = t.name_next;
                    n.includes(t.mount) && Ae.destroyNode(t), t = r;
                  }
                })), r.mounted = null;
                var i = r.mount.mounts.indexOf(o);
                I(-1 !== i), r.mount.mounts.splice(i, 1);
              },
              lookup: (e, t) => e.node_ops.lookup(e, t),
              mknod: (e, t, r) => {
                var o = Ae.lookupPath(e, {
                  parent: !0
                }).node, n = be.basename(e);
                if (!n || "." === n || ".." === n) throw new Ae.ErrnoError(28);
                var i = Ae.mayCreate(o, n);
                if (i) throw new Ae.ErrnoError(i);
                if (!o.node_ops.mknod) throw new Ae.ErrnoError(63);
                return o.node_ops.mknod(o, n, t, r);
              },
              create: (e, t) => (t = void 0 !== t ? t : 438, t &= 4095, t |= 32768, Ae.mknod(e, t, 0)),
              mkdir: (e, t) => (t = void 0 !== t ? t : 511, t &= 1023, t |= 16384, Ae.mknod(e, t, 0)),
              mkdirTree: (e, t) => {
                for (var r = e.split("/"), o = "", n = 0; n < r.length; ++n) if (r[n]) {
                  o += "/" + r[n];
                  try {
                    Ae.mkdir(o, t);
                  } catch (e) {
                    if (20 != e.errno) throw e;
                  }
                }
              },
              mkdev: (e, t, r) => (void 0 === r && (r = t, t = 438), t |= 8192, Ae.mknod(e, t, r)),
              symlink: (e, t) => {
                if (!ve.resolve(e)) throw new Ae.ErrnoError(44);
                var r = Ae.lookupPath(t, {
                  parent: !0
                }).node;
                if (!r) throw new Ae.ErrnoError(44);
                var o = be.basename(t), n = Ae.mayCreate(r, o);
                if (n) throw new Ae.ErrnoError(n);
                if (!r.node_ops.symlink) throw new Ae.ErrnoError(63);
                return r.node_ops.symlink(r, o, e);
              },
              rename: (e, t) => {
                var r, o, n = be.dirname(e), i = be.dirname(t), a = be.basename(e), s = be.basename(t);
                if (r = Ae.lookupPath(e, {
                  parent: !0
                }).node, o = Ae.lookupPath(t, {
                  parent: !0
                }).node, !r || !o) throw new Ae.ErrnoError(44);
                if (r.mount !== o.mount) throw new Ae.ErrnoError(75);
                var d, c = Ae.lookupNode(r, a), l = ve.relative(e, i);
                if ("." !== l.charAt(0)) throw new Ae.ErrnoError(28);
                if ("." !== (l = ve.relative(t, n)).charAt(0)) throw new Ae.ErrnoError(55);
                try {
                  d = Ae.lookupNode(o, s);
                } catch (e) {}
                if (c !== d) {
                  var p = Ae.isDir(c.mode), E = Ae.mayDelete(r, a, p);
                  if (E) throw new Ae.ErrnoError(E);
                  if (E = d ? Ae.mayDelete(o, s, p) : Ae.mayCreate(o, s)) throw new Ae.ErrnoError(E);
                  if (!r.node_ops.rename) throw new Ae.ErrnoError(63);
                  if (Ae.isMountpoint(c) || d && Ae.isMountpoint(d)) throw new Ae.ErrnoError(10);
                  if (o !== r && (E = Ae.nodePermissions(r, "w"))) throw new Ae.ErrnoError(E);
                  Ae.hashRemoveNode(c);
                  try {
                    r.node_ops.rename(c, o, s);
                  } catch (e) {
                    throw e;
                  } finally {
                    Ae.hashAddNode(c);
                  }
                }
              },
              rmdir: e => {
                var t = Ae.lookupPath(e, {
                  parent: !0
                }).node, r = be.basename(e), o = Ae.lookupNode(t, r), n = Ae.mayDelete(t, r, !0);
                if (n) throw new Ae.ErrnoError(n);
                if (!t.node_ops.rmdir) throw new Ae.ErrnoError(63);
                if (Ae.isMountpoint(o)) throw new Ae.ErrnoError(10);
                t.node_ops.rmdir(t, r), Ae.destroyNode(o);
              },
              readdir: e => {
                var t = Ae.lookupPath(e, {
                  follow: !0
                }).node;
                if (!t.node_ops.readdir) throw new Ae.ErrnoError(54);
                return t.node_ops.readdir(t);
              },
              unlink: e => {
                var t = Ae.lookupPath(e, {
                  parent: !0
                }).node;
                if (!t) throw new Ae.ErrnoError(44);
                var r = be.basename(e), o = Ae.lookupNode(t, r), n = Ae.mayDelete(t, r, !1);
                if (n) throw new Ae.ErrnoError(n);
                if (!t.node_ops.unlink) throw new Ae.ErrnoError(63);
                if (Ae.isMountpoint(o)) throw new Ae.ErrnoError(10);
                t.node_ops.unlink(t, r), Ae.destroyNode(o);
              },
              readlink: e => {
                var t = Ae.lookupPath(e).node;
                if (!t) throw new Ae.ErrnoError(44);
                if (!t.node_ops.readlink) throw new Ae.ErrnoError(28);
                return ve.resolve(Ae.getPath(t.parent), t.node_ops.readlink(t));
              },
              stat: (e, t) => {
                var r = Ae.lookupPath(e, {
                  follow: !t
                }).node;
                if (!r) throw new Ae.ErrnoError(44);
                if (!r.node_ops.getattr) throw new Ae.ErrnoError(63);
                return r.node_ops.getattr(r);
              },
              lstat: e => Ae.stat(e, !0),
              chmod: (e, t, r) => {
                var o;
                if (!(o = "string" == typeof e ? Ae.lookupPath(e, {
                  follow: !r
                }).node : e).node_ops.setattr) throw new Ae.ErrnoError(63);
                o.node_ops.setattr(o, {
                  mode: 4095 & t | -4096 & o.mode,
                  timestamp: Date.now()
                });
              },
              lchmod: (e, t) => {
                Ae.chmod(e, t, !0);
              },
              fchmod: (e, t) => {
                var r = Ae.getStream(e);
                if (!r) throw new Ae.ErrnoError(8);
                Ae.chmod(r.node, t);
              },
              chown: (e, t, r, o) => {
                var n;
                if (!(n = "string" == typeof e ? Ae.lookupPath(e, {
                  follow: !o
                }).node : e).node_ops.setattr) throw new Ae.ErrnoError(63);
                n.node_ops.setattr(n, {
                  timestamp: Date.now()
                });
              },
              lchown: (e, t, r) => {
                Ae.chown(e, t, r, !0);
              },
              fchown: (e, t, r) => {
                var o = Ae.getStream(e);
                if (!o) throw new Ae.ErrnoError(8);
                Ae.chown(o.node, t, r);
              },
              truncate: (e, t) => {
                if (t < 0) throw new Ae.ErrnoError(28);
                var r;
                if (!(r = "string" == typeof e ? Ae.lookupPath(e, {
                  follow: !0
                }).node : e).node_ops.setattr) throw new Ae.ErrnoError(63);
                if (Ae.isDir(r.mode)) throw new Ae.ErrnoError(31);
                if (!Ae.isFile(r.mode)) throw new Ae.ErrnoError(28);
                var o = Ae.nodePermissions(r, "w");
                if (o) throw new Ae.ErrnoError(o);
                r.node_ops.setattr(r, {
                  size: t,
                  timestamp: Date.now()
                });
              },
              ftruncate: (e, t) => {
                var r = Ae.getStream(e);
                if (!r) throw new Ae.ErrnoError(8);
                if (!(2097155 & r.flags)) throw new Ae.ErrnoError(28);
                Ae.truncate(r.node, t);
              },
              utime: (e, t, r) => {
                var o = Ae.lookupPath(e, {
                  follow: !0
                }).node;
                o.node_ops.setattr(o, {
                  timestamp: Math.max(t, r)
                });
              },
              open: (e, t, r, o, n) => {
                if ("" === e) throw new Ae.ErrnoError(44);
                var a;
                if (r = void 0 === r ? 438 : r, r = 64 & (t = "string" == typeof t ? Ae.modeStringToFlags(t) : t) ? 4095 & r | 32768 : 0, 
                "object" == typeof e) a = e; else {
                  e = be.normalize(e);
                  try {
                    a = Ae.lookupPath(e, {
                      follow: !(131072 & t)
                    }).node;
                  } catch (e) {}
                }
                var s = !1;
                if (64 & t) if (a) {
                  if (128 & t) throw new Ae.ErrnoError(20);
                } else a = Ae.mknod(e, r, 0), s = !0;
                if (!a) throw new Ae.ErrnoError(44);
                if (Ae.isChrdev(a.mode) && (t &= -513), 65536 & t && !Ae.isDir(a.mode)) throw new Ae.ErrnoError(54);
                if (!s) {
                  var d = Ae.mayOpen(a, t);
                  if (d) throw new Ae.ErrnoError(d);
                }
                512 & t && Ae.truncate(a, 0), t &= -131713;
                var c = Ae.createStream({
                  node: a,
                  path: Ae.getPath(a),
                  flags: t,
                  seekable: !0,
                  position: 0,
                  stream_ops: a.stream_ops,
                  ungotten: [],
                  error: !1
                }, o, n);
                return c.stream_ops.open && c.stream_ops.open(c), !i.logReadFiles || 1 & t || (Ae.readFiles || (Ae.readFiles = {}), 
                e in Ae.readFiles || (Ae.readFiles[e] = 1)), c;
              },
              close: e => {
                if (Ae.isClosed(e)) throw new Ae.ErrnoError(8);
                e.getdents && (e.getdents = null);
                try {
                  e.stream_ops.close && e.stream_ops.close(e);
                } catch (e) {
                  throw e;
                } finally {
                  Ae.closeStream(e.fd);
                }
                e.fd = null;
              },
              isClosed: e => null === e.fd,
              llseek: (e, t, r) => {
                if (Ae.isClosed(e)) throw new Ae.ErrnoError(8);
                if (!e.seekable || !e.stream_ops.llseek) throw new Ae.ErrnoError(70);
                if (0 != r && 1 != r && 2 != r) throw new Ae.ErrnoError(28);
                return e.position = e.stream_ops.llseek(e, t, r), e.ungotten = [], e.position;
              },
              read: (e, t, r, o, n) => {
                if (o < 0 || n < 0) throw new Ae.ErrnoError(28);
                if (Ae.isClosed(e)) throw new Ae.ErrnoError(8);
                if (1 == (2097155 & e.flags)) throw new Ae.ErrnoError(8);
                if (Ae.isDir(e.node.mode)) throw new Ae.ErrnoError(31);
                if (!e.stream_ops.read) throw new Ae.ErrnoError(28);
                var i = void 0 !== n;
                if (i) {
                  if (!e.seekable) throw new Ae.ErrnoError(70);
                } else n = e.position;
                var a = e.stream_ops.read(e, t, r, o, n);
                return i || (e.position += a), a;
              },
              write: (e, t, r, o, n, i) => {
                if (o < 0 || n < 0) throw new Ae.ErrnoError(28);
                if (Ae.isClosed(e)) throw new Ae.ErrnoError(8);
                if (!(2097155 & e.flags)) throw new Ae.ErrnoError(8);
                if (Ae.isDir(e.node.mode)) throw new Ae.ErrnoError(31);
                if (!e.stream_ops.write) throw new Ae.ErrnoError(28);
                e.seekable && 1024 & e.flags && Ae.llseek(e, 0, 2);
                var a = void 0 !== n;
                if (a) {
                  if (!e.seekable) throw new Ae.ErrnoError(70);
                } else n = e.position;
                var s = e.stream_ops.write(e, t, r, o, n, i);
                return a || (e.position += s), s;
              },
              allocate: (e, t, r) => {
                if (Ae.isClosed(e)) throw new Ae.ErrnoError(8);
                if (t < 0 || r <= 0) throw new Ae.ErrnoError(28);
                if (!(2097155 & e.flags)) throw new Ae.ErrnoError(8);
                if (!Ae.isFile(e.node.mode) && !Ae.isDir(e.node.mode)) throw new Ae.ErrnoError(43);
                if (!e.stream_ops.allocate) throw new Ae.ErrnoError(138);
                e.stream_ops.allocate(e, t, r);
              },
              mmap: (e, t, r, o, n, i) => {
                if (2 & n && !(2 & i) && 2 != (2097155 & e.flags)) throw new Ae.ErrnoError(2);
                if (1 == (2097155 & e.flags)) throw new Ae.ErrnoError(2);
                if (!e.stream_ops.mmap) throw new Ae.ErrnoError(43);
                return e.stream_ops.mmap(e, t, r, o, n, i);
              },
              msync: (e, t, r, o, n) => e && e.stream_ops.msync ? e.stream_ops.msync(e, t, r, o, n) : 0,
              munmap: e => 0,
              ioctl: (e, t, r) => {
                if (!e.stream_ops.ioctl) throw new Ae.ErrnoError(59);
                return e.stream_ops.ioctl(e, t, r);
              },
              readFile: (e, t = {}) => {
                if (t.flags = t.flags || 0, t.encoding = t.encoding || "binary", "utf8" !== t.encoding && "binary" !== t.encoding) throw new Error('Invalid encoding type "' + t.encoding + '"');
                var r, o = Ae.open(e, t.flags), n = Ae.stat(e).size, i = new Uint8Array(n);
                return Ae.read(o, i, 0, n, 0), "utf8" === t.encoding ? r = B(i, 0) : "binary" === t.encoding && (r = i), 
                Ae.close(o), r;
              },
              writeFile: (e, t, r = {}) => {
                r.flags = r.flags || 577;
                var o = Ae.open(e, r.flags, r.mode);
                if ("string" == typeof t) {
                  var n = new Uint8Array(K(t) + 1), i = z(t, n, 0, n.length);
                  Ae.write(o, n, 0, i, void 0, r.canOwn);
                } else {
                  if (!ArrayBuffer.isView(t)) throw new Error("Unsupported data type");
                  Ae.write(o, t, 0, t.byteLength, void 0, r.canOwn);
                }
                Ae.close(o);
              },
              cwd: () => Ae.currentPath,
              chdir: e => {
                var t = Ae.lookupPath(e, {
                  follow: !0
                });
                if (null === t.node) throw new Ae.ErrnoError(44);
                if (!Ae.isDir(t.node.mode)) throw new Ae.ErrnoError(54);
                var r = Ae.nodePermissions(t.node, "x");
                if (r) throw new Ae.ErrnoError(r);
                Ae.currentPath = t.path;
              },
              createDefaultDirectories: () => {
                Ae.mkdir("/tmp"), Ae.mkdir("/home"), Ae.mkdir("/home/web_user");
              },
              createDefaultDevices: () => {
                Ae.mkdir("/dev"), Ae.registerDevice(Ae.makedev(1, 3), {
                  read: () => 0,
                  write: (e, t, r, o, n) => o
                }), Ae.mkdev("/dev/null", Ae.makedev(1, 3)), Pe.register(Ae.makedev(5, 0), Pe.default_tty_ops), 
                Pe.register(Ae.makedev(6, 0), Pe.default_tty1_ops), Ae.mkdev("/dev/tty", Ae.makedev(5, 0)), 
                Ae.mkdev("/dev/tty1", Ae.makedev(6, 0));
                var e = function() {
                  if ("object" == typeof crypto && "function" == typeof crypto.getRandomValues) {
                    var e = new Uint8Array(1);
                    return function() {
                      return crypto.getRandomValues(e), e[0];
                    };
                  }
                  if (l) try {
                    var t = r(349);
                    return function() {
                      return t.randomBytes(1)[0];
                    };
                  } catch (e) {}
                  return function() {
                    Ee("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };");
                  };
                }();
                Ae.createDevice("/dev", "random", e), Ae.createDevice("/dev", "urandom", e), Ae.mkdir("/dev/shm"), 
                Ae.mkdir("/dev/shm/tmp");
              },
              createSpecialDirectories: () => {
                Ae.mkdir("/proc");
                var e = Ae.mkdir("/proc/self");
                Ae.mkdir("/proc/self/fd"), Ae.mount({
                  mount: () => {
                    var t = Ae.createNode(e, "fd", 16895, 73);
                    return t.node_ops = {
                      lookup: (e, t) => {
                        var r = +t, o = Ae.getStream(r);
                        if (!o) throw new Ae.ErrnoError(8);
                        var n = {
                          parent: null,
                          mount: {
                            mountpoint: "fake"
                          },
                          node_ops: {
                            readlink: () => o.path
                          }
                        };
                        return n.parent = n, n;
                      }
                    }, t;
                  }
                }, {}, "/proc/self/fd");
              },
              createStandardStreams: () => {
                i.stdin ? Ae.createDevice("/dev", "stdin", i.stdin) : Ae.symlink("/dev/tty", "/dev/stdin"), 
                i.stdout ? Ae.createDevice("/dev", "stdout", null, i.stdout) : Ae.symlink("/dev/tty", "/dev/stdout"), 
                i.stderr ? Ae.createDevice("/dev", "stderr", null, i.stderr) : Ae.symlink("/dev/tty1", "/dev/stderr");
                var e = Ae.open("/dev/stdin", 0), t = Ae.open("/dev/stdout", 1), r = Ae.open("/dev/stderr", 1);
                I(0 === e.fd, "invalid handle for stdin (" + e.fd + ")"), I(1 === t.fd, "invalid handle for stdout (" + t.fd + ")"), 
                I(2 === r.fd, "invalid handle for stderr (" + r.fd + ")");
              },
              ensureErrnoError: () => {
                Ae.ErrnoError || (Ae.ErrnoError = function(e, t) {
                  this.node = t, this.setErrno = function(e) {
                    for (var t in this.errno = e, Se) if (Se[t] === e) {
                      this.code = t;
                      break;
                    }
                  }, this.setErrno(e), this.message = Re[e], this.stack && (Object.defineProperty(this, "stack", {
                    value: (new Error).stack,
                    writable: !0
                  }), this.stack = ye(this.stack));
                }, Ae.ErrnoError.prototype = new Error, Ae.ErrnoError.prototype.constructor = Ae.ErrnoError, 
                [ 44 ].forEach((e => {
                  Ae.genericErrors[e] = new Ae.ErrnoError(e), Ae.genericErrors[e].stack = "<generic error, no stack>";
                })));
              },
              staticInit: () => {
                Ae.ensureErrnoError(), Ae.nameTable = new Array(4096), Ae.mount(Me, {}, "/"), Ae.createDefaultDirectories(), 
                Ae.createDefaultDevices(), Ae.createSpecialDirectories(), Ae.filesystems = {
                  MEMFS: Me
                };
              },
              init: (e, t, r) => {
                I(!Ae.init.initialized, "FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)"), 
                Ae.init.initialized = !0, Ae.ensureErrnoError(), i.stdin = e || i.stdin, i.stdout = t || i.stdout, 
                i.stderr = r || i.stderr, Ae.createStandardStreams();
              },
              quit: () => {
                Ae.init.initialized = !1, He();
                for (var e = 0; e < Ae.streams.length; e++) {
                  var t = Ae.streams[e];
                  t && Ae.close(t);
                }
              },
              getMode: (e, t) => {
                var r = 0;
                return e && (r |= 365), t && (r |= 146), r;
              },
              findObject: (e, t) => {
                var r = Ae.analyzePath(e, t);
                return r.exists ? r.object : null;
              },
              analyzePath: (e, t) => {
                try {
                  e = (o = Ae.lookupPath(e, {
                    follow: !t
                  })).path;
                } catch (e) {}
                var r = {
                  isRoot: !1,
                  exists: !1,
                  error: 0,
                  name: null,
                  path: null,
                  object: null,
                  parentExists: !1,
                  parentPath: null,
                  parentObject: null
                };
                try {
                  var o = Ae.lookupPath(e, {
                    parent: !0
                  });
                  r.parentExists = !0, r.parentPath = o.path, r.parentObject = o.node, r.name = be.basename(e), 
                  o = Ae.lookupPath(e, {
                    follow: !t
                  }), r.exists = !0, r.path = o.path, r.object = o.node, r.name = o.node.name, r.isRoot = "/" === o.path;
                } catch (e) {
                  r.error = e.errno;
                }
                return r;
              },
              createPath: (e, t, r, o) => {
                e = "string" == typeof e ? e : Ae.getPath(e);
                for (var n = t.split("/").reverse(); n.length; ) {
                  var i = n.pop();
                  if (i) {
                    var a = be.join2(e, i);
                    try {
                      Ae.mkdir(a);
                    } catch (e) {}
                    e = a;
                  }
                }
                return a;
              },
              createFile: (e, t, r, o, n) => {
                var i = be.join2("string" == typeof e ? e : Ae.getPath(e), t), a = Ae.getMode(o, n);
                return Ae.create(i, a);
              },
              createDataFile: (e, t, r, o, n, i) => {
                var a = t;
                e && (e = "string" == typeof e ? e : Ae.getPath(e), a = t ? be.join2(e, t) : e);
                var s = Ae.getMode(o, n), d = Ae.create(a, s);
                if (r) {
                  if ("string" == typeof r) {
                    for (var c = new Array(r.length), l = 0, p = r.length; l < p; ++l) c[l] = r.charCodeAt(l);
                    r = c;
                  }
                  Ae.chmod(d, 146 | s);
                  var E = Ae.open(d, 577);
                  Ae.write(E, r, 0, r.length, 0, i), Ae.close(E), Ae.chmod(d, s);
                }
                return d;
              },
              createDevice: (e, t, r, o) => {
                var n = be.join2("string" == typeof e ? e : Ae.getPath(e), t), i = Ae.getMode(!!r, !!o);
                Ae.createDevice.major || (Ae.createDevice.major = 64);
                var a = Ae.makedev(Ae.createDevice.major++, 0);
                return Ae.registerDevice(a, {
                  open: e => {
                    e.seekable = !1;
                  },
                  close: e => {
                    o && o.buffer && o.buffer.length && o(10);
                  },
                  read: (e, t, o, n, i) => {
                    for (var a = 0, s = 0; s < n; s++) {
                      var d;
                      try {
                        d = r();
                      } catch (e) {
                        throw new Ae.ErrnoError(29);
                      }
                      if (void 0 === d && 0 === a) throw new Ae.ErrnoError(6);
                      if (null == d) break;
                      a++, t[o + s] = d;
                    }
                    return a && (e.node.timestamp = Date.now()), a;
                  },
                  write: (e, t, r, n, i) => {
                    for (var a = 0; a < n; a++) try {
                      o(t[r + a]);
                    } catch (e) {
                      throw new Ae.ErrnoError(29);
                    }
                    return n && (e.node.timestamp = Date.now()), a;
                  }
                }), Ae.mkdev(n, i, a);
              },
              forceLoadFile: e => {
                if (e.isDevice || e.isFolder || e.link || e.contents) return !0;
                if ("undefined" != typeof XMLHttpRequest) throw new Error("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");
                if (!E) throw new Error("Cannot load without read() or XMLHttpRequest.");
                try {
                  e.contents = je(E(e.url), !0), e.usedBytes = e.contents.length;
                } catch (e) {
                  throw new Ae.ErrnoError(29);
                }
              },
              createLazyFile: (e, t, r, o, n) => {
                function i() {
                  this.lengthKnown = !1, this.chunks = [];
                }
                if (i.prototype.get = function(e) {
                  if (!(e > this.length - 1 || e < 0)) {
                    var t = e % this.chunkSize, r = e / this.chunkSize | 0;
                    return this.getter(r)[t];
                  }
                }, i.prototype.setDataGetter = function(e) {
                  this.getter = e;
                }, i.prototype.cacheLength = function() {
                  var e = new XMLHttpRequest;
                  if (e.open("HEAD", r, !1), e.send(null), !(e.status >= 200 && e.status < 300 || 304 === e.status)) throw new Error("Couldn't load " + r + ". Status: " + e.status);
                  var t, o = Number(e.getResponseHeader("Content-length")), n = (t = e.getResponseHeader("Accept-Ranges")) && "bytes" === t, i = (t = e.getResponseHeader("Content-Encoding")) && "gzip" === t, a = 1048576;
                  n || (a = o);
                  var s = this;
                  s.setDataGetter((e => {
                    var t = e * a, n = (e + 1) * a - 1;
                    if (n = Math.min(n, o - 1), void 0 === s.chunks[e] && (s.chunks[e] = ((e, t) => {
                      if (e > t) throw new Error("invalid range (" + e + ", " + t + ") or no bytes requested!");
                      if (t > o - 1) throw new Error("only " + o + " bytes available! programmer error!");
                      var n = new XMLHttpRequest;
                      if (n.open("GET", r, !1), o !== a && n.setRequestHeader("Range", "bytes=" + e + "-" + t), 
                      n.responseType = "arraybuffer", n.overrideMimeType && n.overrideMimeType("text/plain; charset=x-user-defined"), 
                      n.send(null), !(n.status >= 200 && n.status < 300 || 304 === n.status)) throw new Error("Couldn't load " + r + ". Status: " + n.status);
                      return void 0 !== n.response ? new Uint8Array(n.response || []) : je(n.responseText || "", !0);
                    })(t, n)), void 0 === s.chunks[e]) throw new Error("doXHR failed!");
                    return s.chunks[e];
                  })), !i && o || (a = o = 1, o = this.getter(0).length, a = o, T("LazyFiles on gzip forces download of the whole file when length is accessed")), 
                  this._length = o, this._chunkSize = a, this.lengthKnown = !0;
                }, "undefined" != typeof XMLHttpRequest) {
                  if (!c) throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";
                  var a = new i;
                  Object.defineProperties(a, {
                    length: {
                      get: function() {
                        return this.lengthKnown || this.cacheLength(), this._length;
                      }
                    },
                    chunkSize: {
                      get: function() {
                        return this.lengthKnown || this.cacheLength(), this._chunkSize;
                      }
                    }
                  });
                  var s = {
                    isDevice: !1,
                    contents: a
                  };
                } else s = {
                  isDevice: !1,
                  url: r
                };
                var d = Ae.createFile(e, t, s, o, n);
                s.contents ? d.contents = s.contents : s.url && (d.contents = null, d.url = s.url), 
                Object.defineProperties(d, {
                  usedBytes: {
                    get: function() {
                      return this.contents.length;
                    }
                  }
                });
                var l = {};
                return Object.keys(d.stream_ops).forEach((e => {
                  var t = d.stream_ops[e];
                  l[e] = function() {
                    return Ae.forceLoadFile(d), t.apply(null, arguments);
                  };
                })), l.read = (e, t, r, o, n) => {
                  Ae.forceLoadFile(d);
                  var i = e.node.contents;
                  if (n >= i.length) return 0;
                  var a = Math.min(i.length - n, o);
                  if (I(a >= 0), i.slice) for (var s = 0; s < a; s++) t[r + s] = i[n + s]; else for (s = 0; s < a; s++) t[r + s] = i.get(n + s);
                  return a;
                }, d.stream_ops = l, d;
              },
              createPreloadedFile: (e, t, r, o, n, i, a, s, d, c) => {
                var l = t ? ve.resolve(be.join2(e, t)) : e, p = ce("cp " + l);
                function E(r) {
                  function E(r) {
                    c && c(), s || Ae.createDataFile(e, t, r, o, n, d), i && i(), pe(p);
                  }
                  Browser.handledByPreloadPlugin(r, l, E, (() => {
                    a && a(), pe(p);
                  })) || E(r);
                }
                le(p), "string" == typeof r ? function(e, t, r, o) {
                  var n = o ? "" : ce("al " + e);
                  u(e, (function(r) {
                    I(r, 'Loading data file "' + e + '" failed (no arrayBuffer).'), t(new Uint8Array(r)), 
                    n && pe(n);
                  }), (function(t) {
                    if (!r) throw 'Loading data file "' + e + '" failed.';
                    r();
                  })), n && le(n);
                }(r, (e => E(e)), a) : E(r);
              },
              indexedDB: () => window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB,
              DB_NAME: () => "EM_FS_" + window.location.pathname,
              DB_VERSION: 20,
              DB_STORE_NAME: "FILE_DATA",
              saveFilesToDB: (e, t, r) => {
                t = t || (() => {}), r = r || (() => {});
                var o = Ae.indexedDB();
                try {
                  var n = o.open(Ae.DB_NAME(), Ae.DB_VERSION);
                } catch (e) {
                  return r(e);
                }
                n.onupgradeneeded = () => {
                  T("creating db"), n.result.createObjectStore(Ae.DB_STORE_NAME);
                }, n.onsuccess = () => {
                  var o = n.result.transaction([ Ae.DB_STORE_NAME ], "readwrite"), i = o.objectStore(Ae.DB_STORE_NAME), a = 0, s = 0, d = e.length;
                  function c() {
                    0 == s ? t() : r();
                  }
                  e.forEach((e => {
                    var t = i.put(Ae.analyzePath(e).object.contents, e);
                    t.onsuccess = () => {
                      ++a + s == d && c();
                    }, t.onerror = () => {
                      s++, a + s == d && c();
                    };
                  })), o.onerror = r;
                }, n.onerror = r;
              },
              loadFilesFromDB: (e, t, r) => {
                t = t || (() => {}), r = r || (() => {});
                var o = Ae.indexedDB();
                try {
                  var n = o.open(Ae.DB_NAME(), Ae.DB_VERSION);
                } catch (e) {
                  return r(e);
                }
                n.onupgradeneeded = r, n.onsuccess = () => {
                  var o = n.result;
                  try {
                    var i = o.transaction([ Ae.DB_STORE_NAME ], "readonly");
                  } catch (e) {
                    return void r(e);
                  }
                  var a = i.objectStore(Ae.DB_STORE_NAME), s = 0, d = 0, c = e.length;
                  function l() {
                    0 == d ? t() : r();
                  }
                  e.forEach((e => {
                    var t = a.get(e);
                    t.onsuccess = () => {
                      Ae.analyzePath(e).exists && Ae.unlink(e), Ae.createDataFile(be.dirname(e), be.basename(e), t.result, !0, !0, !0), 
                      ++s + d == c && l();
                    }, t.onerror = () => {
                      d++, s + d == c && l();
                    };
                  })), i.onerror = r;
                }, n.onerror = r;
              },
              absolutePath: () => {
                Ee("FS.absolutePath has been removed; use PATH_FS.resolve instead");
              },
              createFolder: () => {
                Ee("FS.createFolder has been removed; use FS.mkdir instead");
              },
              createLink: () => {
                Ee("FS.createLink has been removed; use FS.symlink instead");
              },
              joinPath: () => {
                Ee("FS.joinPath has been removed; use PATH.join instead");
              },
              mmapAlloc: () => {
                Ee("FS.mmapAlloc has been replaced by the top level function mmapAlloc");
              },
              standardizePath: () => {
                Ee("FS.standardizePath has been removed; use PATH.normalize instead");
              }
            }, Fe = {
              DEFAULT_POLLMASK: 5,
              calculateAt: function(e, t, r) {
                if ("/" === t[0]) return t;
                var o;
                if (-100 === e) o = Ae.cwd(); else {
                  var n = Ae.getStream(e);
                  if (!n) throw new Ae.ErrnoError(8);
                  o = n.path;
                }
                if (0 == t.length) {
                  if (!r) throw new Ae.ErrnoError(44);
                  return o;
                }
                return be.join2(o, t);
              },
              doStat: function(e, t, r) {
                try {
                  var o = e(t);
                } catch (e) {
                  if (e && e.node && be.normalize(t) !== be.normalize(Ae.getPath(e.node))) return -54;
                  throw e;
                }
                return M(0 | r, 0 | o.dev, 4), M(r + 4 | 0, 0, 4), M(r + 8 | 0, 0 | o.ino, 4), M(r + 12 | 0, 0 | o.mode, 4), 
                M(r + 16 | 0, 0 | o.nlink, 4), M(r + 20 | 0, 0 | o.uid, 4), M(r + 24 | 0, 0 | o.gid, 4), 
                M(r + 28 | 0, 0 | o.rdev, 4), M(r + 32 | 0, 0, 4), M(r + 40 | 0, 0 | o.size, 8), 
                M(r + 48 | 0, 4096, 4), M(r + 52 | 0, 0 | o.blocks, 4), M(r + 56 | 0, o.atime.getTime() / 1e3 | 0, 4), 
                M(r + 60 | 0, 0, 4), M(r + 64 | 0, o.mtime.getTime() / 1e3 | 0, 4), M(r + 68 | 0, 0, 4), 
                M(r + 72 | 0, o.ctime.getTime() / 1e3 | 0, 4), M(r + 76 | 0, 0, 4), M(r + 80 | 0, 0 | o.ino, 8), 
                0;
              },
              doMsync: function(e, t, r, o, n) {
                var i = j.slice(e, e + r);
                Ae.msync(t, i, n, r, o);
              },
              doMkdir: function(e, t) {
                return "/" === (e = be.normalize(e))[e.length - 1] && (e = e.substr(0, e.length - 1)), 
                Ae.mkdir(e, t, 0), 0;
              },
              doMknod: function(e, t, r) {
                switch (61440 & t) {
                 case 32768:
                 case 8192:
                 case 24576:
                 case 4096:
                 case 49152:
                  break;

                 default:
                  return -28;
                }
                return Ae.mknod(e, t, r), 0;
              },
              doReadlink: function(e, t, r) {
                if (r <= 0) return -28;
                var o = Ae.readlink(e), n = Math.min(r, K(o)), i = S(t + n, 1, 0);
                return W(o, t, r + 1), M(t + n, i, 1), n;
              },
              doAccess: function(e, t) {
                if (-8 & t) return -28;
                var r = Ae.lookupPath(e, {
                  follow: !0
                }).node;
                if (!r) return -44;
                var o = "";
                return 4 & t && (o += "r"), 2 & t && (o += "w"), 1 & t && (o += "x"), o && Ae.nodePermissions(r, o) ? -2 : 0;
              },
              doDup: function(e, t, r) {
                var o = Ae.getStream(r);
                return o && Ae.close(o), Ae.open(e, t, 0, r, r).fd;
              },
              doReadv: function(e, t, r, o) {
                for (var n = 0, i = 0; i < r; i++) {
                  var a = 0 | S(t + 8 * i | 0, 4, 0), s = 0 | S(t + (8 * i + 4) | 0, 4, 0), d = Ae.read(e, U, a, s, o);
                  if (d < 0) return -1;
                  if (n += d, d < s) break;
                }
                return n;
              },
              doWritev: function(e, t, r, o) {
                for (var n = 0, i = 0; i < r; i++) {
                  var a = 0 | S(t + 8 * i | 0, 4, 0), s = 0 | S(t + (8 * i + 4) | 0, 4, 0), d = Ae.write(e, U, a, s, o);
                  if (d < 0) return -1;
                  n += d;
                }
                return n;
              },
              varargs: void 0,
              get: function() {
                return I(null != Fe.varargs), Fe.varargs += 4, 0 | S(Fe.varargs - 4 | 0, 4, 0);
              },
              getStr: function(e) {
                return Y(e);
              },
              getStreamFromFD: function(e) {
                var t = Ae.getStream(e);
                if (!t) throw new Ae.ErrnoError(8);
                return t;
              },
              get64: function(e, t) {
                return I(e >= 0 ? 0 === t : -1 === t), e;
              }
            };
            function Ie(e) {
              try {
                return D.grow(e - N.byteLength + 65535 >>> 16), V(D.buffer), 1;
              } catch (t) {
                y("emscripten_realloc_buffer: Attempted to grow heap from " + N.byteLength + " bytes to " + e + " bytes, but got error: " + t);
              }
            }
            var ke = function(e, t, r, o) {
              e || (e = this), this.parent = e, this.mount = e.mount, this.mounted = null, this.id = Ae.nextInode++, 
              this.name = t, this.mode = r, this.node_ops = {}, this.stream_ops = {}, this.rdev = o;
            }, Ne = 365, Ue = 146;
            function je(e, t, r) {
              var o = r > 0 ? r : K(e) + 1, n = new Array(o), i = z(e, n, 0, n.length);
              return t && (n.length = i), n;
            }
            Object.defineProperties(ke.prototype, {
              read: {
                get: function() {
                  return (this.mode & Ne) === Ne;
                },
                set: function(e) {
                  e ? this.mode |= Ne : this.mode &= -366;
                }
              },
              write: {
                get: function() {
                  return (this.mode & Ue) === Ue;
                },
                set: function(e) {
                  e ? this.mode |= Ue : this.mode &= -147;
                }
              },
              isFolder: {
                get: function() {
                  return Ae.isDir(this.mode);
                }
              },
              isDevice: {
                get: function() {
                  return Ae.isChrdev(this.mode);
                }
              }
            }), Ae.FSNode = ke, Ae.staticInit(), Se = {
              EPERM: 63,
              ENOENT: 44,
              ESRCH: 71,
              EINTR: 27,
              EIO: 29,
              ENXIO: 60,
              E2BIG: 1,
              ENOEXEC: 45,
              EBADF: 8,
              ECHILD: 12,
              EAGAIN: 6,
              EWOULDBLOCK: 6,
              ENOMEM: 48,
              EACCES: 2,
              EFAULT: 21,
              ENOTBLK: 105,
              EBUSY: 10,
              EEXIST: 20,
              EXDEV: 75,
              ENODEV: 43,
              ENOTDIR: 54,
              EISDIR: 31,
              EINVAL: 28,
              ENFILE: 41,
              EMFILE: 33,
              ENOTTY: 59,
              ETXTBSY: 74,
              EFBIG: 22,
              ENOSPC: 51,
              ESPIPE: 70,
              EROFS: 69,
              EMLINK: 34,
              EPIPE: 64,
              EDOM: 18,
              ERANGE: 68,
              ENOMSG: 49,
              EIDRM: 24,
              ECHRNG: 106,
              EL2NSYNC: 156,
              EL3HLT: 107,
              EL3RST: 108,
              ELNRNG: 109,
              EUNATCH: 110,
              ENOCSI: 111,
              EL2HLT: 112,
              EDEADLK: 16,
              ENOLCK: 46,
              EBADE: 113,
              EBADR: 114,
              EXFULL: 115,
              ENOANO: 104,
              EBADRQC: 103,
              EBADSLT: 102,
              EDEADLOCK: 16,
              EBFONT: 101,
              ENOSTR: 100,
              ENODATA: 116,
              ETIME: 117,
              ENOSR: 118,
              ENONET: 119,
              ENOPKG: 120,
              EREMOTE: 121,
              ENOLINK: 47,
              EADV: 122,
              ESRMNT: 123,
              ECOMM: 124,
              EPROTO: 65,
              EMULTIHOP: 36,
              EDOTDOT: 125,
              EBADMSG: 9,
              ENOTUNIQ: 126,
              EBADFD: 127,
              EREMCHG: 128,
              ELIBACC: 129,
              ELIBBAD: 130,
              ELIBSCN: 131,
              ELIBMAX: 132,
              ELIBEXEC: 133,
              ENOSYS: 52,
              ENOTEMPTY: 55,
              ENAMETOOLONG: 37,
              ELOOP: 32,
              EOPNOTSUPP: 138,
              EPFNOSUPPORT: 139,
              ECONNRESET: 15,
              ENOBUFS: 42,
              EAFNOSUPPORT: 5,
              EPROTOTYPE: 67,
              ENOTSOCK: 57,
              ENOPROTOOPT: 50,
              ESHUTDOWN: 140,
              ECONNREFUSED: 14,
              EADDRINUSE: 3,
              ECONNABORTED: 13,
              ENETUNREACH: 40,
              ENETDOWN: 38,
              ETIMEDOUT: 73,
              EHOSTDOWN: 142,
              EHOSTUNREACH: 23,
              EINPROGRESS: 26,
              EALREADY: 7,
              EDESTADDRREQ: 17,
              EMSGSIZE: 35,
              EPROTONOSUPPORT: 66,
              ESOCKTNOSUPPORT: 137,
              EADDRNOTAVAIL: 4,
              ENETRESET: 39,
              EISCONN: 30,
              ENOTCONN: 53,
              ETOOMANYREFS: 141,
              EUSERS: 136,
              EDQUOT: 19,
              ESTALE: 72,
              ENOTSUP: 138,
              ENOMEDIUM: 148,
              EILSEQ: 25,
              EOVERFLOW: 61,
              ECANCELED: 11,
              ENOTRECOVERABLE: 56,
              EOWNERDEAD: 62,
              ESTRPIPE: 135
            };
            var xe, Ce = {
              __assert_fail: function(e, t, r, o) {
                Ee("Assertion failed: " + Y(e) + ", at: " + [ t ? Y(t) : "unknown filename", r, o ? Y(o) : "unknown function" ]);
              },
              __syscall_open: function(e, t, r) {
                Fe.varargs = r;
                try {
                  var o = Fe.getStr(e), n = r ? Fe.get() : 0;
                  return Ae.open(o, t, n).fd;
                } catch (e) {
                  if (void 0 === Ae || !(e instanceof Ae.ErrnoError)) throw e;
                  return -e.errno;
                }
              },
              alignfault: function() {
                Ee("alignment fault");
              },
              emscripten_memcpy_big: function(e, t, r) {
                j.copyWithin(e, t, t + r);
              },
              emscripten_resize_heap: function(e) {
                var t = j.length;
                I((e >>>= 0) > t);
                var r, o, n = 2147483648;
                if (e > n) return y("Cannot enlarge memory, asked to go up to " + e + " bytes, but the limit is " + n + " bytes!"), 
                !1;
                for (var i = 1; i <= 4; i *= 2) {
                  var a = t * (1 + .2 / i);
                  a = Math.min(a, e + 100663296);
                  var s = Math.min(n, ((r = Math.max(e, a)) % (o = 65536) > 0 && (r += o - r % o), 
                  r));
                  if (Ie(s)) return !0;
                }
                return y("Failed to grow the heap from " + t + " bytes to " + s + " bytes, not enough memory!"), 
                !1;
              },
              fd_read: function(e, t, r, o) {
                try {
                  var n = Fe.getStreamFromFD(e);
                  return M(0 | o, 0 | Fe.doReadv(n, t, r), 4), 0;
                } catch (e) {
                  if (void 0 === Ae || !(e instanceof Ae.ErrnoError)) throw e;
                  return e.errno;
                }
              },
              fd_write: function(e, t, r, o) {
                try {
                  var n = Fe.getStreamFromFD(e);
                  return M(0 | o, 0 | Fe.doWritev(n, t, r), 4), 0;
                } catch (e) {
                  if (void 0 === Ae || !(e instanceof Ae.ErrnoError)) throw e;
                  return e.errno;
                }
              },
              segfault: function() {
                Ee("segmentation fault");
              }
            }, He = (function() {
              var e = {
                env: Ce,
                wasi_snapshot_preview1: Ce
              };
              function t(e, t) {
                var r, o = e.exports;
                i.asm = o, I(D = i.asm.memory, "memory not found in wasm exports"), V(D.buffer), 
                I(q = i.asm.__indirect_function_table, "table not found in wasm exports"), r = i.asm.__wasm_call_ctors, 
                te.unshift(r), pe("wasm-instantiate");
              }
              le("wasm-instantiate");
              var r = i;
              function o(e) {
                I(i === r, "the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?"), 
                r = null, t(e.instance);
              }
              function a(t) {
                return function() {
                  if (!w && (d || c)) {
                    if ("function" == typeof fetch && !ge(ue)) return fetch(ue, {
                      credentials: "same-origin"
                    }).then((function(e) {
                      if (!e.ok) throw "failed to load wasm binary file at '" + ue + "'";
                      return e.arrayBuffer();
                    })).catch((function() {
                      return we(ue);
                    }));
                    if (u) return new Promise((function(e, t) {
                      u(ue, (function(t) {
                        e(new Uint8Array(t));
                      }), t);
                    }));
                  }
                  return Promise.resolve().then((function() {
                    return we(ue);
                  }));
                }().then((function(t) {
                  return WebAssembly.instantiate(t, e);
                })).then((function(e) {
                  return e;
                })).then(t, (function(e) {
                  y("failed to asynchronously prepare wasm: " + e), ge(ue) && y("warning: Loading from a file URI (" + ue + ") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing"), 
                  Ee(e);
                }));
              }
              if (i.instantiateWasm) try {
                return i.instantiateWasm(e, t);
              } catch (e) {
                return y("Module.instantiateWasm callback failed with error: " + e), !1;
              }
              (w || "function" != typeof WebAssembly.instantiateStreaming || Oe(ue) || ge(ue) || "function" != typeof fetch ? a(o) : fetch(ue, {
                credentials: "same-origin"
              }).then((function(t) {
                return WebAssembly.instantiateStreaming(t, e).then(o, (function(e) {
                  return y("wasm streaming compile failed: " + e), y("falling back to ArrayBuffer instantiation"), 
                  a(o);
                }));
              }))).catch(n);
            }(), i.___wasm_call_ctors = me("__wasm_call_ctors"), i._dilithium_keygen = me("dilithium_keygen"), 
            i._malloc = me("malloc"), i._free = me("free"), i._dilithium_sign = me("dilithium_sign"), 
            i._dilithium_verify = me("dilithium_verify"), i._SHA3_256 = me("SHA3_256"), i._randombytes = me("randombytes"), 
            i.___errno_location = me("__errno_location"), i.___stdio_exit = me("__stdio_exit")), Le = i._sbrk = me("sbrk"), Xe = (i._emscripten_get_sbrk_ptr = me("emscripten_get_sbrk_ptr"), 
            i._emscripten_stack_init = function() {
              return (Xe = i._emscripten_stack_init = i.asm.emscripten_stack_init).apply(null, arguments);
            }), Qe = (i._emscripten_stack_get_free = function() {
              return (i._emscripten_stack_get_free = i.asm.emscripten_stack_get_free).apply(null, arguments);
            }, i._emscripten_stack_get_base = function() {
              return (Qe = i._emscripten_stack_get_base = i.asm.emscripten_stack_get_base).apply(null, arguments);
            }), Be = i._emscripten_stack_get_end = function() {
              return (Be = i._emscripten_stack_get_end = i.asm.emscripten_stack_get_end).apply(null, arguments);
            }, Ye = i.stackSave = me("stackSave"), ze = i.stackRestore = me("stackRestore"), We = i.stackAlloc = me("stackAlloc");
            function Ke(e) {
              this.name = "ExitStatus", this.message = "Program terminated with exit(" + e + ")", 
              this.status = e;
            }
            function Ve(e) {
              function r() {
                xe || (xe = !0, i.calledRun = !0, F || ($(), I(!oe), oe = !0, i.noFSInit || Ae.init.initialized || Ae.init(), 
                Ae.ignorePermissions = !1, Pe.init(), Te(te), t(i), i.onRuntimeInitialized && i.onRuntimeInitialized(), 
                I(!i._main, 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]'), 
                function() {
                  if ($(), i.postRun) for ("function" == typeof i.postRun && (i.postRun = [ i.postRun ]); i.postRun.length; ) e = i.postRun.shift(), 
                  re.unshift(e);
                  var e;
                  Te(re);
                }()));
              }
              e = e || s, ie > 0 || (Xe(), J(), function() {
                if (i.preRun) for ("function" == typeof i.preRun && (i.preRun = [ i.preRun ]); i.preRun.length; ) e = i.preRun.shift(), 
                ee.unshift(e);
                var e;
                Te(ee);
              }(), ie > 0 || (i.setStatus ? (i.setStatus("Running..."), setTimeout((function() {
                setTimeout((function() {
                  i.setStatus("");
                }), 1), r();
              }), 1)) : r(), $()));
            }
            if (Object.getOwnPropertyDescriptor(i, "intArrayFromString") || (i.intArrayFromString = () => Ee("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "intArrayToString") || (i.intArrayToString = () => Ee("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            i.ccall = k, i.cwrap = function(e, t, r, o) {
              return function() {
                return k(e, t, r, arguments);
              };
            }, i.setValue = b, i.getValue = v, Object.getOwnPropertyDescriptor(i, "allocate") || (i.allocate = () => Ee("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "UTF8ArrayToString") || (i.UTF8ArrayToString = () => Ee("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "UTF8ToString") || (i.UTF8ToString = () => Ee("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stringToUTF8Array") || (i.stringToUTF8Array = () => Ee("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stringToUTF8") || (i.stringToUTF8 = () => Ee("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "lengthBytesUTF8") || (i.lengthBytesUTF8 = () => Ee("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stackTrace") || (i.stackTrace = () => Ee("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "addOnPreRun") || (i.addOnPreRun = () => Ee("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "addOnInit") || (i.addOnInit = () => Ee("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "addOnPreMain") || (i.addOnPreMain = () => Ee("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "addOnExit") || (i.addOnExit = () => Ee("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "addOnPostRun") || (i.addOnPostRun = () => Ee("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeStringToMemory") || (i.writeStringToMemory = () => Ee("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeArrayToMemory") || (i.writeArrayToMemory = () => Ee("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeAsciiToMemory") || (i.writeAsciiToMemory = () => Ee("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "addRunDependency") || (i.addRunDependency = () => Ee("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "removeRunDependency") || (i.removeRunDependency = () => Ee("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "FS_createFolder") || (i.FS_createFolder = () => Ee("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "FS_createPath") || (i.FS_createPath = () => Ee("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "FS_createDataFile") || (i.FS_createDataFile = () => Ee("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "FS_createPreloadedFile") || (i.FS_createPreloadedFile = () => Ee("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "FS_createLazyFile") || (i.FS_createLazyFile = () => Ee("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "FS_createLink") || (i.FS_createLink = () => Ee("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "FS_createDevice") || (i.FS_createDevice = () => Ee("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "FS_unlink") || (i.FS_unlink = () => Ee("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you")), 
            Object.getOwnPropertyDescriptor(i, "getLEB") || (i.getLEB = () => Ee("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getFunctionTables") || (i.getFunctionTables = () => Ee("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "alignFunctionTables") || (i.alignFunctionTables = () => Ee("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerFunctions") || (i.registerFunctions = () => Ee("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "addFunction") || (i.addFunction = () => Ee("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "removeFunction") || (i.removeFunction = () => Ee("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getFuncWrapper") || (i.getFuncWrapper = () => Ee("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "prettyPrint") || (i.prettyPrint = () => Ee("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "dynCall") || (i.dynCall = () => Ee("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getCompilerSetting") || (i.getCompilerSetting = () => Ee("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "print") || (i.print = () => Ee("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "printErr") || (i.printErr = () => Ee("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getTempRet0") || (i.getTempRet0 = () => Ee("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "setTempRet0") || (i.setTempRet0 = () => Ee("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "callMain") || (i.callMain = () => Ee("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "abort") || (i.abort = () => Ee("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "keepRuntimeAlive") || (i.keepRuntimeAlive = () => Ee("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "zeroMemory") || (i.zeroMemory = () => Ee("'zeroMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stringToNewUTF8") || (i.stringToNewUTF8 = () => Ee("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "emscripten_realloc_buffer") || (i.emscripten_realloc_buffer = () => Ee("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "ENV") || (i.ENV = () => Ee("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "withStackSave") || (i.withStackSave = () => Ee("'withStackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "ERRNO_CODES") || (i.ERRNO_CODES = () => Ee("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "ERRNO_MESSAGES") || (i.ERRNO_MESSAGES = () => Ee("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "setErrNo") || (i.setErrNo = () => Ee("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "inetPton4") || (i.inetPton4 = () => Ee("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "inetNtop4") || (i.inetNtop4 = () => Ee("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "inetPton6") || (i.inetPton6 = () => Ee("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "inetNtop6") || (i.inetNtop6 = () => Ee("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "readSockaddr") || (i.readSockaddr = () => Ee("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeSockaddr") || (i.writeSockaddr = () => Ee("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "DNS") || (i.DNS = () => Ee("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getHostByName") || (i.getHostByName = () => Ee("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "Protocols") || (i.Protocols = () => Ee("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "Sockets") || (i.Sockets = () => Ee("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getRandomDevice") || (i.getRandomDevice = () => Ee("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "traverseStack") || (i.traverseStack = () => Ee("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "convertFrameToPC") || (i.convertFrameToPC = () => Ee("'convertFrameToPC' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "UNWIND_CACHE") || (i.UNWIND_CACHE = () => Ee("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "saveInUnwindCache") || (i.saveInUnwindCache = () => Ee("'saveInUnwindCache' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "convertPCtoSourceLocation") || (i.convertPCtoSourceLocation = () => Ee("'convertPCtoSourceLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "readAsmConstArgsArray") || (i.readAsmConstArgsArray = () => Ee("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "readAsmConstArgs") || (i.readAsmConstArgs = () => Ee("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "mainThreadEM_ASM") || (i.mainThreadEM_ASM = () => Ee("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "jstoi_q") || (i.jstoi_q = () => Ee("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "jstoi_s") || (i.jstoi_s = () => Ee("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getExecutableName") || (i.getExecutableName = () => Ee("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "listenOnce") || (i.listenOnce = () => Ee("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "autoResumeAudioContext") || (i.autoResumeAudioContext = () => Ee("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "dynCall") || (i.dynCall = () => Ee("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "callRuntimeCallbacks") || (i.callRuntimeCallbacks = () => Ee("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "wasmTableMirror") || (i.wasmTableMirror = () => Ee("'wasmTableMirror' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "setWasmTableEntry") || (i.setWasmTableEntry = () => Ee("'setWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getWasmTableEntry") || (i.getWasmTableEntry = () => Ee("'getWasmTableEntry' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "handleException") || (i.handleException = () => Ee("'handleException' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "runtimeKeepalivePush") || (i.runtimeKeepalivePush = () => Ee("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "runtimeKeepalivePop") || (i.runtimeKeepalivePop = () => Ee("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "callUserCallback") || (i.callUserCallback = () => Ee("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "maybeExit") || (i.maybeExit = () => Ee("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "safeSetTimeout") || (i.safeSetTimeout = () => Ee("'safeSetTimeout' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "asmjsMangle") || (i.asmjsMangle = () => Ee("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "asyncLoad") || (i.asyncLoad = () => Ee("'asyncLoad' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "alignMemory") || (i.alignMemory = () => Ee("'alignMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "mmapAlloc") || (i.mmapAlloc = () => Ee("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "reallyNegative") || (i.reallyNegative = () => Ee("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "unSign") || (i.unSign = () => Ee("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "reSign") || (i.reSign = () => Ee("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "formatString") || (i.formatString = () => Ee("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "PATH") || (i.PATH = () => Ee("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "PATH_FS") || (i.PATH_FS = () => Ee("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "SYSCALLS") || (i.SYSCALLS = () => Ee("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getSocketFromFD") || (i.getSocketFromFD = () => Ee("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getSocketAddress") || (i.getSocketAddress = () => Ee("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "JSEvents") || (i.JSEvents = () => Ee("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerKeyEventCallback") || (i.registerKeyEventCallback = () => Ee("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "specialHTMLTargets") || (i.specialHTMLTargets = () => Ee("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "maybeCStringToJsString") || (i.maybeCStringToJsString = () => Ee("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "findEventTarget") || (i.findEventTarget = () => Ee("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "findCanvasEventTarget") || (i.findCanvasEventTarget = () => Ee("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getBoundingClientRect") || (i.getBoundingClientRect = () => Ee("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillMouseEventData") || (i.fillMouseEventData = () => Ee("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerMouseEventCallback") || (i.registerMouseEventCallback = () => Ee("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerWheelEventCallback") || (i.registerWheelEventCallback = () => Ee("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerUiEventCallback") || (i.registerUiEventCallback = () => Ee("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerFocusEventCallback") || (i.registerFocusEventCallback = () => Ee("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillDeviceOrientationEventData") || (i.fillDeviceOrientationEventData = () => Ee("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerDeviceOrientationEventCallback") || (i.registerDeviceOrientationEventCallback = () => Ee("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillDeviceMotionEventData") || (i.fillDeviceMotionEventData = () => Ee("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerDeviceMotionEventCallback") || (i.registerDeviceMotionEventCallback = () => Ee("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "screenOrientation") || (i.screenOrientation = () => Ee("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillOrientationChangeEventData") || (i.fillOrientationChangeEventData = () => Ee("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerOrientationChangeEventCallback") || (i.registerOrientationChangeEventCallback = () => Ee("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillFullscreenChangeEventData") || (i.fillFullscreenChangeEventData = () => Ee("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerFullscreenChangeEventCallback") || (i.registerFullscreenChangeEventCallback = () => Ee("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerRestoreOldStyle") || (i.registerRestoreOldStyle = () => Ee("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "hideEverythingExceptGivenElement") || (i.hideEverythingExceptGivenElement = () => Ee("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "restoreHiddenElements") || (i.restoreHiddenElements = () => Ee("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "setLetterbox") || (i.setLetterbox = () => Ee("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "currentFullscreenStrategy") || (i.currentFullscreenStrategy = () => Ee("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "restoreOldWindowedStyle") || (i.restoreOldWindowedStyle = () => Ee("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "softFullscreenResizeWebGLRenderTarget") || (i.softFullscreenResizeWebGLRenderTarget = () => Ee("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "doRequestFullscreen") || (i.doRequestFullscreen = () => Ee("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillPointerlockChangeEventData") || (i.fillPointerlockChangeEventData = () => Ee("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerPointerlockChangeEventCallback") || (i.registerPointerlockChangeEventCallback = () => Ee("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerPointerlockErrorEventCallback") || (i.registerPointerlockErrorEventCallback = () => Ee("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "requestPointerLock") || (i.requestPointerLock = () => Ee("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillVisibilityChangeEventData") || (i.fillVisibilityChangeEventData = () => Ee("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerVisibilityChangeEventCallback") || (i.registerVisibilityChangeEventCallback = () => Ee("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerTouchEventCallback") || (i.registerTouchEventCallback = () => Ee("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillGamepadEventData") || (i.fillGamepadEventData = () => Ee("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerGamepadEventCallback") || (i.registerGamepadEventCallback = () => Ee("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerBeforeUnloadEventCallback") || (i.registerBeforeUnloadEventCallback = () => Ee("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "fillBatteryEventData") || (i.fillBatteryEventData = () => Ee("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "battery") || (i.battery = () => Ee("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "registerBatteryEventCallback") || (i.registerBatteryEventCallback = () => Ee("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "setCanvasElementSize") || (i.setCanvasElementSize = () => Ee("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getCanvasElementSize") || (i.getCanvasElementSize = () => Ee("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "demangle") || (i.demangle = () => Ee("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "demangleAll") || (i.demangleAll = () => Ee("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "jsStackTrace") || (i.jsStackTrace = () => Ee("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stackTrace") || (i.stackTrace = () => Ee("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getEnvStrings") || (i.getEnvStrings = () => Ee("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "checkWasiClock") || (i.checkWasiClock = () => Ee("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeI53ToI64") || (i.writeI53ToI64 = () => Ee("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeI53ToI64Clamped") || (i.writeI53ToI64Clamped = () => Ee("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeI53ToI64Signaling") || (i.writeI53ToI64Signaling = () => Ee("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeI53ToU64Clamped") || (i.writeI53ToU64Clamped = () => Ee("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "writeI53ToU64Signaling") || (i.writeI53ToU64Signaling = () => Ee("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "readI53FromI64") || (i.readI53FromI64 = () => Ee("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "readI53FromU64") || (i.readI53FromU64 = () => Ee("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "convertI32PairToI53") || (i.convertI32PairToI53 = () => Ee("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "convertU32PairToI53") || (i.convertU32PairToI53 = () => Ee("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "setImmediateWrapped") || (i.setImmediateWrapped = () => Ee("'setImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "clearImmediateWrapped") || (i.clearImmediateWrapped = () => Ee("'clearImmediateWrapped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "polyfillSetImmediate") || (i.polyfillSetImmediate = () => Ee("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "Browser") || (i.Browser = () => Ee("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "funcWrappers") || (i.funcWrappers = () => Ee("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "getFuncWrapper") || (i.getFuncWrapper = () => Ee("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "setMainLoop") || (i.setMainLoop = () => Ee("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "wget") || (i.wget = () => Ee("'wget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "FS") || (i.FS = () => Ee("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "MEMFS") || (i.MEMFS = () => Ee("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "TTY") || (i.TTY = () => Ee("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "PIPEFS") || (i.PIPEFS = () => Ee("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "SOCKFS") || (i.SOCKFS = () => Ee("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "_setNetworkCallback") || (i._setNetworkCallback = () => Ee("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "warnOnce") || (i.warnOnce = () => Ee("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stackSave") || (i.stackSave = () => Ee("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stackRestore") || (i.stackRestore = () => Ee("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stackAlloc") || (i.stackAlloc = () => Ee("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "AsciiToString") || (i.AsciiToString = () => Ee("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stringToAscii") || (i.stringToAscii = () => Ee("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "UTF16ToString") || (i.UTF16ToString = () => Ee("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stringToUTF16") || (i.stringToUTF16 = () => Ee("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "lengthBytesUTF16") || (i.lengthBytesUTF16 = () => Ee("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "UTF32ToString") || (i.UTF32ToString = () => Ee("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "stringToUTF32") || (i.stringToUTF32 = () => Ee("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "lengthBytesUTF32") || (i.lengthBytesUTF32 = () => Ee("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "allocateUTF8") || (i.allocateUTF8 = () => Ee("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            Object.getOwnPropertyDescriptor(i, "allocateUTF8OnStack") || (i.allocateUTF8OnStack = () => Ee("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)")), 
            i.writeStackCookie = J, i.checkStackCookie = $, Object.getOwnPropertyDescriptor(i, "ALLOC_NORMAL") || Object.defineProperty(i, "ALLOC_NORMAL", {
              configurable: !0,
              get: function() {
                Ee("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
              }
            }), Object.getOwnPropertyDescriptor(i, "ALLOC_STACK") || Object.defineProperty(i, "ALLOC_STACK", {
              configurable: !0,
              get: function() {
                Ee("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");
              }
            }), se = function e() {
              xe || Ve(), xe || (se = e);
            }, i.run = Ve, i.preInit) for ("function" == typeof i.preInit && (i.preInit = [ i.preInit ]); i.preInit.length > 0; ) i.preInit.pop()();
            return Ve(), e.ready;
          });
          e.exports = n;
        },
        727: e => {
          const t = [ {
            CRYPTO_PUBLICKEYBYTES: 896,
            CRYPTO_SECRETKEYBYTES: 2096,
            CRYPTO_BYTES: 1387
          }, {
            CRYPTO_PUBLICKEYBYTES: 1184,
            CRYPTO_SECRETKEYBYTES: 2800,
            CRYPTO_BYTES: 2044
          }, {
            CRYPTO_PUBLICKEYBYTES: 1472,
            CRYPTO_SECRETKEYBYTES: 3504,
            CRYPTO_BYTES: 2701
          }, {
            CRYPTO_PUBLICKEYBYTES: 1760,
            CRYPTO_SECRETKEYBYTES: 3856,
            CRYPTO_BYTES: 3366
          } ];
          e.exports = {
            DILITHIUM_PARAMS: t,
            generateKeys: function(e, r, o) {
              if (r < 0 || r > 3) return -1;
              const n = o ? o.length : 0, i = o ? e._malloc(n) : 0;
              o && e.HEAPU8.set(new Uint8Array(o), i);
              const a = t[r].CRYPTO_SECRETKEYBYTES, s = t[r].CRYPTO_PUBLICKEYBYTES, d = e._malloc(s), c = e._malloc(a), l = e.ccall("dilithium_keygen", "number", [ "number", "number", "number", "number", "number" ], [ d, c, r, i, n ]);
              let p, E;
              return 0 === l && (p = new Uint8Array(e.HEAPU8.subarray(d, d + s)), E = new Uint8Array(e.HEAPU8.subarray(c, c + a))), 
              i && e._free(i), e._free(d), e._free(c), {
                result: l,
                publicKey: p,
                privateKey: E
              };
            },
            sign: function(e, r, o, n) {
              if (n < 0 || n > 3) throw new Error("Invalid Dilithium kind");
              const i = t[n], a = i.CRYPTO_BYTES, s = r.length, d = e._malloc(s);
              e.HEAPU8.set(new Uint8Array(r), d);
              const c = o.length;
              if (c !== i.CRYPTO_SECRETKEYBYTES) throw new Error(`Invalid private key size. Expected: ${i.CRYPTO_SECRETKEYBYTES}, Provided: ${c}`);
              const l = e._malloc(c);
              e.HEAPU8.set(new Uint8Array(o), l);
              const p = a + s, E = e._malloc(p), u = e._malloc(4);
              e.setValue(u, p, "i32");
              const f = e.ccall("dilithium_sign", "number", [ "number", "number", "number", "number", "number", "number", "number" ], [ E, u, d, s, l, c, n ]), h = e.getValue(u, "i32"), O = new Uint8Array(e.HEAPU8.buffer, E, h), g = new Uint8Array(O);
              return e._free(d), e._free(l), e._free(E), e._free(u), {
                result: f,
                signature: g,
                signatureLength: h
              };
            },
            verify: function(e, r, o, n, i) {
              const a = t[i], s = a.CRYPTO_BYTES + o.length, d = a.CRYPTO_PUBLICKEYBYTES;
              if (r.length !== s) throw new Error(`Invalid signature size. Expected ${s}, got ${r.length}`);
              if (n.length !== d) throw new Error(`Invalid public key size. Expected ${d}, got ${n.length}`);
              const c = e._malloc(s), l = e._malloc(o.length), p = e._malloc(d);
              e.HEAPU8.set(new Uint8Array(r), c), e.HEAPU8.set(new Uint8Array(o), l), e.HEAPU8.set(new Uint8Array(n), p);
              try {
                return {
                  result: e.ccall("dilithium_verify", "number", [ "number", "number", "number", "bigint", "number", "number", "number" ], [ c, s, l, BigInt(o.length), p, d, i ]),
                  signatureLength: r.length,
                  expectedSignatureSize: s,
                  messageLength: o.length,
                  publicKeyLength: n.length,
                  expectedPublicKeySize: d,
                  kind: i
                };
              } finally {
                e._free(c), e._free(l), e._free(p);
              }
            }
          };
        },
        349: () => {},
        175: () => {},
        507: () => {}
      }, t = {};
      function r(o) {
        var n = t[o];
        if (void 0 !== n) return n.exports;
        var i = t[o] = {
          exports: {}
        };
        return e[o](i, i.exports, r), i.exports;
      }
      r.n = e => {
        var t = e && e.__esModule ? () => e.default : () => e;
        return r.d(t, {
          a: t
        }), t;
      }, r.d = (e, t) => {
        for (var o in t) r.o(t, o) && !r.o(e, o) && Object.defineProperty(e, o, {
          enumerable: !0,
          get: t[o]
        });
      }, r.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t);
      var o = {};
      r.d(o, {
        G: () => s
      });
      var n = r(944), i = r.n(n), a = r(727);
      const s = () => async function() {
        const e = chrome.runtime.getURL("dilithium.wasm");
        console.log(`Fetching wasm from ${e}`);
        const t = await fetch(e);
        return await t.arrayBuffer();
      }().then((e => i()({
        wasmBinary: e,
        locateFile: e => e.endsWith(".wasm") ? chrome.runtime.getURL("dilithium.wasm") : e
      }))).then((e => ({
        generateKeys: (t, r) => (0, a.generateKeys)(e, t, r),
        sign: (t, r, o) => (0, a.sign)(e, t, r, o),
        verify: (t, r, o, n) => (0, a.verify)(e, t, r, o, n),
        DILITHIUM_PARAMS: a.DILITHIUM_PARAMS
      })));
      var d = o.G;
    },
    7176(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var callBind = __webpack_require__(3126);
      var gOPD = __webpack_require__(5795);
      var hasProtoAccessor;
      try {
        hasProtoAccessor = [].__proto__ === Array.prototype;
      } catch (e) {
        if (!e || typeof e !== "object" || !("code" in e) || e.code !== "ERR_PROTO_ACCESS") {
          throw e;
        }
      }
      var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, "__proto__");
      var $Object = Object;
      var $getPrototypeOf = $Object.getPrototypeOf;
      module.exports = desc && typeof desc.get === "function" ? callBind([ desc.get ]) : typeof $getPrototypeOf === "function" ? function getDunder(value) {
        return $getPrototypeOf(value == null ? value : $Object(value));
      } : false;
    },
    6729(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var elliptic = exports;
      elliptic.version = __webpack_require__(1636).rE;
      elliptic.utils = __webpack_require__(7011);
      elliptic.rand = __webpack_require__(5037);
      elliptic.curve = __webpack_require__(894);
      elliptic.curves = __webpack_require__(480);
      elliptic.ec = __webpack_require__(7447);
      elliptic.eddsa = __webpack_require__(8650);
    },
    6677(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var BN = __webpack_require__(8490);
      var utils = __webpack_require__(7011);
      var getNAF = utils.getNAF;
      var getJSF = utils.getJSF;
      var assert = utils.assert;
      function BaseCurve(type, conf) {
        this.type = type;
        this.p = new BN(conf.p, 16);
        this.red = conf.prime ? BN.red(conf.prime) : BN.mont(this.p);
        this.zero = new BN(0).toRed(this.red);
        this.one = new BN(1).toRed(this.red);
        this.two = new BN(2).toRed(this.red);
        this.n = conf.n && new BN(conf.n, 16);
        this.g = conf.g && this.pointFromJSON(conf.g, conf.gRed);
        this._wnafT1 = new Array(4);
        this._wnafT2 = new Array(4);
        this._wnafT3 = new Array(4);
        this._wnafT4 = new Array(4);
        this._bitLength = this.n ? this.n.bitLength() : 0;
        var adjustCount = this.n && this.p.div(this.n);
        if (!adjustCount || adjustCount.cmpn(100) > 0) {
          this.redN = null;
        } else {
          this._maxwellTrick = true;
          this.redN = this.n.toRed(this.red);
        }
      }
      module.exports = BaseCurve;
      BaseCurve.prototype.point = function point() {
        throw new Error("Not implemented");
      };
      BaseCurve.prototype.validate = function validate() {
        throw new Error("Not implemented");
      };
      BaseCurve.prototype._fixedNafMul = function _fixedNafMul(p, k) {
        assert(p.precomputed);
        var doubles = p._getDoubles();
        var naf = getNAF(k, 1, this._bitLength);
        var I = (1 << doubles.step + 1) - (doubles.step % 2 === 0 ? 2 : 1);
        I /= 3;
        var repr = [];
        var j;
        var nafW;
        for (j = 0; j < naf.length; j += doubles.step) {
          nafW = 0;
          for (var l = j + doubles.step - 1; l >= j; l--) nafW = (nafW << 1) + naf[l];
          repr.push(nafW);
        }
        var a = this.jpoint(null, null, null);
        var b = this.jpoint(null, null, null);
        for (var i = I; i > 0; i--) {
          for (j = 0; j < repr.length; j++) {
            nafW = repr[j];
            if (nafW === i) b = b.mixedAdd(doubles.points[j]); else if (nafW === -i) b = b.mixedAdd(doubles.points[j].neg());
          }
          a = a.add(b);
        }
        return a.toP();
      };
      BaseCurve.prototype._wnafMul = function _wnafMul(p, k) {
        var w = 4;
        var nafPoints = p._getNAFPoints(w);
        w = nafPoints.wnd;
        var wnd = nafPoints.points;
        var naf = getNAF(k, w, this._bitLength);
        var acc = this.jpoint(null, null, null);
        for (var i = naf.length - 1; i >= 0; i--) {
          for (var l = 0; i >= 0 && naf[i] === 0; i--) l++;
          if (i >= 0) l++;
          acc = acc.dblp(l);
          if (i < 0) break;
          var z = naf[i];
          assert(z !== 0);
          if (p.type === "affine") {
            if (z > 0) acc = acc.mixedAdd(wnd[z - 1 >> 1]); else acc = acc.mixedAdd(wnd[-z - 1 >> 1].neg());
          } else {
            if (z > 0) acc = acc.add(wnd[z - 1 >> 1]); else acc = acc.add(wnd[-z - 1 >> 1].neg());
          }
        }
        return p.type === "affine" ? acc.toP() : acc;
      };
      BaseCurve.prototype._wnafMulAdd = function _wnafMulAdd(defW, points, coeffs, len, jacobianResult) {
        var wndWidth = this._wnafT1;
        var wnd = this._wnafT2;
        var naf = this._wnafT3;
        var max = 0;
        var i;
        var j;
        var p;
        for (i = 0; i < len; i++) {
          p = points[i];
          var nafPoints = p._getNAFPoints(defW);
          wndWidth[i] = nafPoints.wnd;
          wnd[i] = nafPoints.points;
        }
        for (i = len - 1; i >= 1; i -= 2) {
          var a = i - 1;
          var b = i;
          if (wndWidth[a] !== 1 || wndWidth[b] !== 1) {
            naf[a] = getNAF(coeffs[a], wndWidth[a], this._bitLength);
            naf[b] = getNAF(coeffs[b], wndWidth[b], this._bitLength);
            max = Math.max(naf[a].length, max);
            max = Math.max(naf[b].length, max);
            continue;
          }
          var comb = [ points[a], null, null, points[b] ];
          if (points[a].y.cmp(points[b].y) === 0) {
            comb[1] = points[a].add(points[b]);
            comb[2] = points[a].toJ().mixedAdd(points[b].neg());
          } else if (points[a].y.cmp(points[b].y.redNeg()) === 0) {
            comb[1] = points[a].toJ().mixedAdd(points[b]);
            comb[2] = points[a].add(points[b].neg());
          } else {
            comb[1] = points[a].toJ().mixedAdd(points[b]);
            comb[2] = points[a].toJ().mixedAdd(points[b].neg());
          }
          var index = [ -3, -1, -5, -7, 0, 7, 5, 1, 3 ];
          var jsf = getJSF(coeffs[a], coeffs[b]);
          max = Math.max(jsf[0].length, max);
          naf[a] = new Array(max);
          naf[b] = new Array(max);
          for (j = 0; j < max; j++) {
            var ja = jsf[0][j] | 0;
            var jb = jsf[1][j] | 0;
            naf[a][j] = index[(ja + 1) * 3 + (jb + 1)];
            naf[b][j] = 0;
            wnd[a] = comb;
          }
        }
        var acc = this.jpoint(null, null, null);
        var tmp = this._wnafT4;
        for (i = max; i >= 0; i--) {
          var k = 0;
          while (i >= 0) {
            var zero = true;
            for (j = 0; j < len; j++) {
              tmp[j] = naf[j][i] | 0;
              if (tmp[j] !== 0) zero = false;
            }
            if (!zero) break;
            k++;
            i--;
          }
          if (i >= 0) k++;
          acc = acc.dblp(k);
          if (i < 0) break;
          for (j = 0; j < len; j++) {
            var z = tmp[j];
            p;
            if (z === 0) continue; else if (z > 0) p = wnd[j][z - 1 >> 1]; else if (z < 0) p = wnd[j][-z - 1 >> 1].neg();
            if (p.type === "affine") acc = acc.mixedAdd(p); else acc = acc.add(p);
          }
        }
        for (i = 0; i < len; i++) wnd[i] = null;
        if (jacobianResult) return acc; else return acc.toP();
      };
      function BasePoint(curve, type) {
        this.curve = curve;
        this.type = type;
        this.precomputed = null;
      }
      BaseCurve.BasePoint = BasePoint;
      BasePoint.prototype.eq = function eq() {
        throw new Error("Not implemented");
      };
      BasePoint.prototype.validate = function validate() {
        return this.curve.validate(this);
      };
      BaseCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
        bytes = utils.toArray(bytes, enc);
        var len = this.p.byteLength();
        if ((bytes[0] === 4 || bytes[0] === 6 || bytes[0] === 7) && bytes.length - 1 === 2 * len) {
          if (bytes[0] === 6) assert(bytes[bytes.length - 1] % 2 === 0); else if (bytes[0] === 7) assert(bytes[bytes.length - 1] % 2 === 1);
          var res = this.point(bytes.slice(1, 1 + len), bytes.slice(1 + len, 1 + 2 * len));
          return res;
        } else if ((bytes[0] === 2 || bytes[0] === 3) && bytes.length - 1 === len) {
          return this.pointFromX(bytes.slice(1, 1 + len), bytes[0] === 3);
        }
        throw new Error("Unknown point format");
      };
      BasePoint.prototype.encodeCompressed = function encodeCompressed(enc) {
        return this.encode(enc, true);
      };
      BasePoint.prototype._encode = function _encode(compact) {
        var len = this.curve.p.byteLength();
        var x = this.getX().toArray("be", len);
        if (compact) return [ this.getY().isEven() ? 2 : 3 ].concat(x);
        return [ 4 ].concat(x, this.getY().toArray("be", len));
      };
      BasePoint.prototype.encode = function encode(enc, compact) {
        return utils.encode(this._encode(compact), enc);
      };
      BasePoint.prototype.precompute = function precompute(power) {
        if (this.precomputed) return this;
        var precomputed = {
          doubles: null,
          naf: null,
          beta: null
        };
        precomputed.naf = this._getNAFPoints(8);
        precomputed.doubles = this._getDoubles(4, power);
        precomputed.beta = this._getBeta();
        this.precomputed = precomputed;
        return this;
      };
      BasePoint.prototype._hasDoubles = function _hasDoubles(k) {
        if (!this.precomputed) return false;
        var doubles = this.precomputed.doubles;
        if (!doubles) return false;
        return doubles.points.length >= Math.ceil((k.bitLength() + 1) / doubles.step);
      };
      BasePoint.prototype._getDoubles = function _getDoubles(step, power) {
        if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;
        var doubles = [ this ];
        var acc = this;
        for (var i = 0; i < power; i += step) {
          for (var j = 0; j < step; j++) acc = acc.dbl();
          doubles.push(acc);
        }
        return {
          step,
          points: doubles
        };
      };
      BasePoint.prototype._getNAFPoints = function _getNAFPoints(wnd) {
        if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;
        var res = [ this ];
        var max = (1 << wnd) - 1;
        var dbl = max === 1 ? null : this.dbl();
        for (var i = 1; i < max; i++) res[i] = res[i - 1].add(dbl);
        return {
          wnd,
          points: res
        };
      };
      BasePoint.prototype._getBeta = function _getBeta() {
        return null;
      };
      BasePoint.prototype.dblp = function dblp(k) {
        var r = this;
        for (var i = 0; i < k; i++) r = r.dbl();
        return r;
      };
    },
    1298(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7011);
      var BN = __webpack_require__(8490);
      var inherits = __webpack_require__(6698);
      var Base = __webpack_require__(6677);
      var assert = utils.assert;
      function EdwardsCurve(conf) {
        this.twisted = (conf.a | 0) !== 1;
        this.mOneA = this.twisted && (conf.a | 0) === -1;
        this.extended = this.mOneA;
        Base.call(this, "edwards", conf);
        this.a = new BN(conf.a, 16).umod(this.red.m);
        this.a = this.a.toRed(this.red);
        this.c = new BN(conf.c, 16).toRed(this.red);
        this.c2 = this.c.redSqr();
        this.d = new BN(conf.d, 16).toRed(this.red);
        this.dd = this.d.redAdd(this.d);
        assert(!this.twisted || this.c.fromRed().cmpn(1) === 0);
        this.oneC = (conf.c | 0) === 1;
      }
      inherits(EdwardsCurve, Base);
      module.exports = EdwardsCurve;
      EdwardsCurve.prototype._mulA = function _mulA(num) {
        if (this.mOneA) return num.redNeg(); else return this.a.redMul(num);
      };
      EdwardsCurve.prototype._mulC = function _mulC(num) {
        if (this.oneC) return num; else return this.c.redMul(num);
      };
      EdwardsCurve.prototype.jpoint = function jpoint(x, y, z, t) {
        return this.point(x, y, z, t);
      };
      EdwardsCurve.prototype.pointFromX = function pointFromX(x, odd) {
        x = new BN(x, 16);
        if (!x.red) x = x.toRed(this.red);
        var x2 = x.redSqr();
        var rhs = this.c2.redSub(this.a.redMul(x2));
        var lhs = this.one.redSub(this.c2.redMul(this.d).redMul(x2));
        var y2 = rhs.redMul(lhs.redInvm());
        var y = y2.redSqrt();
        if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point");
        var isOdd = y.fromRed().isOdd();
        if (odd && !isOdd || !odd && isOdd) y = y.redNeg();
        return this.point(x, y);
      };
      EdwardsCurve.prototype.pointFromY = function pointFromY(y, odd) {
        y = new BN(y, 16);
        if (!y.red) y = y.toRed(this.red);
        var y2 = y.redSqr();
        var lhs = y2.redSub(this.c2);
        var rhs = y2.redMul(this.d).redMul(this.c2).redSub(this.a);
        var x2 = lhs.redMul(rhs.redInvm());
        if (x2.cmp(this.zero) === 0) {
          if (odd) throw new Error("invalid point"); else return this.point(this.zero, y);
        }
        var x = x2.redSqrt();
        if (x.redSqr().redSub(x2).cmp(this.zero) !== 0) throw new Error("invalid point");
        if (x.fromRed().isOdd() !== odd) x = x.redNeg();
        return this.point(x, y);
      };
      EdwardsCurve.prototype.validate = function validate(point) {
        if (point.isInfinity()) return true;
        point.normalize();
        var x2 = point.x.redSqr();
        var y2 = point.y.redSqr();
        var lhs = x2.redMul(this.a).redAdd(y2);
        var rhs = this.c2.redMul(this.one.redAdd(this.d.redMul(x2).redMul(y2)));
        return lhs.cmp(rhs) === 0;
      };
      function Point(curve, x, y, z, t) {
        Base.BasePoint.call(this, curve, "projective");
        if (x === null && y === null && z === null) {
          this.x = this.curve.zero;
          this.y = this.curve.one;
          this.z = this.curve.one;
          this.t = this.curve.zero;
          this.zOne = true;
        } else {
          this.x = new BN(x, 16);
          this.y = new BN(y, 16);
          this.z = z ? new BN(z, 16) : this.curve.one;
          this.t = t && new BN(t, 16);
          if (!this.x.red) this.x = this.x.toRed(this.curve.red);
          if (!this.y.red) this.y = this.y.toRed(this.curve.red);
          if (!this.z.red) this.z = this.z.toRed(this.curve.red);
          if (this.t && !this.t.red) this.t = this.t.toRed(this.curve.red);
          this.zOne = this.z === this.curve.one;
          if (this.curve.extended && !this.t) {
            this.t = this.x.redMul(this.y);
            if (!this.zOne) this.t = this.t.redMul(this.z.redInvm());
          }
        }
      }
      inherits(Point, Base.BasePoint);
      EdwardsCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
        return Point.fromJSON(this, obj);
      };
      EdwardsCurve.prototype.point = function point(x, y, z, t) {
        return new Point(this, x, y, z, t);
      };
      Point.fromJSON = function fromJSON(curve, obj) {
        return new Point(curve, obj[0], obj[1], obj[2]);
      };
      Point.prototype.inspect = function inspect() {
        if (this.isInfinity()) return "<EC Point Infinity>";
        return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
      };
      Point.prototype.isInfinity = function isInfinity() {
        return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0);
      };
      Point.prototype._extDbl = function _extDbl() {
        var a = this.x.redSqr();
        var b = this.y.redSqr();
        var c = this.z.redSqr();
        c = c.redIAdd(c);
        var d = this.curve._mulA(a);
        var e = this.x.redAdd(this.y).redSqr().redISub(a).redISub(b);
        var g = d.redAdd(b);
        var f = g.redSub(c);
        var h = d.redSub(b);
        var nx = e.redMul(f);
        var ny = g.redMul(h);
        var nt = e.redMul(h);
        var nz = f.redMul(g);
        return this.curve.point(nx, ny, nz, nt);
      };
      Point.prototype._projDbl = function _projDbl() {
        var b = this.x.redAdd(this.y).redSqr();
        var c = this.x.redSqr();
        var d = this.y.redSqr();
        var nx;
        var ny;
        var nz;
        var e;
        var h;
        var j;
        if (this.curve.twisted) {
          e = this.curve._mulA(c);
          var f = e.redAdd(d);
          if (this.zOne) {
            nx = b.redSub(c).redSub(d).redMul(f.redSub(this.curve.two));
            ny = f.redMul(e.redSub(d));
            nz = f.redSqr().redSub(f).redSub(f);
          } else {
            h = this.z.redSqr();
            j = f.redSub(h).redISub(h);
            nx = b.redSub(c).redISub(d).redMul(j);
            ny = f.redMul(e.redSub(d));
            nz = f.redMul(j);
          }
        } else {
          e = c.redAdd(d);
          h = this.curve._mulC(this.z).redSqr();
          j = e.redSub(h).redSub(h);
          nx = this.curve._mulC(b.redISub(e)).redMul(j);
          ny = this.curve._mulC(e).redMul(c.redISub(d));
          nz = e.redMul(j);
        }
        return this.curve.point(nx, ny, nz);
      };
      Point.prototype.dbl = function dbl() {
        if (this.isInfinity()) return this;
        if (this.curve.extended) return this._extDbl(); else return this._projDbl();
      };
      Point.prototype._extAdd = function _extAdd(p) {
        var a = this.y.redSub(this.x).redMul(p.y.redSub(p.x));
        var b = this.y.redAdd(this.x).redMul(p.y.redAdd(p.x));
        var c = this.t.redMul(this.curve.dd).redMul(p.t);
        var d = this.z.redMul(p.z.redAdd(p.z));
        var e = b.redSub(a);
        var f = d.redSub(c);
        var g = d.redAdd(c);
        var h = b.redAdd(a);
        var nx = e.redMul(f);
        var ny = g.redMul(h);
        var nt = e.redMul(h);
        var nz = f.redMul(g);
        return this.curve.point(nx, ny, nz, nt);
      };
      Point.prototype._projAdd = function _projAdd(p) {
        var a = this.z.redMul(p.z);
        var b = a.redSqr();
        var c = this.x.redMul(p.x);
        var d = this.y.redMul(p.y);
        var e = this.curve.d.redMul(c).redMul(d);
        var f = b.redSub(e);
        var g = b.redAdd(e);
        var tmp = this.x.redAdd(this.y).redMul(p.x.redAdd(p.y)).redISub(c).redISub(d);
        var nx = a.redMul(f).redMul(tmp);
        var ny;
        var nz;
        if (this.curve.twisted) {
          ny = a.redMul(g).redMul(d.redSub(this.curve._mulA(c)));
          nz = f.redMul(g);
        } else {
          ny = a.redMul(g).redMul(d.redSub(c));
          nz = this.curve._mulC(f).redMul(g);
        }
        return this.curve.point(nx, ny, nz);
      };
      Point.prototype.add = function add(p) {
        if (this.isInfinity()) return p;
        if (p.isInfinity()) return this;
        if (this.curve.extended) return this._extAdd(p); else return this._projAdd(p);
      };
      Point.prototype.mul = function mul(k) {
        if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k); else return this.curve._wnafMul(this, k);
      };
      Point.prototype.mulAdd = function mulAdd(k1, p, k2) {
        return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, false);
      };
      Point.prototype.jmulAdd = function jmulAdd(k1, p, k2) {
        return this.curve._wnafMulAdd(1, [ this, p ], [ k1, k2 ], 2, true);
      };
      Point.prototype.normalize = function normalize() {
        if (this.zOne) return this;
        var zi = this.z.redInvm();
        this.x = this.x.redMul(zi);
        this.y = this.y.redMul(zi);
        if (this.t) this.t = this.t.redMul(zi);
        this.z = this.curve.one;
        this.zOne = true;
        return this;
      };
      Point.prototype.neg = function neg() {
        return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg());
      };
      Point.prototype.getX = function getX() {
        this.normalize();
        return this.x.fromRed();
      };
      Point.prototype.getY = function getY() {
        this.normalize();
        return this.y.fromRed();
      };
      Point.prototype.eq = function eq(other) {
        return this === other || this.getX().cmp(other.getX()) === 0 && this.getY().cmp(other.getY()) === 0;
      };
      Point.prototype.eqXToP = function eqXToP(x) {
        var rx = x.toRed(this.curve.red).redMul(this.z);
        if (this.x.cmp(rx) === 0) return true;
        var xc = x.clone();
        var t = this.curve.redN.redMul(this.z);
        for (;;) {
          xc.iadd(this.curve.n);
          if (xc.cmp(this.curve.p) >= 0) return false;
          rx.redIAdd(t);
          if (this.x.cmp(rx) === 0) return true;
        }
      };
      Point.prototype.toP = Point.prototype.normalize;
      Point.prototype.mixedAdd = Point.prototype.add;
    },
    894(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var curve = exports;
      curve.base = __webpack_require__(6677);
      curve.short = __webpack_require__(9188);
      curve.mont = __webpack_require__(370);
      curve.edwards = __webpack_require__(1298);
    },
    370(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var BN = __webpack_require__(8490);
      var inherits = __webpack_require__(6698);
      var Base = __webpack_require__(6677);
      var utils = __webpack_require__(7011);
      function MontCurve(conf) {
        Base.call(this, "mont", conf);
        this.a = new BN(conf.a, 16).toRed(this.red);
        this.b = new BN(conf.b, 16).toRed(this.red);
        this.i4 = new BN(4).toRed(this.red).redInvm();
        this.two = new BN(2).toRed(this.red);
        this.a24 = this.i4.redMul(this.a.redAdd(this.two));
      }
      inherits(MontCurve, Base);
      module.exports = MontCurve;
      MontCurve.prototype.validate = function validate(point) {
        var x = point.normalize().x;
        var x2 = x.redSqr();
        var rhs = x2.redMul(x).redAdd(x2.redMul(this.a)).redAdd(x);
        var y = rhs.redSqrt();
        return y.redSqr().cmp(rhs) === 0;
      };
      function Point(curve, x, z) {
        Base.BasePoint.call(this, curve, "projective");
        if (x === null && z === null) {
          this.x = this.curve.one;
          this.z = this.curve.zero;
        } else {
          this.x = new BN(x, 16);
          this.z = new BN(z, 16);
          if (!this.x.red) this.x = this.x.toRed(this.curve.red);
          if (!this.z.red) this.z = this.z.toRed(this.curve.red);
        }
      }
      inherits(Point, Base.BasePoint);
      MontCurve.prototype.decodePoint = function decodePoint(bytes, enc) {
        return this.point(utils.toArray(bytes, enc), 1);
      };
      MontCurve.prototype.point = function point(x, z) {
        return new Point(this, x, z);
      };
      MontCurve.prototype.pointFromJSON = function pointFromJSON(obj) {
        return Point.fromJSON(this, obj);
      };
      Point.prototype.precompute = function precompute() {};
      Point.prototype._encode = function _encode() {
        return this.getX().toArray("be", this.curve.p.byteLength());
      };
      Point.fromJSON = function fromJSON(curve, obj) {
        return new Point(curve, obj[0], obj[1] || curve.one);
      };
      Point.prototype.inspect = function inspect() {
        if (this.isInfinity()) return "<EC Point Infinity>";
        return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">";
      };
      Point.prototype.isInfinity = function isInfinity() {
        return this.z.cmpn(0) === 0;
      };
      Point.prototype.dbl = function dbl() {
        var a = this.x.redAdd(this.z);
        var aa = a.redSqr();
        var b = this.x.redSub(this.z);
        var bb = b.redSqr();
        var c = aa.redSub(bb);
        var nx = aa.redMul(bb);
        var nz = c.redMul(bb.redAdd(this.curve.a24.redMul(c)));
        return this.curve.point(nx, nz);
      };
      Point.prototype.add = function add() {
        throw new Error("Not supported on Montgomery curve");
      };
      Point.prototype.diffAdd = function diffAdd(p, diff) {
        var a = this.x.redAdd(this.z);
        var b = this.x.redSub(this.z);
        var c = p.x.redAdd(p.z);
        var d = p.x.redSub(p.z);
        var da = d.redMul(a);
        var cb = c.redMul(b);
        var nx = diff.z.redMul(da.redAdd(cb).redSqr());
        var nz = diff.x.redMul(da.redISub(cb).redSqr());
        return this.curve.point(nx, nz);
      };
      Point.prototype.mul = function mul(k) {
        var t = k.clone();
        var a = this;
        var b = this.curve.point(null, null);
        var c = this;
        for (var bits = []; t.cmpn(0) !== 0; t.iushrn(1)) bits.push(t.andln(1));
        for (var i = bits.length - 1; i >= 0; i--) {
          if (bits[i] === 0) {
            a = a.diffAdd(b, c);
            b = b.dbl();
          } else {
            b = a.diffAdd(b, c);
            a = a.dbl();
          }
        }
        return b;
      };
      Point.prototype.mulAdd = function mulAdd() {
        throw new Error("Not supported on Montgomery curve");
      };
      Point.prototype.jumlAdd = function jumlAdd() {
        throw new Error("Not supported on Montgomery curve");
      };
      Point.prototype.eq = function eq(other) {
        return this.getX().cmp(other.getX()) === 0;
      };
      Point.prototype.normalize = function normalize() {
        this.x = this.x.redMul(this.z.redInvm());
        this.z = this.curve.one;
        return this;
      };
      Point.prototype.getX = function getX() {
        this.normalize();
        return this.x.fromRed();
      };
    },
    9188(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7011);
      var BN = __webpack_require__(8490);
      var inherits = __webpack_require__(6698);
      var Base = __webpack_require__(6677);
      var assert = utils.assert;
      function ShortCurve(conf) {
        Base.call(this, "short", conf);
        this.a = new BN(conf.a, 16).toRed(this.red);
        this.b = new BN(conf.b, 16).toRed(this.red);
        this.tinv = this.two.redInvm();
        this.zeroA = this.a.fromRed().cmpn(0) === 0;
        this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0;
        this.endo = this._getEndomorphism(conf);
        this._endoWnafT1 = new Array(4);
        this._endoWnafT2 = new Array(4);
      }
      inherits(ShortCurve, Base);
      module.exports = ShortCurve;
      ShortCurve.prototype._getEndomorphism = function _getEndomorphism(conf) {
        if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return;
        var beta;
        var lambda;
        if (conf.beta) {
          beta = new BN(conf.beta, 16).toRed(this.red);
        } else {
          var betas = this._getEndoRoots(this.p);
          beta = betas[0].cmp(betas[1]) < 0 ? betas[0] : betas[1];
          beta = beta.toRed(this.red);
        }
        if (conf.lambda) {
          lambda = new BN(conf.lambda, 16);
        } else {
          var lambdas = this._getEndoRoots(this.n);
          if (this.g.mul(lambdas[0]).x.cmp(this.g.x.redMul(beta)) === 0) {
            lambda = lambdas[0];
          } else {
            lambda = lambdas[1];
            assert(this.g.mul(lambda).x.cmp(this.g.x.redMul(beta)) === 0);
          }
        }
        var basis;
        if (conf.basis) {
          basis = conf.basis.map((function(vec) {
            return {
              a: new BN(vec.a, 16),
              b: new BN(vec.b, 16)
            };
          }));
        } else {
          basis = this._getEndoBasis(lambda);
        }
        return {
          beta,
          lambda,
          basis
        };
      };
      ShortCurve.prototype._getEndoRoots = function _getEndoRoots(num) {
        var red = num === this.p ? this.red : BN.mont(num);
        var tinv = new BN(2).toRed(red).redInvm();
        var ntinv = tinv.redNeg();
        var s = new BN(3).toRed(red).redNeg().redSqrt().redMul(tinv);
        var l1 = ntinv.redAdd(s).fromRed();
        var l2 = ntinv.redSub(s).fromRed();
        return [ l1, l2 ];
      };
      ShortCurve.prototype._getEndoBasis = function _getEndoBasis(lambda) {
        var aprxSqrt = this.n.ushrn(Math.floor(this.n.bitLength() / 2));
        var u = lambda;
        var v = this.n.clone();
        var x1 = new BN(1);
        var y1 = new BN(0);
        var x2 = new BN(0);
        var y2 = new BN(1);
        var a0;
        var b0;
        var a1;
        var b1;
        var a2;
        var b2;
        var prevR;
        var i = 0;
        var r;
        var x;
        while (u.cmpn(0) !== 0) {
          var q = v.div(u);
          r = v.sub(q.mul(u));
          x = x2.sub(q.mul(x1));
          var y = y2.sub(q.mul(y1));
          if (!a1 && r.cmp(aprxSqrt) < 0) {
            a0 = prevR.neg();
            b0 = x1;
            a1 = r.neg();
            b1 = x;
          } else if (a1 && ++i === 2) {
            break;
          }
          prevR = r;
          v = u;
          u = r;
          x2 = x1;
          x1 = x;
          y2 = y1;
          y1 = y;
        }
        a2 = r.neg();
        b2 = x;
        var len1 = a1.sqr().add(b1.sqr());
        var len2 = a2.sqr().add(b2.sqr());
        if (len2.cmp(len1) >= 0) {
          a2 = a0;
          b2 = b0;
        }
        if (a1.negative) {
          a1 = a1.neg();
          b1 = b1.neg();
        }
        if (a2.negative) {
          a2 = a2.neg();
          b2 = b2.neg();
        }
        return [ {
          a: a1,
          b: b1
        }, {
          a: a2,
          b: b2
        } ];
      };
      ShortCurve.prototype._endoSplit = function _endoSplit(k) {
        var basis = this.endo.basis;
        var v1 = basis[0];
        var v2 = basis[1];
        var c1 = v2.b.mul(k).divRound(this.n);
        var c2 = v1.b.neg().mul(k).divRound(this.n);
        var p1 = c1.mul(v1.a);
        var p2 = c2.mul(v2.a);
        var q1 = c1.mul(v1.b);
        var q2 = c2.mul(v2.b);
        var k1 = k.sub(p1).sub(p2);
        var k2 = q1.add(q2).neg();
        return {
          k1,
          k2
        };
      };
      ShortCurve.prototype.pointFromX = function pointFromX(x, odd) {
        x = new BN(x, 16);
        if (!x.red) x = x.toRed(this.red);
        var y2 = x.redSqr().redMul(x).redIAdd(x.redMul(this.a)).redIAdd(this.b);
        var y = y2.redSqrt();
        if (y.redSqr().redSub(y2).cmp(this.zero) !== 0) throw new Error("invalid point");
        var isOdd = y.fromRed().isOdd();
        if (odd && !isOdd || !odd && isOdd) y = y.redNeg();
        return this.point(x, y);
      };
      ShortCurve.prototype.validate = function validate(point) {
        if (point.inf) return true;
        var x = point.x;
        var y = point.y;
        var ax = this.a.redMul(x);
        var rhs = x.redSqr().redMul(x).redIAdd(ax).redIAdd(this.b);
        return y.redSqr().redISub(rhs).cmpn(0) === 0;
      };
      ShortCurve.prototype._endoWnafMulAdd = function _endoWnafMulAdd(points, coeffs, jacobianResult) {
        var npoints = this._endoWnafT1;
        var ncoeffs = this._endoWnafT2;
        for (var i = 0; i < points.length; i++) {
          var split = this._endoSplit(coeffs[i]);
          var p = points[i];
          var beta = p._getBeta();
          if (split.k1.negative) {
            split.k1.ineg();
            p = p.neg(true);
          }
          if (split.k2.negative) {
            split.k2.ineg();
            beta = beta.neg(true);
          }
          npoints[i * 2] = p;
          npoints[i * 2 + 1] = beta;
          ncoeffs[i * 2] = split.k1;
          ncoeffs[i * 2 + 1] = split.k2;
        }
        var res = this._wnafMulAdd(1, npoints, ncoeffs, i * 2, jacobianResult);
        for (var j = 0; j < i * 2; j++) {
          npoints[j] = null;
          ncoeffs[j] = null;
        }
        return res;
      };
      function Point(curve, x, y, isRed) {
        Base.BasePoint.call(this, curve, "affine");
        if (x === null && y === null) {
          this.x = null;
          this.y = null;
          this.inf = true;
        } else {
          this.x = new BN(x, 16);
          this.y = new BN(y, 16);
          if (isRed) {
            this.x.forceRed(this.curve.red);
            this.y.forceRed(this.curve.red);
          }
          if (!this.x.red) this.x = this.x.toRed(this.curve.red);
          if (!this.y.red) this.y = this.y.toRed(this.curve.red);
          this.inf = false;
        }
      }
      inherits(Point, Base.BasePoint);
      ShortCurve.prototype.point = function point(x, y, isRed) {
        return new Point(this, x, y, isRed);
      };
      ShortCurve.prototype.pointFromJSON = function pointFromJSON(obj, red) {
        return Point.fromJSON(this, obj, red);
      };
      Point.prototype._getBeta = function _getBeta() {
        if (!this.curve.endo) return;
        var pre = this.precomputed;
        if (pre && pre.beta) return pre.beta;
        var beta = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
        if (pre) {
          var curve = this.curve;
          var endoMul = function(p) {
            return curve.point(p.x.redMul(curve.endo.beta), p.y);
          };
          pre.beta = beta;
          beta.precomputed = {
            beta: null,
            naf: pre.naf && {
              wnd: pre.naf.wnd,
              points: pre.naf.points.map(endoMul)
            },
            doubles: pre.doubles && {
              step: pre.doubles.step,
              points: pre.doubles.points.map(endoMul)
            }
          };
        }
        return beta;
      };
      Point.prototype.toJSON = function toJSON() {
        if (!this.precomputed) return [ this.x, this.y ];
        return [ this.x, this.y, this.precomputed && {
          doubles: this.precomputed.doubles && {
            step: this.precomputed.doubles.step,
            points: this.precomputed.doubles.points.slice(1)
          },
          naf: this.precomputed.naf && {
            wnd: this.precomputed.naf.wnd,
            points: this.precomputed.naf.points.slice(1)
          }
        } ];
      };
      Point.fromJSON = function fromJSON(curve, obj, red) {
        if (typeof obj === "string") obj = JSON.parse(obj);
        var res = curve.point(obj[0], obj[1], red);
        if (!obj[2]) return res;
        function obj2point(obj) {
          return curve.point(obj[0], obj[1], red);
        }
        var pre = obj[2];
        res.precomputed = {
          beta: null,
          doubles: pre.doubles && {
            step: pre.doubles.step,
            points: [ res ].concat(pre.doubles.points.map(obj2point))
          },
          naf: pre.naf && {
            wnd: pre.naf.wnd,
            points: [ res ].concat(pre.naf.points.map(obj2point))
          }
        };
        return res;
      };
      Point.prototype.inspect = function inspect() {
        if (this.isInfinity()) return "<EC Point Infinity>";
        return "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + ">";
      };
      Point.prototype.isInfinity = function isInfinity() {
        return this.inf;
      };
      Point.prototype.add = function add(p) {
        if (this.inf) return p;
        if (p.inf) return this;
        if (this.eq(p)) return this.dbl();
        if (this.neg().eq(p)) return this.curve.point(null, null);
        if (this.x.cmp(p.x) === 0) return this.curve.point(null, null);
        var c = this.y.redSub(p.y);
        if (c.cmpn(0) !== 0) c = c.redMul(this.x.redSub(p.x).redInvm());
        var nx = c.redSqr().redISub(this.x).redISub(p.x);
        var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
        return this.curve.point(nx, ny);
      };
      Point.prototype.dbl = function dbl() {
        if (this.inf) return this;
        var ys1 = this.y.redAdd(this.y);
        if (ys1.cmpn(0) === 0) return this.curve.point(null, null);
        var a = this.curve.a;
        var x2 = this.x.redSqr();
        var dyinv = ys1.redInvm();
        var c = x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);
        var nx = c.redSqr().redISub(this.x.redAdd(this.x));
        var ny = c.redMul(this.x.redSub(nx)).redISub(this.y);
        return this.curve.point(nx, ny);
      };
      Point.prototype.getX = function getX() {
        return this.x.fromRed();
      };
      Point.prototype.getY = function getY() {
        return this.y.fromRed();
      };
      Point.prototype.mul = function mul(k) {
        k = new BN(k, 16);
        if (this.isInfinity()) return this; else if (this._hasDoubles(k)) return this.curve._fixedNafMul(this, k); else if (this.curve.endo) return this.curve._endoWnafMulAdd([ this ], [ k ]); else return this.curve._wnafMul(this, k);
      };
      Point.prototype.mulAdd = function mulAdd(k1, p2, k2) {
        var points = [ this, p2 ];
        var coeffs = [ k1, k2 ];
        if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs); else return this.curve._wnafMulAdd(1, points, coeffs, 2);
      };
      Point.prototype.jmulAdd = function jmulAdd(k1, p2, k2) {
        var points = [ this, p2 ];
        var coeffs = [ k1, k2 ];
        if (this.curve.endo) return this.curve._endoWnafMulAdd(points, coeffs, true); else return this.curve._wnafMulAdd(1, points, coeffs, 2, true);
      };
      Point.prototype.eq = function eq(p) {
        return this === p || this.inf === p.inf && (this.inf || this.x.cmp(p.x) === 0 && this.y.cmp(p.y) === 0);
      };
      Point.prototype.neg = function neg(_precompute) {
        if (this.inf) return this;
        var res = this.curve.point(this.x, this.y.redNeg());
        if (_precompute && this.precomputed) {
          var pre = this.precomputed;
          var negate = function(p) {
            return p.neg();
          };
          res.precomputed = {
            naf: pre.naf && {
              wnd: pre.naf.wnd,
              points: pre.naf.points.map(negate)
            },
            doubles: pre.doubles && {
              step: pre.doubles.step,
              points: pre.doubles.points.map(negate)
            }
          };
        }
        return res;
      };
      Point.prototype.toJ = function toJ() {
        if (this.inf) return this.curve.jpoint(null, null, null);
        var res = this.curve.jpoint(this.x, this.y, this.curve.one);
        return res;
      };
      function JPoint(curve, x, y, z) {
        Base.BasePoint.call(this, curve, "jacobian");
        if (x === null && y === null && z === null) {
          this.x = this.curve.one;
          this.y = this.curve.one;
          this.z = new BN(0);
        } else {
          this.x = new BN(x, 16);
          this.y = new BN(y, 16);
          this.z = new BN(z, 16);
        }
        if (!this.x.red) this.x = this.x.toRed(this.curve.red);
        if (!this.y.red) this.y = this.y.toRed(this.curve.red);
        if (!this.z.red) this.z = this.z.toRed(this.curve.red);
        this.zOne = this.z === this.curve.one;
      }
      inherits(JPoint, Base.BasePoint);
      ShortCurve.prototype.jpoint = function jpoint(x, y, z) {
        return new JPoint(this, x, y, z);
      };
      JPoint.prototype.toP = function toP() {
        if (this.isInfinity()) return this.curve.point(null, null);
        var zinv = this.z.redInvm();
        var zinv2 = zinv.redSqr();
        var ax = this.x.redMul(zinv2);
        var ay = this.y.redMul(zinv2).redMul(zinv);
        return this.curve.point(ax, ay);
      };
      JPoint.prototype.neg = function neg() {
        return this.curve.jpoint(this.x, this.y.redNeg(), this.z);
      };
      JPoint.prototype.add = function add(p) {
        if (this.isInfinity()) return p;
        if (p.isInfinity()) return this;
        var pz2 = p.z.redSqr();
        var z2 = this.z.redSqr();
        var u1 = this.x.redMul(pz2);
        var u2 = p.x.redMul(z2);
        var s1 = this.y.redMul(pz2.redMul(p.z));
        var s2 = p.y.redMul(z2.redMul(this.z));
        var h = u1.redSub(u2);
        var r = s1.redSub(s2);
        if (h.cmpn(0) === 0) {
          if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); else return this.dbl();
        }
        var h2 = h.redSqr();
        var h3 = h2.redMul(h);
        var v = u1.redMul(h2);
        var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
        var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
        var nz = this.z.redMul(p.z).redMul(h);
        return this.curve.jpoint(nx, ny, nz);
      };
      JPoint.prototype.mixedAdd = function mixedAdd(p) {
        if (this.isInfinity()) return p.toJ();
        if (p.isInfinity()) return this;
        var z2 = this.z.redSqr();
        var u1 = this.x;
        var u2 = p.x.redMul(z2);
        var s1 = this.y;
        var s2 = p.y.redMul(z2).redMul(this.z);
        var h = u1.redSub(u2);
        var r = s1.redSub(s2);
        if (h.cmpn(0) === 0) {
          if (r.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); else return this.dbl();
        }
        var h2 = h.redSqr();
        var h3 = h2.redMul(h);
        var v = u1.redMul(h2);
        var nx = r.redSqr().redIAdd(h3).redISub(v).redISub(v);
        var ny = r.redMul(v.redISub(nx)).redISub(s1.redMul(h3));
        var nz = this.z.redMul(h);
        return this.curve.jpoint(nx, ny, nz);
      };
      JPoint.prototype.dblp = function dblp(pow) {
        if (pow === 0) return this;
        if (this.isInfinity()) return this;
        if (!pow) return this.dbl();
        var i;
        if (this.curve.zeroA || this.curve.threeA) {
          var r = this;
          for (i = 0; i < pow; i++) r = r.dbl();
          return r;
        }
        var a = this.curve.a;
        var tinv = this.curve.tinv;
        var jx = this.x;
        var jy = this.y;
        var jz = this.z;
        var jz4 = jz.redSqr().redSqr();
        var jyd = jy.redAdd(jy);
        for (i = 0; i < pow; i++) {
          var jx2 = jx.redSqr();
          var jyd2 = jyd.redSqr();
          var jyd4 = jyd2.redSqr();
          var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
          var t1 = jx.redMul(jyd2);
          var nx = c.redSqr().redISub(t1.redAdd(t1));
          var t2 = t1.redISub(nx);
          var dny = c.redMul(t2);
          dny = dny.redIAdd(dny).redISub(jyd4);
          var nz = jyd.redMul(jz);
          if (i + 1 < pow) jz4 = jz4.redMul(jyd4);
          jx = nx;
          jz = nz;
          jyd = dny;
        }
        return this.curve.jpoint(jx, jyd.redMul(tinv), jz);
      };
      JPoint.prototype.dbl = function dbl() {
        if (this.isInfinity()) return this;
        if (this.curve.zeroA) return this._zeroDbl(); else if (this.curve.threeA) return this._threeDbl(); else return this._dbl();
      };
      JPoint.prototype._zeroDbl = function _zeroDbl() {
        var nx;
        var ny;
        var nz;
        if (this.zOne) {
          var xx = this.x.redSqr();
          var yy = this.y.redSqr();
          var yyyy = yy.redSqr();
          var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
          s = s.redIAdd(s);
          var m = xx.redAdd(xx).redIAdd(xx);
          var t = m.redSqr().redISub(s).redISub(s);
          var yyyy8 = yyyy.redIAdd(yyyy);
          yyyy8 = yyyy8.redIAdd(yyyy8);
          yyyy8 = yyyy8.redIAdd(yyyy8);
          nx = t;
          ny = m.redMul(s.redISub(t)).redISub(yyyy8);
          nz = this.y.redAdd(this.y);
        } else {
          var a = this.x.redSqr();
          var b = this.y.redSqr();
          var c = b.redSqr();
          var d = this.x.redAdd(b).redSqr().redISub(a).redISub(c);
          d = d.redIAdd(d);
          var e = a.redAdd(a).redIAdd(a);
          var f = e.redSqr();
          var c8 = c.redIAdd(c);
          c8 = c8.redIAdd(c8);
          c8 = c8.redIAdd(c8);
          nx = f.redISub(d).redISub(d);
          ny = e.redMul(d.redISub(nx)).redISub(c8);
          nz = this.y.redMul(this.z);
          nz = nz.redIAdd(nz);
        }
        return this.curve.jpoint(nx, ny, nz);
      };
      JPoint.prototype._threeDbl = function _threeDbl() {
        var nx;
        var ny;
        var nz;
        if (this.zOne) {
          var xx = this.x.redSqr();
          var yy = this.y.redSqr();
          var yyyy = yy.redSqr();
          var s = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
          s = s.redIAdd(s);
          var m = xx.redAdd(xx).redIAdd(xx).redIAdd(this.curve.a);
          var t = m.redSqr().redISub(s).redISub(s);
          nx = t;
          var yyyy8 = yyyy.redIAdd(yyyy);
          yyyy8 = yyyy8.redIAdd(yyyy8);
          yyyy8 = yyyy8.redIAdd(yyyy8);
          ny = m.redMul(s.redISub(t)).redISub(yyyy8);
          nz = this.y.redAdd(this.y);
        } else {
          var delta = this.z.redSqr();
          var gamma = this.y.redSqr();
          var beta = this.x.redMul(gamma);
          var alpha = this.x.redSub(delta).redMul(this.x.redAdd(delta));
          alpha = alpha.redAdd(alpha).redIAdd(alpha);
          var beta4 = beta.redIAdd(beta);
          beta4 = beta4.redIAdd(beta4);
          var beta8 = beta4.redAdd(beta4);
          nx = alpha.redSqr().redISub(beta8);
          nz = this.y.redAdd(this.z).redSqr().redISub(gamma).redISub(delta);
          var ggamma8 = gamma.redSqr();
          ggamma8 = ggamma8.redIAdd(ggamma8);
          ggamma8 = ggamma8.redIAdd(ggamma8);
          ggamma8 = ggamma8.redIAdd(ggamma8);
          ny = alpha.redMul(beta4.redISub(nx)).redISub(ggamma8);
        }
        return this.curve.jpoint(nx, ny, nz);
      };
      JPoint.prototype._dbl = function _dbl() {
        var a = this.curve.a;
        var jx = this.x;
        var jy = this.y;
        var jz = this.z;
        var jz4 = jz.redSqr().redSqr();
        var jx2 = jx.redSqr();
        var jy2 = jy.redSqr();
        var c = jx2.redAdd(jx2).redIAdd(jx2).redIAdd(a.redMul(jz4));
        var jxd4 = jx.redAdd(jx);
        jxd4 = jxd4.redIAdd(jxd4);
        var t1 = jxd4.redMul(jy2);
        var nx = c.redSqr().redISub(t1.redAdd(t1));
        var t2 = t1.redISub(nx);
        var jyd8 = jy2.redSqr();
        jyd8 = jyd8.redIAdd(jyd8);
        jyd8 = jyd8.redIAdd(jyd8);
        jyd8 = jyd8.redIAdd(jyd8);
        var ny = c.redMul(t2).redISub(jyd8);
        var nz = jy.redAdd(jy).redMul(jz);
        return this.curve.jpoint(nx, ny, nz);
      };
      JPoint.prototype.trpl = function trpl() {
        if (!this.curve.zeroA) return this.dbl().add(this);
        var xx = this.x.redSqr();
        var yy = this.y.redSqr();
        var zz = this.z.redSqr();
        var yyyy = yy.redSqr();
        var m = xx.redAdd(xx).redIAdd(xx);
        var mm = m.redSqr();
        var e = this.x.redAdd(yy).redSqr().redISub(xx).redISub(yyyy);
        e = e.redIAdd(e);
        e = e.redAdd(e).redIAdd(e);
        e = e.redISub(mm);
        var ee = e.redSqr();
        var t = yyyy.redIAdd(yyyy);
        t = t.redIAdd(t);
        t = t.redIAdd(t);
        t = t.redIAdd(t);
        var u = m.redIAdd(e).redSqr().redISub(mm).redISub(ee).redISub(t);
        var yyu4 = yy.redMul(u);
        yyu4 = yyu4.redIAdd(yyu4);
        yyu4 = yyu4.redIAdd(yyu4);
        var nx = this.x.redMul(ee).redISub(yyu4);
        nx = nx.redIAdd(nx);
        nx = nx.redIAdd(nx);
        var ny = this.y.redMul(u.redMul(t.redISub(u)).redISub(e.redMul(ee)));
        ny = ny.redIAdd(ny);
        ny = ny.redIAdd(ny);
        ny = ny.redIAdd(ny);
        var nz = this.z.redAdd(e).redSqr().redISub(zz).redISub(ee);
        return this.curve.jpoint(nx, ny, nz);
      };
      JPoint.prototype.mul = function mul(k, kbase) {
        k = new BN(k, kbase);
        return this.curve._wnafMul(this, k);
      };
      JPoint.prototype.eq = function eq(p) {
        if (p.type === "affine") return this.eq(p.toJ());
        if (this === p) return true;
        var z2 = this.z.redSqr();
        var pz2 = p.z.redSqr();
        if (this.x.redMul(pz2).redISub(p.x.redMul(z2)).cmpn(0) !== 0) return false;
        var z3 = z2.redMul(this.z);
        var pz3 = pz2.redMul(p.z);
        return this.y.redMul(pz3).redISub(p.y.redMul(z3)).cmpn(0) === 0;
      };
      JPoint.prototype.eqXToP = function eqXToP(x) {
        var zs = this.z.redSqr();
        var rx = x.toRed(this.curve.red).redMul(zs);
        if (this.x.cmp(rx) === 0) return true;
        var xc = x.clone();
        var t = this.curve.redN.redMul(zs);
        for (;;) {
          xc.iadd(this.curve.n);
          if (xc.cmp(this.curve.p) >= 0) return false;
          rx.redIAdd(t);
          if (this.x.cmp(rx) === 0) return true;
        }
      };
      JPoint.prototype.inspect = function inspect() {
        if (this.isInfinity()) return "<EC JPoint Infinity>";
        return "<EC JPoint x: " + this.x.toString(16, 2) + " y: " + this.y.toString(16, 2) + " z: " + this.z.toString(16, 2) + ">";
      };
      JPoint.prototype.isInfinity = function isInfinity() {
        return this.z.cmpn(0) === 0;
      };
    },
    480(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var curves = exports;
      var hash = __webpack_require__(7952);
      var curve = __webpack_require__(894);
      var utils = __webpack_require__(7011);
      var assert = utils.assert;
      function PresetCurve(options) {
        if (options.type === "short") this.curve = new curve.short(options); else if (options.type === "edwards") this.curve = new curve.edwards(options); else this.curve = new curve.mont(options);
        this.g = this.curve.g;
        this.n = this.curve.n;
        this.hash = options.hash;
        assert(this.g.validate(), "Invalid curve");
        assert(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O");
      }
      curves.PresetCurve = PresetCurve;
      function defineCurve(name, options) {
        Object.defineProperty(curves, name, {
          configurable: true,
          enumerable: true,
          get: function() {
            var curve = new PresetCurve(options);
            Object.defineProperty(curves, name, {
              configurable: true,
              enumerable: true,
              value: curve
            });
            return curve;
          }
        });
      }
      defineCurve("p192", {
        type: "short",
        prime: "p192",
        p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",
        a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",
        b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",
        n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",
        hash: hash.sha256,
        gRed: false,
        g: [ "188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811" ]
      });
      defineCurve("p224", {
        type: "short",
        prime: "p224",
        p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",
        a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",
        b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",
        n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",
        hash: hash.sha256,
        gRed: false,
        g: [ "b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34" ]
      });
      defineCurve("p256", {
        type: "short",
        prime: null,
        p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",
        a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",
        b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",
        n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",
        hash: hash.sha256,
        gRed: false,
        g: [ "6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5" ]
      });
      defineCurve("p384", {
        type: "short",
        prime: null,
        p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff " + "fffffffe ffffffff 00000000 00000000 ffffffff",
        a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff " + "fffffffe ffffffff 00000000 00000000 fffffffc",
        b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f " + "5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",
        n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 " + "f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",
        hash: hash.sha384,
        gRed: false,
        g: [ "aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 " + "5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 " + "0a60b1ce 1d7e819d 7a431d7c 90ea0e5f" ]
      });
      defineCurve("p521", {
        type: "short",
        prime: null,
        p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff " + "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff " + "ffffffff ffffffff ffffffff ffffffff ffffffff",
        a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff " + "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff " + "ffffffff ffffffff ffffffff ffffffff fffffffc",
        b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b " + "99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd " + "3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",
        n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff " + "ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 " + "f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",
        hash: hash.sha512,
        gRed: false,
        g: [ "000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 " + "053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 " + "a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 " + "579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 " + "3fad0761 353c7086 a272c240 88be9476 9fd16650" ]
      });
      defineCurve("curve25519", {
        type: "mont",
        prime: "p25519",
        p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
        a: "76d06",
        b: "1",
        n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
        hash: hash.sha256,
        gRed: false,
        g: [ "9" ]
      });
      defineCurve("ed25519", {
        type: "edwards",
        prime: "p25519",
        p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
        a: "-1",
        c: "1",
        d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",
        n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
        hash: hash.sha256,
        gRed: false,
        g: [ "216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658" ]
      });
      var pre;
      try {
        pre = __webpack_require__(4011);
      } catch (e) {
        pre = undefined;
      }
      defineCurve("secp256k1", {
        type: "short",
        prime: "k256",
        p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",
        a: "0",
        b: "7",
        n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",
        h: "1",
        hash: hash.sha256,
        beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",
        lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",
        basis: [ {
          a: "3086d221a7d46bcde86c90e49284eb15",
          b: "-e4437ed6010e88286f547fa90abfe4c3"
        }, {
          a: "114ca50f7a8e2f3f657c1108d9d44cfd8",
          b: "3086d221a7d46bcde86c90e49284eb15"
        } ],
        gRed: false,
        g: [ "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", pre ]
      });
    },
    7447(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var BN = __webpack_require__(8490);
      var HmacDRBG = __webpack_require__(2723);
      var utils = __webpack_require__(7011);
      var curves = __webpack_require__(480);
      var rand = __webpack_require__(5037);
      var assert = utils.assert;
      var KeyPair = __webpack_require__(1200);
      var Signature = __webpack_require__(8545);
      function EC(options) {
        if (!(this instanceof EC)) return new EC(options);
        if (typeof options === "string") {
          assert(Object.prototype.hasOwnProperty.call(curves, options), "Unknown curve " + options);
          options = curves[options];
        }
        if (options instanceof curves.PresetCurve) options = {
          curve: options
        };
        this.curve = options.curve.curve;
        this.n = this.curve.n;
        this.nh = this.n.ushrn(1);
        this.g = this.curve.g;
        this.g = options.curve.g;
        this.g.precompute(options.curve.n.bitLength() + 1);
        this.hash = options.hash || options.curve.hash;
      }
      module.exports = EC;
      EC.prototype.keyPair = function keyPair(options) {
        return new KeyPair(this, options);
      };
      EC.prototype.keyFromPrivate = function keyFromPrivate(priv, enc) {
        return KeyPair.fromPrivate(this, priv, enc);
      };
      EC.prototype.keyFromPublic = function keyFromPublic(pub, enc) {
        return KeyPair.fromPublic(this, pub, enc);
      };
      EC.prototype.genKeyPair = function genKeyPair(options) {
        if (!options) options = {};
        var drbg = new HmacDRBG({
          hash: this.hash,
          pers: options.pers,
          persEnc: options.persEnc || "utf8",
          entropy: options.entropy || rand(this.hash.hmacStrength),
          entropyEnc: options.entropy && options.entropyEnc || "utf8",
          nonce: this.n.toArray()
        });
        var bytes = this.n.byteLength();
        var ns2 = this.n.sub(new BN(2));
        for (;;) {
          var priv = new BN(drbg.generate(bytes));
          if (priv.cmp(ns2) > 0) continue;
          priv.iaddn(1);
          return this.keyFromPrivate(priv);
        }
      };
      EC.prototype._truncateToN = function _truncateToN(msg, truncOnly, bitLength) {
        var byteLength;
        if (BN.isBN(msg) || typeof msg === "number") {
          msg = new BN(msg, 16);
          byteLength = msg.byteLength();
        } else if (typeof msg === "object") {
          byteLength = msg.length;
          msg = new BN(msg, 16);
        } else {
          var str = msg.toString();
          byteLength = str.length + 1 >>> 1;
          msg = new BN(str, 16);
        }
        if (typeof bitLength !== "number") {
          bitLength = byteLength * 8;
        }
        var delta = bitLength - this.n.bitLength();
        if (delta > 0) msg = msg.ushrn(delta);
        if (!truncOnly && msg.cmp(this.n) >= 0) return msg.sub(this.n); else return msg;
      };
      EC.prototype.sign = function sign(msg, key, enc, options) {
        if (typeof enc === "object") {
          options = enc;
          enc = null;
        }
        if (!options) options = {};
        if (typeof msg !== "string" && typeof msg !== "number" && !BN.isBN(msg)) {
          assert(typeof msg === "object" && msg && typeof msg.length === "number", "Expected message to be an array-like, a hex string, or a BN instance");
          assert(msg.length >>> 0 === msg.length);
          for (var i = 0; i < msg.length; i++) assert((msg[i] & 255) === msg[i]);
        }
        key = this.keyFromPrivate(key, enc);
        msg = this._truncateToN(msg, false, options.msgBitLength);
        assert(!msg.isNeg(), "Can not sign a negative message");
        var bytes = this.n.byteLength();
        var bkey = key.getPrivate().toArray("be", bytes);
        var nonce = msg.toArray("be", bytes);
        assert(new BN(nonce).eq(msg), "Can not sign message");
        var drbg = new HmacDRBG({
          hash: this.hash,
          entropy: bkey,
          nonce,
          pers: options.pers,
          persEnc: options.persEnc || "utf8"
        });
        var ns1 = this.n.sub(new BN(1));
        for (var iter = 0; ;iter++) {
          var k = options.k ? options.k(iter) : new BN(drbg.generate(this.n.byteLength()));
          k = this._truncateToN(k, true);
          if (k.cmpn(1) <= 0 || k.cmp(ns1) >= 0) continue;
          var kp = this.g.mul(k);
          if (kp.isInfinity()) continue;
          var kpX = kp.getX();
          var r = kpX.umod(this.n);
          if (r.cmpn(0) === 0) continue;
          var s = k.invm(this.n).mul(r.mul(key.getPrivate()).iadd(msg));
          s = s.umod(this.n);
          if (s.cmpn(0) === 0) continue;
          var recoveryParam = (kp.getY().isOdd() ? 1 : 0) | (kpX.cmp(r) !== 0 ? 2 : 0);
          if (options.canonical && s.cmp(this.nh) > 0) {
            s = this.n.sub(s);
            recoveryParam ^= 1;
          }
          return new Signature({
            r,
            s,
            recoveryParam
          });
        }
      };
      EC.prototype.verify = function verify(msg, signature, key, enc, options) {
        if (!options) options = {};
        msg = this._truncateToN(msg, false, options.msgBitLength);
        key = this.keyFromPublic(key, enc);
        signature = new Signature(signature, "hex");
        var r = signature.r;
        var s = signature.s;
        if (r.cmpn(1) < 0 || r.cmp(this.n) >= 0) return false;
        if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return false;
        var sinv = s.invm(this.n);
        var u1 = sinv.mul(msg).umod(this.n);
        var u2 = sinv.mul(r).umod(this.n);
        var p;
        if (!this.curve._maxwellTrick) {
          p = this.g.mulAdd(u1, key.getPublic(), u2);
          if (p.isInfinity()) return false;
          return p.getX().umod(this.n).cmp(r) === 0;
        }
        p = this.g.jmulAdd(u1, key.getPublic(), u2);
        if (p.isInfinity()) return false;
        return p.eqXToP(r);
      };
      EC.prototype.recoverPubKey = function(msg, signature, j, enc) {
        assert((3 & j) === j, "The recovery param is more than two bits");
        signature = new Signature(signature, enc);
        var n = this.n;
        var e = new BN(msg);
        var r = signature.r;
        var s = signature.s;
        var isYOdd = j & 1;
        var isSecondKey = j >> 1;
        if (r.cmp(this.curve.p.umod(this.curve.n)) >= 0 && isSecondKey) throw new Error("Unable to find sencond key candinate");
        if (isSecondKey) r = this.curve.pointFromX(r.add(this.curve.n), isYOdd); else r = this.curve.pointFromX(r, isYOdd);
        var rInv = signature.r.invm(n);
        var s1 = n.sub(e).mul(rInv).umod(n);
        var s2 = s.mul(rInv).umod(n);
        return this.g.mulAdd(s1, r, s2);
      };
      EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) {
        signature = new Signature(signature, enc);
        if (signature.recoveryParam !== null) return signature.recoveryParam;
        for (var i = 0; i < 4; i++) {
          var Qprime;
          try {
            Qprime = this.recoverPubKey(e, signature, i);
          } catch (e) {
            continue;
          }
          if (Qprime.eq(Q)) return i;
        }
        throw new Error("Unable to find valid recovery factor");
      };
    },
    1200(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var BN = __webpack_require__(8490);
      var utils = __webpack_require__(7011);
      var assert = utils.assert;
      function KeyPair(ec, options) {
        this.ec = ec;
        this.priv = null;
        this.pub = null;
        if (options.priv) this._importPrivate(options.priv, options.privEnc);
        if (options.pub) this._importPublic(options.pub, options.pubEnc);
      }
      module.exports = KeyPair;
      KeyPair.fromPublic = function fromPublic(ec, pub, enc) {
        if (pub instanceof KeyPair) return pub;
        return new KeyPair(ec, {
          pub,
          pubEnc: enc
        });
      };
      KeyPair.fromPrivate = function fromPrivate(ec, priv, enc) {
        if (priv instanceof KeyPair) return priv;
        return new KeyPair(ec, {
          priv,
          privEnc: enc
        });
      };
      KeyPair.prototype.validate = function validate() {
        var pub = this.getPublic();
        if (pub.isInfinity()) return {
          result: false,
          reason: "Invalid public key"
        };
        if (!pub.validate()) return {
          result: false,
          reason: "Public key is not a point"
        };
        if (!pub.mul(this.ec.curve.n).isInfinity()) return {
          result: false,
          reason: "Public key * N != O"
        };
        return {
          result: true,
          reason: null
        };
      };
      KeyPair.prototype.getPublic = function getPublic(compact, enc) {
        if (typeof compact === "string") {
          enc = compact;
          compact = null;
        }
        if (!this.pub) this.pub = this.ec.g.mul(this.priv);
        if (!enc) return this.pub;
        return this.pub.encode(enc, compact);
      };
      KeyPair.prototype.getPrivate = function getPrivate(enc) {
        if (enc === "hex") return this.priv.toString(16, 2); else return this.priv;
      };
      KeyPair.prototype._importPrivate = function _importPrivate(key, enc) {
        this.priv = new BN(key, enc || 16);
        this.priv = this.priv.umod(this.ec.curve.n);
      };
      KeyPair.prototype._importPublic = function _importPublic(key, enc) {
        if (key.x || key.y) {
          if (this.ec.curve.type === "mont") {
            assert(key.x, "Need x coordinate");
          } else if (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") {
            assert(key.x && key.y, "Need both x and y coordinate");
          }
          this.pub = this.ec.curve.point(key.x, key.y);
          return;
        }
        this.pub = this.ec.curve.decodePoint(key, enc);
      };
      KeyPair.prototype.derive = function derive(pub) {
        if (!pub.validate()) {
          assert(pub.validate(), "public point not validated");
        }
        return pub.mul(this.priv).getX();
      };
      KeyPair.prototype.sign = function sign(msg, enc, options) {
        return this.ec.sign(msg, this, enc, options);
      };
      KeyPair.prototype.verify = function verify(msg, signature, options) {
        return this.ec.verify(msg, signature, this, undefined, options);
      };
      KeyPair.prototype.inspect = function inspect() {
        return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >";
      };
    },
    8545(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var BN = __webpack_require__(8490);
      var utils = __webpack_require__(7011);
      var assert = utils.assert;
      function Signature(options, enc) {
        if (options instanceof Signature) return options;
        if (this._importDER(options, enc)) return;
        assert(options.r && options.s, "Signature without r or s");
        this.r = new BN(options.r, 16);
        this.s = new BN(options.s, 16);
        if (options.recoveryParam === undefined) this.recoveryParam = null; else this.recoveryParam = options.recoveryParam;
      }
      module.exports = Signature;
      function Position() {
        this.place = 0;
      }
      function getLength(buf, p) {
        var initial = buf[p.place++];
        if (!(initial & 128)) {
          return initial;
        }
        var octetLen = initial & 15;
        if (octetLen === 0 || octetLen > 4) {
          return false;
        }
        if (buf[p.place] === 0) {
          return false;
        }
        var val = 0;
        for (var i = 0, off = p.place; i < octetLen; i++, off++) {
          val <<= 8;
          val |= buf[off];
          val >>>= 0;
        }
        if (val <= 127) {
          return false;
        }
        p.place = off;
        return val;
      }
      function rmPadding(buf) {
        var i = 0;
        var len = buf.length - 1;
        while (!buf[i] && !(buf[i + 1] & 128) && i < len) {
          i++;
        }
        if (i === 0) {
          return buf;
        }
        return buf.slice(i);
      }
      Signature.prototype._importDER = function _importDER(data, enc) {
        data = utils.toArray(data, enc);
        var p = new Position;
        if (data[p.place++] !== 48) {
          return false;
        }
        var len = getLength(data, p);
        if (len === false) {
          return false;
        }
        if (len + p.place !== data.length) {
          return false;
        }
        if (data[p.place++] !== 2) {
          return false;
        }
        var rlen = getLength(data, p);
        if (rlen === false) {
          return false;
        }
        if ((data[p.place] & 128) !== 0) {
          return false;
        }
        var r = data.slice(p.place, rlen + p.place);
        p.place += rlen;
        if (data[p.place++] !== 2) {
          return false;
        }
        var slen = getLength(data, p);
        if (slen === false) {
          return false;
        }
        if (data.length !== slen + p.place) {
          return false;
        }
        if ((data[p.place] & 128) !== 0) {
          return false;
        }
        var s = data.slice(p.place, slen + p.place);
        if (r[0] === 0) {
          if (r[1] & 128) {
            r = r.slice(1);
          } else {
            return false;
          }
        }
        if (s[0] === 0) {
          if (s[1] & 128) {
            s = s.slice(1);
          } else {
            return false;
          }
        }
        this.r = new BN(r);
        this.s = new BN(s);
        this.recoveryParam = null;
        return true;
      };
      function constructLength(arr, len) {
        if (len < 128) {
          arr.push(len);
          return;
        }
        var octets = 1 + (Math.log(len) / Math.LN2 >>> 3);
        arr.push(octets | 128);
        while (--octets) {
          arr.push(len >>> (octets << 3) & 255);
        }
        arr.push(len);
      }
      Signature.prototype.toDER = function toDER(enc) {
        var r = this.r.toArray();
        var s = this.s.toArray();
        if (r[0] & 128) r = [ 0 ].concat(r);
        if (s[0] & 128) s = [ 0 ].concat(s);
        r = rmPadding(r);
        s = rmPadding(s);
        while (!s[0] && !(s[1] & 128)) {
          s = s.slice(1);
        }
        var arr = [ 2 ];
        constructLength(arr, r.length);
        arr = arr.concat(r);
        arr.push(2);
        constructLength(arr, s.length);
        var backHalf = arr.concat(s);
        var res = [ 48 ];
        constructLength(res, backHalf.length);
        res = res.concat(backHalf);
        return utils.encode(res, enc);
      };
    },
    8650(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var hash = __webpack_require__(7952);
      var curves = __webpack_require__(480);
      var utils = __webpack_require__(7011);
      var assert = utils.assert;
      var parseBytes = utils.parseBytes;
      var KeyPair = __webpack_require__(6661);
      var Signature = __webpack_require__(220);
      function EDDSA(curve) {
        assert(curve === "ed25519", "only tested with ed25519 so far");
        if (!(this instanceof EDDSA)) return new EDDSA(curve);
        curve = curves[curve].curve;
        this.curve = curve;
        this.g = curve.g;
        this.g.precompute(curve.n.bitLength() + 1);
        this.pointClass = curve.point().constructor;
        this.encodingLength = Math.ceil(curve.n.bitLength() / 8);
        this.hash = hash.sha512;
      }
      module.exports = EDDSA;
      EDDSA.prototype.sign = function sign(message, secret) {
        message = parseBytes(message);
        var key = this.keyFromSecret(secret);
        var r = this.hashInt(key.messagePrefix(), message);
        var R = this.g.mul(r);
        var Rencoded = this.encodePoint(R);
        var s_ = this.hashInt(Rencoded, key.pubBytes(), message).mul(key.priv());
        var S = r.add(s_).umod(this.curve.n);
        return this.makeSignature({
          R,
          S,
          Rencoded
        });
      };
      EDDSA.prototype.verify = function verify(message, sig, pub) {
        message = parseBytes(message);
        sig = this.makeSignature(sig);
        if (sig.S().gte(sig.eddsa.curve.n) || sig.S().isNeg()) {
          return false;
        }
        var key = this.keyFromPublic(pub);
        var h = this.hashInt(sig.Rencoded(), key.pubBytes(), message);
        var SG = this.g.mul(sig.S());
        var RplusAh = sig.R().add(key.pub().mul(h));
        return RplusAh.eq(SG);
      };
      EDDSA.prototype.hashInt = function hashInt() {
        var hash = this.hash();
        for (var i = 0; i < arguments.length; i++) hash.update(arguments[i]);
        return utils.intFromLE(hash.digest()).umod(this.curve.n);
      };
      EDDSA.prototype.keyFromPublic = function keyFromPublic(pub) {
        return KeyPair.fromPublic(this, pub);
      };
      EDDSA.prototype.keyFromSecret = function keyFromSecret(secret) {
        return KeyPair.fromSecret(this, secret);
      };
      EDDSA.prototype.makeSignature = function makeSignature(sig) {
        if (sig instanceof Signature) return sig;
        return new Signature(this, sig);
      };
      EDDSA.prototype.encodePoint = function encodePoint(point) {
        var enc = point.getY().toArray("le", this.encodingLength);
        enc[this.encodingLength - 1] |= point.getX().isOdd() ? 128 : 0;
        return enc;
      };
      EDDSA.prototype.decodePoint = function decodePoint(bytes) {
        bytes = utils.parseBytes(bytes);
        var lastIx = bytes.length - 1;
        var normed = bytes.slice(0, lastIx).concat(bytes[lastIx] & ~128);
        var xIsOdd = (bytes[lastIx] & 128) !== 0;
        var y = utils.intFromLE(normed);
        return this.curve.pointFromY(y, xIsOdd);
      };
      EDDSA.prototype.encodeInt = function encodeInt(num) {
        return num.toArray("le", this.encodingLength);
      };
      EDDSA.prototype.decodeInt = function decodeInt(bytes) {
        return utils.intFromLE(bytes);
      };
      EDDSA.prototype.isPoint = function isPoint(val) {
        return val instanceof this.pointClass;
      };
    },
    6661(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7011);
      var assert = utils.assert;
      var parseBytes = utils.parseBytes;
      var cachedProperty = utils.cachedProperty;
      function KeyPair(eddsa, params) {
        this.eddsa = eddsa;
        this._secret = parseBytes(params.secret);
        if (eddsa.isPoint(params.pub)) this._pub = params.pub; else this._pubBytes = parseBytes(params.pub);
      }
      KeyPair.fromPublic = function fromPublic(eddsa, pub) {
        if (pub instanceof KeyPair) return pub;
        return new KeyPair(eddsa, {
          pub
        });
      };
      KeyPair.fromSecret = function fromSecret(eddsa, secret) {
        if (secret instanceof KeyPair) return secret;
        return new KeyPair(eddsa, {
          secret
        });
      };
      KeyPair.prototype.secret = function secret() {
        return this._secret;
      };
      cachedProperty(KeyPair, "pubBytes", (function pubBytes() {
        return this.eddsa.encodePoint(this.pub());
      }));
      cachedProperty(KeyPair, "pub", (function pub() {
        if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes);
        return this.eddsa.g.mul(this.priv());
      }));
      cachedProperty(KeyPair, "privBytes", (function privBytes() {
        var eddsa = this.eddsa;
        var hash = this.hash();
        var lastIx = eddsa.encodingLength - 1;
        var a = hash.slice(0, eddsa.encodingLength);
        a[0] &= 248;
        a[lastIx] &= 127;
        a[lastIx] |= 64;
        return a;
      }));
      cachedProperty(KeyPair, "priv", (function priv() {
        return this.eddsa.decodeInt(this.privBytes());
      }));
      cachedProperty(KeyPair, "hash", (function hash() {
        return this.eddsa.hash().update(this.secret()).digest();
      }));
      cachedProperty(KeyPair, "messagePrefix", (function messagePrefix() {
        return this.hash().slice(this.eddsa.encodingLength);
      }));
      KeyPair.prototype.sign = function sign(message) {
        assert(this._secret, "KeyPair can only verify");
        return this.eddsa.sign(message, this);
      };
      KeyPair.prototype.verify = function verify(message, sig) {
        return this.eddsa.verify(message, sig, this);
      };
      KeyPair.prototype.getSecret = function getSecret(enc) {
        assert(this._secret, "KeyPair is public only");
        return utils.encode(this.secret(), enc);
      };
      KeyPair.prototype.getPublic = function getPublic(enc) {
        return utils.encode(this.pubBytes(), enc);
      };
      module.exports = KeyPair;
    },
    220(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var BN = __webpack_require__(8490);
      var utils = __webpack_require__(7011);
      var assert = utils.assert;
      var cachedProperty = utils.cachedProperty;
      var parseBytes = utils.parseBytes;
      function Signature(eddsa, sig) {
        this.eddsa = eddsa;
        if (typeof sig !== "object") sig = parseBytes(sig);
        if (Array.isArray(sig)) {
          assert(sig.length === eddsa.encodingLength * 2, "Signature has invalid size");
          sig = {
            R: sig.slice(0, eddsa.encodingLength),
            S: sig.slice(eddsa.encodingLength)
          };
        }
        assert(sig.R && sig.S, "Signature without R or S");
        if (eddsa.isPoint(sig.R)) this._R = sig.R;
        if (sig.S instanceof BN) this._S = sig.S;
        this._Rencoded = Array.isArray(sig.R) ? sig.R : sig.Rencoded;
        this._Sencoded = Array.isArray(sig.S) ? sig.S : sig.Sencoded;
      }
      cachedProperty(Signature, "S", (function S() {
        return this.eddsa.decodeInt(this.Sencoded());
      }));
      cachedProperty(Signature, "R", (function R() {
        return this.eddsa.decodePoint(this.Rencoded());
      }));
      cachedProperty(Signature, "Rencoded", (function Rencoded() {
        return this.eddsa.encodePoint(this.R());
      }));
      cachedProperty(Signature, "Sencoded", (function Sencoded() {
        return this.eddsa.encodeInt(this.S());
      }));
      Signature.prototype.toBytes = function toBytes() {
        return this.Rencoded().concat(this.Sencoded());
      };
      Signature.prototype.toHex = function toHex() {
        return utils.encode(this.toBytes(), "hex").toUpperCase();
      };
      module.exports = Signature;
    },
    4011(module) {
      module.exports = {
        doubles: {
          step: 4,
          points: [ [ "e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821" ], [ "8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf" ], [ "175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695" ], [ "363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9" ], [ "8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36" ], [ "723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f" ], [ "eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999" ], [ "100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09" ], [ "e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d" ], [ "feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088" ], [ "da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d" ], [ "53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8" ], [ "8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a" ], [ "385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453" ], [ "6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160" ], [ "3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0" ], [ "85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6" ], [ "948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589" ], [ "6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17" ], [ "e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda" ], [ "e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd" ], [ "213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2" ], [ "4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6" ], [ "fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f" ], [ "76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01" ], [ "c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3" ], [ "d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f" ], [ "b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7" ], [ "e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78" ], [ "a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1" ], [ "90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150" ], [ "8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82" ], [ "e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc" ], [ "8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b" ], [ "e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51" ], [ "b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45" ], [ "d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120" ], [ "324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84" ], [ "4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d" ], [ "9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d" ], [ "6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8" ], [ "a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8" ], [ "7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac" ], [ "928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f" ], [ "85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962" ], [ "ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907" ], [ "827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec" ], [ "eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d" ], [ "e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414" ], [ "1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd" ], [ "146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0" ], [ "fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811" ], [ "da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1" ], [ "a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c" ], [ "174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73" ], [ "959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd" ], [ "d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405" ], [ "64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589" ], [ "8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e" ], [ "13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27" ], [ "bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1" ], [ "8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482" ], [ "8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945" ], [ "dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573" ], [ "f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82" ] ]
        },
        naf: {
          wnd: 7,
          points: [ [ "f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672" ], [ "2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6" ], [ "5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da" ], [ "acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37" ], [ "774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b" ], [ "f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81" ], [ "d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58" ], [ "defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77" ], [ "2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a" ], [ "352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c" ], [ "2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67" ], [ "9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402" ], [ "daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55" ], [ "c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482" ], [ "6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82" ], [ "1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396" ], [ "605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49" ], [ "62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf" ], [ "80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a" ], [ "7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7" ], [ "d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933" ], [ "49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a" ], [ "77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6" ], [ "f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37" ], [ "463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e" ], [ "f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6" ], [ "caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476" ], [ "2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40" ], [ "7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61" ], [ "754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683" ], [ "e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5" ], [ "186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b" ], [ "df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417" ], [ "5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868" ], [ "290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a" ], [ "af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6" ], [ "766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996" ], [ "59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e" ], [ "f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d" ], [ "7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2" ], [ "948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e" ], [ "7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437" ], [ "3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311" ], [ "d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4" ], [ "1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575" ], [ "733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d" ], [ "15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d" ], [ "a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629" ], [ "e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06" ], [ "311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374" ], [ "34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee" ], [ "f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1" ], [ "d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b" ], [ "32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661" ], [ "7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6" ], [ "ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e" ], [ "16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d" ], [ "eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc" ], [ "78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4" ], [ "494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c" ], [ "a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b" ], [ "c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913" ], [ "841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154" ], [ "5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865" ], [ "36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc" ], [ "336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224" ], [ "8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e" ], [ "1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6" ], [ "85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511" ], [ "29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b" ], [ "a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2" ], [ "4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c" ], [ "d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3" ], [ "ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d" ], [ "af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700" ], [ "e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4" ], [ "591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196" ], [ "11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4" ], [ "3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257" ], [ "cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13" ], [ "c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096" ], [ "c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38" ], [ "a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f" ], [ "347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448" ], [ "da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a" ], [ "c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4" ], [ "4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437" ], [ "3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7" ], [ "cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d" ], [ "b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a" ], [ "d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54" ], [ "48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77" ], [ "dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517" ], [ "6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10" ], [ "e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125" ], [ "eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e" ], [ "13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1" ], [ "ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2" ], [ "b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423" ], [ "ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8" ], [ "8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758" ], [ "52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375" ], [ "e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d" ], [ "7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec" ], [ "5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0" ], [ "32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c" ], [ "e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4" ], [ "8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f" ], [ "4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649" ], [ "3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826" ], [ "674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5" ], [ "d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87" ], [ "30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b" ], [ "be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc" ], [ "93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c" ], [ "b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f" ], [ "d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a" ], [ "d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46" ], [ "463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f" ], [ "7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03" ], [ "74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08" ], [ "30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8" ], [ "9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373" ], [ "176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3" ], [ "75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8" ], [ "809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1" ], [ "1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9" ] ]
        }
      };
    },
    7011(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var utils = exports;
      var BN = __webpack_require__(8490);
      var minAssert = __webpack_require__(3349);
      var minUtils = __webpack_require__(4367);
      utils.assert = minAssert;
      utils.toArray = minUtils.toArray;
      utils.zero2 = minUtils.zero2;
      utils.toHex = minUtils.toHex;
      utils.encode = minUtils.encode;
      function getNAF(num, w, bits) {
        var naf = new Array(Math.max(num.bitLength(), bits) + 1);
        var i;
        for (i = 0; i < naf.length; i += 1) {
          naf[i] = 0;
        }
        var ws = 1 << w + 1;
        var k = num.clone();
        for (i = 0; i < naf.length; i++) {
          var z;
          var mod = k.andln(ws - 1);
          if (k.isOdd()) {
            if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod; else z = mod;
            k.isubn(z);
          } else {
            z = 0;
          }
          naf[i] = z;
          k.iushrn(1);
        }
        return naf;
      }
      utils.getNAF = getNAF;
      function getJSF(k1, k2) {
        var jsf = [ [], [] ];
        k1 = k1.clone();
        k2 = k2.clone();
        var d1 = 0;
        var d2 = 0;
        var m8;
        while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) {
          var m14 = k1.andln(3) + d1 & 3;
          var m24 = k2.andln(3) + d2 & 3;
          if (m14 === 3) m14 = -1;
          if (m24 === 3) m24 = -1;
          var u1;
          if ((m14 & 1) === 0) {
            u1 = 0;
          } else {
            m8 = k1.andln(7) + d1 & 7;
            if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14; else u1 = m14;
          }
          jsf[0].push(u1);
          var u2;
          if ((m24 & 1) === 0) {
            u2 = 0;
          } else {
            m8 = k2.andln(7) + d2 & 7;
            if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24; else u2 = m24;
          }
          jsf[1].push(u2);
          if (2 * d1 === u1 + 1) d1 = 1 - d1;
          if (2 * d2 === u2 + 1) d2 = 1 - d2;
          k1.iushrn(1);
          k2.iushrn(1);
        }
        return jsf;
      }
      utils.getJSF = getJSF;
      function cachedProperty(obj, name, computer) {
        var key = "_" + name;
        obj.prototype[name] = function cachedProperty() {
          return this[key] !== undefined ? this[key] : this[key] = computer.call(this);
        };
      }
      utils.cachedProperty = cachedProperty;
      function parseBytes(bytes) {
        return typeof bytes === "string" ? utils.toArray(bytes, "hex") : bytes;
      }
      utils.parseBytes = parseBytes;
      function intFromLE(bytes) {
        return new BN(bytes, "hex", "le");
      }
      utils.intFromLE = intFromLE;
    },
    8490(module, __unused_webpack_exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      (function(module, exports) {
        "use strict";
        function assert(val, msg) {
          if (!val) throw new Error(msg || "Assertion failed");
        }
        function inherits(ctor, superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {};
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor;
          ctor.prototype.constructor = ctor;
        }
        function BN(number, base, endian) {
          if (BN.isBN(number)) {
            return number;
          }
          this.negative = 0;
          this.words = null;
          this.length = 0;
          this.red = null;
          if (number !== null) {
            if (base === "le" || base === "be") {
              endian = base;
              base = 10;
            }
            this._init(number || 0, base || 10, endian || "be");
          }
        }
        if (typeof module === "object") {
          module.exports = BN;
        } else {
          exports.BN = BN;
        }
        BN.BN = BN;
        BN.wordSize = 26;
        var Buffer;
        try {
          if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
            Buffer = window.Buffer;
          } else {
            Buffer = __webpack_require__(9368).Buffer;
          }
        } catch (e) {}
        BN.isBN = function isBN(num) {
          if (num instanceof BN) {
            return true;
          }
          return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
        };
        BN.max = function max(left, right) {
          if (left.cmp(right) > 0) return left;
          return right;
        };
        BN.min = function min(left, right) {
          if (left.cmp(right) < 0) return left;
          return right;
        };
        BN.prototype._init = function init(number, base, endian) {
          if (typeof number === "number") {
            return this._initNumber(number, base, endian);
          }
          if (typeof number === "object") {
            return this._initArray(number, base, endian);
          }
          if (base === "hex") {
            base = 16;
          }
          assert(base === (base | 0) && base >= 2 && base <= 36);
          number = number.toString().replace(/\s+/g, "");
          var start = 0;
          if (number[0] === "-") {
            start++;
            this.negative = 1;
          }
          if (start < number.length) {
            if (base === 16) {
              this._parseHex(number, start, endian);
            } else {
              this._parseBase(number, base, start);
              if (endian === "le") {
                this._initArray(this.toArray(), base, endian);
              }
            }
          }
        };
        BN.prototype._initNumber = function _initNumber(number, base, endian) {
          if (number < 0) {
            this.negative = 1;
            number = -number;
          }
          if (number < 67108864) {
            this.words = [ number & 67108863 ];
            this.length = 1;
          } else if (number < 4503599627370496) {
            this.words = [ number & 67108863, number / 67108864 & 67108863 ];
            this.length = 2;
          } else {
            assert(number < 9007199254740992);
            this.words = [ number & 67108863, number / 67108864 & 67108863, 1 ];
            this.length = 3;
          }
          if (endian !== "le") return;
          this._initArray(this.toArray(), base, endian);
        };
        BN.prototype._initArray = function _initArray(number, base, endian) {
          assert(typeof number.length === "number");
          if (number.length <= 0) {
            this.words = [ 0 ];
            this.length = 1;
            return this;
          }
          this.length = Math.ceil(number.length / 3);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var j, w;
          var off = 0;
          if (endian === "be") {
            for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
              w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          } else if (endian === "le") {
            for (i = 0, j = 0; i < number.length; i += 3) {
              w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          }
          return this.strip();
        };
        function parseHex4Bits(string, index) {
          var c = string.charCodeAt(index);
          if (c >= 65 && c <= 70) {
            return c - 55;
          } else if (c >= 97 && c <= 102) {
            return c - 87;
          } else {
            return c - 48 & 15;
          }
        }
        function parseHexByte(string, lowerBound, index) {
          var r = parseHex4Bits(string, index);
          if (index - 1 >= lowerBound) {
            r |= parseHex4Bits(string, index - 1) << 4;
          }
          return r;
        }
        BN.prototype._parseHex = function _parseHex(number, start, endian) {
          this.length = Math.ceil((number.length - start) / 6);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var off = 0;
          var j = 0;
          var w;
          if (endian === "be") {
            for (i = number.length - 1; i >= start; i -= 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          } else {
            var parseLength = number.length - start;
            for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          }
          this.strip();
        };
        function parseBase(str, start, end, mul) {
          var r = 0;
          var len = Math.min(str.length, end);
          for (var i = start; i < len; i++) {
            var c = str.charCodeAt(i) - 48;
            r *= mul;
            if (c >= 49) {
              r += c - 49 + 10;
            } else if (c >= 17) {
              r += c - 17 + 10;
            } else {
              r += c;
            }
          }
          return r;
        }
        BN.prototype._parseBase = function _parseBase(number, base, start) {
          this.words = [ 0 ];
          this.length = 1;
          for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
            limbLen++;
          }
          limbLen--;
          limbPow = limbPow / base | 0;
          var total = number.length - start;
          var mod = total % limbLen;
          var end = Math.min(total, total - mod) + start;
          var word = 0;
          for (var i = start; i < end; i += limbLen) {
            word = parseBase(number, i, i + limbLen, base);
            this.imuln(limbPow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          if (mod !== 0) {
            var pow = 1;
            word = parseBase(number, i, number.length, base);
            for (i = 0; i < mod; i++) {
              pow *= base;
            }
            this.imuln(pow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          this.strip();
        };
        BN.prototype.copy = function copy(dest) {
          dest.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            dest.words[i] = this.words[i];
          }
          dest.length = this.length;
          dest.negative = this.negative;
          dest.red = this.red;
        };
        BN.prototype.clone = function clone() {
          var r = new BN(null);
          this.copy(r);
          return r;
        };
        BN.prototype._expand = function _expand(size) {
          while (this.length < size) {
            this.words[this.length++] = 0;
          }
          return this;
        };
        BN.prototype.strip = function strip() {
          while (this.length > 1 && this.words[this.length - 1] === 0) {
            this.length--;
          }
          return this._normSign();
        };
        BN.prototype._normSign = function _normSign() {
          if (this.length === 1 && this.words[0] === 0) {
            this.negative = 0;
          }
          return this;
        };
        BN.prototype.inspect = function inspect() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
        };
        var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ];
        var groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];
        var groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ];
        BN.prototype.toString = function toString(base, padding) {
          base = base || 10;
          padding = padding | 0 || 1;
          var out;
          if (base === 16 || base === "hex") {
            out = "";
            var off = 0;
            var carry = 0;
            for (var i = 0; i < this.length; i++) {
              var w = this.words[i];
              var word = ((w << off | carry) & 16777215).toString(16);
              carry = w >>> 24 - off & 16777215;
              off += 2;
              if (off >= 26) {
                off -= 26;
                i--;
              }
              if (carry !== 0 || i !== this.length - 1) {
                out = zeros[6 - word.length] + word + out;
              } else {
                out = word + out;
              }
            }
            if (carry !== 0) {
              out = carry.toString(16) + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          if (base === (base | 0) && base >= 2 && base <= 36) {
            var groupSize = groupSizes[base];
            var groupBase = groupBases[base];
            out = "";
            var c = this.clone();
            c.negative = 0;
            while (!c.isZero()) {
              var r = c.modn(groupBase).toString(base);
              c = c.idivn(groupBase);
              if (!c.isZero()) {
                out = zeros[groupSize - r.length] + r + out;
              } else {
                out = r + out;
              }
            }
            if (this.isZero()) {
              out = "0" + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          assert(false, "Base should be between 2 and 36");
        };
        BN.prototype.toNumber = function toNumber() {
          var ret = this.words[0];
          if (this.length === 2) {
            ret += this.words[1] * 67108864;
          } else if (this.length === 3 && this.words[2] === 1) {
            ret += 4503599627370496 + this.words[1] * 67108864;
          } else if (this.length > 2) {
            assert(false, "Number can only safely store up to 53 bits");
          }
          return this.negative !== 0 ? -ret : ret;
        };
        BN.prototype.toJSON = function toJSON() {
          return this.toString(16);
        };
        BN.prototype.toBuffer = function toBuffer(endian, length) {
          assert(typeof Buffer !== "undefined");
          return this.toArrayLike(Buffer, endian, length);
        };
        BN.prototype.toArray = function toArray(endian, length) {
          return this.toArrayLike(Array, endian, length);
        };
        BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
          var byteLength = this.byteLength();
          var reqLength = length || Math.max(1, byteLength);
          assert(byteLength <= reqLength, "byte array longer than desired length");
          assert(reqLength > 0, "Requested array length <= 0");
          this.strip();
          var littleEndian = endian === "le";
          var res = new ArrayType(reqLength);
          var b, i;
          var q = this.clone();
          if (!littleEndian) {
            for (i = 0; i < reqLength - byteLength; i++) {
              res[i] = 0;
            }
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[reqLength - i - 1] = b;
            }
          } else {
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[i] = b;
            }
            for (;i < reqLength; i++) {
              res[i] = 0;
            }
          }
          return res;
        };
        if (Math.clz32) {
          BN.prototype._countBits = function _countBits(w) {
            return 32 - Math.clz32(w);
          };
        } else {
          BN.prototype._countBits = function _countBits(w) {
            var t = w;
            var r = 0;
            if (t >= 4096) {
              r += 13;
              t >>>= 13;
            }
            if (t >= 64) {
              r += 7;
              t >>>= 7;
            }
            if (t >= 8) {
              r += 4;
              t >>>= 4;
            }
            if (t >= 2) {
              r += 2;
              t >>>= 2;
            }
            return r + t;
          };
        }
        BN.prototype._zeroBits = function _zeroBits(w) {
          if (w === 0) return 26;
          var t = w;
          var r = 0;
          if ((t & 8191) === 0) {
            r += 13;
            t >>>= 13;
          }
          if ((t & 127) === 0) {
            r += 7;
            t >>>= 7;
          }
          if ((t & 15) === 0) {
            r += 4;
            t >>>= 4;
          }
          if ((t & 3) === 0) {
            r += 2;
            t >>>= 2;
          }
          if ((t & 1) === 0) {
            r++;
          }
          return r;
        };
        BN.prototype.bitLength = function bitLength() {
          var w = this.words[this.length - 1];
          var hi = this._countBits(w);
          return (this.length - 1) * 26 + hi;
        };
        function toBitArray(num) {
          var w = new Array(num.bitLength());
          for (var bit = 0; bit < w.length; bit++) {
            var off = bit / 26 | 0;
            var wbit = bit % 26;
            w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
          }
          return w;
        }
        BN.prototype.zeroBits = function zeroBits() {
          if (this.isZero()) return 0;
          var r = 0;
          for (var i = 0; i < this.length; i++) {
            var b = this._zeroBits(this.words[i]);
            r += b;
            if (b !== 26) break;
          }
          return r;
        };
        BN.prototype.byteLength = function byteLength() {
          return Math.ceil(this.bitLength() / 8);
        };
        BN.prototype.toTwos = function toTwos(width) {
          if (this.negative !== 0) {
            return this.abs().inotn(width).iaddn(1);
          }
          return this.clone();
        };
        BN.prototype.fromTwos = function fromTwos(width) {
          if (this.testn(width - 1)) {
            return this.notn(width).iaddn(1).ineg();
          }
          return this.clone();
        };
        BN.prototype.isNeg = function isNeg() {
          return this.negative !== 0;
        };
        BN.prototype.neg = function neg() {
          return this.clone().ineg();
        };
        BN.prototype.ineg = function ineg() {
          if (!this.isZero()) {
            this.negative ^= 1;
          }
          return this;
        };
        BN.prototype.iuor = function iuor(num) {
          while (this.length < num.length) {
            this.words[this.length++] = 0;
          }
          for (var i = 0; i < num.length; i++) {
            this.words[i] = this.words[i] | num.words[i];
          }
          return this.strip();
        };
        BN.prototype.ior = function ior(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuor(num);
        };
        BN.prototype.or = function or(num) {
          if (this.length > num.length) return this.clone().ior(num);
          return num.clone().ior(this);
        };
        BN.prototype.uor = function uor(num) {
          if (this.length > num.length) return this.clone().iuor(num);
          return num.clone().iuor(this);
        };
        BN.prototype.iuand = function iuand(num) {
          var b;
          if (this.length > num.length) {
            b = num;
          } else {
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = this.words[i] & num.words[i];
          }
          this.length = b.length;
          return this.strip();
        };
        BN.prototype.iand = function iand(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuand(num);
        };
        BN.prototype.and = function and(num) {
          if (this.length > num.length) return this.clone().iand(num);
          return num.clone().iand(this);
        };
        BN.prototype.uand = function uand(num) {
          if (this.length > num.length) return this.clone().iuand(num);
          return num.clone().iuand(this);
        };
        BN.prototype.iuxor = function iuxor(num) {
          var a;
          var b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = a.words[i] ^ b.words[i];
          }
          if (this !== a) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = a.length;
          return this.strip();
        };
        BN.prototype.ixor = function ixor(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuxor(num);
        };
        BN.prototype.xor = function xor(num) {
          if (this.length > num.length) return this.clone().ixor(num);
          return num.clone().ixor(this);
        };
        BN.prototype.uxor = function uxor(num) {
          if (this.length > num.length) return this.clone().iuxor(num);
          return num.clone().iuxor(this);
        };
        BN.prototype.inotn = function inotn(width) {
          assert(typeof width === "number" && width >= 0);
          var bytesNeeded = Math.ceil(width / 26) | 0;
          var bitsLeft = width % 26;
          this._expand(bytesNeeded);
          if (bitsLeft > 0) {
            bytesNeeded--;
          }
          for (var i = 0; i < bytesNeeded; i++) {
            this.words[i] = ~this.words[i] & 67108863;
          }
          if (bitsLeft > 0) {
            this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
          }
          return this.strip();
        };
        BN.prototype.notn = function notn(width) {
          return this.clone().inotn(width);
        };
        BN.prototype.setn = function setn(bit, val) {
          assert(typeof bit === "number" && bit >= 0);
          var off = bit / 26 | 0;
          var wbit = bit % 26;
          this._expand(off + 1);
          if (val) {
            this.words[off] = this.words[off] | 1 << wbit;
          } else {
            this.words[off] = this.words[off] & ~(1 << wbit);
          }
          return this.strip();
        };
        BN.prototype.iadd = function iadd(num) {
          var r;
          if (this.negative !== 0 && num.negative === 0) {
            this.negative = 0;
            r = this.isub(num);
            this.negative ^= 1;
            return this._normSign();
          } else if (this.negative === 0 && num.negative !== 0) {
            num.negative = 0;
            r = this.isub(num);
            num.negative = 1;
            return r._normSign();
          }
          var a, b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          this.length = a.length;
          if (carry !== 0) {
            this.words[this.length] = carry;
            this.length++;
          } else if (a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          return this;
        };
        BN.prototype.add = function add(num) {
          var res;
          if (num.negative !== 0 && this.negative === 0) {
            num.negative = 0;
            res = this.sub(num);
            num.negative ^= 1;
            return res;
          } else if (num.negative === 0 && this.negative !== 0) {
            this.negative = 0;
            res = num.sub(this);
            this.negative = 1;
            return res;
          }
          if (this.length > num.length) return this.clone().iadd(num);
          return num.clone().iadd(this);
        };
        BN.prototype.isub = function isub(num) {
          if (num.negative !== 0) {
            num.negative = 0;
            var r = this.iadd(num);
            num.negative = 1;
            return r._normSign();
          } else if (this.negative !== 0) {
            this.negative = 0;
            this.iadd(num);
            this.negative = 1;
            return this._normSign();
          }
          var cmp = this.cmp(num);
          if (cmp === 0) {
            this.negative = 0;
            this.length = 1;
            this.words[0] = 0;
            return this;
          }
          var a, b;
          if (cmp > 0) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          if (carry === 0 && i < a.length && a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = Math.max(this.length, i);
          if (a !== this) {
            this.negative = 1;
          }
          return this.strip();
        };
        BN.prototype.sub = function sub(num) {
          return this.clone().isub(num);
        };
        function smallMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          var len = self.length + num.length | 0;
          out.length = len;
          len = len - 1 | 0;
          var a = self.words[0] | 0;
          var b = num.words[0] | 0;
          var r = a * b;
          var lo = r & 67108863;
          var carry = r / 67108864 | 0;
          out.words[0] = lo;
          for (var k = 1; k < len; k++) {
            var ncarry = carry >>> 26;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j | 0;
              a = self.words[i] | 0;
              b = num.words[j] | 0;
              r = a * b + rword;
              ncarry += r / 67108864 | 0;
              rword = r & 67108863;
            }
            out.words[k] = rword | 0;
            carry = ncarry | 0;
          }
          if (carry !== 0) {
            out.words[k] = carry | 0;
          } else {
            out.length--;
          }
          return out.strip();
        }
        var comb10MulTo = function comb10MulTo(self, num, out) {
          var a = self.words;
          var b = num.words;
          var o = out.words;
          var c = 0;
          var lo;
          var mid;
          var hi;
          var a0 = a[0] | 0;
          var al0 = a0 & 8191;
          var ah0 = a0 >>> 13;
          var a1 = a[1] | 0;
          var al1 = a1 & 8191;
          var ah1 = a1 >>> 13;
          var a2 = a[2] | 0;
          var al2 = a2 & 8191;
          var ah2 = a2 >>> 13;
          var a3 = a[3] | 0;
          var al3 = a3 & 8191;
          var ah3 = a3 >>> 13;
          var a4 = a[4] | 0;
          var al4 = a4 & 8191;
          var ah4 = a4 >>> 13;
          var a5 = a[5] | 0;
          var al5 = a5 & 8191;
          var ah5 = a5 >>> 13;
          var a6 = a[6] | 0;
          var al6 = a6 & 8191;
          var ah6 = a6 >>> 13;
          var a7 = a[7] | 0;
          var al7 = a7 & 8191;
          var ah7 = a7 >>> 13;
          var a8 = a[8] | 0;
          var al8 = a8 & 8191;
          var ah8 = a8 >>> 13;
          var a9 = a[9] | 0;
          var al9 = a9 & 8191;
          var ah9 = a9 >>> 13;
          var b0 = b[0] | 0;
          var bl0 = b0 & 8191;
          var bh0 = b0 >>> 13;
          var b1 = b[1] | 0;
          var bl1 = b1 & 8191;
          var bh1 = b1 >>> 13;
          var b2 = b[2] | 0;
          var bl2 = b2 & 8191;
          var bh2 = b2 >>> 13;
          var b3 = b[3] | 0;
          var bl3 = b3 & 8191;
          var bh3 = b3 >>> 13;
          var b4 = b[4] | 0;
          var bl4 = b4 & 8191;
          var bh4 = b4 >>> 13;
          var b5 = b[5] | 0;
          var bl5 = b5 & 8191;
          var bh5 = b5 >>> 13;
          var b6 = b[6] | 0;
          var bl6 = b6 & 8191;
          var bh6 = b6 >>> 13;
          var b7 = b[7] | 0;
          var bl7 = b7 & 8191;
          var bh7 = b7 >>> 13;
          var b8 = b[8] | 0;
          var bl8 = b8 & 8191;
          var bh8 = b8 >>> 13;
          var b9 = b[9] | 0;
          var bl9 = b9 & 8191;
          var bh9 = b9 >>> 13;
          out.negative = self.negative ^ num.negative;
          out.length = 19;
          lo = Math.imul(al0, bl0);
          mid = Math.imul(al0, bh0);
          mid = mid + Math.imul(ah0, bl0) | 0;
          hi = Math.imul(ah0, bh0);
          var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
          w0 &= 67108863;
          lo = Math.imul(al1, bl0);
          mid = Math.imul(al1, bh0);
          mid = mid + Math.imul(ah1, bl0) | 0;
          hi = Math.imul(ah1, bh0);
          lo = lo + Math.imul(al0, bl1) | 0;
          mid = mid + Math.imul(al0, bh1) | 0;
          mid = mid + Math.imul(ah0, bl1) | 0;
          hi = hi + Math.imul(ah0, bh1) | 0;
          var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
          w1 &= 67108863;
          lo = Math.imul(al2, bl0);
          mid = Math.imul(al2, bh0);
          mid = mid + Math.imul(ah2, bl0) | 0;
          hi = Math.imul(ah2, bh0);
          lo = lo + Math.imul(al1, bl1) | 0;
          mid = mid + Math.imul(al1, bh1) | 0;
          mid = mid + Math.imul(ah1, bl1) | 0;
          hi = hi + Math.imul(ah1, bh1) | 0;
          lo = lo + Math.imul(al0, bl2) | 0;
          mid = mid + Math.imul(al0, bh2) | 0;
          mid = mid + Math.imul(ah0, bl2) | 0;
          hi = hi + Math.imul(ah0, bh2) | 0;
          var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
          w2 &= 67108863;
          lo = Math.imul(al3, bl0);
          mid = Math.imul(al3, bh0);
          mid = mid + Math.imul(ah3, bl0) | 0;
          hi = Math.imul(ah3, bh0);
          lo = lo + Math.imul(al2, bl1) | 0;
          mid = mid + Math.imul(al2, bh1) | 0;
          mid = mid + Math.imul(ah2, bl1) | 0;
          hi = hi + Math.imul(ah2, bh1) | 0;
          lo = lo + Math.imul(al1, bl2) | 0;
          mid = mid + Math.imul(al1, bh2) | 0;
          mid = mid + Math.imul(ah1, bl2) | 0;
          hi = hi + Math.imul(ah1, bh2) | 0;
          lo = lo + Math.imul(al0, bl3) | 0;
          mid = mid + Math.imul(al0, bh3) | 0;
          mid = mid + Math.imul(ah0, bl3) | 0;
          hi = hi + Math.imul(ah0, bh3) | 0;
          var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
          w3 &= 67108863;
          lo = Math.imul(al4, bl0);
          mid = Math.imul(al4, bh0);
          mid = mid + Math.imul(ah4, bl0) | 0;
          hi = Math.imul(ah4, bh0);
          lo = lo + Math.imul(al3, bl1) | 0;
          mid = mid + Math.imul(al3, bh1) | 0;
          mid = mid + Math.imul(ah3, bl1) | 0;
          hi = hi + Math.imul(ah3, bh1) | 0;
          lo = lo + Math.imul(al2, bl2) | 0;
          mid = mid + Math.imul(al2, bh2) | 0;
          mid = mid + Math.imul(ah2, bl2) | 0;
          hi = hi + Math.imul(ah2, bh2) | 0;
          lo = lo + Math.imul(al1, bl3) | 0;
          mid = mid + Math.imul(al1, bh3) | 0;
          mid = mid + Math.imul(ah1, bl3) | 0;
          hi = hi + Math.imul(ah1, bh3) | 0;
          lo = lo + Math.imul(al0, bl4) | 0;
          mid = mid + Math.imul(al0, bh4) | 0;
          mid = mid + Math.imul(ah0, bl4) | 0;
          hi = hi + Math.imul(ah0, bh4) | 0;
          var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
          w4 &= 67108863;
          lo = Math.imul(al5, bl0);
          mid = Math.imul(al5, bh0);
          mid = mid + Math.imul(ah5, bl0) | 0;
          hi = Math.imul(ah5, bh0);
          lo = lo + Math.imul(al4, bl1) | 0;
          mid = mid + Math.imul(al4, bh1) | 0;
          mid = mid + Math.imul(ah4, bl1) | 0;
          hi = hi + Math.imul(ah4, bh1) | 0;
          lo = lo + Math.imul(al3, bl2) | 0;
          mid = mid + Math.imul(al3, bh2) | 0;
          mid = mid + Math.imul(ah3, bl2) | 0;
          hi = hi + Math.imul(ah3, bh2) | 0;
          lo = lo + Math.imul(al2, bl3) | 0;
          mid = mid + Math.imul(al2, bh3) | 0;
          mid = mid + Math.imul(ah2, bl3) | 0;
          hi = hi + Math.imul(ah2, bh3) | 0;
          lo = lo + Math.imul(al1, bl4) | 0;
          mid = mid + Math.imul(al1, bh4) | 0;
          mid = mid + Math.imul(ah1, bl4) | 0;
          hi = hi + Math.imul(ah1, bh4) | 0;
          lo = lo + Math.imul(al0, bl5) | 0;
          mid = mid + Math.imul(al0, bh5) | 0;
          mid = mid + Math.imul(ah0, bl5) | 0;
          hi = hi + Math.imul(ah0, bh5) | 0;
          var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
          w5 &= 67108863;
          lo = Math.imul(al6, bl0);
          mid = Math.imul(al6, bh0);
          mid = mid + Math.imul(ah6, bl0) | 0;
          hi = Math.imul(ah6, bh0);
          lo = lo + Math.imul(al5, bl1) | 0;
          mid = mid + Math.imul(al5, bh1) | 0;
          mid = mid + Math.imul(ah5, bl1) | 0;
          hi = hi + Math.imul(ah5, bh1) | 0;
          lo = lo + Math.imul(al4, bl2) | 0;
          mid = mid + Math.imul(al4, bh2) | 0;
          mid = mid + Math.imul(ah4, bl2) | 0;
          hi = hi + Math.imul(ah4, bh2) | 0;
          lo = lo + Math.imul(al3, bl3) | 0;
          mid = mid + Math.imul(al3, bh3) | 0;
          mid = mid + Math.imul(ah3, bl3) | 0;
          hi = hi + Math.imul(ah3, bh3) | 0;
          lo = lo + Math.imul(al2, bl4) | 0;
          mid = mid + Math.imul(al2, bh4) | 0;
          mid = mid + Math.imul(ah2, bl4) | 0;
          hi = hi + Math.imul(ah2, bh4) | 0;
          lo = lo + Math.imul(al1, bl5) | 0;
          mid = mid + Math.imul(al1, bh5) | 0;
          mid = mid + Math.imul(ah1, bl5) | 0;
          hi = hi + Math.imul(ah1, bh5) | 0;
          lo = lo + Math.imul(al0, bl6) | 0;
          mid = mid + Math.imul(al0, bh6) | 0;
          mid = mid + Math.imul(ah0, bl6) | 0;
          hi = hi + Math.imul(ah0, bh6) | 0;
          var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
          w6 &= 67108863;
          lo = Math.imul(al7, bl0);
          mid = Math.imul(al7, bh0);
          mid = mid + Math.imul(ah7, bl0) | 0;
          hi = Math.imul(ah7, bh0);
          lo = lo + Math.imul(al6, bl1) | 0;
          mid = mid + Math.imul(al6, bh1) | 0;
          mid = mid + Math.imul(ah6, bl1) | 0;
          hi = hi + Math.imul(ah6, bh1) | 0;
          lo = lo + Math.imul(al5, bl2) | 0;
          mid = mid + Math.imul(al5, bh2) | 0;
          mid = mid + Math.imul(ah5, bl2) | 0;
          hi = hi + Math.imul(ah5, bh2) | 0;
          lo = lo + Math.imul(al4, bl3) | 0;
          mid = mid + Math.imul(al4, bh3) | 0;
          mid = mid + Math.imul(ah4, bl3) | 0;
          hi = hi + Math.imul(ah4, bh3) | 0;
          lo = lo + Math.imul(al3, bl4) | 0;
          mid = mid + Math.imul(al3, bh4) | 0;
          mid = mid + Math.imul(ah3, bl4) | 0;
          hi = hi + Math.imul(ah3, bh4) | 0;
          lo = lo + Math.imul(al2, bl5) | 0;
          mid = mid + Math.imul(al2, bh5) | 0;
          mid = mid + Math.imul(ah2, bl5) | 0;
          hi = hi + Math.imul(ah2, bh5) | 0;
          lo = lo + Math.imul(al1, bl6) | 0;
          mid = mid + Math.imul(al1, bh6) | 0;
          mid = mid + Math.imul(ah1, bl6) | 0;
          hi = hi + Math.imul(ah1, bh6) | 0;
          lo = lo + Math.imul(al0, bl7) | 0;
          mid = mid + Math.imul(al0, bh7) | 0;
          mid = mid + Math.imul(ah0, bl7) | 0;
          hi = hi + Math.imul(ah0, bh7) | 0;
          var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
          w7 &= 67108863;
          lo = Math.imul(al8, bl0);
          mid = Math.imul(al8, bh0);
          mid = mid + Math.imul(ah8, bl0) | 0;
          hi = Math.imul(ah8, bh0);
          lo = lo + Math.imul(al7, bl1) | 0;
          mid = mid + Math.imul(al7, bh1) | 0;
          mid = mid + Math.imul(ah7, bl1) | 0;
          hi = hi + Math.imul(ah7, bh1) | 0;
          lo = lo + Math.imul(al6, bl2) | 0;
          mid = mid + Math.imul(al6, bh2) | 0;
          mid = mid + Math.imul(ah6, bl2) | 0;
          hi = hi + Math.imul(ah6, bh2) | 0;
          lo = lo + Math.imul(al5, bl3) | 0;
          mid = mid + Math.imul(al5, bh3) | 0;
          mid = mid + Math.imul(ah5, bl3) | 0;
          hi = hi + Math.imul(ah5, bh3) | 0;
          lo = lo + Math.imul(al4, bl4) | 0;
          mid = mid + Math.imul(al4, bh4) | 0;
          mid = mid + Math.imul(ah4, bl4) | 0;
          hi = hi + Math.imul(ah4, bh4) | 0;
          lo = lo + Math.imul(al3, bl5) | 0;
          mid = mid + Math.imul(al3, bh5) | 0;
          mid = mid + Math.imul(ah3, bl5) | 0;
          hi = hi + Math.imul(ah3, bh5) | 0;
          lo = lo + Math.imul(al2, bl6) | 0;
          mid = mid + Math.imul(al2, bh6) | 0;
          mid = mid + Math.imul(ah2, bl6) | 0;
          hi = hi + Math.imul(ah2, bh6) | 0;
          lo = lo + Math.imul(al1, bl7) | 0;
          mid = mid + Math.imul(al1, bh7) | 0;
          mid = mid + Math.imul(ah1, bl7) | 0;
          hi = hi + Math.imul(ah1, bh7) | 0;
          lo = lo + Math.imul(al0, bl8) | 0;
          mid = mid + Math.imul(al0, bh8) | 0;
          mid = mid + Math.imul(ah0, bl8) | 0;
          hi = hi + Math.imul(ah0, bh8) | 0;
          var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
          w8 &= 67108863;
          lo = Math.imul(al9, bl0);
          mid = Math.imul(al9, bh0);
          mid = mid + Math.imul(ah9, bl0) | 0;
          hi = Math.imul(ah9, bh0);
          lo = lo + Math.imul(al8, bl1) | 0;
          mid = mid + Math.imul(al8, bh1) | 0;
          mid = mid + Math.imul(ah8, bl1) | 0;
          hi = hi + Math.imul(ah8, bh1) | 0;
          lo = lo + Math.imul(al7, bl2) | 0;
          mid = mid + Math.imul(al7, bh2) | 0;
          mid = mid + Math.imul(ah7, bl2) | 0;
          hi = hi + Math.imul(ah7, bh2) | 0;
          lo = lo + Math.imul(al6, bl3) | 0;
          mid = mid + Math.imul(al6, bh3) | 0;
          mid = mid + Math.imul(ah6, bl3) | 0;
          hi = hi + Math.imul(ah6, bh3) | 0;
          lo = lo + Math.imul(al5, bl4) | 0;
          mid = mid + Math.imul(al5, bh4) | 0;
          mid = mid + Math.imul(ah5, bl4) | 0;
          hi = hi + Math.imul(ah5, bh4) | 0;
          lo = lo + Math.imul(al4, bl5) | 0;
          mid = mid + Math.imul(al4, bh5) | 0;
          mid = mid + Math.imul(ah4, bl5) | 0;
          hi = hi + Math.imul(ah4, bh5) | 0;
          lo = lo + Math.imul(al3, bl6) | 0;
          mid = mid + Math.imul(al3, bh6) | 0;
          mid = mid + Math.imul(ah3, bl6) | 0;
          hi = hi + Math.imul(ah3, bh6) | 0;
          lo = lo + Math.imul(al2, bl7) | 0;
          mid = mid + Math.imul(al2, bh7) | 0;
          mid = mid + Math.imul(ah2, bl7) | 0;
          hi = hi + Math.imul(ah2, bh7) | 0;
          lo = lo + Math.imul(al1, bl8) | 0;
          mid = mid + Math.imul(al1, bh8) | 0;
          mid = mid + Math.imul(ah1, bl8) | 0;
          hi = hi + Math.imul(ah1, bh8) | 0;
          lo = lo + Math.imul(al0, bl9) | 0;
          mid = mid + Math.imul(al0, bh9) | 0;
          mid = mid + Math.imul(ah0, bl9) | 0;
          hi = hi + Math.imul(ah0, bh9) | 0;
          var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
          w9 &= 67108863;
          lo = Math.imul(al9, bl1);
          mid = Math.imul(al9, bh1);
          mid = mid + Math.imul(ah9, bl1) | 0;
          hi = Math.imul(ah9, bh1);
          lo = lo + Math.imul(al8, bl2) | 0;
          mid = mid + Math.imul(al8, bh2) | 0;
          mid = mid + Math.imul(ah8, bl2) | 0;
          hi = hi + Math.imul(ah8, bh2) | 0;
          lo = lo + Math.imul(al7, bl3) | 0;
          mid = mid + Math.imul(al7, bh3) | 0;
          mid = mid + Math.imul(ah7, bl3) | 0;
          hi = hi + Math.imul(ah7, bh3) | 0;
          lo = lo + Math.imul(al6, bl4) | 0;
          mid = mid + Math.imul(al6, bh4) | 0;
          mid = mid + Math.imul(ah6, bl4) | 0;
          hi = hi + Math.imul(ah6, bh4) | 0;
          lo = lo + Math.imul(al5, bl5) | 0;
          mid = mid + Math.imul(al5, bh5) | 0;
          mid = mid + Math.imul(ah5, bl5) | 0;
          hi = hi + Math.imul(ah5, bh5) | 0;
          lo = lo + Math.imul(al4, bl6) | 0;
          mid = mid + Math.imul(al4, bh6) | 0;
          mid = mid + Math.imul(ah4, bl6) | 0;
          hi = hi + Math.imul(ah4, bh6) | 0;
          lo = lo + Math.imul(al3, bl7) | 0;
          mid = mid + Math.imul(al3, bh7) | 0;
          mid = mid + Math.imul(ah3, bl7) | 0;
          hi = hi + Math.imul(ah3, bh7) | 0;
          lo = lo + Math.imul(al2, bl8) | 0;
          mid = mid + Math.imul(al2, bh8) | 0;
          mid = mid + Math.imul(ah2, bl8) | 0;
          hi = hi + Math.imul(ah2, bh8) | 0;
          lo = lo + Math.imul(al1, bl9) | 0;
          mid = mid + Math.imul(al1, bh9) | 0;
          mid = mid + Math.imul(ah1, bl9) | 0;
          hi = hi + Math.imul(ah1, bh9) | 0;
          var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
          w10 &= 67108863;
          lo = Math.imul(al9, bl2);
          mid = Math.imul(al9, bh2);
          mid = mid + Math.imul(ah9, bl2) | 0;
          hi = Math.imul(ah9, bh2);
          lo = lo + Math.imul(al8, bl3) | 0;
          mid = mid + Math.imul(al8, bh3) | 0;
          mid = mid + Math.imul(ah8, bl3) | 0;
          hi = hi + Math.imul(ah8, bh3) | 0;
          lo = lo + Math.imul(al7, bl4) | 0;
          mid = mid + Math.imul(al7, bh4) | 0;
          mid = mid + Math.imul(ah7, bl4) | 0;
          hi = hi + Math.imul(ah7, bh4) | 0;
          lo = lo + Math.imul(al6, bl5) | 0;
          mid = mid + Math.imul(al6, bh5) | 0;
          mid = mid + Math.imul(ah6, bl5) | 0;
          hi = hi + Math.imul(ah6, bh5) | 0;
          lo = lo + Math.imul(al5, bl6) | 0;
          mid = mid + Math.imul(al5, bh6) | 0;
          mid = mid + Math.imul(ah5, bl6) | 0;
          hi = hi + Math.imul(ah5, bh6) | 0;
          lo = lo + Math.imul(al4, bl7) | 0;
          mid = mid + Math.imul(al4, bh7) | 0;
          mid = mid + Math.imul(ah4, bl7) | 0;
          hi = hi + Math.imul(ah4, bh7) | 0;
          lo = lo + Math.imul(al3, bl8) | 0;
          mid = mid + Math.imul(al3, bh8) | 0;
          mid = mid + Math.imul(ah3, bl8) | 0;
          hi = hi + Math.imul(ah3, bh8) | 0;
          lo = lo + Math.imul(al2, bl9) | 0;
          mid = mid + Math.imul(al2, bh9) | 0;
          mid = mid + Math.imul(ah2, bl9) | 0;
          hi = hi + Math.imul(ah2, bh9) | 0;
          var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
          w11 &= 67108863;
          lo = Math.imul(al9, bl3);
          mid = Math.imul(al9, bh3);
          mid = mid + Math.imul(ah9, bl3) | 0;
          hi = Math.imul(ah9, bh3);
          lo = lo + Math.imul(al8, bl4) | 0;
          mid = mid + Math.imul(al8, bh4) | 0;
          mid = mid + Math.imul(ah8, bl4) | 0;
          hi = hi + Math.imul(ah8, bh4) | 0;
          lo = lo + Math.imul(al7, bl5) | 0;
          mid = mid + Math.imul(al7, bh5) | 0;
          mid = mid + Math.imul(ah7, bl5) | 0;
          hi = hi + Math.imul(ah7, bh5) | 0;
          lo = lo + Math.imul(al6, bl6) | 0;
          mid = mid + Math.imul(al6, bh6) | 0;
          mid = mid + Math.imul(ah6, bl6) | 0;
          hi = hi + Math.imul(ah6, bh6) | 0;
          lo = lo + Math.imul(al5, bl7) | 0;
          mid = mid + Math.imul(al5, bh7) | 0;
          mid = mid + Math.imul(ah5, bl7) | 0;
          hi = hi + Math.imul(ah5, bh7) | 0;
          lo = lo + Math.imul(al4, bl8) | 0;
          mid = mid + Math.imul(al4, bh8) | 0;
          mid = mid + Math.imul(ah4, bl8) | 0;
          hi = hi + Math.imul(ah4, bh8) | 0;
          lo = lo + Math.imul(al3, bl9) | 0;
          mid = mid + Math.imul(al3, bh9) | 0;
          mid = mid + Math.imul(ah3, bl9) | 0;
          hi = hi + Math.imul(ah3, bh9) | 0;
          var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
          w12 &= 67108863;
          lo = Math.imul(al9, bl4);
          mid = Math.imul(al9, bh4);
          mid = mid + Math.imul(ah9, bl4) | 0;
          hi = Math.imul(ah9, bh4);
          lo = lo + Math.imul(al8, bl5) | 0;
          mid = mid + Math.imul(al8, bh5) | 0;
          mid = mid + Math.imul(ah8, bl5) | 0;
          hi = hi + Math.imul(ah8, bh5) | 0;
          lo = lo + Math.imul(al7, bl6) | 0;
          mid = mid + Math.imul(al7, bh6) | 0;
          mid = mid + Math.imul(ah7, bl6) | 0;
          hi = hi + Math.imul(ah7, bh6) | 0;
          lo = lo + Math.imul(al6, bl7) | 0;
          mid = mid + Math.imul(al6, bh7) | 0;
          mid = mid + Math.imul(ah6, bl7) | 0;
          hi = hi + Math.imul(ah6, bh7) | 0;
          lo = lo + Math.imul(al5, bl8) | 0;
          mid = mid + Math.imul(al5, bh8) | 0;
          mid = mid + Math.imul(ah5, bl8) | 0;
          hi = hi + Math.imul(ah5, bh8) | 0;
          lo = lo + Math.imul(al4, bl9) | 0;
          mid = mid + Math.imul(al4, bh9) | 0;
          mid = mid + Math.imul(ah4, bl9) | 0;
          hi = hi + Math.imul(ah4, bh9) | 0;
          var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
          w13 &= 67108863;
          lo = Math.imul(al9, bl5);
          mid = Math.imul(al9, bh5);
          mid = mid + Math.imul(ah9, bl5) | 0;
          hi = Math.imul(ah9, bh5);
          lo = lo + Math.imul(al8, bl6) | 0;
          mid = mid + Math.imul(al8, bh6) | 0;
          mid = mid + Math.imul(ah8, bl6) | 0;
          hi = hi + Math.imul(ah8, bh6) | 0;
          lo = lo + Math.imul(al7, bl7) | 0;
          mid = mid + Math.imul(al7, bh7) | 0;
          mid = mid + Math.imul(ah7, bl7) | 0;
          hi = hi + Math.imul(ah7, bh7) | 0;
          lo = lo + Math.imul(al6, bl8) | 0;
          mid = mid + Math.imul(al6, bh8) | 0;
          mid = mid + Math.imul(ah6, bl8) | 0;
          hi = hi + Math.imul(ah6, bh8) | 0;
          lo = lo + Math.imul(al5, bl9) | 0;
          mid = mid + Math.imul(al5, bh9) | 0;
          mid = mid + Math.imul(ah5, bl9) | 0;
          hi = hi + Math.imul(ah5, bh9) | 0;
          var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
          w14 &= 67108863;
          lo = Math.imul(al9, bl6);
          mid = Math.imul(al9, bh6);
          mid = mid + Math.imul(ah9, bl6) | 0;
          hi = Math.imul(ah9, bh6);
          lo = lo + Math.imul(al8, bl7) | 0;
          mid = mid + Math.imul(al8, bh7) | 0;
          mid = mid + Math.imul(ah8, bl7) | 0;
          hi = hi + Math.imul(ah8, bh7) | 0;
          lo = lo + Math.imul(al7, bl8) | 0;
          mid = mid + Math.imul(al7, bh8) | 0;
          mid = mid + Math.imul(ah7, bl8) | 0;
          hi = hi + Math.imul(ah7, bh8) | 0;
          lo = lo + Math.imul(al6, bl9) | 0;
          mid = mid + Math.imul(al6, bh9) | 0;
          mid = mid + Math.imul(ah6, bl9) | 0;
          hi = hi + Math.imul(ah6, bh9) | 0;
          var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
          w15 &= 67108863;
          lo = Math.imul(al9, bl7);
          mid = Math.imul(al9, bh7);
          mid = mid + Math.imul(ah9, bl7) | 0;
          hi = Math.imul(ah9, bh7);
          lo = lo + Math.imul(al8, bl8) | 0;
          mid = mid + Math.imul(al8, bh8) | 0;
          mid = mid + Math.imul(ah8, bl8) | 0;
          hi = hi + Math.imul(ah8, bh8) | 0;
          lo = lo + Math.imul(al7, bl9) | 0;
          mid = mid + Math.imul(al7, bh9) | 0;
          mid = mid + Math.imul(ah7, bl9) | 0;
          hi = hi + Math.imul(ah7, bh9) | 0;
          var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
          w16 &= 67108863;
          lo = Math.imul(al9, bl8);
          mid = Math.imul(al9, bh8);
          mid = mid + Math.imul(ah9, bl8) | 0;
          hi = Math.imul(ah9, bh8);
          lo = lo + Math.imul(al8, bl9) | 0;
          mid = mid + Math.imul(al8, bh9) | 0;
          mid = mid + Math.imul(ah8, bl9) | 0;
          hi = hi + Math.imul(ah8, bh9) | 0;
          var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
          w17 &= 67108863;
          lo = Math.imul(al9, bl9);
          mid = Math.imul(al9, bh9);
          mid = mid + Math.imul(ah9, bl9) | 0;
          hi = Math.imul(ah9, bh9);
          var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
          w18 &= 67108863;
          o[0] = w0;
          o[1] = w1;
          o[2] = w2;
          o[3] = w3;
          o[4] = w4;
          o[5] = w5;
          o[6] = w6;
          o[7] = w7;
          o[8] = w8;
          o[9] = w9;
          o[10] = w10;
          o[11] = w11;
          o[12] = w12;
          o[13] = w13;
          o[14] = w14;
          o[15] = w15;
          o[16] = w16;
          o[17] = w17;
          o[18] = w18;
          if (c !== 0) {
            o[19] = c;
            out.length++;
          }
          return out;
        };
        if (!Math.imul) {
          comb10MulTo = smallMulTo;
        }
        function bigMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          out.length = self.length + num.length;
          var carry = 0;
          var hncarry = 0;
          for (var k = 0; k < out.length - 1; k++) {
            var ncarry = hncarry;
            hncarry = 0;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j;
              var a = self.words[i] | 0;
              var b = num.words[j] | 0;
              var r = a * b;
              var lo = r & 67108863;
              ncarry = ncarry + (r / 67108864 | 0) | 0;
              lo = lo + rword | 0;
              rword = lo & 67108863;
              ncarry = ncarry + (lo >>> 26) | 0;
              hncarry += ncarry >>> 26;
              ncarry &= 67108863;
            }
            out.words[k] = rword;
            carry = ncarry;
            ncarry = hncarry;
          }
          if (carry !== 0) {
            out.words[k] = carry;
          } else {
            out.length--;
          }
          return out.strip();
        }
        function jumboMulTo(self, num, out) {
          var fftm = new FFTM;
          return fftm.mulp(self, num, out);
        }
        BN.prototype.mulTo = function mulTo(num, out) {
          var res;
          var len = this.length + num.length;
          if (this.length === 10 && num.length === 10) {
            res = comb10MulTo(this, num, out);
          } else if (len < 63) {
            res = smallMulTo(this, num, out);
          } else if (len < 1024) {
            res = bigMulTo(this, num, out);
          } else {
            res = jumboMulTo(this, num, out);
          }
          return res;
        };
        function FFTM(x, y) {
          this.x = x;
          this.y = y;
        }
        FFTM.prototype.makeRBT = function makeRBT(N) {
          var t = new Array(N);
          var l = BN.prototype._countBits(N) - 1;
          for (var i = 0; i < N; i++) {
            t[i] = this.revBin(i, l, N);
          }
          return t;
        };
        FFTM.prototype.revBin = function revBin(x, l, N) {
          if (x === 0 || x === N - 1) return x;
          var rb = 0;
          for (var i = 0; i < l; i++) {
            rb |= (x & 1) << l - i - 1;
            x >>= 1;
          }
          return rb;
        };
        FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
          for (var i = 0; i < N; i++) {
            rtws[i] = rws[rbt[i]];
            itws[i] = iws[rbt[i]];
          }
        };
        FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
          this.permute(rbt, rws, iws, rtws, itws, N);
          for (var s = 1; s < N; s <<= 1) {
            var l = s << 1;
            var rtwdf = Math.cos(2 * Math.PI / l);
            var itwdf = Math.sin(2 * Math.PI / l);
            for (var p = 0; p < N; p += l) {
              var rtwdf_ = rtwdf;
              var itwdf_ = itwdf;
              for (var j = 0; j < s; j++) {
                var re = rtws[p + j];
                var ie = itws[p + j];
                var ro = rtws[p + j + s];
                var io = itws[p + j + s];
                var rx = rtwdf_ * ro - itwdf_ * io;
                io = rtwdf_ * io + itwdf_ * ro;
                ro = rx;
                rtws[p + j] = re + ro;
                itws[p + j] = ie + io;
                rtws[p + j + s] = re - ro;
                itws[p + j + s] = ie - io;
                if (j !== l) {
                  rx = rtwdf * rtwdf_ - itwdf * itwdf_;
                  itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
                  rtwdf_ = rx;
                }
              }
            }
          }
        };
        FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
          var N = Math.max(m, n) | 1;
          var odd = N & 1;
          var i = 0;
          for (N = N / 2 | 0; N; N = N >>> 1) {
            i++;
          }
          return 1 << i + 1 + odd;
        };
        FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
          if (N <= 1) return;
          for (var i = 0; i < N / 2; i++) {
            var t = rws[i];
            rws[i] = rws[N - i - 1];
            rws[N - i - 1] = t;
            t = iws[i];
            iws[i] = -iws[N - i - 1];
            iws[N - i - 1] = -t;
          }
        };
        FFTM.prototype.normalize13b = function normalize13b(ws, N) {
          var carry = 0;
          for (var i = 0; i < N / 2; i++) {
            var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
            ws[i] = w & 67108863;
            if (w < 67108864) {
              carry = 0;
            } else {
              carry = w / 67108864 | 0;
            }
          }
          return ws;
        };
        FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
          var carry = 0;
          for (var i = 0; i < len; i++) {
            carry = carry + (ws[i] | 0);
            rws[2 * i] = carry & 8191;
            carry = carry >>> 13;
            rws[2 * i + 1] = carry & 8191;
            carry = carry >>> 13;
          }
          for (i = 2 * len; i < N; ++i) {
            rws[i] = 0;
          }
          assert(carry === 0);
          assert((carry & ~8191) === 0);
        };
        FFTM.prototype.stub = function stub(N) {
          var ph = new Array(N);
          for (var i = 0; i < N; i++) {
            ph[i] = 0;
          }
          return ph;
        };
        FFTM.prototype.mulp = function mulp(x, y, out) {
          var N = 2 * this.guessLen13b(x.length, y.length);
          var rbt = this.makeRBT(N);
          var _ = this.stub(N);
          var rws = new Array(N);
          var rwst = new Array(N);
          var iwst = new Array(N);
          var nrws = new Array(N);
          var nrwst = new Array(N);
          var niwst = new Array(N);
          var rmws = out.words;
          rmws.length = N;
          this.convert13b(x.words, x.length, rws, N);
          this.convert13b(y.words, y.length, nrws, N);
          this.transform(rws, _, rwst, iwst, N, rbt);
          this.transform(nrws, _, nrwst, niwst, N, rbt);
          for (var i = 0; i < N; i++) {
            var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
            iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
            rwst[i] = rx;
          }
          this.conjugate(rwst, iwst, N);
          this.transform(rwst, iwst, rmws, _, N, rbt);
          this.conjugate(rmws, _, N);
          this.normalize13b(rmws, N);
          out.negative = x.negative ^ y.negative;
          out.length = x.length + y.length;
          return out.strip();
        };
        BN.prototype.mul = function mul(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return this.mulTo(num, out);
        };
        BN.prototype.mulf = function mulf(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return jumboMulTo(this, num, out);
        };
        BN.prototype.imul = function imul(num) {
          return this.clone().mulTo(num, this);
        };
        BN.prototype.imuln = function imuln(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          var carry = 0;
          for (var i = 0; i < this.length; i++) {
            var w = (this.words[i] | 0) * num;
            var lo = (w & 67108863) + (carry & 67108863);
            carry >>= 26;
            carry += w / 67108864 | 0;
            carry += lo >>> 26;
            this.words[i] = lo & 67108863;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          this.length = num === 0 ? 1 : this.length;
          return this;
        };
        BN.prototype.muln = function muln(num) {
          return this.clone().imuln(num);
        };
        BN.prototype.sqr = function sqr() {
          return this.mul(this);
        };
        BN.prototype.isqr = function isqr() {
          return this.imul(this.clone());
        };
        BN.prototype.pow = function pow(num) {
          var w = toBitArray(num);
          if (w.length === 0) return new BN(1);
          var res = this;
          for (var i = 0; i < w.length; i++, res = res.sqr()) {
            if (w[i] !== 0) break;
          }
          if (++i < w.length) {
            for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
              if (w[i] === 0) continue;
              res = res.mul(q);
            }
          }
          return res;
        };
        BN.prototype.iushln = function iushln(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          var carryMask = 67108863 >>> 26 - r << 26 - r;
          var i;
          if (r !== 0) {
            var carry = 0;
            for (i = 0; i < this.length; i++) {
              var newCarry = this.words[i] & carryMask;
              var c = (this.words[i] | 0) - newCarry << r;
              this.words[i] = c | carry;
              carry = newCarry >>> 26 - r;
            }
            if (carry) {
              this.words[i] = carry;
              this.length++;
            }
          }
          if (s !== 0) {
            for (i = this.length - 1; i >= 0; i--) {
              this.words[i + s] = this.words[i];
            }
            for (i = 0; i < s; i++) {
              this.words[i] = 0;
            }
            this.length += s;
          }
          return this.strip();
        };
        BN.prototype.ishln = function ishln(bits) {
          assert(this.negative === 0);
          return this.iushln(bits);
        };
        BN.prototype.iushrn = function iushrn(bits, hint, extended) {
          assert(typeof bits === "number" && bits >= 0);
          var h;
          if (hint) {
            h = (hint - hint % 26) / 26;
          } else {
            h = 0;
          }
          var r = bits % 26;
          var s = Math.min((bits - r) / 26, this.length);
          var mask = 67108863 ^ 67108863 >>> r << r;
          var maskedWords = extended;
          h -= s;
          h = Math.max(0, h);
          if (maskedWords) {
            for (var i = 0; i < s; i++) {
              maskedWords.words[i] = this.words[i];
            }
            maskedWords.length = s;
          }
          if (s === 0) {} else if (this.length > s) {
            this.length -= s;
            for (i = 0; i < this.length; i++) {
              this.words[i] = this.words[i + s];
            }
          } else {
            this.words[0] = 0;
            this.length = 1;
          }
          var carry = 0;
          for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
            var word = this.words[i] | 0;
            this.words[i] = carry << 26 - r | word >>> r;
            carry = word & mask;
          }
          if (maskedWords && carry !== 0) {
            maskedWords.words[maskedWords.length++] = carry;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.ishrn = function ishrn(bits, hint, extended) {
          assert(this.negative === 0);
          return this.iushrn(bits, hint, extended);
        };
        BN.prototype.shln = function shln(bits) {
          return this.clone().ishln(bits);
        };
        BN.prototype.ushln = function ushln(bits) {
          return this.clone().iushln(bits);
        };
        BN.prototype.shrn = function shrn(bits) {
          return this.clone().ishrn(bits);
        };
        BN.prototype.ushrn = function ushrn(bits) {
          return this.clone().iushrn(bits);
        };
        BN.prototype.testn = function testn(bit) {
          assert(typeof bit === "number" && bit >= 0);
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) return false;
          var w = this.words[s];
          return !!(w & q);
        };
        BN.prototype.imaskn = function imaskn(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          assert(this.negative === 0, "imaskn works only with positive numbers");
          if (this.length <= s) {
            return this;
          }
          if (r !== 0) {
            s++;
          }
          this.length = Math.min(s, this.length);
          if (r !== 0) {
            var mask = 67108863 ^ 67108863 >>> r << r;
            this.words[this.length - 1] &= mask;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.maskn = function maskn(bits) {
          return this.clone().imaskn(bits);
        };
        BN.prototype.iaddn = function iaddn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.isubn(-num);
          if (this.negative !== 0) {
            if (this.length === 1 && (this.words[0] | 0) < num) {
              this.words[0] = num - (this.words[0] | 0);
              this.negative = 0;
              return this;
            }
            this.negative = 0;
            this.isubn(num);
            this.negative = 1;
            return this;
          }
          return this._iaddn(num);
        };
        BN.prototype._iaddn = function _iaddn(num) {
          this.words[0] += num;
          for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
            this.words[i] -= 67108864;
            if (i === this.length - 1) {
              this.words[i + 1] = 1;
            } else {
              this.words[i + 1]++;
            }
          }
          this.length = Math.max(this.length, i + 1);
          return this;
        };
        BN.prototype.isubn = function isubn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.iaddn(-num);
          if (this.negative !== 0) {
            this.negative = 0;
            this.iaddn(num);
            this.negative = 1;
            return this;
          }
          this.words[0] -= num;
          if (this.length === 1 && this.words[0] < 0) {
            this.words[0] = -this.words[0];
            this.negative = 1;
          } else {
            for (var i = 0; i < this.length && this.words[i] < 0; i++) {
              this.words[i] += 67108864;
              this.words[i + 1] -= 1;
            }
          }
          return this.strip();
        };
        BN.prototype.addn = function addn(num) {
          return this.clone().iaddn(num);
        };
        BN.prototype.subn = function subn(num) {
          return this.clone().isubn(num);
        };
        BN.prototype.iabs = function iabs() {
          this.negative = 0;
          return this;
        };
        BN.prototype.abs = function abs() {
          return this.clone().iabs();
        };
        BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
          var len = num.length + shift;
          var i;
          this._expand(len);
          var w;
          var carry = 0;
          for (i = 0; i < num.length; i++) {
            w = (this.words[i + shift] | 0) + carry;
            var right = (num.words[i] | 0) * mul;
            w -= right & 67108863;
            carry = (w >> 26) - (right / 67108864 | 0);
            this.words[i + shift] = w & 67108863;
          }
          for (;i < this.length - shift; i++) {
            w = (this.words[i + shift] | 0) + carry;
            carry = w >> 26;
            this.words[i + shift] = w & 67108863;
          }
          if (carry === 0) return this.strip();
          assert(carry === -1);
          carry = 0;
          for (i = 0; i < this.length; i++) {
            w = -(this.words[i] | 0) + carry;
            carry = w >> 26;
            this.words[i] = w & 67108863;
          }
          this.negative = 1;
          return this.strip();
        };
        BN.prototype._wordDiv = function _wordDiv(num, mode) {
          var shift = this.length - num.length;
          var a = this.clone();
          var b = num;
          var bhi = b.words[b.length - 1] | 0;
          var bhiBits = this._countBits(bhi);
          shift = 26 - bhiBits;
          if (shift !== 0) {
            b = b.ushln(shift);
            a.iushln(shift);
            bhi = b.words[b.length - 1] | 0;
          }
          var m = a.length - b.length;
          var q;
          if (mode !== "mod") {
            q = new BN(null);
            q.length = m + 1;
            q.words = new Array(q.length);
            for (var i = 0; i < q.length; i++) {
              q.words[i] = 0;
            }
          }
          var diff = a.clone()._ishlnsubmul(b, 1, m);
          if (diff.negative === 0) {
            a = diff;
            if (q) {
              q.words[m] = 1;
            }
          }
          for (var j = m - 1; j >= 0; j--) {
            var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
            qj = Math.min(qj / bhi | 0, 67108863);
            a._ishlnsubmul(b, qj, j);
            while (a.negative !== 0) {
              qj--;
              a.negative = 0;
              a._ishlnsubmul(b, 1, j);
              if (!a.isZero()) {
                a.negative ^= 1;
              }
            }
            if (q) {
              q.words[j] = qj;
            }
          }
          if (q) {
            q.strip();
          }
          a.strip();
          if (mode !== "div" && shift !== 0) {
            a.iushrn(shift);
          }
          return {
            div: q || null,
            mod: a
          };
        };
        BN.prototype.divmod = function divmod(num, mode, positive) {
          assert(!num.isZero());
          if (this.isZero()) {
            return {
              div: new BN(0),
              mod: new BN(0)
            };
          }
          var div, mod, res;
          if (this.negative !== 0 && num.negative === 0) {
            res = this.neg().divmod(num, mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.iadd(num);
              }
            }
            return {
              div,
              mod
            };
          }
          if (this.negative === 0 && num.negative !== 0) {
            res = this.divmod(num.neg(), mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            return {
              div,
              mod: res.mod
            };
          }
          if ((this.negative & num.negative) !== 0) {
            res = this.neg().divmod(num.neg(), mode);
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.isub(num);
              }
            }
            return {
              div: res.div,
              mod
            };
          }
          if (num.length > this.length || this.cmp(num) < 0) {
            return {
              div: new BN(0),
              mod: this
            };
          }
          if (num.length === 1) {
            if (mode === "div") {
              return {
                div: this.divn(num.words[0]),
                mod: null
              };
            }
            if (mode === "mod") {
              return {
                div: null,
                mod: new BN(this.modn(num.words[0]))
              };
            }
            return {
              div: this.divn(num.words[0]),
              mod: new BN(this.modn(num.words[0]))
            };
          }
          return this._wordDiv(num, mode);
        };
        BN.prototype.div = function div(num) {
          return this.divmod(num, "div", false).div;
        };
        BN.prototype.mod = function mod(num) {
          return this.divmod(num, "mod", false).mod;
        };
        BN.prototype.umod = function umod(num) {
          return this.divmod(num, "mod", true).mod;
        };
        BN.prototype.divRound = function divRound(num) {
          var dm = this.divmod(num);
          if (dm.mod.isZero()) return dm.div;
          var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
          var half = num.ushrn(1);
          var r2 = num.andln(1);
          var cmp = mod.cmp(half);
          if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
          return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
        };
        BN.prototype.modn = function modn(num) {
          assert(num <= 67108863);
          var p = (1 << 26) % num;
          var acc = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            acc = (p * acc + (this.words[i] | 0)) % num;
          }
          return acc;
        };
        BN.prototype.idivn = function idivn(num) {
          assert(num <= 67108863);
          var carry = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var w = (this.words[i] | 0) + carry * 67108864;
            this.words[i] = w / num | 0;
            carry = w % num;
          }
          return this.strip();
        };
        BN.prototype.divn = function divn(num) {
          return this.clone().idivn(num);
        };
        BN.prototype.egcd = function egcd(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var x = this;
          var y = p.clone();
          if (x.negative !== 0) {
            x = x.umod(p);
          } else {
            x = x.clone();
          }
          var A = new BN(1);
          var B = new BN(0);
          var C = new BN(0);
          var D = new BN(1);
          var g = 0;
          while (x.isEven() && y.isEven()) {
            x.iushrn(1);
            y.iushrn(1);
            ++g;
          }
          var yp = y.clone();
          var xp = x.clone();
          while (!x.isZero()) {
            for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              x.iushrn(i);
              while (i-- > 0) {
                if (A.isOdd() || B.isOdd()) {
                  A.iadd(yp);
                  B.isub(xp);
                }
                A.iushrn(1);
                B.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              y.iushrn(j);
              while (j-- > 0) {
                if (C.isOdd() || D.isOdd()) {
                  C.iadd(yp);
                  D.isub(xp);
                }
                C.iushrn(1);
                D.iushrn(1);
              }
            }
            if (x.cmp(y) >= 0) {
              x.isub(y);
              A.isub(C);
              B.isub(D);
            } else {
              y.isub(x);
              C.isub(A);
              D.isub(B);
            }
          }
          return {
            a: C,
            b: D,
            gcd: y.iushln(g)
          };
        };
        BN.prototype._invmp = function _invmp(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var a = this;
          var b = p.clone();
          if (a.negative !== 0) {
            a = a.umod(p);
          } else {
            a = a.clone();
          }
          var x1 = new BN(1);
          var x2 = new BN(0);
          var delta = b.clone();
          while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
            for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              a.iushrn(i);
              while (i-- > 0) {
                if (x1.isOdd()) {
                  x1.iadd(delta);
                }
                x1.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              b.iushrn(j);
              while (j-- > 0) {
                if (x2.isOdd()) {
                  x2.iadd(delta);
                }
                x2.iushrn(1);
              }
            }
            if (a.cmp(b) >= 0) {
              a.isub(b);
              x1.isub(x2);
            } else {
              b.isub(a);
              x2.isub(x1);
            }
          }
          var res;
          if (a.cmpn(1) === 0) {
            res = x1;
          } else {
            res = x2;
          }
          if (res.cmpn(0) < 0) {
            res.iadd(p);
          }
          return res;
        };
        BN.prototype.gcd = function gcd(num) {
          if (this.isZero()) return num.abs();
          if (num.isZero()) return this.abs();
          var a = this.clone();
          var b = num.clone();
          a.negative = 0;
          b.negative = 0;
          for (var shift = 0; a.isEven() && b.isEven(); shift++) {
            a.iushrn(1);
            b.iushrn(1);
          }
          do {
            while (a.isEven()) {
              a.iushrn(1);
            }
            while (b.isEven()) {
              b.iushrn(1);
            }
            var r = a.cmp(b);
            if (r < 0) {
              var t = a;
              a = b;
              b = t;
            } else if (r === 0 || b.cmpn(1) === 0) {
              break;
            }
            a.isub(b);
          } while (true);
          return b.iushln(shift);
        };
        BN.prototype.invm = function invm(num) {
          return this.egcd(num).a.umod(num);
        };
        BN.prototype.isEven = function isEven() {
          return (this.words[0] & 1) === 0;
        };
        BN.prototype.isOdd = function isOdd() {
          return (this.words[0] & 1) === 1;
        };
        BN.prototype.andln = function andln(num) {
          return this.words[0] & num;
        };
        BN.prototype.bincn = function bincn(bit) {
          assert(typeof bit === "number");
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) {
            this._expand(s + 1);
            this.words[s] |= q;
            return this;
          }
          var carry = q;
          for (var i = s; carry !== 0 && i < this.length; i++) {
            var w = this.words[i] | 0;
            w += carry;
            carry = w >>> 26;
            w &= 67108863;
            this.words[i] = w;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          return this;
        };
        BN.prototype.isZero = function isZero() {
          return this.length === 1 && this.words[0] === 0;
        };
        BN.prototype.cmpn = function cmpn(num) {
          var negative = num < 0;
          if (this.negative !== 0 && !negative) return -1;
          if (this.negative === 0 && negative) return 1;
          this.strip();
          var res;
          if (this.length > 1) {
            res = 1;
          } else {
            if (negative) {
              num = -num;
            }
            assert(num <= 67108863, "Number is too big");
            var w = this.words[0] | 0;
            res = w === num ? 0 : w < num ? -1 : 1;
          }
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.cmp = function cmp(num) {
          if (this.negative !== 0 && num.negative === 0) return -1;
          if (this.negative === 0 && num.negative !== 0) return 1;
          var res = this.ucmp(num);
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.ucmp = function ucmp(num) {
          if (this.length > num.length) return 1;
          if (this.length < num.length) return -1;
          var res = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var a = this.words[i] | 0;
            var b = num.words[i] | 0;
            if (a === b) continue;
            if (a < b) {
              res = -1;
            } else if (a > b) {
              res = 1;
            }
            break;
          }
          return res;
        };
        BN.prototype.gtn = function gtn(num) {
          return this.cmpn(num) === 1;
        };
        BN.prototype.gt = function gt(num) {
          return this.cmp(num) === 1;
        };
        BN.prototype.gten = function gten(num) {
          return this.cmpn(num) >= 0;
        };
        BN.prototype.gte = function gte(num) {
          return this.cmp(num) >= 0;
        };
        BN.prototype.ltn = function ltn(num) {
          return this.cmpn(num) === -1;
        };
        BN.prototype.lt = function lt(num) {
          return this.cmp(num) === -1;
        };
        BN.prototype.lten = function lten(num) {
          return this.cmpn(num) <= 0;
        };
        BN.prototype.lte = function lte(num) {
          return this.cmp(num) <= 0;
        };
        BN.prototype.eqn = function eqn(num) {
          return this.cmpn(num) === 0;
        };
        BN.prototype.eq = function eq(num) {
          return this.cmp(num) === 0;
        };
        BN.red = function red(num) {
          return new Red(num);
        };
        BN.prototype.toRed = function toRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          assert(this.negative === 0, "red works only with positives");
          return ctx.convertTo(this)._forceRed(ctx);
        };
        BN.prototype.fromRed = function fromRed() {
          assert(this.red, "fromRed works only with numbers in reduction context");
          return this.red.convertFrom(this);
        };
        BN.prototype._forceRed = function _forceRed(ctx) {
          this.red = ctx;
          return this;
        };
        BN.prototype.forceRed = function forceRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          return this._forceRed(ctx);
        };
        BN.prototype.redAdd = function redAdd(num) {
          assert(this.red, "redAdd works only with red numbers");
          return this.red.add(this, num);
        };
        BN.prototype.redIAdd = function redIAdd(num) {
          assert(this.red, "redIAdd works only with red numbers");
          return this.red.iadd(this, num);
        };
        BN.prototype.redSub = function redSub(num) {
          assert(this.red, "redSub works only with red numbers");
          return this.red.sub(this, num);
        };
        BN.prototype.redISub = function redISub(num) {
          assert(this.red, "redISub works only with red numbers");
          return this.red.isub(this, num);
        };
        BN.prototype.redShl = function redShl(num) {
          assert(this.red, "redShl works only with red numbers");
          return this.red.shl(this, num);
        };
        BN.prototype.redMul = function redMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.mul(this, num);
        };
        BN.prototype.redIMul = function redIMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.imul(this, num);
        };
        BN.prototype.redSqr = function redSqr() {
          assert(this.red, "redSqr works only with red numbers");
          this.red._verify1(this);
          return this.red.sqr(this);
        };
        BN.prototype.redISqr = function redISqr() {
          assert(this.red, "redISqr works only with red numbers");
          this.red._verify1(this);
          return this.red.isqr(this);
        };
        BN.prototype.redSqrt = function redSqrt() {
          assert(this.red, "redSqrt works only with red numbers");
          this.red._verify1(this);
          return this.red.sqrt(this);
        };
        BN.prototype.redInvm = function redInvm() {
          assert(this.red, "redInvm works only with red numbers");
          this.red._verify1(this);
          return this.red.invm(this);
        };
        BN.prototype.redNeg = function redNeg() {
          assert(this.red, "redNeg works only with red numbers");
          this.red._verify1(this);
          return this.red.neg(this);
        };
        BN.prototype.redPow = function redPow(num) {
          assert(this.red && !num.red, "redPow(normalNum)");
          this.red._verify1(this);
          return this.red.pow(this, num);
        };
        var primes = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };
        function MPrime(name, p) {
          this.name = name;
          this.p = new BN(p, 16);
          this.n = this.p.bitLength();
          this.k = new BN(1).iushln(this.n).isub(this.p);
          this.tmp = this._tmp();
        }
        MPrime.prototype._tmp = function _tmp() {
          var tmp = new BN(null);
          tmp.words = new Array(Math.ceil(this.n / 13));
          return tmp;
        };
        MPrime.prototype.ireduce = function ireduce(num) {
          var r = num;
          var rlen;
          do {
            this.split(r, this.tmp);
            r = this.imulK(r);
            r = r.iadd(this.tmp);
            rlen = r.bitLength();
          } while (rlen > this.n);
          var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
          if (cmp === 0) {
            r.words[0] = 0;
            r.length = 1;
          } else if (cmp > 0) {
            r.isub(this.p);
          } else {
            if (r.strip !== undefined) {
              r.strip();
            } else {
              r._strip();
            }
          }
          return r;
        };
        MPrime.prototype.split = function split(input, out) {
          input.iushrn(this.n, 0, out);
        };
        MPrime.prototype.imulK = function imulK(num) {
          return num.imul(this.k);
        };
        function K256() {
          MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
        }
        inherits(K256, MPrime);
        K256.prototype.split = function split(input, output) {
          var mask = 4194303;
          var outLen = Math.min(input.length, 9);
          for (var i = 0; i < outLen; i++) {
            output.words[i] = input.words[i];
          }
          output.length = outLen;
          if (input.length <= 9) {
            input.words[0] = 0;
            input.length = 1;
            return;
          }
          var prev = input.words[9];
          output.words[output.length++] = prev & mask;
          for (i = 10; i < input.length; i++) {
            var next = input.words[i] | 0;
            input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
            prev = next;
          }
          prev >>>= 22;
          input.words[i - 10] = prev;
          if (prev === 0 && input.length > 10) {
            input.length -= 10;
          } else {
            input.length -= 9;
          }
        };
        K256.prototype.imulK = function imulK(num) {
          num.words[num.length] = 0;
          num.words[num.length + 1] = 0;
          num.length += 2;
          var lo = 0;
          for (var i = 0; i < num.length; i++) {
            var w = num.words[i] | 0;
            lo += w * 977;
            num.words[i] = lo & 67108863;
            lo = w * 64 + (lo / 67108864 | 0);
          }
          if (num.words[num.length - 1] === 0) {
            num.length--;
            if (num.words[num.length - 1] === 0) {
              num.length--;
            }
          }
          return num;
        };
        function P224() {
          MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
        }
        inherits(P224, MPrime);
        function P192() {
          MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
        }
        inherits(P192, MPrime);
        function P25519() {
          MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
        }
        inherits(P25519, MPrime);
        P25519.prototype.imulK = function imulK(num) {
          var carry = 0;
          for (var i = 0; i < num.length; i++) {
            var hi = (num.words[i] | 0) * 19 + carry;
            var lo = hi & 67108863;
            hi >>>= 26;
            num.words[i] = lo;
            carry = hi;
          }
          if (carry !== 0) {
            num.words[num.length++] = carry;
          }
          return num;
        };
        BN._prime = function prime(name) {
          if (primes[name]) return primes[name];
          var prime;
          if (name === "k256") {
            prime = new K256;
          } else if (name === "p224") {
            prime = new P224;
          } else if (name === "p192") {
            prime = new P192;
          } else if (name === "p25519") {
            prime = new P25519;
          } else {
            throw new Error("Unknown prime " + name);
          }
          primes[name] = prime;
          return prime;
        };
        function Red(m) {
          if (typeof m === "string") {
            var prime = BN._prime(m);
            this.m = prime.p;
            this.prime = prime;
          } else {
            assert(m.gtn(1), "modulus must be greater than 1");
            this.m = m;
            this.prime = null;
          }
        }
        Red.prototype._verify1 = function _verify1(a) {
          assert(a.negative === 0, "red works only with positives");
          assert(a.red, "red works only with red numbers");
        };
        Red.prototype._verify2 = function _verify2(a, b) {
          assert((a.negative | b.negative) === 0, "red works only with positives");
          assert(a.red && a.red === b.red, "red works only with red numbers");
        };
        Red.prototype.imod = function imod(a) {
          if (this.prime) return this.prime.ireduce(a)._forceRed(this);
          return a.umod(this.m)._forceRed(this);
        };
        Red.prototype.neg = function neg(a) {
          if (a.isZero()) {
            return a.clone();
          }
          return this.m.sub(a)._forceRed(this);
        };
        Red.prototype.add = function add(a, b) {
          this._verify2(a, b);
          var res = a.add(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.iadd = function iadd(a, b) {
          this._verify2(a, b);
          var res = a.iadd(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res;
        };
        Red.prototype.sub = function sub(a, b) {
          this._verify2(a, b);
          var res = a.sub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.isub = function isub(a, b) {
          this._verify2(a, b);
          var res = a.isub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res;
        };
        Red.prototype.shl = function shl(a, num) {
          this._verify1(a);
          return this.imod(a.ushln(num));
        };
        Red.prototype.imul = function imul(a, b) {
          this._verify2(a, b);
          return this.imod(a.imul(b));
        };
        Red.prototype.mul = function mul(a, b) {
          this._verify2(a, b);
          return this.imod(a.mul(b));
        };
        Red.prototype.isqr = function isqr(a) {
          return this.imul(a, a.clone());
        };
        Red.prototype.sqr = function sqr(a) {
          return this.mul(a, a);
        };
        Red.prototype.sqrt = function sqrt(a) {
          if (a.isZero()) return a.clone();
          var mod3 = this.m.andln(3);
          assert(mod3 % 2 === 1);
          if (mod3 === 3) {
            var pow = this.m.add(new BN(1)).iushrn(2);
            return this.pow(a, pow);
          }
          var q = this.m.subn(1);
          var s = 0;
          while (!q.isZero() && q.andln(1) === 0) {
            s++;
            q.iushrn(1);
          }
          assert(!q.isZero());
          var one = new BN(1).toRed(this);
          var nOne = one.redNeg();
          var lpow = this.m.subn(1).iushrn(1);
          var z = this.m.bitLength();
          z = new BN(2 * z * z).toRed(this);
          while (this.pow(z, lpow).cmp(nOne) !== 0) {
            z.redIAdd(nOne);
          }
          var c = this.pow(z, q);
          var r = this.pow(a, q.addn(1).iushrn(1));
          var t = this.pow(a, q);
          var m = s;
          while (t.cmp(one) !== 0) {
            var tmp = t;
            for (var i = 0; tmp.cmp(one) !== 0; i++) {
              tmp = tmp.redSqr();
            }
            assert(i < m);
            var b = this.pow(c, new BN(1).iushln(m - i - 1));
            r = r.redMul(b);
            c = b.redSqr();
            t = t.redMul(c);
            m = i;
          }
          return r;
        };
        Red.prototype.invm = function invm(a) {
          var inv = a._invmp(this.m);
          if (inv.negative !== 0) {
            inv.negative = 0;
            return this.imod(inv).redNeg();
          } else {
            return this.imod(inv);
          }
        };
        Red.prototype.pow = function pow(a, num) {
          if (num.isZero()) return new BN(1).toRed(this);
          if (num.cmpn(1) === 0) return a.clone();
          var windowSize = 4;
          var wnd = new Array(1 << windowSize);
          wnd[0] = new BN(1).toRed(this);
          wnd[1] = a;
          for (var i = 2; i < wnd.length; i++) {
            wnd[i] = this.mul(wnd[i - 1], a);
          }
          var res = wnd[0];
          var current = 0;
          var currentLen = 0;
          var start = num.bitLength() % 26;
          if (start === 0) {
            start = 26;
          }
          for (i = num.length - 1; i >= 0; i--) {
            var word = num.words[i];
            for (var j = start - 1; j >= 0; j--) {
              var bit = word >> j & 1;
              if (res !== wnd[0]) {
                res = this.sqr(res);
              }
              if (bit === 0 && current === 0) {
                currentLen = 0;
                continue;
              }
              current <<= 1;
              current |= bit;
              currentLen++;
              if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
              res = this.mul(res, wnd[current]);
              currentLen = 0;
              current = 0;
            }
            start = 26;
          }
          return res;
        };
        Red.prototype.convertTo = function convertTo(num) {
          var r = num.umod(this.m);
          return r === num ? r.clone() : r;
        };
        Red.prototype.convertFrom = function convertFrom(num) {
          var res = num.clone();
          res.red = null;
          return res;
        };
        BN.mont = function mont(num) {
          return new Mont(num);
        };
        function Mont(m) {
          Red.call(this, m);
          this.shift = this.m.bitLength();
          if (this.shift % 26 !== 0) {
            this.shift += 26 - this.shift % 26;
          }
          this.r = new BN(1).iushln(this.shift);
          this.r2 = this.imod(this.r.sqr());
          this.rinv = this.r._invmp(this.m);
          this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
          this.minv = this.minv.umod(this.r);
          this.minv = this.r.sub(this.minv);
        }
        inherits(Mont, Red);
        Mont.prototype.convertTo = function convertTo(num) {
          return this.imod(num.ushln(this.shift));
        };
        Mont.prototype.convertFrom = function convertFrom(num) {
          var r = this.imod(num.mul(this.rinv));
          r.red = null;
          return r;
        };
        Mont.prototype.imul = function imul(a, b) {
          if (a.isZero() || b.isZero()) {
            a.words[0] = 0;
            a.length = 1;
            return a;
          }
          var t = a.imul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.mul = function mul(a, b) {
          if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
          var t = a.mul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.invm = function invm(a) {
          var res = this.imod(a._invmp(this.m).mul(this.r2));
          return res._forceRed(this);
        };
      })(false || module, this);
    },
    655(module) {
      "use strict";
      var $defineProperty = Object.defineProperty || false;
      if ($defineProperty) {
        try {
          $defineProperty({}, "a", {
            value: 1
          });
        } catch (e) {
          $defineProperty = false;
        }
      }
      module.exports = $defineProperty;
    },
    1237(module) {
      "use strict";
      module.exports = EvalError;
    },
    9383(module) {
      "use strict";
      module.exports = Error;
    },
    9290(module) {
      "use strict";
      module.exports = RangeError;
    },
    9538(module) {
      "use strict";
      module.exports = ReferenceError;
    },
    8068(module) {
      "use strict";
      module.exports = SyntaxError;
    },
    9675(module) {
      "use strict";
      module.exports = TypeError;
    },
    5345(module) {
      "use strict";
      module.exports = URIError;
    },
    9612(module) {
      "use strict";
      module.exports = Object;
    },
    7007(module) {
      "use strict";
      var R = typeof Reflect === "object" ? Reflect : null;
      var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply(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 ReflectOwnKeys(target) {
          return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
        };
      } else {
        ReflectOwnKeys = function ReflectOwnKeys(target) {
          return Object.getOwnPropertyNames(target);
        };
      }
      function ProcessEmitWarning(warning) {
        if (console && console.warn) console.warn(warning);
      }
      var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {
        return value !== value;
      };
      function EventEmitter() {
        EventEmitter.init.call(this);
      }
      module.exports = EventEmitter;
      module.exports.once = once;
      EventEmitter.EventEmitter = EventEmitter;
      EventEmitter.prototype._events = undefined;
      EventEmitter.prototype._eventsCount = 0;
      EventEmitter.prototype._maxListeners = undefined;
      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 === undefined || this._events === Object.getPrototypeOf(this)._events) {
          this._events = Object.create(null);
          this._eventsCount = 0;
        }
        this._maxListeners = this._maxListeners || undefined;
      };
      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 === undefined) return EventEmitter.defaultMaxListeners;
        return that._maxListeners;
      }
      EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
        return _getMaxListeners(this);
      };
      EventEmitter.prototype.emit = function emit(type) {
        var args = [];
        for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);
        var doError = type === "error";
        var events = this._events;
        if (events !== undefined) doError = doError && events.error === undefined; 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 = events[type];
        if (handler === undefined) 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, type, listener, prepend) {
        var m;
        var events;
        var existing;
        checkListener(listener);
        events = target._events;
        if (events === undefined) {
          events = target._events = Object.create(null);
          target._eventsCount = 0;
        } else {
          if (events.newListener !== undefined) {
            target.emit("newListener", type, listener.listener ? listener.listener : listener);
            events = target._events;
          }
          existing = events[type];
        }
        if (existing === undefined) {
          existing = events[type] = listener;
          ++target._eventsCount;
        } else {
          if (typeof existing === "function") {
            existing = events[type] = 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(type) + " listeners " + "added. Use emitter.setMaxListeners() to " + "increase limit");
            w.name = "MaxListenersExceededWarning";
            w.emitter = target;
            w.type = type;
            w.count = existing.length;
            ProcessEmitWarning(w);
          }
        }
        return target;
      }
      EventEmitter.prototype.addListener = function addListener(type, listener) {
        return _addListener(this, type, listener, false);
      };
      EventEmitter.prototype.on = EventEmitter.prototype.addListener;
      EventEmitter.prototype.prependListener = function prependListener(type, listener) {
        return _addListener(this, type, 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, type, listener) {
        var state = {
          fired: false,
          wrapFn: undefined,
          target,
          type,
          listener
        };
        var wrapped = onceWrapper.bind(state);
        wrapped.listener = listener;
        state.wrapFn = wrapped;
        return wrapped;
      }
      EventEmitter.prototype.once = function once(type, listener) {
        checkListener(listener);
        this.on(type, _onceWrap(this, type, listener));
        return this;
      };
      EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
        checkListener(listener);
        this.prependListener(type, _onceWrap(this, type, listener));
        return this;
      };
      EventEmitter.prototype.removeListener = function removeListener(type, listener) {
        var list, events, position, i, originalListener;
        checkListener(listener);
        events = this._events;
        if (events === undefined) return this;
        list = events[type];
        if (list === undefined) return this;
        if (list === listener || list.listener === listener) {
          if (--this._eventsCount === 0) this._events = Object.create(null); else {
            delete events[type];
            if (events.removeListener) this.emit("removeListener", type, 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) events[type] = list[0];
          if (events.removeListener !== undefined) this.emit("removeListener", type, originalListener || listener);
        }
        return this;
      };
      EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
      EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
        var listeners, events, i;
        events = this._events;
        if (events === undefined) return this;
        if (events.removeListener === undefined) {
          if (arguments.length === 0) {
            this._events = Object.create(null);
            this._eventsCount = 0;
          } else if (events[type] !== undefined) {
            if (--this._eventsCount === 0) this._events = Object.create(null); else delete events[type];
          }
          return this;
        }
        if (arguments.length === 0) {
          var keys = Object.keys(events);
          var key;
          for (i = 0; i < keys.length; ++i) {
            key = keys[i];
            if (key === "removeListener") continue;
            this.removeAllListeners(key);
          }
          this.removeAllListeners("removeListener");
          this._events = Object.create(null);
          this._eventsCount = 0;
          return this;
        }
        listeners = events[type];
        if (typeof listeners === "function") {
          this.removeListener(type, listeners);
        } else if (listeners !== undefined) {
          for (i = listeners.length - 1; i >= 0; i--) {
            this.removeListener(type, listeners[i]);
          }
        }
        return this;
      };
      function _listeners(target, type, unwrap) {
        var events = target._events;
        if (events === undefined) return [];
        var evlistener = events[type];
        if (evlistener === undefined) return [];
        if (typeof evlistener === "function") return unwrap ? [ evlistener.listener || evlistener ] : [ evlistener ];
        return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
      }
      EventEmitter.prototype.listeners = function listeners(type) {
        return _listeners(this, type, true);
      };
      EventEmitter.prototype.rawListeners = function rawListeners(type) {
        return _listeners(this, type, false);
      };
      EventEmitter.listenerCount = function(emitter, type) {
        if (typeof emitter.listenerCount === "function") {
          return emitter.listenerCount(type);
        } else {
          return listenerCount.call(emitter, type);
        }
      };
      EventEmitter.prototype.listenerCount = listenerCount;
      function listenerCount(type) {
        var events = this._events;
        if (events !== undefined) {
          var evlistener = events[type];
          if (typeof evlistener === "function") {
            return 1;
          } else if (evlistener !== undefined) {
            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);
        }
      }
    },
    8078(module, __unused_webpack_exports, __webpack_require__) {
      var Buffer = __webpack_require__(2861).Buffer;
      var MD5 = __webpack_require__(8276);
      function EVP_BytesToKey(password, salt, keyBits, ivLen) {
        if (!Buffer.isBuffer(password)) password = Buffer.from(password, "binary");
        if (salt) {
          if (!Buffer.isBuffer(salt)) salt = Buffer.from(salt, "binary");
          if (salt.length !== 8) throw new RangeError("salt should be Buffer with 8 byte length");
        }
        var keyLen = keyBits / 8;
        var key = Buffer.alloc(keyLen);
        var iv = Buffer.alloc(ivLen || 0);
        var tmp = Buffer.alloc(0);
        while (keyLen > 0 || ivLen > 0) {
          var hash = new MD5;
          hash.update(tmp);
          hash.update(password);
          if (salt) hash.update(salt);
          tmp = hash.digest();
          var used = 0;
          if (keyLen > 0) {
            var keyStart = key.length - keyLen;
            used = Math.min(keyLen, tmp.length);
            tmp.copy(key, keyStart, 0, used);
            keyLen -= used;
          }
          if (used < tmp.length && ivLen > 0) {
            var ivStart = iv.length - ivLen;
            var length = Math.min(ivLen, tmp.length - used);
            tmp.copy(iv, ivStart, used, used + length);
            ivLen -= length;
          }
        }
        tmp.fill(0);
        return {
          key,
          iv
        };
      }
      module.exports = EVP_BytesToKey;
    },
    2682(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var isCallable = __webpack_require__(9600);
      var toStr = Object.prototype.toString;
      var hasOwnProperty = Object.prototype.hasOwnProperty;
      var forEachArray = function forEachArray(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 forEachString(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 forEachObject(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);
            }
          }
        }
      };
      function isArray(x) {
        return toStr.call(x) === "[object Array]";
      }
      module.exports = function forEach(list, iterator, thisArg) {
        if (!isCallable(iterator)) {
          throw new TypeError("iterator must be a function");
        }
        var receiver;
        if (arguments.length >= 3) {
          receiver = thisArg;
        }
        if (isArray(list)) {
          forEachArray(list, iterator, receiver);
        } else if (typeof list === "string") {
          forEachString(list, iterator, receiver);
        } else {
          forEachObject(list, iterator, receiver);
        }
      };
    },
    9353(module) {
      "use strict";
      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 concatty(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 slicy(arrLike, offset) {
        var arr = [];
        for (var i = offset || 0, 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;
      };
      module.exports = 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 Empty() {};
          Empty.prototype = target.prototype;
          bound.prototype = new Empty;
          Empty.prototype = null;
        }
        return bound;
      };
    },
    6743(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var implementation = __webpack_require__(9353);
      module.exports = Function.prototype.bind || implementation;
    },
    453(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var undefined;
      var $Object = __webpack_require__(9612);
      var $Error = __webpack_require__(9383);
      var $EvalError = __webpack_require__(1237);
      var $RangeError = __webpack_require__(9290);
      var $ReferenceError = __webpack_require__(9538);
      var $SyntaxError = __webpack_require__(8068);
      var $TypeError = __webpack_require__(9675);
      var $URIError = __webpack_require__(5345);
      var abs = __webpack_require__(1514);
      var floor = __webpack_require__(8968);
      var max = __webpack_require__(6188);
      var min = __webpack_require__(8002);
      var pow = __webpack_require__(5880);
      var round = __webpack_require__(414);
      var sign = __webpack_require__(3093);
      var $Function = Function;
      var getEvalledConstructor = function(expressionSyntax) {
        try {
          return $Function('"use strict"; return (' + expressionSyntax + ").constructor;")();
        } catch (e) {}
      };
      var $gOPD = __webpack_require__(5795);
      var $defineProperty = __webpack_require__(655);
      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 hasSymbols = __webpack_require__(4039)();
      var getProto = __webpack_require__(3628);
      var $ObjectGPO = __webpack_require__(1064);
      var $ReflectGPO = __webpack_require__(8648);
      var $apply = __webpack_require__(1002);
      var $call = __webpack_require__(76);
      var needsEval = {};
      var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined : getProto(Uint8Array);
      var INTRINSICS = {
        __proto__: null,
        "%AggregateError%": typeof AggregateError === "undefined" ? undefined : AggregateError,
        "%Array%": Array,
        "%ArrayBuffer%": typeof ArrayBuffer === "undefined" ? undefined : ArrayBuffer,
        "%ArrayIteratorPrototype%": hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,
        "%AsyncFromSyncIteratorPrototype%": undefined,
        "%AsyncFunction%": needsEval,
        "%AsyncGenerator%": needsEval,
        "%AsyncGeneratorFunction%": needsEval,
        "%AsyncIteratorPrototype%": needsEval,
        "%Atomics%": typeof Atomics === "undefined" ? undefined : Atomics,
        "%BigInt%": typeof BigInt === "undefined" ? undefined : BigInt,
        "%BigInt64Array%": typeof BigInt64Array === "undefined" ? undefined : BigInt64Array,
        "%BigUint64Array%": typeof BigUint64Array === "undefined" ? undefined : BigUint64Array,
        "%Boolean%": Boolean,
        "%DataView%": typeof DataView === "undefined" ? undefined : DataView,
        "%Date%": Date,
        "%decodeURI%": decodeURI,
        "%decodeURIComponent%": decodeURIComponent,
        "%encodeURI%": encodeURI,
        "%encodeURIComponent%": encodeURIComponent,
        "%Error%": $Error,
        "%eval%": eval,
        "%EvalError%": $EvalError,
        "%Float16Array%": typeof Float16Array === "undefined" ? undefined : Float16Array,
        "%Float32Array%": typeof Float32Array === "undefined" ? undefined : Float32Array,
        "%Float64Array%": typeof Float64Array === "undefined" ? undefined : Float64Array,
        "%FinalizationRegistry%": typeof FinalizationRegistry === "undefined" ? undefined : FinalizationRegistry,
        "%Function%": $Function,
        "%GeneratorFunction%": needsEval,
        "%Int8Array%": typeof Int8Array === "undefined" ? undefined : Int8Array,
        "%Int16Array%": typeof Int16Array === "undefined" ? undefined : Int16Array,
        "%Int32Array%": typeof Int32Array === "undefined" ? undefined : Int32Array,
        "%isFinite%": isFinite,
        "%isNaN%": isNaN,
        "%IteratorPrototype%": hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,
        "%JSON%": typeof JSON === "object" ? JSON : undefined,
        "%Map%": typeof Map === "undefined" ? undefined : Map,
        "%MapIteratorPrototype%": typeof Map === "undefined" || !hasSymbols || !getProto ? undefined : getProto((new Map)[Symbol.iterator]()),
        "%Math%": Math,
        "%Number%": Number,
        "%Object%": $Object,
        "%Object.getOwnPropertyDescriptor%": $gOPD,
        "%parseFloat%": parseFloat,
        "%parseInt%": parseInt,
        "%Promise%": typeof Promise === "undefined" ? undefined : Promise,
        "%Proxy%": typeof Proxy === "undefined" ? undefined : Proxy,
        "%RangeError%": $RangeError,
        "%ReferenceError%": $ReferenceError,
        "%Reflect%": typeof Reflect === "undefined" ? undefined : Reflect,
        "%RegExp%": RegExp,
        "%Set%": typeof Set === "undefined" ? undefined : Set,
        "%SetIteratorPrototype%": typeof Set === "undefined" || !hasSymbols || !getProto ? undefined : getProto((new Set)[Symbol.iterator]()),
        "%SharedArrayBuffer%": typeof SharedArrayBuffer === "undefined" ? undefined : SharedArrayBuffer,
        "%String%": String,
        "%StringIteratorPrototype%": hasSymbols && getProto ? getProto(""[Symbol.iterator]()) : undefined,
        "%Symbol%": hasSymbols ? Symbol : undefined,
        "%SyntaxError%": $SyntaxError,
        "%ThrowTypeError%": ThrowTypeError,
        "%TypedArray%": TypedArray,
        "%TypeError%": $TypeError,
        "%Uint8Array%": typeof Uint8Array === "undefined" ? undefined : Uint8Array,
        "%Uint8ClampedArray%": typeof Uint8ClampedArray === "undefined" ? undefined : Uint8ClampedArray,
        "%Uint16Array%": typeof Uint16Array === "undefined" ? undefined : Uint16Array,
        "%Uint32Array%": typeof Uint32Array === "undefined" ? undefined : Uint32Array,
        "%URIError%": $URIError,
        "%WeakMap%": typeof WeakMap === "undefined" ? undefined : WeakMap,
        "%WeakRef%": typeof WeakRef === "undefined" ? undefined : WeakRef,
        "%WeakSet%": typeof WeakSet === "undefined" ? undefined : WeakSet,
        "%Function.prototype.call%": $call,
        "%Function.prototype.apply%": $apply,
        "%Object.defineProperty%": $defineProperty,
        "%Object.getPrototypeOf%": $ObjectGPO,
        "%Math.abs%": abs,
        "%Math.floor%": floor,
        "%Math.max%": max,
        "%Math.min%": min,
        "%Math.pow%": pow,
        "%Math.round%": round,
        "%Math.sign%": sign,
        "%Reflect.getPrototypeOf%": $ReflectGPO
      };
      if (getProto) {
        try {
          null.error;
        } catch (e) {
          var errorProto = getProto(getProto(e));
          INTRINSICS["%Error.prototype%"] = errorProto;
        }
      }
      var doEval = function doEval(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 = doEval("%AsyncGeneratorFunction%");
          if (fn) {
            value = fn.prototype;
          }
        } else if (name === "%AsyncIteratorPrototype%") {
          var gen = doEval("%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 = __webpack_require__(6743);
      var hasOwn = __webpack_require__(9957);
      var $concat = bind.call($call, Array.prototype.concat);
      var $spliceApply = bind.call($apply, Array.prototype.splice);
      var $replace = bind.call($call, String.prototype.replace);
      var $strSlice = bind.call($call, String.prototype.slice);
      var $exec = bind.call($call, RegExp.prototype.exec);
      var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
      var reEscapeChar = /\\(\\)?/g;
      var stringToPath = function stringToPath(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 getBaseIntrinsic(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!");
      };
      module.exports = 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 undefined;
            }
            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;
      };
    },
    1064(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var $Object = __webpack_require__(9612);
      module.exports = $Object.getPrototypeOf || null;
    },
    8648(module) {
      "use strict";
      module.exports = typeof Reflect !== "undefined" && Reflect.getPrototypeOf || null;
    },
    3628(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var reflectGetProto = __webpack_require__(8648);
      var originalGetProto = __webpack_require__(1064);
      var getDunderProto = __webpack_require__(7176);
      module.exports = reflectGetProto ? function getProto(O) {
        return reflectGetProto(O);
      } : originalGetProto ? function getProto(O) {
        if (!O || typeof O !== "object" && typeof O !== "function") {
          throw new TypeError("getProto: not an object");
        }
        return originalGetProto(O);
      } : getDunderProto ? function getProto(O) {
        return getDunderProto(O);
      } : null;
    },
    6549(module) {
      "use strict";
      module.exports = Object.getOwnPropertyDescriptor;
    },
    5795(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var $gOPD = __webpack_require__(6549);
      if ($gOPD) {
        try {
          $gOPD([], "length");
        } catch (e) {
          $gOPD = null;
        }
      }
      module.exports = $gOPD;
    },
    592(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var $defineProperty = __webpack_require__(655);
      var hasPropertyDescriptors = function hasPropertyDescriptors() {
        return !!$defineProperty;
      };
      hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
        if (!$defineProperty) {
          return null;
        }
        try {
          return $defineProperty([], "length", {
            value: 1
          }).length !== 1;
        } catch (e) {
          return true;
        }
      };
      module.exports = hasPropertyDescriptors;
    },
    4039(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var origSymbol = typeof Symbol !== "undefined" && Symbol;
      var hasSymbolSham = __webpack_require__(1333);
      module.exports = 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();
      };
    },
    1333(module) {
      "use strict";
      module.exports = function hasSymbols() {
        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 (var _ 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;
      };
    },
    9092(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var hasSymbols = __webpack_require__(1333);
      module.exports = function hasToStringTagShams() {
        return hasSymbols() && !!Symbol.toStringTag;
      };
    },
    4729(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var Transform = __webpack_require__(8310).Transform;
      var inherits = __webpack_require__(6698);
      function HashBase(blockSize) {
        Transform.call(this);
        this._block = Buffer.allocUnsafe(blockSize);
        this._blockSize = blockSize;
        this._blockOffset = 0;
        this._length = [ 0, 0, 0, 0 ];
        this._finalized = false;
      }
      inherits(HashBase, Transform);
      HashBase.prototype._transform = function(chunk, encoding, callback) {
        var error = null;
        try {
          this.update(chunk, encoding);
        } catch (err) {
          error = err;
        }
        callback(error);
      };
      HashBase.prototype._flush = function(callback) {
        var error = null;
        try {
          this.push(this.digest());
        } catch (err) {
          error = err;
        }
        callback(error);
      };
      var useUint8Array = typeof Uint8Array !== "undefined";
      var useArrayBuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined" && ArrayBuffer.isView && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT);
      function toBuffer(data, encoding) {
        if (data instanceof Buffer) return data;
        if (typeof data === "string") return Buffer.from(data, encoding);
        if (useArrayBuffer && ArrayBuffer.isView(data)) {
          if (data.byteLength === 0) return Buffer.alloc(0);
          var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
          if (res.byteLength === data.byteLength) return res;
        }
        if (useUint8Array && data instanceof Uint8Array) return Buffer.from(data);
        if (Buffer.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) {
          return Buffer.from(data);
        }
        throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.');
      }
      HashBase.prototype.update = function(data, encoding) {
        if (this._finalized) throw new Error("Digest already called");
        data = toBuffer(data, encoding);
        var block = this._block;
        var offset = 0;
        while (this._blockOffset + data.length - offset >= this._blockSize) {
          for (var i = this._blockOffset; i < this._blockSize; ) block[i++] = data[offset++];
          this._update();
          this._blockOffset = 0;
        }
        while (offset < data.length) block[this._blockOffset++] = data[offset++];
        for (var j = 0, carry = data.length * 8; carry > 0; ++j) {
          this._length[j] += carry;
          carry = this._length[j] / 4294967296 | 0;
          if (carry > 0) this._length[j] -= 4294967296 * carry;
        }
        return this;
      };
      HashBase.prototype._update = function() {
        throw new Error("_update is not implemented");
      };
      HashBase.prototype.digest = function(encoding) {
        if (this._finalized) throw new Error("Digest already called");
        this._finalized = true;
        var digest = this._digest();
        if (encoding !== undefined) digest = digest.toString(encoding);
        this._block.fill(0);
        this._blockOffset = 0;
        for (var i = 0; i < 4; ++i) this._length[i] = 0;
        return digest;
      };
      HashBase.prototype._digest = function() {
        throw new Error("_digest is not implemented");
      };
      module.exports = HashBase;
    },
    7952(__unused_webpack_module, exports, __webpack_require__) {
      var hash = exports;
      hash.utils = __webpack_require__(7426);
      hash.common = __webpack_require__(6166);
      hash.sha = __webpack_require__(8610);
      hash.ripemd = __webpack_require__(6784);
      hash.hmac = __webpack_require__(8948);
      hash.sha1 = hash.sha.sha1;
      hash.sha256 = hash.sha.sha256;
      hash.sha224 = hash.sha.sha224;
      hash.sha384 = hash.sha.sha384;
      hash.sha512 = hash.sha.sha512;
      hash.ripemd160 = hash.ripemd.ripemd160;
    },
    6166(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var assert = __webpack_require__(3349);
      function BlockHash() {
        this.pending = null;
        this.pendingTotal = 0;
        this.blockSize = this.constructor.blockSize;
        this.outSize = this.constructor.outSize;
        this.hmacStrength = this.constructor.hmacStrength;
        this.padLength = this.constructor.padLength / 8;
        this.endian = "big";
        this._delta8 = this.blockSize / 8;
        this._delta32 = this.blockSize / 32;
      }
      exports.BlockHash = BlockHash;
      BlockHash.prototype.update = function update(msg, enc) {
        msg = utils.toArray(msg, enc);
        if (!this.pending) this.pending = msg; else this.pending = this.pending.concat(msg);
        this.pendingTotal += msg.length;
        if (this.pending.length >= this._delta8) {
          msg = this.pending;
          var r = msg.length % this._delta8;
          this.pending = msg.slice(msg.length - r, msg.length);
          if (this.pending.length === 0) this.pending = null;
          msg = utils.join32(msg, 0, msg.length - r, this.endian);
          for (var i = 0; i < msg.length; i += this._delta32) this._update(msg, i, i + this._delta32);
        }
        return this;
      };
      BlockHash.prototype.digest = function digest(enc) {
        this.update(this._pad());
        assert(this.pending === null);
        return this._digest(enc);
      };
      BlockHash.prototype._pad = function pad() {
        var len = this.pendingTotal;
        var bytes = this._delta8;
        var k = bytes - (len + this.padLength) % bytes;
        var res = new Array(k + this.padLength);
        res[0] = 128;
        for (var i = 1; i < k; i++) res[i] = 0;
        len <<= 3;
        if (this.endian === "big") {
          for (var t = 8; t < this.padLength; t++) res[i++] = 0;
          res[i++] = 0;
          res[i++] = 0;
          res[i++] = 0;
          res[i++] = 0;
          res[i++] = len >>> 24 & 255;
          res[i++] = len >>> 16 & 255;
          res[i++] = len >>> 8 & 255;
          res[i++] = len & 255;
        } else {
          res[i++] = len & 255;
          res[i++] = len >>> 8 & 255;
          res[i++] = len >>> 16 & 255;
          res[i++] = len >>> 24 & 255;
          res[i++] = 0;
          res[i++] = 0;
          res[i++] = 0;
          res[i++] = 0;
          for (t = 8; t < this.padLength; t++) res[i++] = 0;
        }
        return res;
      };
    },
    8948(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var assert = __webpack_require__(3349);
      function Hmac(hash, key, enc) {
        if (!(this instanceof Hmac)) return new Hmac(hash, key, enc);
        this.Hash = hash;
        this.blockSize = hash.blockSize / 8;
        this.outSize = hash.outSize / 8;
        this.inner = null;
        this.outer = null;
        this._init(utils.toArray(key, enc));
      }
      module.exports = Hmac;
      Hmac.prototype._init = function init(key) {
        if (key.length > this.blockSize) key = (new this.Hash).update(key).digest();
        assert(key.length <= this.blockSize);
        for (var i = key.length; i < this.blockSize; i++) key.push(0);
        for (i = 0; i < key.length; i++) key[i] ^= 54;
        this.inner = (new this.Hash).update(key);
        for (i = 0; i < key.length; i++) key[i] ^= 106;
        this.outer = (new this.Hash).update(key);
      };
      Hmac.prototype.update = function update(msg, enc) {
        this.inner.update(msg, enc);
        return this;
      };
      Hmac.prototype.digest = function digest(enc) {
        this.outer.update(this.inner.digest());
        return this.outer.digest(enc);
      };
    },
    6784(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var common = __webpack_require__(6166);
      var rotl32 = utils.rotl32;
      var sum32 = utils.sum32;
      var sum32_3 = utils.sum32_3;
      var sum32_4 = utils.sum32_4;
      var BlockHash = common.BlockHash;
      function RIPEMD160() {
        if (!(this instanceof RIPEMD160)) return new RIPEMD160;
        BlockHash.call(this);
        this.h = [ 1732584193, 4023233417, 2562383102, 271733878, 3285377520 ];
        this.endian = "little";
      }
      utils.inherits(RIPEMD160, BlockHash);
      exports.ripemd160 = RIPEMD160;
      RIPEMD160.blockSize = 512;
      RIPEMD160.outSize = 160;
      RIPEMD160.hmacStrength = 192;
      RIPEMD160.padLength = 64;
      RIPEMD160.prototype._update = function update(msg, start) {
        var A = this.h[0];
        var B = this.h[1];
        var C = this.h[2];
        var D = this.h[3];
        var E = this.h[4];
        var Ah = A;
        var Bh = B;
        var Ch = C;
        var Dh = D;
        var Eh = E;
        for (var j = 0; j < 80; j++) {
          var T = sum32(rotl32(sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)), s[j]), E);
          A = E;
          E = D;
          D = rotl32(C, 10);
          C = B;
          B = T;
          T = sum32(rotl32(sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)), sh[j]), Eh);
          Ah = Eh;
          Eh = Dh;
          Dh = rotl32(Ch, 10);
          Ch = Bh;
          Bh = T;
        }
        T = sum32_3(this.h[1], C, Dh);
        this.h[1] = sum32_3(this.h[2], D, Eh);
        this.h[2] = sum32_3(this.h[3], E, Ah);
        this.h[3] = sum32_3(this.h[4], A, Bh);
        this.h[4] = sum32_3(this.h[0], B, Ch);
        this.h[0] = T;
      };
      RIPEMD160.prototype._digest = function digest(enc) {
        if (enc === "hex") return utils.toHex32(this.h, "little"); else return utils.split32(this.h, "little");
      };
      function f(j, x, y, z) {
        if (j <= 15) return x ^ y ^ z; else if (j <= 31) return x & y | ~x & z; else if (j <= 47) return (x | ~y) ^ z; else if (j <= 63) return x & z | y & ~z; else return x ^ (y | ~z);
      }
      function K(j) {
        if (j <= 15) return 0; else if (j <= 31) return 1518500249; else if (j <= 47) return 1859775393; else if (j <= 63) return 2400959708; else return 2840853838;
      }
      function Kh(j) {
        if (j <= 15) return 1352829926; else if (j <= 31) return 1548603684; else if (j <= 47) return 1836072691; else if (j <= 63) return 2053994217; else return 0;
      }
      var r = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 ];
      var rh = [ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 ];
      var s = [ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ];
      var sh = [ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ];
    },
    8610(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      exports.sha1 = __webpack_require__(3917);
      exports.sha224 = __webpack_require__(7714);
      exports.sha256 = __webpack_require__(2287);
      exports.sha384 = __webpack_require__(1911);
      exports.sha512 = __webpack_require__(7766);
    },
    3917(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var common = __webpack_require__(6166);
      var shaCommon = __webpack_require__(6225);
      var rotl32 = utils.rotl32;
      var sum32 = utils.sum32;
      var sum32_5 = utils.sum32_5;
      var ft_1 = shaCommon.ft_1;
      var BlockHash = common.BlockHash;
      var sha1_K = [ 1518500249, 1859775393, 2400959708, 3395469782 ];
      function SHA1() {
        if (!(this instanceof SHA1)) return new SHA1;
        BlockHash.call(this);
        this.h = [ 1732584193, 4023233417, 2562383102, 271733878, 3285377520 ];
        this.W = new Array(80);
      }
      utils.inherits(SHA1, BlockHash);
      module.exports = SHA1;
      SHA1.blockSize = 512;
      SHA1.outSize = 160;
      SHA1.hmacStrength = 80;
      SHA1.padLength = 64;
      SHA1.prototype._update = function _update(msg, start) {
        var W = this.W;
        for (var i = 0; i < 16; i++) W[i] = msg[start + i];
        for (;i < W.length; i++) W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
        var a = this.h[0];
        var b = this.h[1];
        var c = this.h[2];
        var d = this.h[3];
        var e = this.h[4];
        for (i = 0; i < W.length; i++) {
          var s = ~~(i / 20);
          var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
          e = d;
          d = c;
          c = rotl32(b, 30);
          b = a;
          a = t;
        }
        this.h[0] = sum32(this.h[0], a);
        this.h[1] = sum32(this.h[1], b);
        this.h[2] = sum32(this.h[2], c);
        this.h[3] = sum32(this.h[3], d);
        this.h[4] = sum32(this.h[4], e);
      };
      SHA1.prototype._digest = function digest(enc) {
        if (enc === "hex") return utils.toHex32(this.h, "big"); else return utils.split32(this.h, "big");
      };
    },
    7714(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var SHA256 = __webpack_require__(2287);
      function SHA224() {
        if (!(this instanceof SHA224)) return new SHA224;
        SHA256.call(this);
        this.h = [ 3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428 ];
      }
      utils.inherits(SHA224, SHA256);
      module.exports = SHA224;
      SHA224.blockSize = 512;
      SHA224.outSize = 224;
      SHA224.hmacStrength = 192;
      SHA224.padLength = 64;
      SHA224.prototype._digest = function digest(enc) {
        if (enc === "hex") return utils.toHex32(this.h.slice(0, 7), "big"); else return utils.split32(this.h.slice(0, 7), "big");
      };
    },
    2287(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var common = __webpack_require__(6166);
      var shaCommon = __webpack_require__(6225);
      var assert = __webpack_require__(3349);
      var sum32 = utils.sum32;
      var sum32_4 = utils.sum32_4;
      var sum32_5 = utils.sum32_5;
      var ch32 = shaCommon.ch32;
      var maj32 = shaCommon.maj32;
      var s0_256 = shaCommon.s0_256;
      var s1_256 = shaCommon.s1_256;
      var g0_256 = shaCommon.g0_256;
      var g1_256 = shaCommon.g1_256;
      var BlockHash = common.BlockHash;
      var sha256_K = [ 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298 ];
      function SHA256() {
        if (!(this instanceof SHA256)) return new SHA256;
        BlockHash.call(this);
        this.h = [ 1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225 ];
        this.k = sha256_K;
        this.W = new Array(64);
      }
      utils.inherits(SHA256, BlockHash);
      module.exports = SHA256;
      SHA256.blockSize = 512;
      SHA256.outSize = 256;
      SHA256.hmacStrength = 192;
      SHA256.padLength = 64;
      SHA256.prototype._update = function _update(msg, start) {
        var W = this.W;
        for (var i = 0; i < 16; i++) W[i] = msg[start + i];
        for (;i < W.length; i++) W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
        var a = this.h[0];
        var b = this.h[1];
        var c = this.h[2];
        var d = this.h[3];
        var e = this.h[4];
        var f = this.h[5];
        var g = this.h[6];
        var h = this.h[7];
        assert(this.k.length === W.length);
        for (i = 0; i < W.length; i++) {
          var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
          var T2 = sum32(s0_256(a), maj32(a, b, c));
          h = g;
          g = f;
          f = e;
          e = sum32(d, T1);
          d = c;
          c = b;
          b = a;
          a = sum32(T1, T2);
        }
        this.h[0] = sum32(this.h[0], a);
        this.h[1] = sum32(this.h[1], b);
        this.h[2] = sum32(this.h[2], c);
        this.h[3] = sum32(this.h[3], d);
        this.h[4] = sum32(this.h[4], e);
        this.h[5] = sum32(this.h[5], f);
        this.h[6] = sum32(this.h[6], g);
        this.h[7] = sum32(this.h[7], h);
      };
      SHA256.prototype._digest = function digest(enc) {
        if (enc === "hex") return utils.toHex32(this.h, "big"); else return utils.split32(this.h, "big");
      };
    },
    1911(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var SHA512 = __webpack_require__(7766);
      function SHA384() {
        if (!(this instanceof SHA384)) return new SHA384;
        SHA512.call(this);
        this.h = [ 3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428 ];
      }
      utils.inherits(SHA384, SHA512);
      module.exports = SHA384;
      SHA384.blockSize = 1024;
      SHA384.outSize = 384;
      SHA384.hmacStrength = 192;
      SHA384.padLength = 128;
      SHA384.prototype._digest = function digest(enc) {
        if (enc === "hex") return utils.toHex32(this.h.slice(0, 12), "big"); else return utils.split32(this.h.slice(0, 12), "big");
      };
    },
    7766(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var common = __webpack_require__(6166);
      var assert = __webpack_require__(3349);
      var rotr64_hi = utils.rotr64_hi;
      var rotr64_lo = utils.rotr64_lo;
      var shr64_hi = utils.shr64_hi;
      var shr64_lo = utils.shr64_lo;
      var sum64 = utils.sum64;
      var sum64_hi = utils.sum64_hi;
      var sum64_lo = utils.sum64_lo;
      var sum64_4_hi = utils.sum64_4_hi;
      var sum64_4_lo = utils.sum64_4_lo;
      var sum64_5_hi = utils.sum64_5_hi;
      var sum64_5_lo = utils.sum64_5_lo;
      var BlockHash = common.BlockHash;
      var sha512_K = [ 1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591 ];
      function SHA512() {
        if (!(this instanceof SHA512)) return new SHA512;
        BlockHash.call(this);
        this.h = [ 1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209 ];
        this.k = sha512_K;
        this.W = new Array(160);
      }
      utils.inherits(SHA512, BlockHash);
      module.exports = SHA512;
      SHA512.blockSize = 1024;
      SHA512.outSize = 512;
      SHA512.hmacStrength = 192;
      SHA512.padLength = 128;
      SHA512.prototype._prepareBlock = function _prepareBlock(msg, start) {
        var W = this.W;
        for (var i = 0; i < 32; i++) W[i] = msg[start + i];
        for (;i < W.length; i += 2) {
          var c0_hi = g1_512_hi(W[i - 4], W[i - 3]);
          var c0_lo = g1_512_lo(W[i - 4], W[i - 3]);
          var c1_hi = W[i - 14];
          var c1_lo = W[i - 13];
          var c2_hi = g0_512_hi(W[i - 30], W[i - 29]);
          var c2_lo = g0_512_lo(W[i - 30], W[i - 29]);
          var c3_hi = W[i - 32];
          var c3_lo = W[i - 31];
          W[i] = sum64_4_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);
          W[i + 1] = sum64_4_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo);
        }
      };
      SHA512.prototype._update = function _update(msg, start) {
        this._prepareBlock(msg, start);
        var W = this.W;
        var ah = this.h[0];
        var al = this.h[1];
        var bh = this.h[2];
        var bl = this.h[3];
        var ch = this.h[4];
        var cl = this.h[5];
        var dh = this.h[6];
        var dl = this.h[7];
        var eh = this.h[8];
        var el = this.h[9];
        var fh = this.h[10];
        var fl = this.h[11];
        var gh = this.h[12];
        var gl = this.h[13];
        var hh = this.h[14];
        var hl = this.h[15];
        assert(this.k.length === W.length);
        for (var i = 0; i < W.length; i += 2) {
          var c0_hi = hh;
          var c0_lo = hl;
          var c1_hi = s1_512_hi(eh, el);
          var c1_lo = s1_512_lo(eh, el);
          var c2_hi = ch64_hi(eh, el, fh, fl, gh, gl);
          var c2_lo = ch64_lo(eh, el, fh, fl, gh, gl);
          var c3_hi = this.k[i];
          var c3_lo = this.k[i + 1];
          var c4_hi = W[i];
          var c4_lo = W[i + 1];
          var T1_hi = sum64_5_hi(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);
          var T1_lo = sum64_5_lo(c0_hi, c0_lo, c1_hi, c1_lo, c2_hi, c2_lo, c3_hi, c3_lo, c4_hi, c4_lo);
          c0_hi = s0_512_hi(ah, al);
          c0_lo = s0_512_lo(ah, al);
          c1_hi = maj64_hi(ah, al, bh, bl, ch, cl);
          c1_lo = maj64_lo(ah, al, bh, bl, ch, cl);
          var T2_hi = sum64_hi(c0_hi, c0_lo, c1_hi, c1_lo);
          var T2_lo = sum64_lo(c0_hi, c0_lo, c1_hi, c1_lo);
          hh = gh;
          hl = gl;
          gh = fh;
          gl = fl;
          fh = eh;
          fl = el;
          eh = sum64_hi(dh, dl, T1_hi, T1_lo);
          el = sum64_lo(dl, dl, T1_hi, T1_lo);
          dh = ch;
          dl = cl;
          ch = bh;
          cl = bl;
          bh = ah;
          bl = al;
          ah = sum64_hi(T1_hi, T1_lo, T2_hi, T2_lo);
          al = sum64_lo(T1_hi, T1_lo, T2_hi, T2_lo);
        }
        sum64(this.h, 0, ah, al);
        sum64(this.h, 2, bh, bl);
        sum64(this.h, 4, ch, cl);
        sum64(this.h, 6, dh, dl);
        sum64(this.h, 8, eh, el);
        sum64(this.h, 10, fh, fl);
        sum64(this.h, 12, gh, gl);
        sum64(this.h, 14, hh, hl);
      };
      SHA512.prototype._digest = function digest(enc) {
        if (enc === "hex") return utils.toHex32(this.h, "big"); else return utils.split32(this.h, "big");
      };
      function ch64_hi(xh, xl, yh, yl, zh) {
        var r = xh & yh ^ ~xh & zh;
        if (r < 0) r += 4294967296;
        return r;
      }
      function ch64_lo(xh, xl, yh, yl, zh, zl) {
        var r = xl & yl ^ ~xl & zl;
        if (r < 0) r += 4294967296;
        return r;
      }
      function maj64_hi(xh, xl, yh, yl, zh) {
        var r = xh & yh ^ xh & zh ^ yh & zh;
        if (r < 0) r += 4294967296;
        return r;
      }
      function maj64_lo(xh, xl, yh, yl, zh, zl) {
        var r = xl & yl ^ xl & zl ^ yl & zl;
        if (r < 0) r += 4294967296;
        return r;
      }
      function s0_512_hi(xh, xl) {
        var c0_hi = rotr64_hi(xh, xl, 28);
        var c1_hi = rotr64_hi(xl, xh, 2);
        var c2_hi = rotr64_hi(xl, xh, 7);
        var r = c0_hi ^ c1_hi ^ c2_hi;
        if (r < 0) r += 4294967296;
        return r;
      }
      function s0_512_lo(xh, xl) {
        var c0_lo = rotr64_lo(xh, xl, 28);
        var c1_lo = rotr64_lo(xl, xh, 2);
        var c2_lo = rotr64_lo(xl, xh, 7);
        var r = c0_lo ^ c1_lo ^ c2_lo;
        if (r < 0) r += 4294967296;
        return r;
      }
      function s1_512_hi(xh, xl) {
        var c0_hi = rotr64_hi(xh, xl, 14);
        var c1_hi = rotr64_hi(xh, xl, 18);
        var c2_hi = rotr64_hi(xl, xh, 9);
        var r = c0_hi ^ c1_hi ^ c2_hi;
        if (r < 0) r += 4294967296;
        return r;
      }
      function s1_512_lo(xh, xl) {
        var c0_lo = rotr64_lo(xh, xl, 14);
        var c1_lo = rotr64_lo(xh, xl, 18);
        var c2_lo = rotr64_lo(xl, xh, 9);
        var r = c0_lo ^ c1_lo ^ c2_lo;
        if (r < 0) r += 4294967296;
        return r;
      }
      function g0_512_hi(xh, xl) {
        var c0_hi = rotr64_hi(xh, xl, 1);
        var c1_hi = rotr64_hi(xh, xl, 8);
        var c2_hi = shr64_hi(xh, xl, 7);
        var r = c0_hi ^ c1_hi ^ c2_hi;
        if (r < 0) r += 4294967296;
        return r;
      }
      function g0_512_lo(xh, xl) {
        var c0_lo = rotr64_lo(xh, xl, 1);
        var c1_lo = rotr64_lo(xh, xl, 8);
        var c2_lo = shr64_lo(xh, xl, 7);
        var r = c0_lo ^ c1_lo ^ c2_lo;
        if (r < 0) r += 4294967296;
        return r;
      }
      function g1_512_hi(xh, xl) {
        var c0_hi = rotr64_hi(xh, xl, 19);
        var c1_hi = rotr64_hi(xl, xh, 29);
        var c2_hi = shr64_hi(xh, xl, 6);
        var r = c0_hi ^ c1_hi ^ c2_hi;
        if (r < 0) r += 4294967296;
        return r;
      }
      function g1_512_lo(xh, xl) {
        var c0_lo = rotr64_lo(xh, xl, 19);
        var c1_lo = rotr64_lo(xl, xh, 29);
        var c2_lo = shr64_lo(xh, xl, 6);
        var r = c0_lo ^ c1_lo ^ c2_lo;
        if (r < 0) r += 4294967296;
        return r;
      }
    },
    6225(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var utils = __webpack_require__(7426);
      var rotr32 = utils.rotr32;
      function ft_1(s, x, y, z) {
        if (s === 0) return ch32(x, y, z);
        if (s === 1 || s === 3) return p32(x, y, z);
        if (s === 2) return maj32(x, y, z);
      }
      exports.ft_1 = ft_1;
      function ch32(x, y, z) {
        return x & y ^ ~x & z;
      }
      exports.ch32 = ch32;
      function maj32(x, y, z) {
        return x & y ^ x & z ^ y & z;
      }
      exports.maj32 = maj32;
      function p32(x, y, z) {
        return x ^ y ^ z;
      }
      exports.p32 = p32;
      function s0_256(x) {
        return rotr32(x, 2) ^ rotr32(x, 13) ^ rotr32(x, 22);
      }
      exports.s0_256 = s0_256;
      function s1_256(x) {
        return rotr32(x, 6) ^ rotr32(x, 11) ^ rotr32(x, 25);
      }
      exports.s1_256 = s1_256;
      function g0_256(x) {
        return rotr32(x, 7) ^ rotr32(x, 18) ^ x >>> 3;
      }
      exports.g0_256 = g0_256;
      function g1_256(x) {
        return rotr32(x, 17) ^ rotr32(x, 19) ^ x >>> 10;
      }
      exports.g1_256 = g1_256;
    },
    7426(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var assert = __webpack_require__(3349);
      var inherits = __webpack_require__(6698);
      exports.inherits = inherits;
      function isSurrogatePair(msg, i) {
        if ((msg.charCodeAt(i) & 64512) !== 55296) {
          return false;
        }
        if (i < 0 || i + 1 >= msg.length) {
          return false;
        }
        return (msg.charCodeAt(i + 1) & 64512) === 56320;
      }
      function toArray(msg, enc) {
        if (Array.isArray(msg)) return msg.slice();
        if (!msg) return [];
        var res = [];
        if (typeof msg === "string") {
          if (!enc) {
            var p = 0;
            for (var i = 0; i < msg.length; i++) {
              var c = msg.charCodeAt(i);
              if (c < 128) {
                res[p++] = c;
              } else if (c < 2048) {
                res[p++] = c >> 6 | 192;
                res[p++] = c & 63 | 128;
              } else if (isSurrogatePair(msg, i)) {
                c = 65536 + ((c & 1023) << 10) + (msg.charCodeAt(++i) & 1023);
                res[p++] = c >> 18 | 240;
                res[p++] = c >> 12 & 63 | 128;
                res[p++] = c >> 6 & 63 | 128;
                res[p++] = c & 63 | 128;
              } else {
                res[p++] = c >> 12 | 224;
                res[p++] = c >> 6 & 63 | 128;
                res[p++] = c & 63 | 128;
              }
            }
          } else if (enc === "hex") {
            msg = msg.replace(/[^a-z0-9]+/gi, "");
            if (msg.length % 2 !== 0) msg = "0" + msg;
            for (i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));
          }
        } else {
          for (i = 0; i < msg.length; i++) res[i] = msg[i] | 0;
        }
        return res;
      }
      exports.toArray = toArray;
      function toHex(msg) {
        var res = "";
        for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));
        return res;
      }
      exports.toHex = toHex;
      function htonl(w) {
        var res = w >>> 24 | w >>> 8 & 65280 | w << 8 & 16711680 | (w & 255) << 24;
        return res >>> 0;
      }
      exports.htonl = htonl;
      function toHex32(msg, endian) {
        var res = "";
        for (var i = 0; i < msg.length; i++) {
          var w = msg[i];
          if (endian === "little") w = htonl(w);
          res += zero8(w.toString(16));
        }
        return res;
      }
      exports.toHex32 = toHex32;
      function zero2(word) {
        if (word.length === 1) return "0" + word; else return word;
      }
      exports.zero2 = zero2;
      function zero8(word) {
        if (word.length === 7) return "0" + word; else if (word.length === 6) return "00" + word; else if (word.length === 5) return "000" + word; else if (word.length === 4) return "0000" + word; else if (word.length === 3) return "00000" + word; else if (word.length === 2) return "000000" + word; else if (word.length === 1) return "0000000" + word; else return word;
      }
      exports.zero8 = zero8;
      function join32(msg, start, end, endian) {
        var len = end - start;
        assert(len % 4 === 0);
        var res = new Array(len / 4);
        for (var i = 0, k = start; i < res.length; i++, k += 4) {
          var w;
          if (endian === "big") w = msg[k] << 24 | msg[k + 1] << 16 | msg[k + 2] << 8 | msg[k + 3]; else w = msg[k + 3] << 24 | msg[k + 2] << 16 | msg[k + 1] << 8 | msg[k];
          res[i] = w >>> 0;
        }
        return res;
      }
      exports.join32 = join32;
      function split32(msg, endian) {
        var res = new Array(msg.length * 4);
        for (var i = 0, k = 0; i < msg.length; i++, k += 4) {
          var m = msg[i];
          if (endian === "big") {
            res[k] = m >>> 24;
            res[k + 1] = m >>> 16 & 255;
            res[k + 2] = m >>> 8 & 255;
            res[k + 3] = m & 255;
          } else {
            res[k + 3] = m >>> 24;
            res[k + 2] = m >>> 16 & 255;
            res[k + 1] = m >>> 8 & 255;
            res[k] = m & 255;
          }
        }
        return res;
      }
      exports.split32 = split32;
      function rotr32(w, b) {
        return w >>> b | w << 32 - b;
      }
      exports.rotr32 = rotr32;
      function rotl32(w, b) {
        return w << b | w >>> 32 - b;
      }
      exports.rotl32 = rotl32;
      function sum32(a, b) {
        return a + b >>> 0;
      }
      exports.sum32 = sum32;
      function sum32_3(a, b, c) {
        return a + b + c >>> 0;
      }
      exports.sum32_3 = sum32_3;
      function sum32_4(a, b, c, d) {
        return a + b + c + d >>> 0;
      }
      exports.sum32_4 = sum32_4;
      function sum32_5(a, b, c, d, e) {
        return a + b + c + d + e >>> 0;
      }
      exports.sum32_5 = sum32_5;
      function sum64(buf, pos, ah, al) {
        var bh = buf[pos];
        var bl = buf[pos + 1];
        var lo = al + bl >>> 0;
        var hi = (lo < al ? 1 : 0) + ah + bh;
        buf[pos] = hi >>> 0;
        buf[pos + 1] = lo;
      }
      exports.sum64 = sum64;
      function sum64_hi(ah, al, bh, bl) {
        var lo = al + bl >>> 0;
        var hi = (lo < al ? 1 : 0) + ah + bh;
        return hi >>> 0;
      }
      exports.sum64_hi = sum64_hi;
      function sum64_lo(ah, al, bh, bl) {
        var lo = al + bl;
        return lo >>> 0;
      }
      exports.sum64_lo = sum64_lo;
      function sum64_4_hi(ah, al, bh, bl, ch, cl, dh, dl) {
        var carry = 0;
        var lo = al;
        lo = lo + bl >>> 0;
        carry += lo < al ? 1 : 0;
        lo = lo + cl >>> 0;
        carry += lo < cl ? 1 : 0;
        lo = lo + dl >>> 0;
        carry += lo < dl ? 1 : 0;
        var hi = ah + bh + ch + dh + carry;
        return hi >>> 0;
      }
      exports.sum64_4_hi = sum64_4_hi;
      function sum64_4_lo(ah, al, bh, bl, ch, cl, dh, dl) {
        var lo = al + bl + cl + dl;
        return lo >>> 0;
      }
      exports.sum64_4_lo = sum64_4_lo;
      function sum64_5_hi(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
        var carry = 0;
        var lo = al;
        lo = lo + bl >>> 0;
        carry += lo < al ? 1 : 0;
        lo = lo + cl >>> 0;
        carry += lo < cl ? 1 : 0;
        lo = lo + dl >>> 0;
        carry += lo < dl ? 1 : 0;
        lo = lo + el >>> 0;
        carry += lo < el ? 1 : 0;
        var hi = ah + bh + ch + dh + eh + carry;
        return hi >>> 0;
      }
      exports.sum64_5_hi = sum64_5_hi;
      function sum64_5_lo(ah, al, bh, bl, ch, cl, dh, dl, eh, el) {
        var lo = al + bl + cl + dl + el;
        return lo >>> 0;
      }
      exports.sum64_5_lo = sum64_5_lo;
      function rotr64_hi(ah, al, num) {
        var r = al << 32 - num | ah >>> num;
        return r >>> 0;
      }
      exports.rotr64_hi = rotr64_hi;
      function rotr64_lo(ah, al, num) {
        var r = ah << 32 - num | al >>> num;
        return r >>> 0;
      }
      exports.rotr64_lo = rotr64_lo;
      function shr64_hi(ah, al, num) {
        return ah >>> num;
      }
      exports.shr64_hi = shr64_hi;
      function shr64_lo(ah, al, num) {
        var r = ah << 32 - num | al >>> num;
        return r >>> 0;
      }
      exports.shr64_lo = shr64_lo;
    },
    9957(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var call = Function.prototype.call;
      var $hasOwn = Object.prototype.hasOwnProperty;
      var bind = __webpack_require__(6743);
      module.exports = bind.call(call, $hasOwn);
    },
    2723(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var hash = __webpack_require__(7952);
      var utils = __webpack_require__(4367);
      var assert = __webpack_require__(3349);
      function HmacDRBG(options) {
        if (!(this instanceof HmacDRBG)) return new HmacDRBG(options);
        this.hash = options.hash;
        this.predResist = !!options.predResist;
        this.outLen = this.hash.outSize;
        this.minEntropy = options.minEntropy || this.hash.hmacStrength;
        this._reseed = null;
        this.reseedInterval = null;
        this.K = null;
        this.V = null;
        var entropy = utils.toArray(options.entropy, options.entropyEnc || "hex");
        var nonce = utils.toArray(options.nonce, options.nonceEnc || "hex");
        var pers = utils.toArray(options.pers, options.persEnc || "hex");
        assert(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits");
        this._init(entropy, nonce, pers);
      }
      module.exports = HmacDRBG;
      HmacDRBG.prototype._init = function init(entropy, nonce, pers) {
        var seed = entropy.concat(nonce).concat(pers);
        this.K = new Array(this.outLen / 8);
        this.V = new Array(this.outLen / 8);
        for (var i = 0; i < this.V.length; i++) {
          this.K[i] = 0;
          this.V[i] = 1;
        }
        this._update(seed);
        this._reseed = 1;
        this.reseedInterval = 281474976710656;
      };
      HmacDRBG.prototype._hmac = function hmac() {
        return new hash.hmac(this.hash, this.K);
      };
      HmacDRBG.prototype._update = function update(seed) {
        var kmac = this._hmac().update(this.V).update([ 0 ]);
        if (seed) kmac = kmac.update(seed);
        this.K = kmac.digest();
        this.V = this._hmac().update(this.V).digest();
        if (!seed) return;
        this.K = this._hmac().update(this.V).update([ 1 ]).update(seed).digest();
        this.V = this._hmac().update(this.V).digest();
      };
      HmacDRBG.prototype.reseed = function reseed(entropy, entropyEnc, add, addEnc) {
        if (typeof entropyEnc !== "string") {
          addEnc = add;
          add = entropyEnc;
          entropyEnc = null;
        }
        entropy = utils.toArray(entropy, entropyEnc);
        add = utils.toArray(add, addEnc);
        assert(entropy.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits");
        this._update(entropy.concat(add || []));
        this._reseed = 1;
      };
      HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) {
        if (this._reseed > this.reseedInterval) throw new Error("Reseed is required");
        if (typeof enc !== "string") {
          addEnc = add;
          add = enc;
          enc = null;
        }
        if (add) {
          add = utils.toArray(add, addEnc || "hex");
          this._update(add);
        }
        var temp = [];
        while (temp.length < len) {
          this.V = this._hmac().update(this.V).digest();
          temp = temp.concat(this.V);
        }
        var res = temp.slice(0, len);
        this._update(add);
        this._reseed++;
        return utils.encode(res, enc);
      };
    },
    251(__unused_webpack_module, exports) {
      exports.read = function(buffer, 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 = buffer[offset + i];
        i += d;
        e = s & (1 << -nBits) - 1;
        s >>= -nBits;
        nBits += eLen;
        for (;nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
        m = e & (1 << -nBits) - 1;
        e >>= -nBits;
        nBits += mLen;
        for (;nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
        if (e === 0) {
          e = 1 - eBias;
        } else if (e === eMax) {
          return m ? NaN : (s ? -1 : 1) * Infinity;
        } else {
          m = m + Math.pow(2, mLen);
          e = e - eBias;
        }
        return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
      };
      exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
        var e, m, c;
        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; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {}
        e = e << mLen | m;
        eLen += mLen;
        for (;eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {}
        buffer[offset + i - d] |= s * 128;
      };
    },
    6698(module) {
      if (typeof Object.create === "function") {
        module.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 {
        module.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;
          }
        };
      }
    },
    9600(module) {
      "use strict";
      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;
          };
        }
      }
      module.exports = reflectApply ? function isCallable(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 isCallable(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);
      };
    },
    5680(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var whichTypedArray = __webpack_require__(5767);
      module.exports = function isTypedArray(value) {
        return !!whichTypedArray(value);
      };
    },
    4634(module) {
      var toString = {}.toString;
      module.exports = Array.isArray || function(arr) {
        return toString.call(arr) == "[object Array]";
      };
    },
    1176(module, exports, __webpack_require__) {
      var process = __webpack_require__(5606);
      var __WEBPACK_AMD_DEFINE_RESULT__;
      (function() {
        "use strict";
        var INPUT_ERROR = "input is invalid type";
        var FINALIZE_ERROR = "finalize already called";
        var WINDOW = typeof window === "object";
        var root = WINDOW ? window : {};
        if (root.JS_SHA3_NO_WINDOW) {
          WINDOW = false;
        }
        var WEB_WORKER = !WINDOW && typeof self === "object";
        var NODE_JS = !root.JS_SHA3_NO_NODE_JS && typeof process === "object" && process.versions && process.versions.node;
        if (NODE_JS) {
          root = __webpack_require__.g;
        } else if (WEB_WORKER) {
          root = self;
        }
        var COMMON_JS = !root.JS_SHA3_NO_COMMON_JS && "object" === "object" && module.exports;
        var AMD = true && __webpack_require__.amdO;
        var ARRAY_BUFFER = !root.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer !== "undefined";
        var HEX_CHARS = "0123456789abcdef".split("");
        var SHAKE_PADDING = [ 31, 7936, 2031616, 520093696 ];
        var CSHAKE_PADDING = [ 4, 1024, 262144, 67108864 ];
        var KECCAK_PADDING = [ 1, 256, 65536, 16777216 ];
        var PADDING = [ 6, 1536, 393216, 100663296 ];
        var SHIFT = [ 0, 8, 16, 24 ];
        var RC = [ 1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648 ];
        var BITS = [ 224, 256, 384, 512 ];
        var SHAKE_BITS = [ 128, 256 ];
        var OUTPUT_TYPES = [ "hex", "buffer", "arrayBuffer", "array", "digest" ];
        var CSHAKE_BYTEPAD = {
          128: 168,
          256: 136
        };
        if (root.JS_SHA3_NO_NODE_JS || !Array.isArray) {
          Array.isArray = function(obj) {
            return Object.prototype.toString.call(obj) === "[object Array]";
          };
        }
        if (ARRAY_BUFFER && (root.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
          ArrayBuffer.isView = function(obj) {
            return typeof obj === "object" && obj.buffer && obj.buffer.constructor === ArrayBuffer;
          };
        }
        var createOutputMethod = function(bits, padding, outputType) {
          return function(message) {
            return new Keccak(bits, padding, bits).update(message)[outputType]();
          };
        };
        var createShakeOutputMethod = function(bits, padding, outputType) {
          return function(message, outputBits) {
            return new Keccak(bits, padding, outputBits).update(message)[outputType]();
          };
        };
        var createCshakeOutputMethod = function(bits, padding, outputType) {
          return function(message, outputBits, n, s) {
            return methods["cshake" + bits].update(message, outputBits, n, s)[outputType]();
          };
        };
        var createKmacOutputMethod = function(bits, padding, outputType) {
          return function(key, message, outputBits, s) {
            return methods["kmac" + bits].update(key, message, outputBits, s)[outputType]();
          };
        };
        var createOutputMethods = function(method, createMethod, bits, padding) {
          for (var i = 0; i < OUTPUT_TYPES.length; ++i) {
            var type = OUTPUT_TYPES[i];
            method[type] = createMethod(bits, padding, type);
          }
          return method;
        };
        var createMethod = function(bits, padding) {
          var method = createOutputMethod(bits, padding, "hex");
          method.create = function() {
            return new Keccak(bits, padding, bits);
          };
          method.update = function(message) {
            return method.create().update(message);
          };
          return createOutputMethods(method, createOutputMethod, bits, padding);
        };
        var createShakeMethod = function(bits, padding) {
          var method = createShakeOutputMethod(bits, padding, "hex");
          method.create = function(outputBits) {
            return new Keccak(bits, padding, outputBits);
          };
          method.update = function(message, outputBits) {
            return method.create(outputBits).update(message);
          };
          return createOutputMethods(method, createShakeOutputMethod, bits, padding);
        };
        var createCshakeMethod = function(bits, padding) {
          var w = CSHAKE_BYTEPAD[bits];
          var method = createCshakeOutputMethod(bits, padding, "hex");
          method.create = function(outputBits, n, s) {
            if (!n && !s) {
              return methods["shake" + bits].create(outputBits);
            } else {
              return new Keccak(bits, padding, outputBits).bytepad([ n, s ], w);
            }
          };
          method.update = function(message, outputBits, n, s) {
            return method.create(outputBits, n, s).update(message);
          };
          return createOutputMethods(method, createCshakeOutputMethod, bits, padding);
        };
        var createKmacMethod = function(bits, padding) {
          var w = CSHAKE_BYTEPAD[bits];
          var method = createKmacOutputMethod(bits, padding, "hex");
          method.create = function(key, outputBits, s) {
            return new Kmac(bits, padding, outputBits).bytepad([ "KMAC", s ], w).bytepad([ key ], w);
          };
          method.update = function(key, message, outputBits, s) {
            return method.create(key, outputBits, s).update(message);
          };
          return createOutputMethods(method, createKmacOutputMethod, bits, padding);
        };
        var algorithms = [ {
          name: "keccak",
          padding: KECCAK_PADDING,
          bits: BITS,
          createMethod
        }, {
          name: "sha3",
          padding: PADDING,
          bits: BITS,
          createMethod
        }, {
          name: "shake",
          padding: SHAKE_PADDING,
          bits: SHAKE_BITS,
          createMethod: createShakeMethod
        }, {
          name: "cshake",
          padding: CSHAKE_PADDING,
          bits: SHAKE_BITS,
          createMethod: createCshakeMethod
        }, {
          name: "kmac",
          padding: CSHAKE_PADDING,
          bits: SHAKE_BITS,
          createMethod: createKmacMethod
        } ];
        var methods = {}, methodNames = [];
        for (var i = 0; i < algorithms.length; ++i) {
          var algorithm = algorithms[i];
          var bits = algorithm.bits;
          for (var j = 0; j < bits.length; ++j) {
            var methodName = algorithm.name + "_" + bits[j];
            methodNames.push(methodName);
            methods[methodName] = algorithm.createMethod(bits[j], algorithm.padding);
            if (algorithm.name !== "sha3") {
              var newMethodName = algorithm.name + bits[j];
              methodNames.push(newMethodName);
              methods[newMethodName] = methods[methodName];
            }
          }
        }
        function Keccak(bits, padding, outputBits) {
          this.blocks = [];
          this.s = [];
          this.padding = padding;
          this.outputBits = outputBits;
          this.reset = true;
          this.finalized = false;
          this.block = 0;
          this.start = 0;
          this.blockCount = 1600 - (bits << 1) >> 5;
          this.byteCount = this.blockCount << 2;
          this.outputBlocks = outputBits >> 5;
          this.extraBytes = (outputBits & 31) >> 3;
          for (var i = 0; i < 50; ++i) {
            this.s[i] = 0;
          }
        }
        Keccak.prototype.update = function(message) {
          if (this.finalized) {
            throw new Error(FINALIZE_ERROR);
          }
          var notString, type = typeof message;
          if (type !== "string") {
            if (type === "object") {
              if (message === null) {
                throw new Error(INPUT_ERROR);
              } else if (ARRAY_BUFFER && message.constructor === ArrayBuffer) {
                message = new Uint8Array(message);
              } else if (!Array.isArray(message)) {
                if (!ARRAY_BUFFER || !ArrayBuffer.isView(message)) {
                  throw new Error(INPUT_ERROR);
                }
              }
            } else {
              throw new Error(INPUT_ERROR);
            }
            notString = true;
          }
          var blocks = this.blocks, byteCount = this.byteCount, length = message.length, blockCount = this.blockCount, index = 0, s = this.s, i, code;
          while (index < length) {
            if (this.reset) {
              this.reset = false;
              blocks[0] = this.block;
              for (i = 1; i < blockCount + 1; ++i) {
                blocks[i] = 0;
              }
            }
            if (notString) {
              for (i = this.start; index < length && i < byteCount; ++index) {
                blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];
              }
            } else {
              for (i = this.start; index < length && i < byteCount; ++index) {
                code = message.charCodeAt(index);
                if (code < 128) {
                  blocks[i >> 2] |= code << SHIFT[i++ & 3];
                } else if (code < 2048) {
                  blocks[i >> 2] |= (192 | code >> 6) << SHIFT[i++ & 3];
                  blocks[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
                } else if (code < 55296 || code >= 57344) {
                  blocks[i >> 2] |= (224 | code >> 12) << SHIFT[i++ & 3];
                  blocks[i >> 2] |= (128 | code >> 6 & 63) << SHIFT[i++ & 3];
                  blocks[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
                } else {
                  code = 65536 + ((code & 1023) << 10 | message.charCodeAt(++index) & 1023);
                  blocks[i >> 2] |= (240 | code >> 18) << SHIFT[i++ & 3];
                  blocks[i >> 2] |= (128 | code >> 12 & 63) << SHIFT[i++ & 3];
                  blocks[i >> 2] |= (128 | code >> 6 & 63) << SHIFT[i++ & 3];
                  blocks[i >> 2] |= (128 | code & 63) << SHIFT[i++ & 3];
                }
              }
            }
            this.lastByteIndex = i;
            if (i >= byteCount) {
              this.start = i - byteCount;
              this.block = blocks[blockCount];
              for (i = 0; i < blockCount; ++i) {
                s[i] ^= blocks[i];
              }
              f(s);
              this.reset = true;
            } else {
              this.start = i;
            }
          }
          return this;
        };
        Keccak.prototype.encode = function(x, right) {
          var o = x & 255, n = 1;
          var bytes = [ o ];
          x = x >> 8;
          o = x & 255;
          while (o > 0) {
            bytes.unshift(o);
            x = x >> 8;
            o = x & 255;
            ++n;
          }
          if (right) {
            bytes.push(n);
          } else {
            bytes.unshift(n);
          }
          this.update(bytes);
          return bytes.length;
        };
        Keccak.prototype.encodeString = function(str) {
          var notString, type = typeof str;
          if (type !== "string") {
            if (type === "object") {
              if (str === null) {
                throw new Error(INPUT_ERROR);
              } else if (ARRAY_BUFFER && str.constructor === ArrayBuffer) {
                str = new Uint8Array(str);
              } else if (!Array.isArray(str)) {
                if (!ARRAY_BUFFER || !ArrayBuffer.isView(str)) {
                  throw new Error(INPUT_ERROR);
                }
              }
            } else {
              throw new Error(INPUT_ERROR);
            }
            notString = true;
          }
          var bytes = 0, length = str.length;
          if (notString) {
            bytes = length;
          } else {
            for (var i = 0; i < str.length; ++i) {
              var code = str.charCodeAt(i);
              if (code < 128) {
                bytes += 1;
              } else if (code < 2048) {
                bytes += 2;
              } else if (code < 55296 || code >= 57344) {
                bytes += 3;
              } else {
                code = 65536 + ((code & 1023) << 10 | str.charCodeAt(++i) & 1023);
                bytes += 4;
              }
            }
          }
          bytes += this.encode(bytes * 8);
          this.update(str);
          return bytes;
        };
        Keccak.prototype.bytepad = function(strs, w) {
          var bytes = this.encode(w);
          for (var i = 0; i < strs.length; ++i) {
            bytes += this.encodeString(strs[i]);
          }
          var paddingBytes = w - bytes % w;
          var zeros = [];
          zeros.length = paddingBytes;
          this.update(zeros);
          return this;
        };
        Keccak.prototype.finalize = function() {
          if (this.finalized) {
            return;
          }
          this.finalized = true;
          var blocks = this.blocks, i = this.lastByteIndex, blockCount = this.blockCount, s = this.s;
          blocks[i >> 2] |= this.padding[i & 3];
          if (this.lastByteIndex === this.byteCount) {
            blocks[0] = blocks[blockCount];
            for (i = 1; i < blockCount + 1; ++i) {
              blocks[i] = 0;
            }
          }
          blocks[blockCount - 1] |= 2147483648;
          for (i = 0; i < blockCount; ++i) {
            s[i] ^= blocks[i];
          }
          f(s);
        };
        Keccak.prototype.toString = Keccak.prototype.hex = function() {
          this.finalize();
          var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
          var hex = "", block;
          while (j < outputBlocks) {
            for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
              block = s[i];
              hex += HEX_CHARS[block >> 4 & 15] + HEX_CHARS[block & 15] + HEX_CHARS[block >> 12 & 15] + HEX_CHARS[block >> 8 & 15] + HEX_CHARS[block >> 20 & 15] + HEX_CHARS[block >> 16 & 15] + HEX_CHARS[block >> 28 & 15] + HEX_CHARS[block >> 24 & 15];
            }
            if (j % blockCount === 0) {
              f(s);
              i = 0;
            }
          }
          if (extraBytes) {
            block = s[i];
            hex += HEX_CHARS[block >> 4 & 15] + HEX_CHARS[block & 15];
            if (extraBytes > 1) {
              hex += HEX_CHARS[block >> 12 & 15] + HEX_CHARS[block >> 8 & 15];
            }
            if (extraBytes > 2) {
              hex += HEX_CHARS[block >> 20 & 15] + HEX_CHARS[block >> 16 & 15];
            }
          }
          return hex;
        };
        Keccak.prototype.arrayBuffer = function() {
          this.finalize();
          var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
          var bytes = this.outputBits >> 3;
          var buffer;
          if (extraBytes) {
            buffer = new ArrayBuffer(outputBlocks + 1 << 2);
          } else {
            buffer = new ArrayBuffer(bytes);
          }
          var array = new Uint32Array(buffer);
          while (j < outputBlocks) {
            for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
              array[j] = s[i];
            }
            if (j % blockCount === 0) {
              f(s);
            }
          }
          if (extraBytes) {
            array[i] = s[i];
            buffer = buffer.slice(0, bytes);
          }
          return buffer;
        };
        Keccak.prototype.buffer = Keccak.prototype.arrayBuffer;
        Keccak.prototype.digest = Keccak.prototype.array = function() {
          this.finalize();
          var blockCount = this.blockCount, s = this.s, outputBlocks = this.outputBlocks, extraBytes = this.extraBytes, i = 0, j = 0;
          var array = [], offset, block;
          while (j < outputBlocks) {
            for (i = 0; i < blockCount && j < outputBlocks; ++i, ++j) {
              offset = j << 2;
              block = s[i];
              array[offset] = block & 255;
              array[offset + 1] = block >> 8 & 255;
              array[offset + 2] = block >> 16 & 255;
              array[offset + 3] = block >> 24 & 255;
            }
            if (j % blockCount === 0) {
              f(s);
            }
          }
          if (extraBytes) {
            offset = j << 2;
            block = s[i];
            array[offset] = block & 255;
            if (extraBytes > 1) {
              array[offset + 1] = block >> 8 & 255;
            }
            if (extraBytes > 2) {
              array[offset + 2] = block >> 16 & 255;
            }
          }
          return array;
        };
        function Kmac(bits, padding, outputBits) {
          Keccak.call(this, bits, padding, outputBits);
        }
        Kmac.prototype = new Keccak;
        Kmac.prototype.finalize = function() {
          this.encode(this.outputBits, true);
          return Keccak.prototype.finalize.call(this);
        };
        var f = function(s) {
          var h, l, n, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26, b27, b28, b29, b30, b31, b32, b33, b34, b35, b36, b37, b38, b39, b40, b41, b42, b43, b44, b45, b46, b47, b48, b49;
          for (n = 0; n < 48; n += 2) {
            c0 = s[0] ^ s[10] ^ s[20] ^ s[30] ^ s[40];
            c1 = s[1] ^ s[11] ^ s[21] ^ s[31] ^ s[41];
            c2 = s[2] ^ s[12] ^ s[22] ^ s[32] ^ s[42];
            c3 = s[3] ^ s[13] ^ s[23] ^ s[33] ^ s[43];
            c4 = s[4] ^ s[14] ^ s[24] ^ s[34] ^ s[44];
            c5 = s[5] ^ s[15] ^ s[25] ^ s[35] ^ s[45];
            c6 = s[6] ^ s[16] ^ s[26] ^ s[36] ^ s[46];
            c7 = s[7] ^ s[17] ^ s[27] ^ s[37] ^ s[47];
            c8 = s[8] ^ s[18] ^ s[28] ^ s[38] ^ s[48];
            c9 = s[9] ^ s[19] ^ s[29] ^ s[39] ^ s[49];
            h = c8 ^ (c2 << 1 | c3 >>> 31);
            l = c9 ^ (c3 << 1 | c2 >>> 31);
            s[0] ^= h;
            s[1] ^= l;
            s[10] ^= h;
            s[11] ^= l;
            s[20] ^= h;
            s[21] ^= l;
            s[30] ^= h;
            s[31] ^= l;
            s[40] ^= h;
            s[41] ^= l;
            h = c0 ^ (c4 << 1 | c5 >>> 31);
            l = c1 ^ (c5 << 1 | c4 >>> 31);
            s[2] ^= h;
            s[3] ^= l;
            s[12] ^= h;
            s[13] ^= l;
            s[22] ^= h;
            s[23] ^= l;
            s[32] ^= h;
            s[33] ^= l;
            s[42] ^= h;
            s[43] ^= l;
            h = c2 ^ (c6 << 1 | c7 >>> 31);
            l = c3 ^ (c7 << 1 | c6 >>> 31);
            s[4] ^= h;
            s[5] ^= l;
            s[14] ^= h;
            s[15] ^= l;
            s[24] ^= h;
            s[25] ^= l;
            s[34] ^= h;
            s[35] ^= l;
            s[44] ^= h;
            s[45] ^= l;
            h = c4 ^ (c8 << 1 | c9 >>> 31);
            l = c5 ^ (c9 << 1 | c8 >>> 31);
            s[6] ^= h;
            s[7] ^= l;
            s[16] ^= h;
            s[17] ^= l;
            s[26] ^= h;
            s[27] ^= l;
            s[36] ^= h;
            s[37] ^= l;
            s[46] ^= h;
            s[47] ^= l;
            h = c6 ^ (c0 << 1 | c1 >>> 31);
            l = c7 ^ (c1 << 1 | c0 >>> 31);
            s[8] ^= h;
            s[9] ^= l;
            s[18] ^= h;
            s[19] ^= l;
            s[28] ^= h;
            s[29] ^= l;
            s[38] ^= h;
            s[39] ^= l;
            s[48] ^= h;
            s[49] ^= l;
            b0 = s[0];
            b1 = s[1];
            b32 = s[11] << 4 | s[10] >>> 28;
            b33 = s[10] << 4 | s[11] >>> 28;
            b14 = s[20] << 3 | s[21] >>> 29;
            b15 = s[21] << 3 | s[20] >>> 29;
            b46 = s[31] << 9 | s[30] >>> 23;
            b47 = s[30] << 9 | s[31] >>> 23;
            b28 = s[40] << 18 | s[41] >>> 14;
            b29 = s[41] << 18 | s[40] >>> 14;
            b20 = s[2] << 1 | s[3] >>> 31;
            b21 = s[3] << 1 | s[2] >>> 31;
            b2 = s[13] << 12 | s[12] >>> 20;
            b3 = s[12] << 12 | s[13] >>> 20;
            b34 = s[22] << 10 | s[23] >>> 22;
            b35 = s[23] << 10 | s[22] >>> 22;
            b16 = s[33] << 13 | s[32] >>> 19;
            b17 = s[32] << 13 | s[33] >>> 19;
            b48 = s[42] << 2 | s[43] >>> 30;
            b49 = s[43] << 2 | s[42] >>> 30;
            b40 = s[5] << 30 | s[4] >>> 2;
            b41 = s[4] << 30 | s[5] >>> 2;
            b22 = s[14] << 6 | s[15] >>> 26;
            b23 = s[15] << 6 | s[14] >>> 26;
            b4 = s[25] << 11 | s[24] >>> 21;
            b5 = s[24] << 11 | s[25] >>> 21;
            b36 = s[34] << 15 | s[35] >>> 17;
            b37 = s[35] << 15 | s[34] >>> 17;
            b18 = s[45] << 29 | s[44] >>> 3;
            b19 = s[44] << 29 | s[45] >>> 3;
            b10 = s[6] << 28 | s[7] >>> 4;
            b11 = s[7] << 28 | s[6] >>> 4;
            b42 = s[17] << 23 | s[16] >>> 9;
            b43 = s[16] << 23 | s[17] >>> 9;
            b24 = s[26] << 25 | s[27] >>> 7;
            b25 = s[27] << 25 | s[26] >>> 7;
            b6 = s[36] << 21 | s[37] >>> 11;
            b7 = s[37] << 21 | s[36] >>> 11;
            b38 = s[47] << 24 | s[46] >>> 8;
            b39 = s[46] << 24 | s[47] >>> 8;
            b30 = s[8] << 27 | s[9] >>> 5;
            b31 = s[9] << 27 | s[8] >>> 5;
            b12 = s[18] << 20 | s[19] >>> 12;
            b13 = s[19] << 20 | s[18] >>> 12;
            b44 = s[29] << 7 | s[28] >>> 25;
            b45 = s[28] << 7 | s[29] >>> 25;
            b26 = s[38] << 8 | s[39] >>> 24;
            b27 = s[39] << 8 | s[38] >>> 24;
            b8 = s[48] << 14 | s[49] >>> 18;
            b9 = s[49] << 14 | s[48] >>> 18;
            s[0] = b0 ^ ~b2 & b4;
            s[1] = b1 ^ ~b3 & b5;
            s[10] = b10 ^ ~b12 & b14;
            s[11] = b11 ^ ~b13 & b15;
            s[20] = b20 ^ ~b22 & b24;
            s[21] = b21 ^ ~b23 & b25;
            s[30] = b30 ^ ~b32 & b34;
            s[31] = b31 ^ ~b33 & b35;
            s[40] = b40 ^ ~b42 & b44;
            s[41] = b41 ^ ~b43 & b45;
            s[2] = b2 ^ ~b4 & b6;
            s[3] = b3 ^ ~b5 & b7;
            s[12] = b12 ^ ~b14 & b16;
            s[13] = b13 ^ ~b15 & b17;
            s[22] = b22 ^ ~b24 & b26;
            s[23] = b23 ^ ~b25 & b27;
            s[32] = b32 ^ ~b34 & b36;
            s[33] = b33 ^ ~b35 & b37;
            s[42] = b42 ^ ~b44 & b46;
            s[43] = b43 ^ ~b45 & b47;
            s[4] = b4 ^ ~b6 & b8;
            s[5] = b5 ^ ~b7 & b9;
            s[14] = b14 ^ ~b16 & b18;
            s[15] = b15 ^ ~b17 & b19;
            s[24] = b24 ^ ~b26 & b28;
            s[25] = b25 ^ ~b27 & b29;
            s[34] = b34 ^ ~b36 & b38;
            s[35] = b35 ^ ~b37 & b39;
            s[44] = b44 ^ ~b46 & b48;
            s[45] = b45 ^ ~b47 & b49;
            s[6] = b6 ^ ~b8 & b0;
            s[7] = b7 ^ ~b9 & b1;
            s[16] = b16 ^ ~b18 & b10;
            s[17] = b17 ^ ~b19 & b11;
            s[26] = b26 ^ ~b28 & b20;
            s[27] = b27 ^ ~b29 & b21;
            s[36] = b36 ^ ~b38 & b30;
            s[37] = b37 ^ ~b39 & b31;
            s[46] = b46 ^ ~b48 & b40;
            s[47] = b47 ^ ~b49 & b41;
            s[8] = b8 ^ ~b0 & b2;
            s[9] = b9 ^ ~b1 & b3;
            s[18] = b18 ^ ~b10 & b12;
            s[19] = b19 ^ ~b11 & b13;
            s[28] = b28 ^ ~b20 & b22;
            s[29] = b29 ^ ~b21 & b23;
            s[38] = b38 ^ ~b30 & b32;
            s[39] = b39 ^ ~b31 & b33;
            s[48] = b48 ^ ~b40 & b42;
            s[49] = b49 ^ ~b41 & b43;
            s[0] ^= RC[n];
            s[1] ^= RC[n + 1];
          }
        };
        if (COMMON_JS) {
          module.exports = methods;
        } else {
          for (i = 0; i < methodNames.length; ++i) {
            root[methodNames[i]] = methods[methodNames[i]];
          }
          if (AMD) {
            !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
              return methods;
            }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
          }
        }
      })();
    },
    6230() {},
    1562(__unused_webpack_module, exports, __webpack_require__) {
      (function(global, factory) {
        true ? factory(exports, __webpack_require__(6230)) : 0;
      })(this, (function(exports, chalk) {
        "use strict";
        chalk = chalk && chalk.hasOwnProperty("default") ? chalk["default"] : chalk;
        var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function(obj) {
          return typeof obj;
        } : function(obj) {
          return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
        };
        var classCallCheck = function(instance, Constructor) {
          if (!(instance instanceof Constructor)) {
            throw new TypeError("Cannot call a class as a function");
          }
        };
        var createClass = function() {
          function defineProperties(target, props) {
            for (var i = 0; i < props.length; i++) {
              var descriptor = props[i];
              descriptor.enumerable = descriptor.enumerable || false;
              descriptor.configurable = true;
              if ("value" in descriptor) descriptor.writable = true;
              Object.defineProperty(target, descriptor.key, descriptor);
            }
          }
          return function(Constructor, protoProps, staticProps) {
            if (protoProps) defineProperties(Constructor.prototype, protoProps);
            if (staticProps) defineProperties(Constructor, staticProps);
            return Constructor;
          };
        }();
        var get = function get(object, property, receiver) {
          if (object === null) object = Function.prototype;
          var desc = Object.getOwnPropertyDescriptor(object, property);
          if (desc === undefined) {
            var parent = Object.getPrototypeOf(object);
            if (parent === null) {
              return undefined;
            } else {
              return get(parent, property, receiver);
            }
          } else if ("value" in desc) {
            return desc.value;
          } else {
            var getter = desc.get;
            if (getter === undefined) {
              return undefined;
            }
            return getter.call(receiver);
          }
        };
        var inherits = function(subClass, superClass) {
          if (typeof superClass !== "function" && superClass !== null) {
            throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
          }
          subClass.prototype = Object.create(superClass && superClass.prototype, {
            constructor: {
              value: subClass,
              enumerable: false,
              writable: true,
              configurable: true
            }
          });
          if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
        };
        var possibleConstructorReturn = function(self, call) {
          if (!self) {
            throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
          }
          return call && (typeof call === "object" || typeof call === "function") ? call : self;
        };
        var slicedToArray = function() {
          function sliceIterator(arr, i) {
            var _arr = [];
            var _n = true;
            var _d = false;
            var _e = undefined;
            try {
              for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
                _arr.push(_s.value);
                if (i && _arr.length === i) break;
              }
            } catch (err) {
              _d = true;
              _e = err;
            } finally {
              try {
                if (!_n && _i["return"]) _i["return"]();
              } finally {
                if (_d) throw _e;
              }
            }
            return _arr;
          }
          return function(arr, i) {
            if (Array.isArray(arr)) {
              return arr;
            } else if (Symbol.iterator in Object(arr)) {
              return sliceIterator(arr, i);
            } else {
              throw new TypeError("Invalid attempt to destructure non-iterable instance");
            }
          };
        }();
        var toConsumableArray = function(arr) {
          if (Array.isArray(arr)) {
            for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
            return arr2;
          } else {
            return Array.from(arr);
          }
        };
        var Processor = function() {
          function Processor(options) {
            classCallCheck(this, Processor);
            this.selfOptions = options || {};
            this.pipes = {};
          }
          createClass(Processor, [ {
            key: "options",
            value: function options(_options) {
              if (_options) {
                this.selfOptions = _options;
              }
              return this.selfOptions;
            }
          }, {
            key: "pipe",
            value: function pipe(name, pipeArg) {
              var pipe = pipeArg;
              if (typeof name === "string") {
                if (typeof pipe === "undefined") {
                  return this.pipes[name];
                } else {
                  this.pipes[name] = pipe;
                }
              }
              if (name && name.name) {
                pipe = name;
                if (pipe.processor === this) {
                  return pipe;
                }
                this.pipes[pipe.name] = pipe;
              }
              pipe.processor = this;
              return pipe;
            }
          }, {
            key: "process",
            value: function process(input, pipe) {
              var context = input;
              context.options = this.options();
              var nextPipe = pipe || input.pipe || "default";
              var lastPipe = void 0;
              var lastContext = void 0;
              while (nextPipe) {
                if (typeof context.nextAfterChildren !== "undefined") {
                  context.next = context.nextAfterChildren;
                  context.nextAfterChildren = null;
                }
                if (typeof nextPipe === "string") {
                  nextPipe = this.pipe(nextPipe);
                }
                nextPipe.process(context);
                lastContext = context;
                lastPipe = nextPipe;
                nextPipe = null;
                if (context) {
                  if (context.next) {
                    context = context.next;
                    nextPipe = lastContext.nextPipe || context.pipe || lastPipe;
                  }
                }
              }
              return context.hasResult ? context.result : undefined;
            }
          } ]);
          return Processor;
        }();
        var Pipe = function() {
          function Pipe(name) {
            classCallCheck(this, Pipe);
            this.name = name;
            this.filters = [];
          }
          createClass(Pipe, [ {
            key: "process",
            value: function process(input) {
              if (!this.processor) {
                throw new Error("add this pipe to a processor before using it");
              }
              var debug = this.debug;
              var length = this.filters.length;
              var context = input;
              for (var index = 0; index < length; index++) {
                var filter = this.filters[index];
                if (debug) {
                  this.log("filter: " + filter.filterName);
                }
                filter(context);
                if ((typeof context === "undefined" ? "undefined" : _typeof(context)) === "object" && context.exiting) {
                  context.exiting = false;
                  break;
                }
              }
              if (!context.next && this.resultCheck) {
                this.resultCheck(context);
              }
            }
          }, {
            key: "log",
            value: function log(msg) {
              console.log("[jsondiffpatch] " + this.name + " pipe, " + msg);
            }
          }, {
            key: "append",
            value: function append() {
              var _filters;
              (_filters = this.filters).push.apply(_filters, arguments);
              return this;
            }
          }, {
            key: "prepend",
            value: function prepend() {
              var _filters2;
              (_filters2 = this.filters).unshift.apply(_filters2, arguments);
              return this;
            }
          }, {
            key: "indexOf",
            value: function indexOf(filterName) {
              if (!filterName) {
                throw new Error("a filter name is required");
              }
              for (var index = 0; index < this.filters.length; index++) {
                var filter = this.filters[index];
                if (filter.filterName === filterName) {
                  return index;
                }
              }
              throw new Error("filter not found: " + filterName);
            }
          }, {
            key: "list",
            value: function list() {
              return this.filters.map((function(f) {
                return f.filterName;
              }));
            }
          }, {
            key: "after",
            value: function after(filterName) {
              var index = this.indexOf(filterName);
              var params = Array.prototype.slice.call(arguments, 1);
              if (!params.length) {
                throw new Error("a filter is required");
              }
              params.unshift(index + 1, 0);
              Array.prototype.splice.apply(this.filters, params);
              return this;
            }
          }, {
            key: "before",
            value: function before(filterName) {
              var index = this.indexOf(filterName);
              var params = Array.prototype.slice.call(arguments, 1);
              if (!params.length) {
                throw new Error("a filter is required");
              }
              params.unshift(index, 0);
              Array.prototype.splice.apply(this.filters, params);
              return this;
            }
          }, {
            key: "replace",
            value: function replace(filterName) {
              var index = this.indexOf(filterName);
              var params = Array.prototype.slice.call(arguments, 1);
              if (!params.length) {
                throw new Error("a filter is required");
              }
              params.unshift(index, 1);
              Array.prototype.splice.apply(this.filters, params);
              return this;
            }
          }, {
            key: "remove",
            value: function remove(filterName) {
              var index = this.indexOf(filterName);
              this.filters.splice(index, 1);
              return this;
            }
          }, {
            key: "clear",
            value: function clear() {
              this.filters.length = 0;
              return this;
            }
          }, {
            key: "shouldHaveResult",
            value: function shouldHaveResult(should) {
              if (should === false) {
                this.resultCheck = null;
                return;
              }
              if (this.resultCheck) {
                return;
              }
              var pipe = this;
              this.resultCheck = function(context) {
                if (!context.hasResult) {
                  console.log(context);
                  var error = new Error(pipe.name + " failed");
                  error.noResult = true;
                  throw error;
                }
              };
              return this;
            }
          } ]);
          return Pipe;
        }();
        var Context = function() {
          function Context() {
            classCallCheck(this, Context);
          }
          createClass(Context, [ {
            key: "setResult",
            value: function setResult(result) {
              this.result = result;
              this.hasResult = true;
              return this;
            }
          }, {
            key: "exit",
            value: function exit() {
              this.exiting = true;
              return this;
            }
          }, {
            key: "switchTo",
            value: function switchTo(next, pipe) {
              if (typeof next === "string" || next instanceof Pipe) {
                this.nextPipe = next;
              } else {
                this.next = next;
                if (pipe) {
                  this.nextPipe = pipe;
                }
              }
              return this;
            }
          }, {
            key: "push",
            value: function push(child, name) {
              child.parent = this;
              if (typeof name !== "undefined") {
                child.childName = name;
              }
              child.root = this.root || this;
              child.options = child.options || this.options;
              if (!this.children) {
                this.children = [ child ];
                this.nextAfterChildren = this.next || null;
                this.next = child;
              } else {
                this.children[this.children.length - 1].next = child;
                this.children.push(child);
              }
              child.next = this;
              return this;
            }
          } ]);
          return Context;
        }();
        var isArray = typeof Array.isArray === "function" ? Array.isArray : function(a) {
          return a instanceof Array;
        };
        function cloneRegExp(re) {
          var regexMatch = /^\/(.*)\/([gimyu]*)$/.exec(re.toString());
          return new RegExp(regexMatch[1], regexMatch[2]);
        }
        function clone(arg) {
          if ((typeof arg === "undefined" ? "undefined" : _typeof(arg)) !== "object") {
            return arg;
          }
          if (arg === null) {
            return null;
          }
          if (isArray(arg)) {
            return arg.map(clone);
          }
          if (arg instanceof Date) {
            return new Date(arg.getTime());
          }
          if (arg instanceof RegExp) {
            return cloneRegExp(arg);
          }
          var cloned = {};
          for (var name in arg) {
            if (Object.prototype.hasOwnProperty.call(arg, name)) {
              cloned[name] = clone(arg[name]);
            }
          }
          return cloned;
        }
        var DiffContext = function(_Context) {
          inherits(DiffContext, _Context);
          function DiffContext(left, right) {
            classCallCheck(this, DiffContext);
            var _this = possibleConstructorReturn(this, (DiffContext.__proto__ || Object.getPrototypeOf(DiffContext)).call(this));
            _this.left = left;
            _this.right = right;
            _this.pipe = "diff";
            return _this;
          }
          createClass(DiffContext, [ {
            key: "setResult",
            value: function setResult(result) {
              if (this.options.cloneDiffValues && (typeof result === "undefined" ? "undefined" : _typeof(result)) === "object") {
                var clone$$1 = typeof this.options.cloneDiffValues === "function" ? this.options.cloneDiffValues : clone;
                if (_typeof(result[0]) === "object") {
                  result[0] = clone$$1(result[0]);
                }
                if (_typeof(result[1]) === "object") {
                  result[1] = clone$$1(result[1]);
                }
              }
              return Context.prototype.setResult.apply(this, arguments);
            }
          } ]);
          return DiffContext;
        }(Context);
        var PatchContext = function(_Context) {
          inherits(PatchContext, _Context);
          function PatchContext(left, delta) {
            classCallCheck(this, PatchContext);
            var _this = possibleConstructorReturn(this, (PatchContext.__proto__ || Object.getPrototypeOf(PatchContext)).call(this));
            _this.left = left;
            _this.delta = delta;
            _this.pipe = "patch";
            return _this;
          }
          return PatchContext;
        }(Context);
        var ReverseContext = function(_Context) {
          inherits(ReverseContext, _Context);
          function ReverseContext(delta) {
            classCallCheck(this, ReverseContext);
            var _this = possibleConstructorReturn(this, (ReverseContext.__proto__ || Object.getPrototypeOf(ReverseContext)).call(this));
            _this.delta = delta;
            _this.pipe = "reverse";
            return _this;
          }
          return ReverseContext;
        }(Context);
        var isArray$1 = typeof Array.isArray === "function" ? Array.isArray : function(a) {
          return a instanceof Array;
        };
        var diffFilter = function trivialMatchesDiffFilter(context) {
          if (context.left === context.right) {
            context.setResult(undefined).exit();
            return;
          }
          if (typeof context.left === "undefined") {
            if (typeof context.right === "function") {
              throw new Error("functions are not supported");
            }
            context.setResult([ context.right ]).exit();
            return;
          }
          if (typeof context.right === "undefined") {
            context.setResult([ context.left, 0, 0 ]).exit();
            return;
          }
          if (typeof context.left === "function" || typeof context.right === "function") {
            throw new Error("functions are not supported");
          }
          context.leftType = context.left === null ? "null" : _typeof(context.left);
          context.rightType = context.right === null ? "null" : _typeof(context.right);
          if (context.leftType !== context.rightType) {
            context.setResult([ context.left, context.right ]).exit();
            return;
          }
          if (context.leftType === "boolean" || context.leftType === "number") {
            context.setResult([ context.left, context.right ]).exit();
            return;
          }
          if (context.leftType === "object") {
            context.leftIsArray = isArray$1(context.left);
          }
          if (context.rightType === "object") {
            context.rightIsArray = isArray$1(context.right);
          }
          if (context.leftIsArray !== context.rightIsArray) {
            context.setResult([ context.left, context.right ]).exit();
            return;
          }
          if (context.left instanceof RegExp) {
            if (context.right instanceof RegExp) {
              context.setResult([ context.left.toString(), context.right.toString() ]).exit();
            } else {
              context.setResult([ context.left, context.right ]).exit();
            }
          }
        };
        diffFilter.filterName = "trivial";
        var patchFilter = function trivialMatchesPatchFilter(context) {
          if (typeof context.delta === "undefined") {
            context.setResult(context.left).exit();
            return;
          }
          context.nested = !isArray$1(context.delta);
          if (context.nested) {
            return;
          }
          if (context.delta.length === 1) {
            context.setResult(context.delta[0]).exit();
            return;
          }
          if (context.delta.length === 2) {
            if (context.left instanceof RegExp) {
              var regexArgs = /^\/(.*)\/([gimyu]+)$/.exec(context.delta[1]);
              if (regexArgs) {
                context.setResult(new RegExp(regexArgs[1], regexArgs[2])).exit();
                return;
              }
            }
            context.setResult(context.delta[1]).exit();
            return;
          }
          if (context.delta.length === 3 && context.delta[2] === 0) {
            context.setResult(undefined).exit();
          }
        };
        patchFilter.filterName = "trivial";
        var reverseFilter = function trivialReferseFilter(context) {
          if (typeof context.delta === "undefined") {
            context.setResult(context.delta).exit();
            return;
          }
          context.nested = !isArray$1(context.delta);
          if (context.nested) {
            return;
          }
          if (context.delta.length === 1) {
            context.setResult([ context.delta[0], 0, 0 ]).exit();
            return;
          }
          if (context.delta.length === 2) {
            context.setResult([ context.delta[1], context.delta[0] ]).exit();
            return;
          }
          if (context.delta.length === 3 && context.delta[2] === 0) {
            context.setResult([ context.delta[0] ]).exit();
          }
        };
        reverseFilter.filterName = "trivial";
        function collectChildrenDiffFilter(context) {
          if (!context || !context.children) {
            return;
          }
          var length = context.children.length;
          var child = void 0;
          var result = context.result;
          for (var index = 0; index < length; index++) {
            child = context.children[index];
            if (typeof child.result === "undefined") {
              continue;
            }
            result = result || {};
            result[child.childName] = child.result;
          }
          if (result && context.leftIsArray) {
            result._t = "a";
          }
          context.setResult(result).exit();
        }
        collectChildrenDiffFilter.filterName = "collectChildren";
        function objectsDiffFilter(context) {
          if (context.leftIsArray || context.leftType !== "object") {
            return;
          }
          var name = void 0;
          var child = void 0;
          var propertyFilter = context.options.propertyFilter;
          for (name in context.left) {
            if (!Object.prototype.hasOwnProperty.call(context.left, name)) {
              continue;
            }
            if (propertyFilter && !propertyFilter(name, context)) {
              continue;
            }
            child = new DiffContext(context.left[name], context.right[name]);
            context.push(child, name);
          }
          for (name in context.right) {
            if (!Object.prototype.hasOwnProperty.call(context.right, name)) {
              continue;
            }
            if (propertyFilter && !propertyFilter(name, context)) {
              continue;
            }
            if (typeof context.left[name] === "undefined") {
              child = new DiffContext(undefined, context.right[name]);
              context.push(child, name);
            }
          }
          if (!context.children || context.children.length === 0) {
            context.setResult(undefined).exit();
            return;
          }
          context.exit();
        }
        objectsDiffFilter.filterName = "objects";
        var patchFilter$1 = function nestedPatchFilter(context) {
          if (!context.nested) {
            return;
          }
          if (context.delta._t) {
            return;
          }
          var name = void 0;
          var child = void 0;
          for (name in context.delta) {
            child = new PatchContext(context.left[name], context.delta[name]);
            context.push(child, name);
          }
          context.exit();
        };
        patchFilter$1.filterName = "objects";
        var collectChildrenPatchFilter = function collectChildrenPatchFilter(context) {
          if (!context || !context.children) {
            return;
          }
          if (context.delta._t) {
            return;
          }
          var length = context.children.length;
          var child = void 0;
          for (var index = 0; index < length; index++) {
            child = context.children[index];
            if (Object.prototype.hasOwnProperty.call(context.left, child.childName) && child.result === undefined) {
              delete context.left[child.childName];
            } else if (context.left[child.childName] !== child.result) {
              context.left[child.childName] = child.result;
            }
          }
          context.setResult(context.left).exit();
        };
        collectChildrenPatchFilter.filterName = "collectChildren";
        var reverseFilter$1 = function nestedReverseFilter(context) {
          if (!context.nested) {
            return;
          }
          if (context.delta._t) {
            return;
          }
          var name = void 0;
          var child = void 0;
          for (name in context.delta) {
            child = new ReverseContext(context.delta[name]);
            context.push(child, name);
          }
          context.exit();
        };
        reverseFilter$1.filterName = "objects";
        function collectChildrenReverseFilter(context) {
          if (!context || !context.children) {
            return;
          }
          if (context.delta._t) {
            return;
          }
          var length = context.children.length;
          var child = void 0;
          var delta = {};
          for (var index = 0; index < length; index++) {
            child = context.children[index];
            if (delta[child.childName] !== child.result) {
              delta[child.childName] = child.result;
            }
          }
          context.setResult(delta).exit();
        }
        collectChildrenReverseFilter.filterName = "collectChildren";
        var defaultMatch = function defaultMatch(array1, array2, index1, index2) {
          return array1[index1] === array2[index2];
        };
        var lengthMatrix = function lengthMatrix(array1, array2, match, context) {
          var len1 = array1.length;
          var len2 = array2.length;
          var x = void 0, y = void 0;
          var matrix = [ len1 + 1 ];
          for (x = 0; x < len1 + 1; x++) {
            matrix[x] = [ len2 + 1 ];
            for (y = 0; y < len2 + 1; y++) {
              matrix[x][y] = 0;
            }
          }
          matrix.match = match;
          for (x = 1; x < len1 + 1; x++) {
            for (y = 1; y < len2 + 1; y++) {
              if (match(array1, array2, x - 1, y - 1, context)) {
                matrix[x][y] = matrix[x - 1][y - 1] + 1;
              } else {
                matrix[x][y] = Math.max(matrix[x - 1][y], matrix[x][y - 1]);
              }
            }
          }
          return matrix;
        };
        var backtrack = function backtrack(matrix, array1, array2, context) {
          var index1 = array1.length;
          var index2 = array2.length;
          var subsequence = {
            sequence: [],
            indices1: [],
            indices2: []
          };
          while (index1 !== 0 && index2 !== 0) {
            var sameLetter = matrix.match(array1, array2, index1 - 1, index2 - 1, context);
            if (sameLetter) {
              subsequence.sequence.unshift(array1[index1 - 1]);
              subsequence.indices1.unshift(index1 - 1);
              subsequence.indices2.unshift(index2 - 1);
              --index1;
              --index2;
            } else {
              var valueAtMatrixAbove = matrix[index1][index2 - 1];
              var valueAtMatrixLeft = matrix[index1 - 1][index2];
              if (valueAtMatrixAbove > valueAtMatrixLeft) {
                --index2;
              } else {
                --index1;
              }
            }
          }
          return subsequence;
        };
        var get$1 = function get(array1, array2, match, context) {
          var innerContext = context || {};
          var matrix = lengthMatrix(array1, array2, match || defaultMatch, innerContext);
          var result = backtrack(matrix, array1, array2, innerContext);
          if (typeof array1 === "string" && typeof array2 === "string") {
            result.sequence = result.sequence.join("");
          }
          return result;
        };
        var lcs = {
          get: get$1
        };
        var ARRAY_MOVE = 3;
        var isArray$2 = typeof Array.isArray === "function" ? Array.isArray : function(a) {
          return a instanceof Array;
        };
        var arrayIndexOf = typeof Array.prototype.indexOf === "function" ? function(array, item) {
          return array.indexOf(item);
        } : function(array, item) {
          var length = array.length;
          for (var i = 0; i < length; i++) {
            if (array[i] === item) {
              return i;
            }
          }
          return -1;
        };
        function arraysHaveMatchByRef(array1, array2, len1, len2) {
          for (var index1 = 0; index1 < len1; index1++) {
            var val1 = array1[index1];
            for (var index2 = 0; index2 < len2; index2++) {
              var val2 = array2[index2];
              if (index1 !== index2 && val1 === val2) {
                return true;
              }
            }
          }
        }
        function matchItems(array1, array2, index1, index2, context) {
          var value1 = array1[index1];
          var value2 = array2[index2];
          if (value1 === value2) {
            return true;
          }
          if ((typeof value1 === "undefined" ? "undefined" : _typeof(value1)) !== "object" || (typeof value2 === "undefined" ? "undefined" : _typeof(value2)) !== "object") {
            return false;
          }
          var objectHash = context.objectHash;
          if (!objectHash) {
            return context.matchByPosition && index1 === index2;
          }
          var hash1 = void 0;
          var hash2 = void 0;
          if (typeof index1 === "number") {
            context.hashCache1 = context.hashCache1 || [];
            hash1 = context.hashCache1[index1];
            if (typeof hash1 === "undefined") {
              context.hashCache1[index1] = hash1 = objectHash(value1, index1);
            }
          } else {
            hash1 = objectHash(value1);
          }
          if (typeof hash1 === "undefined") {
            return false;
          }
          if (typeof index2 === "number") {
            context.hashCache2 = context.hashCache2 || [];
            hash2 = context.hashCache2[index2];
            if (typeof hash2 === "undefined") {
              context.hashCache2[index2] = hash2 = objectHash(value2, index2);
            }
          } else {
            hash2 = objectHash(value2);
          }
          if (typeof hash2 === "undefined") {
            return false;
          }
          return hash1 === hash2;
        }
        var diffFilter$1 = function arraysDiffFilter(context) {
          if (!context.leftIsArray) {
            return;
          }
          var matchContext = {
            objectHash: context.options && context.options.objectHash,
            matchByPosition: context.options && context.options.matchByPosition
          };
          var commonHead = 0;
          var commonTail = 0;
          var index = void 0;
          var index1 = void 0;
          var index2 = void 0;
          var array1 = context.left;
          var array2 = context.right;
          var len1 = array1.length;
          var len2 = array2.length;
          var child = void 0;
          if (len1 > 0 && len2 > 0 && !matchContext.objectHash && typeof matchContext.matchByPosition !== "boolean") {
            matchContext.matchByPosition = !arraysHaveMatchByRef(array1, array2, len1, len2);
          }
          while (commonHead < len1 && commonHead < len2 && matchItems(array1, array2, commonHead, commonHead, matchContext)) {
            index = commonHead;
            child = new DiffContext(context.left[index], context.right[index]);
            context.push(child, index);
            commonHead++;
          }
          while (commonTail + commonHead < len1 && commonTail + commonHead < len2 && matchItems(array1, array2, len1 - 1 - commonTail, len2 - 1 - commonTail, matchContext)) {
            index1 = len1 - 1 - commonTail;
            index2 = len2 - 1 - commonTail;
            child = new DiffContext(context.left[index1], context.right[index2]);
            context.push(child, index2);
            commonTail++;
          }
          var result = void 0;
          if (commonHead + commonTail === len1) {
            if (len1 === len2) {
              context.setResult(undefined).exit();
              return;
            }
            result = result || {
              _t: "a"
            };
            for (index = commonHead; index < len2 - commonTail; index++) {
              result[index] = [ array2[index] ];
            }
            context.setResult(result).exit();
            return;
          }
          if (commonHead + commonTail === len2) {
            result = result || {
              _t: "a"
            };
            for (index = commonHead; index < len1 - commonTail; index++) {
              result["_" + index] = [ array1[index], 0, 0 ];
            }
            context.setResult(result).exit();
            return;
          }
          delete matchContext.hashCache1;
          delete matchContext.hashCache2;
          var trimmed1 = array1.slice(commonHead, len1 - commonTail);
          var trimmed2 = array2.slice(commonHead, len2 - commonTail);
          var seq = lcs.get(trimmed1, trimmed2, matchItems, matchContext);
          var removedItems = [];
          result = result || {
            _t: "a"
          };
          for (index = commonHead; index < len1 - commonTail; index++) {
            if (arrayIndexOf(seq.indices1, index - commonHead) < 0) {
              result["_" + index] = [ array1[index], 0, 0 ];
              removedItems.push(index);
            }
          }
          var detectMove = true;
          if (context.options && context.options.arrays && context.options.arrays.detectMove === false) {
            detectMove = false;
          }
          var includeValueOnMove = false;
          if (context.options && context.options.arrays && context.options.arrays.includeValueOnMove) {
            includeValueOnMove = true;
          }
          var removedItemsLength = removedItems.length;
          for (index = commonHead; index < len2 - commonTail; index++) {
            var indexOnArray2 = arrayIndexOf(seq.indices2, index - commonHead);
            if (indexOnArray2 < 0) {
              var isMove = false;
              if (detectMove && removedItemsLength > 0) {
                for (var removeItemIndex1 = 0; removeItemIndex1 < removedItemsLength; removeItemIndex1++) {
                  index1 = removedItems[removeItemIndex1];
                  if (matchItems(trimmed1, trimmed2, index1 - commonHead, index - commonHead, matchContext)) {
                    result["_" + index1].splice(1, 2, index, ARRAY_MOVE);
                    if (!includeValueOnMove) {
                      result["_" + index1][0] = "";
                    }
                    index2 = index;
                    child = new DiffContext(context.left[index1], context.right[index2]);
                    context.push(child, index2);
                    removedItems.splice(removeItemIndex1, 1);
                    isMove = true;
                    break;
                  }
                }
              }
              if (!isMove) {
                result[index] = [ array2[index] ];
              }
            } else {
              index1 = seq.indices1[indexOnArray2] + commonHead;
              index2 = seq.indices2[indexOnArray2] + commonHead;
              child = new DiffContext(context.left[index1], context.right[index2]);
              context.push(child, index2);
            }
          }
          context.setResult(result).exit();
        };
        diffFilter$1.filterName = "arrays";
        var compare = {
          numerically: function numerically(a, b) {
            return a - b;
          },
          numericallyBy: function numericallyBy(name) {
            return function(a, b) {
              return a[name] - b[name];
            };
          }
        };
        var patchFilter$2 = function nestedPatchFilter(context) {
          if (!context.nested) {
            return;
          }
          if (context.delta._t !== "a") {
            return;
          }
          var index = void 0;
          var index1 = void 0;
          var delta = context.delta;
          var array = context.left;
          var toRemove = [];
          var toInsert = [];
          var toModify = [];
          for (index in delta) {
            if (index !== "_t") {
              if (index[0] === "_") {
                if (delta[index][2] === 0 || delta[index][2] === ARRAY_MOVE) {
                  toRemove.push(parseInt(index.slice(1), 10));
                } else {
                  throw new Error("only removal or move can be applied at original array indices," + (" invalid diff type: " + delta[index][2]));
                }
              } else {
                if (delta[index].length === 1) {
                  toInsert.push({
                    index: parseInt(index, 10),
                    value: delta[index][0]
                  });
                } else {
                  toModify.push({
                    index: parseInt(index, 10),
                    delta: delta[index]
                  });
                }
              }
            }
          }
          toRemove = toRemove.sort(compare.numerically);
          for (index = toRemove.length - 1; index >= 0; index--) {
            index1 = toRemove[index];
            var indexDiff = delta["_" + index1];
            var removedValue = array.splice(index1, 1)[0];
            if (indexDiff[2] === ARRAY_MOVE) {
              toInsert.push({
                index: indexDiff[1],
                value: removedValue
              });
            }
          }
          toInsert = toInsert.sort(compare.numericallyBy("index"));
          var toInsertLength = toInsert.length;
          for (index = 0; index < toInsertLength; index++) {
            var insertion = toInsert[index];
            array.splice(insertion.index, 0, insertion.value);
          }
          var toModifyLength = toModify.length;
          var child = void 0;
          if (toModifyLength > 0) {
            for (index = 0; index < toModifyLength; index++) {
              var modification = toModify[index];
              child = new PatchContext(context.left[modification.index], modification.delta);
              context.push(child, modification.index);
            }
          }
          if (!context.children) {
            context.setResult(context.left).exit();
            return;
          }
          context.exit();
        };
        patchFilter$2.filterName = "arrays";
        var collectChildrenPatchFilter$1 = function collectChildrenPatchFilter(context) {
          if (!context || !context.children) {
            return;
          }
          if (context.delta._t !== "a") {
            return;
          }
          var length = context.children.length;
          var child = void 0;
          for (var index = 0; index < length; index++) {
            child = context.children[index];
            context.left[child.childName] = child.result;
          }
          context.setResult(context.left).exit();
        };
        collectChildrenPatchFilter$1.filterName = "arraysCollectChildren";
        var reverseFilter$2 = function arraysReverseFilter(context) {
          if (!context.nested) {
            if (context.delta[2] === ARRAY_MOVE) {
              context.newName = "_" + context.delta[1];
              context.setResult([ context.delta[0], parseInt(context.childName.substr(1), 10), ARRAY_MOVE ]).exit();
            }
            return;
          }
          if (context.delta._t !== "a") {
            return;
          }
          var name = void 0;
          var child = void 0;
          for (name in context.delta) {
            if (name === "_t") {
              continue;
            }
            child = new ReverseContext(context.delta[name]);
            context.push(child, name);
          }
          context.exit();
        };
        reverseFilter$2.filterName = "arrays";
        var reverseArrayDeltaIndex = function reverseArrayDeltaIndex(delta, index, itemDelta) {
          if (typeof index === "string" && index[0] === "_") {
            return parseInt(index.substr(1), 10);
          } else if (isArray$2(itemDelta) && itemDelta[2] === 0) {
            return "_" + index;
          }
          var reverseIndex = +index;
          for (var deltaIndex in delta) {
            var deltaItem = delta[deltaIndex];
            if (isArray$2(deltaItem)) {
              if (deltaItem[2] === ARRAY_MOVE) {
                var moveFromIndex = parseInt(deltaIndex.substr(1), 10);
                var moveToIndex = deltaItem[1];
                if (moveToIndex === +index) {
                  return moveFromIndex;
                }
                if (moveFromIndex <= reverseIndex && moveToIndex > reverseIndex) {
                  reverseIndex++;
                } else if (moveFromIndex >= reverseIndex && moveToIndex < reverseIndex) {
                  reverseIndex--;
                }
              } else if (deltaItem[2] === 0) {
                var deleteIndex = parseInt(deltaIndex.substr(1), 10);
                if (deleteIndex <= reverseIndex) {
                  reverseIndex++;
                }
              } else if (deltaItem.length === 1 && deltaIndex <= reverseIndex) {
                reverseIndex--;
              }
            }
          }
          return reverseIndex;
        };
        function collectChildrenReverseFilter$1(context) {
          if (!context || !context.children) {
            return;
          }
          if (context.delta._t !== "a") {
            return;
          }
          var length = context.children.length;
          var child = void 0;
          var delta = {
            _t: "a"
          };
          for (var index = 0; index < length; index++) {
            child = context.children[index];
            var name = child.newName;
            if (typeof name === "undefined") {
              name = reverseArrayDeltaIndex(context.delta, child.childName, child.result);
            }
            if (delta[name] !== child.result) {
              delta[name] = child.result;
            }
          }
          context.setResult(delta).exit();
        }
        collectChildrenReverseFilter$1.filterName = "arraysCollectChildren";
        var diffFilter$2 = function datesDiffFilter(context) {
          if (context.left instanceof Date) {
            if (context.right instanceof Date) {
              if (context.left.getTime() !== context.right.getTime()) {
                context.setResult([ context.left, context.right ]);
              } else {
                context.setResult(undefined);
              }
            } else {
              context.setResult([ context.left, context.right ]);
            }
            context.exit();
          } else if (context.right instanceof Date) {
            context.setResult([ context.left, context.right ]).exit();
          }
        };
        diffFilter$2.filterName = "dates";
        function createCommonjsModule(fn, module) {
          return module = {
            exports: {}
          }, fn(module, module.exports), module.exports;
        }
        var diffMatchPatch = createCommonjsModule((function(module) {
          function diff_match_patch() {
            this.Diff_Timeout = 1;
            this.Diff_EditCost = 4;
            this.Match_Threshold = .5;
            this.Match_Distance = 1e3;
            this.Patch_DeleteThreshold = .5;
            this.Patch_Margin = 4;
            this.Match_MaxBits = 32;
          }
          var DIFF_DELETE = -1;
          var DIFF_INSERT = 1;
          var DIFF_EQUAL = 0;
          diff_match_patch.prototype.diff_main = function(text1, text2, opt_checklines, opt_deadline) {
            if (typeof opt_deadline == "undefined") {
              if (this.Diff_Timeout <= 0) {
                opt_deadline = Number.MAX_VALUE;
              } else {
                opt_deadline = (new Date).getTime() + this.Diff_Timeout * 1e3;
              }
            }
            var deadline = opt_deadline;
            if (text1 == null || text2 == null) {
              throw new Error("Null input. (diff_main)");
            }
            if (text1 == text2) {
              if (text1) {
                return [ [ DIFF_EQUAL, text1 ] ];
              }
              return [];
            }
            if (typeof opt_checklines == "undefined") {
              opt_checklines = true;
            }
            var checklines = opt_checklines;
            var commonlength = this.diff_commonPrefix(text1, text2);
            var commonprefix = text1.substring(0, commonlength);
            text1 = text1.substring(commonlength);
            text2 = text2.substring(commonlength);
            commonlength = this.diff_commonSuffix(text1, text2);
            var commonsuffix = text1.substring(text1.length - commonlength);
            text1 = text1.substring(0, text1.length - commonlength);
            text2 = text2.substring(0, text2.length - commonlength);
            var diffs = this.diff_compute_(text1, text2, checklines, deadline);
            if (commonprefix) {
              diffs.unshift([ DIFF_EQUAL, commonprefix ]);
            }
            if (commonsuffix) {
              diffs.push([ DIFF_EQUAL, commonsuffix ]);
            }
            this.diff_cleanupMerge(diffs);
            return diffs;
          };
          diff_match_patch.prototype.diff_compute_ = function(text1, text2, checklines, deadline) {
            var diffs;
            if (!text1) {
              return [ [ DIFF_INSERT, text2 ] ];
            }
            if (!text2) {
              return [ [ DIFF_DELETE, text1 ] ];
            }
            var longtext = text1.length > text2.length ? text1 : text2;
            var shorttext = text1.length > text2.length ? text2 : text1;
            var i = longtext.indexOf(shorttext);
            if (i != -1) {
              diffs = [ [ DIFF_INSERT, longtext.substring(0, i) ], [ DIFF_EQUAL, shorttext ], [ DIFF_INSERT, longtext.substring(i + shorttext.length) ] ];
              if (text1.length > text2.length) {
                diffs[0][0] = diffs[2][0] = DIFF_DELETE;
              }
              return diffs;
            }
            if (shorttext.length == 1) {
              return [ [ DIFF_DELETE, text1 ], [ DIFF_INSERT, text2 ] ];
            }
            var hm = this.diff_halfMatch_(text1, text2);
            if (hm) {
              var text1_a = hm[0];
              var text1_b = hm[1];
              var text2_a = hm[2];
              var text2_b = hm[3];
              var mid_common = hm[4];
              var diffs_a = this.diff_main(text1_a, text2_a, checklines, deadline);
              var diffs_b = this.diff_main(text1_b, text2_b, checklines, deadline);
              return diffs_a.concat([ [ DIFF_EQUAL, mid_common ] ], diffs_b);
            }
            if (checklines && text1.length > 100 && text2.length > 100) {
              return this.diff_lineMode_(text1, text2, deadline);
            }
            return this.diff_bisect_(text1, text2, deadline);
          };
          diff_match_patch.prototype.diff_lineMode_ = function(text1, text2, deadline) {
            var a = this.diff_linesToChars_(text1, text2);
            text1 = a.chars1;
            text2 = a.chars2;
            var linearray = a.lineArray;
            var diffs = this.diff_main(text1, text2, false, deadline);
            this.diff_charsToLines_(diffs, linearray);
            this.diff_cleanupSemantic(diffs);
            diffs.push([ DIFF_EQUAL, "" ]);
            var pointer = 0;
            var count_delete = 0;
            var count_insert = 0;
            var text_delete = "";
            var text_insert = "";
            while (pointer < diffs.length) {
              switch (diffs[pointer][0]) {
               case DIFF_INSERT:
                count_insert++;
                text_insert += diffs[pointer][1];
                break;

               case DIFF_DELETE:
                count_delete++;
                text_delete += diffs[pointer][1];
                break;

               case DIFF_EQUAL:
                if (count_delete >= 1 && count_insert >= 1) {
                  diffs.splice(pointer - count_delete - count_insert, count_delete + count_insert);
                  pointer = pointer - count_delete - count_insert;
                  var a = this.diff_main(text_delete, text_insert, false, deadline);
                  for (var j = a.length - 1; j >= 0; j--) {
                    diffs.splice(pointer, 0, a[j]);
                  }
                  pointer = pointer + a.length;
                }
                count_insert = 0;
                count_delete = 0;
                text_delete = "";
                text_insert = "";
                break;
              }
              pointer++;
            }
            diffs.pop();
            return diffs;
          };
          diff_match_patch.prototype.diff_bisect_ = function(text1, text2, deadline) {
            var text1_length = text1.length;
            var text2_length = text2.length;
            var max_d = Math.ceil((text1_length + text2_length) / 2);
            var v_offset = max_d;
            var v_length = 2 * max_d;
            var v1 = new Array(v_length);
            var v2 = new Array(v_length);
            for (var x = 0; x < v_length; x++) {
              v1[x] = -1;
              v2[x] = -1;
            }
            v1[v_offset + 1] = 0;
            v2[v_offset + 1] = 0;
            var delta = text1_length - text2_length;
            var front = delta % 2 != 0;
            var k1start = 0;
            var k1end = 0;
            var k2start = 0;
            var k2end = 0;
            for (var d = 0; d < max_d; d++) {
              if ((new Date).getTime() > deadline) {
                break;
              }
              for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {
                var k1_offset = v_offset + k1;
                var x1;
                if (k1 == -d || k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1]) {
                  x1 = v1[k1_offset + 1];
                } else {
                  x1 = v1[k1_offset - 1] + 1;
                }
                var y1 = x1 - k1;
                while (x1 < text1_length && y1 < text2_length && text1.charAt(x1) == text2.charAt(y1)) {
                  x1++;
                  y1++;
                }
                v1[k1_offset] = x1;
                if (x1 > text1_length) {
                  k1end += 2;
                } else if (y1 > text2_length) {
                  k1start += 2;
                } else if (front) {
                  var k2_offset = v_offset + delta - k1;
                  if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {
                    var x2 = text1_length - v2[k2_offset];
                    if (x1 >= x2) {
                      return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
                    }
                  }
                }
              }
              for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {
                var k2_offset = v_offset + k2;
                var x2;
                if (k2 == -d || k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1]) {
                  x2 = v2[k2_offset + 1];
                } else {
                  x2 = v2[k2_offset - 1] + 1;
                }
                var y2 = x2 - k2;
                while (x2 < text1_length && y2 < text2_length && text1.charAt(text1_length - x2 - 1) == text2.charAt(text2_length - y2 - 1)) {
                  x2++;
                  y2++;
                }
                v2[k2_offset] = x2;
                if (x2 > text1_length) {
                  k2end += 2;
                } else if (y2 > text2_length) {
                  k2start += 2;
                } else if (!front) {
                  var k1_offset = v_offset + delta - k2;
                  if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {
                    var x1 = v1[k1_offset];
                    var y1 = v_offset + x1 - k1_offset;
                    x2 = text1_length - x2;
                    if (x1 >= x2) {
                      return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
                    }
                  }
                }
              }
            }
            return [ [ DIFF_DELETE, text1 ], [ DIFF_INSERT, text2 ] ];
          };
          diff_match_patch.prototype.diff_bisectSplit_ = function(text1, text2, x, y, deadline) {
            var text1a = text1.substring(0, x);
            var text2a = text2.substring(0, y);
            var text1b = text1.substring(x);
            var text2b = text2.substring(y);
            var diffs = this.diff_main(text1a, text2a, false, deadline);
            var diffsb = this.diff_main(text1b, text2b, false, deadline);
            return diffs.concat(diffsb);
          };
          diff_match_patch.prototype.diff_linesToChars_ = function(text1, text2) {
            var lineArray = [];
            var lineHash = {};
            lineArray[0] = "";
            function diff_linesToCharsMunge_(text) {
              var chars = "";
              var lineStart = 0;
              var lineEnd = -1;
              var lineArrayLength = lineArray.length;
              while (lineEnd < text.length - 1) {
                lineEnd = text.indexOf("\n", lineStart);
                if (lineEnd == -1) {
                  lineEnd = text.length - 1;
                }
                var line = text.substring(lineStart, lineEnd + 1);
                lineStart = lineEnd + 1;
                if (lineHash.hasOwnProperty ? lineHash.hasOwnProperty(line) : lineHash[line] !== undefined) {
                  chars += String.fromCharCode(lineHash[line]);
                } else {
                  chars += String.fromCharCode(lineArrayLength);
                  lineHash[line] = lineArrayLength;
                  lineArray[lineArrayLength++] = line;
                }
              }
              return chars;
            }
            var chars1 = diff_linesToCharsMunge_(text1);
            var chars2 = diff_linesToCharsMunge_(text2);
            return {
              chars1,
              chars2,
              lineArray
            };
          };
          diff_match_patch.prototype.diff_charsToLines_ = function(diffs, lineArray) {
            for (var x = 0; x < diffs.length; x++) {
              var chars = diffs[x][1];
              var text = [];
              for (var y = 0; y < chars.length; y++) {
                text[y] = lineArray[chars.charCodeAt(y)];
              }
              diffs[x][1] = text.join("");
            }
          };
          diff_match_patch.prototype.diff_commonPrefix = function(text1, text2) {
            if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {
              return 0;
            }
            var pointermin = 0;
            var pointermax = Math.min(text1.length, text2.length);
            var pointermid = pointermax;
            var pointerstart = 0;
            while (pointermin < pointermid) {
              if (text1.substring(pointerstart, pointermid) == text2.substring(pointerstart, pointermid)) {
                pointermin = pointermid;
                pointerstart = pointermin;
              } else {
                pointermax = pointermid;
              }
              pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
            }
            return pointermid;
          };
          diff_match_patch.prototype.diff_commonSuffix = function(text1, text2) {
            if (!text1 || !text2 || text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {
              return 0;
            }
            var pointermin = 0;
            var pointermax = Math.min(text1.length, text2.length);
            var pointermid = pointermax;
            var pointerend = 0;
            while (pointermin < pointermid) {
              if (text1.substring(text1.length - pointermid, text1.length - pointerend) == text2.substring(text2.length - pointermid, text2.length - pointerend)) {
                pointermin = pointermid;
                pointerend = pointermin;
              } else {
                pointermax = pointermid;
              }
              pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);
            }
            return pointermid;
          };
          diff_match_patch.prototype.diff_commonOverlap_ = function(text1, text2) {
            var text1_length = text1.length;
            var text2_length = text2.length;
            if (text1_length == 0 || text2_length == 0) {
              return 0;
            }
            if (text1_length > text2_length) {
              text1 = text1.substring(text1_length - text2_length);
            } else if (text1_length < text2_length) {
              text2 = text2.substring(0, text1_length);
            }
            var text_length = Math.min(text1_length, text2_length);
            if (text1 == text2) {
              return text_length;
            }
            var best = 0;
            var length = 1;
            while (true) {
              var pattern = text1.substring(text_length - length);
              var found = text2.indexOf(pattern);
              if (found == -1) {
                return best;
              }
              length += found;
              if (found == 0 || text1.substring(text_length - length) == text2.substring(0, length)) {
                best = length;
                length++;
              }
            }
          };
          diff_match_patch.prototype.diff_halfMatch_ = function(text1, text2) {
            if (this.Diff_Timeout <= 0) {
              return null;
            }
            var longtext = text1.length > text2.length ? text1 : text2;
            var shorttext = text1.length > text2.length ? text2 : text1;
            if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {
              return null;
            }
            var dmp = this;
            function diff_halfMatchI_(longtext, shorttext, i) {
              var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));
              var j = -1;
              var best_common = "";
              var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;
              while ((j = shorttext.indexOf(seed, j + 1)) != -1) {
                var prefixLength = dmp.diff_commonPrefix(longtext.substring(i), shorttext.substring(j));
                var suffixLength = dmp.diff_commonSuffix(longtext.substring(0, i), shorttext.substring(0, j));
                if (best_common.length < suffixLength + prefixLength) {
                  best_common = shorttext.substring(j - suffixLength, j) + shorttext.substring(j, j + prefixLength);
                  best_longtext_a = longtext.substring(0, i - suffixLength);
                  best_longtext_b = longtext.substring(i + prefixLength);
                  best_shorttext_a = shorttext.substring(0, j - suffixLength);
                  best_shorttext_b = shorttext.substring(j + prefixLength);
                }
              }
              if (best_common.length * 2 >= longtext.length) {
                return [ best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b, best_common ];
              } else {
                return null;
              }
            }
            var hm1 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 4));
            var hm2 = diff_halfMatchI_(longtext, shorttext, Math.ceil(longtext.length / 2));
            var hm;
            if (!hm1 && !hm2) {
              return null;
            } else if (!hm2) {
              hm = hm1;
            } else if (!hm1) {
              hm = hm2;
            } else {
              hm = hm1[4].length > hm2[4].length ? hm1 : hm2;
            }
            var text1_a, text1_b, text2_a, text2_b;
            if (text1.length > text2.length) {
              text1_a = hm[0];
              text1_b = hm[1];
              text2_a = hm[2];
              text2_b = hm[3];
            } else {
              text2_a = hm[0];
              text2_b = hm[1];
              text1_a = hm[2];
              text1_b = hm[3];
            }
            var mid_common = hm[4];
            return [ text1_a, text1_b, text2_a, text2_b, mid_common ];
          };
          diff_match_patch.prototype.diff_cleanupSemantic = function(diffs) {
            var changes = false;
            var equalities = [];
            var equalitiesLength = 0;
            var lastequality = null;
            var pointer = 0;
            var length_insertions1 = 0;
            var length_deletions1 = 0;
            var length_insertions2 = 0;
            var length_deletions2 = 0;
            while (pointer < diffs.length) {
              if (diffs[pointer][0] == DIFF_EQUAL) {
                equalities[equalitiesLength++] = pointer;
                length_insertions1 = length_insertions2;
                length_deletions1 = length_deletions2;
                length_insertions2 = 0;
                length_deletions2 = 0;
                lastequality = diffs[pointer][1];
              } else {
                if (diffs[pointer][0] == DIFF_INSERT) {
                  length_insertions2 += diffs[pointer][1].length;
                } else {
                  length_deletions2 += diffs[pointer][1].length;
                }
                if (lastequality && lastequality.length <= Math.max(length_insertions1, length_deletions1) && lastequality.length <= Math.max(length_insertions2, length_deletions2)) {
                  diffs.splice(equalities[equalitiesLength - 1], 0, [ DIFF_DELETE, lastequality ]);
                  diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
                  equalitiesLength--;
                  equalitiesLength--;
                  pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
                  length_insertions1 = 0;
                  length_deletions1 = 0;
                  length_insertions2 = 0;
                  length_deletions2 = 0;
                  lastequality = null;
                  changes = true;
                }
              }
              pointer++;
            }
            if (changes) {
              this.diff_cleanupMerge(diffs);
            }
            this.diff_cleanupSemanticLossless(diffs);
            pointer = 1;
            while (pointer < diffs.length) {
              if (diffs[pointer - 1][0] == DIFF_DELETE && diffs[pointer][0] == DIFF_INSERT) {
                var deletion = diffs[pointer - 1][1];
                var insertion = diffs[pointer][1];
                var overlap_length1 = this.diff_commonOverlap_(deletion, insertion);
                var overlap_length2 = this.diff_commonOverlap_(insertion, deletion);
                if (overlap_length1 >= overlap_length2) {
                  if (overlap_length1 >= deletion.length / 2 || overlap_length1 >= insertion.length / 2) {
                    diffs.splice(pointer, 0, [ DIFF_EQUAL, insertion.substring(0, overlap_length1) ]);
                    diffs[pointer - 1][1] = deletion.substring(0, deletion.length - overlap_length1);
                    diffs[pointer + 1][1] = insertion.substring(overlap_length1);
                    pointer++;
                  }
                } else {
                  if (overlap_length2 >= deletion.length / 2 || overlap_length2 >= insertion.length / 2) {
                    diffs.splice(pointer, 0, [ DIFF_EQUAL, deletion.substring(0, overlap_length2) ]);
                    diffs[pointer - 1][0] = DIFF_INSERT;
                    diffs[pointer - 1][1] = insertion.substring(0, insertion.length - overlap_length2);
                    diffs[pointer + 1][0] = DIFF_DELETE;
                    diffs[pointer + 1][1] = deletion.substring(overlap_length2);
                    pointer++;
                  }
                }
                pointer++;
              }
              pointer++;
            }
          };
          diff_match_patch.prototype.diff_cleanupSemanticLossless = function(diffs) {
            function diff_cleanupSemanticScore_(one, two) {
              if (!one || !two) {
                return 6;
              }
              var char1 = one.charAt(one.length - 1);
              var char2 = two.charAt(0);
              var nonAlphaNumeric1 = char1.match(diff_match_patch.nonAlphaNumericRegex_);
              var nonAlphaNumeric2 = char2.match(diff_match_patch.nonAlphaNumericRegex_);
              var whitespace1 = nonAlphaNumeric1 && char1.match(diff_match_patch.whitespaceRegex_);
              var whitespace2 = nonAlphaNumeric2 && char2.match(diff_match_patch.whitespaceRegex_);
              var lineBreak1 = whitespace1 && char1.match(diff_match_patch.linebreakRegex_);
              var lineBreak2 = whitespace2 && char2.match(diff_match_patch.linebreakRegex_);
              var blankLine1 = lineBreak1 && one.match(diff_match_patch.blanklineEndRegex_);
              var blankLine2 = lineBreak2 && two.match(diff_match_patch.blanklineStartRegex_);
              if (blankLine1 || blankLine2) {
                return 5;
              } else if (lineBreak1 || lineBreak2) {
                return 4;
              } else if (nonAlphaNumeric1 && !whitespace1 && whitespace2) {
                return 3;
              } else if (whitespace1 || whitespace2) {
                return 2;
              } else if (nonAlphaNumeric1 || nonAlphaNumeric2) {
                return 1;
              }
              return 0;
            }
            var pointer = 1;
            while (pointer < diffs.length - 1) {
              if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
                var equality1 = diffs[pointer - 1][1];
                var edit = diffs[pointer][1];
                var equality2 = diffs[pointer + 1][1];
                var commonOffset = this.diff_commonSuffix(equality1, edit);
                if (commonOffset) {
                  var commonString = edit.substring(edit.length - commonOffset);
                  equality1 = equality1.substring(0, equality1.length - commonOffset);
                  edit = commonString + edit.substring(0, edit.length - commonOffset);
                  equality2 = commonString + equality2;
                }
                var bestEquality1 = equality1;
                var bestEdit = edit;
                var bestEquality2 = equality2;
                var bestScore = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
                while (edit.charAt(0) === equality2.charAt(0)) {
                  equality1 += edit.charAt(0);
                  edit = edit.substring(1) + equality2.charAt(0);
                  equality2 = equality2.substring(1);
                  var score = diff_cleanupSemanticScore_(equality1, edit) + diff_cleanupSemanticScore_(edit, equality2);
                  if (score >= bestScore) {
                    bestScore = score;
                    bestEquality1 = equality1;
                    bestEdit = edit;
                    bestEquality2 = equality2;
                  }
                }
                if (diffs[pointer - 1][1] != bestEquality1) {
                  if (bestEquality1) {
                    diffs[pointer - 1][1] = bestEquality1;
                  } else {
                    diffs.splice(pointer - 1, 1);
                    pointer--;
                  }
                  diffs[pointer][1] = bestEdit;
                  if (bestEquality2) {
                    diffs[pointer + 1][1] = bestEquality2;
                  } else {
                    diffs.splice(pointer + 1, 1);
                    pointer--;
                  }
                }
              }
              pointer++;
            }
          };
          diff_match_patch.nonAlphaNumericRegex_ = /[^a-zA-Z0-9]/;
          diff_match_patch.whitespaceRegex_ = /\s/;
          diff_match_patch.linebreakRegex_ = /[\r\n]/;
          diff_match_patch.blanklineEndRegex_ = /\n\r?\n$/;
          diff_match_patch.blanklineStartRegex_ = /^\r?\n\r?\n/;
          diff_match_patch.prototype.diff_cleanupEfficiency = function(diffs) {
            var changes = false;
            var equalities = [];
            var equalitiesLength = 0;
            var lastequality = null;
            var pointer = 0;
            var pre_ins = false;
            var pre_del = false;
            var post_ins = false;
            var post_del = false;
            while (pointer < diffs.length) {
              if (diffs[pointer][0] == DIFF_EQUAL) {
                if (diffs[pointer][1].length < this.Diff_EditCost && (post_ins || post_del)) {
                  equalities[equalitiesLength++] = pointer;
                  pre_ins = post_ins;
                  pre_del = post_del;
                  lastequality = diffs[pointer][1];
                } else {
                  equalitiesLength = 0;
                  lastequality = null;
                }
                post_ins = post_del = false;
              } else {
                if (diffs[pointer][0] == DIFF_DELETE) {
                  post_del = true;
                } else {
                  post_ins = true;
                }
                if (lastequality && (pre_ins && pre_del && post_ins && post_del || lastequality.length < this.Diff_EditCost / 2 && pre_ins + pre_del + post_ins + post_del == 3)) {
                  diffs.splice(equalities[equalitiesLength - 1], 0, [ DIFF_DELETE, lastequality ]);
                  diffs[equalities[equalitiesLength - 1] + 1][0] = DIFF_INSERT;
                  equalitiesLength--;
                  lastequality = null;
                  if (pre_ins && pre_del) {
                    post_ins = post_del = true;
                    equalitiesLength = 0;
                  } else {
                    equalitiesLength--;
                    pointer = equalitiesLength > 0 ? equalities[equalitiesLength - 1] : -1;
                    post_ins = post_del = false;
                  }
                  changes = true;
                }
              }
              pointer++;
            }
            if (changes) {
              this.diff_cleanupMerge(diffs);
            }
          };
          diff_match_patch.prototype.diff_cleanupMerge = function(diffs) {
            diffs.push([ DIFF_EQUAL, "" ]);
            var pointer = 0;
            var count_delete = 0;
            var count_insert = 0;
            var text_delete = "";
            var text_insert = "";
            var commonlength;
            while (pointer < diffs.length) {
              switch (diffs[pointer][0]) {
               case DIFF_INSERT:
                count_insert++;
                text_insert += diffs[pointer][1];
                pointer++;
                break;

               case DIFF_DELETE:
                count_delete++;
                text_delete += diffs[pointer][1];
                pointer++;
                break;

               case DIFF_EQUAL:
                if (count_delete + count_insert > 1) {
                  if (count_delete !== 0 && count_insert !== 0) {
                    commonlength = this.diff_commonPrefix(text_insert, text_delete);
                    if (commonlength !== 0) {
                      if (pointer - count_delete - count_insert > 0 && diffs[pointer - count_delete - count_insert - 1][0] == DIFF_EQUAL) {
                        diffs[pointer - count_delete - count_insert - 1][1] += text_insert.substring(0, commonlength);
                      } else {
                        diffs.splice(0, 0, [ DIFF_EQUAL, text_insert.substring(0, commonlength) ]);
                        pointer++;
                      }
                      text_insert = text_insert.substring(commonlength);
                      text_delete = text_delete.substring(commonlength);
                    }
                    commonlength = this.diff_commonSuffix(text_insert, text_delete);
                    if (commonlength !== 0) {
                      diffs[pointer][1] = text_insert.substring(text_insert.length - commonlength) + diffs[pointer][1];
                      text_insert = text_insert.substring(0, text_insert.length - commonlength);
                      text_delete = text_delete.substring(0, text_delete.length - commonlength);
                    }
                  }
                  if (count_delete === 0) {
                    diffs.splice(pointer - count_insert, count_delete + count_insert, [ DIFF_INSERT, text_insert ]);
                  } else if (count_insert === 0) {
                    diffs.splice(pointer - count_delete, count_delete + count_insert, [ DIFF_DELETE, text_delete ]);
                  } else {
                    diffs.splice(pointer - count_delete - count_insert, count_delete + count_insert, [ DIFF_DELETE, text_delete ], [ DIFF_INSERT, text_insert ]);
                  }
                  pointer = pointer - count_delete - count_insert + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;
                } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {
                  diffs[pointer - 1][1] += diffs[pointer][1];
                  diffs.splice(pointer, 1);
                } else {
                  pointer++;
                }
                count_insert = 0;
                count_delete = 0;
                text_delete = "";
                text_insert = "";
                break;
              }
            }
            if (diffs[diffs.length - 1][1] === "") {
              diffs.pop();
            }
            var changes = false;
            pointer = 1;
            while (pointer < diffs.length - 1) {
              if (diffs[pointer - 1][0] == DIFF_EQUAL && diffs[pointer + 1][0] == DIFF_EQUAL) {
                if (diffs[pointer][1].substring(diffs[pointer][1].length - diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {
                  diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1].substring(0, diffs[pointer][1].length - diffs[pointer - 1][1].length);
                  diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];
                  diffs.splice(pointer - 1, 1);
                  changes = true;
                } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == diffs[pointer + 1][1]) {
                  diffs[pointer - 1][1] += diffs[pointer + 1][1];
                  diffs[pointer][1] = diffs[pointer][1].substring(diffs[pointer + 1][1].length) + diffs[pointer + 1][1];
                  diffs.splice(pointer + 1, 1);
                  changes = true;
                }
              }
              pointer++;
            }
            if (changes) {
              this.diff_cleanupMerge(diffs);
            }
          };
          diff_match_patch.prototype.diff_xIndex = function(diffs, loc) {
            var chars1 = 0;
            var chars2 = 0;
            var last_chars1 = 0;
            var last_chars2 = 0;
            var x;
            for (x = 0; x < diffs.length; x++) {
              if (diffs[x][0] !== DIFF_INSERT) {
                chars1 += diffs[x][1].length;
              }
              if (diffs[x][0] !== DIFF_DELETE) {
                chars2 += diffs[x][1].length;
              }
              if (chars1 > loc) {
                break;
              }
              last_chars1 = chars1;
              last_chars2 = chars2;
            }
            if (diffs.length != x && diffs[x][0] === DIFF_DELETE) {
              return last_chars2;
            }
            return last_chars2 + (loc - last_chars1);
          };
          diff_match_patch.prototype.diff_prettyHtml = function(diffs) {
            var html = [];
            var pattern_amp = /&/g;
            var pattern_lt = /</g;
            var pattern_gt = />/g;
            var pattern_para = /\n/g;
            for (var x = 0; x < diffs.length; x++) {
              var op = diffs[x][0];
              var data = diffs[x][1];
              var text = data.replace(pattern_amp, "&amp;").replace(pattern_lt, "&lt;").replace(pattern_gt, "&gt;").replace(pattern_para, "&para;<br>");
              switch (op) {
               case DIFF_INSERT:
                html[x] = '<ins style="background:#e6ffe6;">' + text + "</ins>";
                break;

               case DIFF_DELETE:
                html[x] = '<del style="background:#ffe6e6;">' + text + "</del>";
                break;

               case DIFF_EQUAL:
                html[x] = "<span>" + text + "</span>";
                break;
              }
            }
            return html.join("");
          };
          diff_match_patch.prototype.diff_text1 = function(diffs) {
            var text = [];
            for (var x = 0; x < diffs.length; x++) {
              if (diffs[x][0] !== DIFF_INSERT) {
                text[x] = diffs[x][1];
              }
            }
            return text.join("");
          };
          diff_match_patch.prototype.diff_text2 = function(diffs) {
            var text = [];
            for (var x = 0; x < diffs.length; x++) {
              if (diffs[x][0] !== DIFF_DELETE) {
                text[x] = diffs[x][1];
              }
            }
            return text.join("");
          };
          diff_match_patch.prototype.diff_levenshtein = function(diffs) {
            var levenshtein = 0;
            var insertions = 0;
            var deletions = 0;
            for (var x = 0; x < diffs.length; x++) {
              var op = diffs[x][0];
              var data = diffs[x][1];
              switch (op) {
               case DIFF_INSERT:
                insertions += data.length;
                break;

               case DIFF_DELETE:
                deletions += data.length;
                break;

               case DIFF_EQUAL:
                levenshtein += Math.max(insertions, deletions);
                insertions = 0;
                deletions = 0;
                break;
              }
            }
            levenshtein += Math.max(insertions, deletions);
            return levenshtein;
          };
          diff_match_patch.prototype.diff_toDelta = function(diffs) {
            var text = [];
            for (var x = 0; x < diffs.length; x++) {
              switch (diffs[x][0]) {
               case DIFF_INSERT:
                text[x] = "+" + encodeURI(diffs[x][1]);
                break;

               case DIFF_DELETE:
                text[x] = "-" + diffs[x][1].length;
                break;

               case DIFF_EQUAL:
                text[x] = "=" + diffs[x][1].length;
                break;
              }
            }
            return text.join("\t").replace(/%20/g, " ");
          };
          diff_match_patch.prototype.diff_fromDelta = function(text1, delta) {
            var diffs = [];
            var diffsLength = 0;
            var pointer = 0;
            var tokens = delta.split(/\t/g);
            for (var x = 0; x < tokens.length; x++) {
              var param = tokens[x].substring(1);
              switch (tokens[x].charAt(0)) {
               case "+":
                try {
                  diffs[diffsLength++] = [ DIFF_INSERT, decodeURI(param) ];
                } catch (ex) {
                  throw new Error("Illegal escape in diff_fromDelta: " + param);
                }
                break;

               case "-":
               case "=":
                var n = parseInt(param, 10);
                if (isNaN(n) || n < 0) {
                  throw new Error("Invalid number in diff_fromDelta: " + param);
                }
                var text = text1.substring(pointer, pointer += n);
                if (tokens[x].charAt(0) == "=") {
                  diffs[diffsLength++] = [ DIFF_EQUAL, text ];
                } else {
                  diffs[diffsLength++] = [ DIFF_DELETE, text ];
                }
                break;

               default:
                if (tokens[x]) {
                  throw new Error("Invalid diff operation in diff_fromDelta: " + tokens[x]);
                }
              }
            }
            if (pointer != text1.length) {
              throw new Error("Delta length (" + pointer + ") does not equal source text length (" + text1.length + ").");
            }
            return diffs;
          };
          diff_match_patch.prototype.match_main = function(text, pattern, loc) {
            if (text == null || pattern == null || loc == null) {
              throw new Error("Null input. (match_main)");
            }
            loc = Math.max(0, Math.min(loc, text.length));
            if (text == pattern) {
              return 0;
            } else if (!text.length) {
              return -1;
            } else if (text.substring(loc, loc + pattern.length) == pattern) {
              return loc;
            } else {
              return this.match_bitap_(text, pattern, loc);
            }
          };
          diff_match_patch.prototype.match_bitap_ = function(text, pattern, loc) {
            if (pattern.length > this.Match_MaxBits) {
              throw new Error("Pattern too long for this browser.");
            }
            var s = this.match_alphabet_(pattern);
            var dmp = this;
            function match_bitapScore_(e, x) {
              var accuracy = e / pattern.length;
              var proximity = Math.abs(loc - x);
              if (!dmp.Match_Distance) {
                return proximity ? 1 : accuracy;
              }
              return accuracy + proximity / dmp.Match_Distance;
            }
            var score_threshold = this.Match_Threshold;
            var best_loc = text.indexOf(pattern, loc);
            if (best_loc != -1) {
              score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);
              best_loc = text.lastIndexOf(pattern, loc + pattern.length);
              if (best_loc != -1) {
                score_threshold = Math.min(match_bitapScore_(0, best_loc), score_threshold);
              }
            }
            var matchmask = 1 << pattern.length - 1;
            best_loc = -1;
            var bin_min, bin_mid;
            var bin_max = pattern.length + text.length;
            var last_rd;
            for (var d = 0; d < pattern.length; d++) {
              bin_min = 0;
              bin_mid = bin_max;
              while (bin_min < bin_mid) {
                if (match_bitapScore_(d, loc + bin_mid) <= score_threshold) {
                  bin_min = bin_mid;
                } else {
                  bin_max = bin_mid;
                }
                bin_mid = Math.floor((bin_max - bin_min) / 2 + bin_min);
              }
              bin_max = bin_mid;
              var start = Math.max(1, loc - bin_mid + 1);
              var finish = Math.min(loc + bin_mid, text.length) + pattern.length;
              var rd = Array(finish + 2);
              rd[finish + 1] = (1 << d) - 1;
              for (var j = finish; j >= start; j--) {
                var charMatch = s[text.charAt(j - 1)];
                if (d === 0) {
                  rd[j] = (rd[j + 1] << 1 | 1) & charMatch;
                } else {
                  rd[j] = (rd[j + 1] << 1 | 1) & charMatch | ((last_rd[j + 1] | last_rd[j]) << 1 | 1) | last_rd[j + 1];
                }
                if (rd[j] & matchmask) {
                  var score = match_bitapScore_(d, j - 1);
                  if (score <= score_threshold) {
                    score_threshold = score;
                    best_loc = j - 1;
                    if (best_loc > loc) {
                      start = Math.max(1, 2 * loc - best_loc);
                    } else {
                      break;
                    }
                  }
                }
              }
              if (match_bitapScore_(d + 1, loc) > score_threshold) {
                break;
              }
              last_rd = rd;
            }
            return best_loc;
          };
          diff_match_patch.prototype.match_alphabet_ = function(pattern) {
            var s = {};
            for (var i = 0; i < pattern.length; i++) {
              s[pattern.charAt(i)] = 0;
            }
            for (var i = 0; i < pattern.length; i++) {
              s[pattern.charAt(i)] |= 1 << pattern.length - i - 1;
            }
            return s;
          };
          diff_match_patch.prototype.patch_addContext_ = function(patch, text) {
            if (text.length == 0) {
              return;
            }
            var pattern = text.substring(patch.start2, patch.start2 + patch.length1);
            var padding = 0;
            while (text.indexOf(pattern) != text.lastIndexOf(pattern) && pattern.length < this.Match_MaxBits - this.Patch_Margin - this.Patch_Margin) {
              padding += this.Patch_Margin;
              pattern = text.substring(patch.start2 - padding, patch.start2 + patch.length1 + padding);
            }
            padding += this.Patch_Margin;
            var prefix = text.substring(patch.start2 - padding, patch.start2);
            if (prefix) {
              patch.diffs.unshift([ DIFF_EQUAL, prefix ]);
            }
            var suffix = text.substring(patch.start2 + patch.length1, patch.start2 + patch.length1 + padding);
            if (suffix) {
              patch.diffs.push([ DIFF_EQUAL, suffix ]);
            }
            patch.start1 -= prefix.length;
            patch.start2 -= prefix.length;
            patch.length1 += prefix.length + suffix.length;
            patch.length2 += prefix.length + suffix.length;
          };
          diff_match_patch.prototype.patch_make = function(a, opt_b, opt_c) {
            var text1, diffs;
            if (typeof a == "string" && typeof opt_b == "string" && typeof opt_c == "undefined") {
              text1 = a;
              diffs = this.diff_main(text1, opt_b, true);
              if (diffs.length > 2) {
                this.diff_cleanupSemantic(diffs);
                this.diff_cleanupEfficiency(diffs);
              }
            } else if (a && typeof a == "object" && typeof opt_b == "undefined" && typeof opt_c == "undefined") {
              diffs = a;
              text1 = this.diff_text1(diffs);
            } else if (typeof a == "string" && opt_b && typeof opt_b == "object" && typeof opt_c == "undefined") {
              text1 = a;
              diffs = opt_b;
            } else if (typeof a == "string" && typeof opt_b == "string" && opt_c && typeof opt_c == "object") {
              text1 = a;
              diffs = opt_c;
            } else {
              throw new Error("Unknown call format to patch_make.");
            }
            if (diffs.length === 0) {
              return [];
            }
            var patches = [];
            var patch = new diff_match_patch.patch_obj;
            var patchDiffLength = 0;
            var char_count1 = 0;
            var char_count2 = 0;
            var prepatch_text = text1;
            var postpatch_text = text1;
            for (var x = 0; x < diffs.length; x++) {
              var diff_type = diffs[x][0];
              var diff_text = diffs[x][1];
              if (!patchDiffLength && diff_type !== DIFF_EQUAL) {
                patch.start1 = char_count1;
                patch.start2 = char_count2;
              }
              switch (diff_type) {
               case DIFF_INSERT:
                patch.diffs[patchDiffLength++] = diffs[x];
                patch.length2 += diff_text.length;
                postpatch_text = postpatch_text.substring(0, char_count2) + diff_text + postpatch_text.substring(char_count2);
                break;

               case DIFF_DELETE:
                patch.length1 += diff_text.length;
                patch.diffs[patchDiffLength++] = diffs[x];
                postpatch_text = postpatch_text.substring(0, char_count2) + postpatch_text.substring(char_count2 + diff_text.length);
                break;

               case DIFF_EQUAL:
                if (diff_text.length <= 2 * this.Patch_Margin && patchDiffLength && diffs.length != x + 1) {
                  patch.diffs[patchDiffLength++] = diffs[x];
                  patch.length1 += diff_text.length;
                  patch.length2 += diff_text.length;
                } else if (diff_text.length >= 2 * this.Patch_Margin) {
                  if (patchDiffLength) {
                    this.patch_addContext_(patch, prepatch_text);
                    patches.push(patch);
                    patch = new diff_match_patch.patch_obj;
                    patchDiffLength = 0;
                    prepatch_text = postpatch_text;
                    char_count1 = char_count2;
                  }
                }
                break;
              }
              if (diff_type !== DIFF_INSERT) {
                char_count1 += diff_text.length;
              }
              if (diff_type !== DIFF_DELETE) {
                char_count2 += diff_text.length;
              }
            }
            if (patchDiffLength) {
              this.patch_addContext_(patch, prepatch_text);
              patches.push(patch);
            }
            return patches;
          };
          diff_match_patch.prototype.patch_deepCopy = function(patches) {
            var patchesCopy = [];
            for (var x = 0; x < patches.length; x++) {
              var patch = patches[x];
              var patchCopy = new diff_match_patch.patch_obj;
              patchCopy.diffs = [];
              for (var y = 0; y < patch.diffs.length; y++) {
                patchCopy.diffs[y] = patch.diffs[y].slice();
              }
              patchCopy.start1 = patch.start1;
              patchCopy.start2 = patch.start2;
              patchCopy.length1 = patch.length1;
              patchCopy.length2 = patch.length2;
              patchesCopy[x] = patchCopy;
            }
            return patchesCopy;
          };
          diff_match_patch.prototype.patch_apply = function(patches, text) {
            if (patches.length == 0) {
              return [ text, [] ];
            }
            patches = this.patch_deepCopy(patches);
            var nullPadding = this.patch_addPadding(patches);
            text = nullPadding + text + nullPadding;
            this.patch_splitMax(patches);
            var delta = 0;
            var results = [];
            for (var x = 0; x < patches.length; x++) {
              var expected_loc = patches[x].start2 + delta;
              var text1 = this.diff_text1(patches[x].diffs);
              var start_loc;
              var end_loc = -1;
              if (text1.length > this.Match_MaxBits) {
                start_loc = this.match_main(text, text1.substring(0, this.Match_MaxBits), expected_loc);
                if (start_loc != -1) {
                  end_loc = this.match_main(text, text1.substring(text1.length - this.Match_MaxBits), expected_loc + text1.length - this.Match_MaxBits);
                  if (end_loc == -1 || start_loc >= end_loc) {
                    start_loc = -1;
                  }
                }
              } else {
                start_loc = this.match_main(text, text1, expected_loc);
              }
              if (start_loc == -1) {
                results[x] = false;
                delta -= patches[x].length2 - patches[x].length1;
              } else {
                results[x] = true;
                delta = start_loc - expected_loc;
                var text2;
                if (end_loc == -1) {
                  text2 = text.substring(start_loc, start_loc + text1.length);
                } else {
                  text2 = text.substring(start_loc, end_loc + this.Match_MaxBits);
                }
                if (text1 == text2) {
                  text = text.substring(0, start_loc) + this.diff_text2(patches[x].diffs) + text.substring(start_loc + text1.length);
                } else {
                  var diffs = this.diff_main(text1, text2, false);
                  if (text1.length > this.Match_MaxBits && this.diff_levenshtein(diffs) / text1.length > this.Patch_DeleteThreshold) {
                    results[x] = false;
                  } else {
                    this.diff_cleanupSemanticLossless(diffs);
                    var index1 = 0;
                    var index2;
                    for (var y = 0; y < patches[x].diffs.length; y++) {
                      var mod = patches[x].diffs[y];
                      if (mod[0] !== DIFF_EQUAL) {
                        index2 = this.diff_xIndex(diffs, index1);
                      }
                      if (mod[0] === DIFF_INSERT) {
                        text = text.substring(0, start_loc + index2) + mod[1] + text.substring(start_loc + index2);
                      } else if (mod[0] === DIFF_DELETE) {
                        text = text.substring(0, start_loc + index2) + text.substring(start_loc + this.diff_xIndex(diffs, index1 + mod[1].length));
                      }
                      if (mod[0] !== DIFF_DELETE) {
                        index1 += mod[1].length;
                      }
                    }
                  }
                }
              }
            }
            text = text.substring(nullPadding.length, text.length - nullPadding.length);
            return [ text, results ];
          };
          diff_match_patch.prototype.patch_addPadding = function(patches) {
            var paddingLength = this.Patch_Margin;
            var nullPadding = "";
            for (var x = 1; x <= paddingLength; x++) {
              nullPadding += String.fromCharCode(x);
            }
            for (var x = 0; x < patches.length; x++) {
              patches[x].start1 += paddingLength;
              patches[x].start2 += paddingLength;
            }
            var patch = patches[0];
            var diffs = patch.diffs;
            if (diffs.length == 0 || diffs[0][0] != DIFF_EQUAL) {
              diffs.unshift([ DIFF_EQUAL, nullPadding ]);
              patch.start1 -= paddingLength;
              patch.start2 -= paddingLength;
              patch.length1 += paddingLength;
              patch.length2 += paddingLength;
            } else if (paddingLength > diffs[0][1].length) {
              var extraLength = paddingLength - diffs[0][1].length;
              diffs[0][1] = nullPadding.substring(diffs[0][1].length) + diffs[0][1];
              patch.start1 -= extraLength;
              patch.start2 -= extraLength;
              patch.length1 += extraLength;
              patch.length2 += extraLength;
            }
            patch = patches[patches.length - 1];
            diffs = patch.diffs;
            if (diffs.length == 0 || diffs[diffs.length - 1][0] != DIFF_EQUAL) {
              diffs.push([ DIFF_EQUAL, nullPadding ]);
              patch.length1 += paddingLength;
              patch.length2 += paddingLength;
            } else if (paddingLength > diffs[diffs.length - 1][1].length) {
              var extraLength = paddingLength - diffs[diffs.length - 1][1].length;
              diffs[diffs.length - 1][1] += nullPadding.substring(0, extraLength);
              patch.length1 += extraLength;
              patch.length2 += extraLength;
            }
            return nullPadding;
          };
          diff_match_patch.prototype.patch_splitMax = function(patches) {
            var patch_size = this.Match_MaxBits;
            for (var x = 0; x < patches.length; x++) {
              if (patches[x].length1 <= patch_size) {
                continue;
              }
              var bigpatch = patches[x];
              patches.splice(x--, 1);
              var start1 = bigpatch.start1;
              var start2 = bigpatch.start2;
              var precontext = "";
              while (bigpatch.diffs.length !== 0) {
                var patch = new diff_match_patch.patch_obj;
                var empty = true;
                patch.start1 = start1 - precontext.length;
                patch.start2 = start2 - precontext.length;
                if (precontext !== "") {
                  patch.length1 = patch.length2 = precontext.length;
                  patch.diffs.push([ DIFF_EQUAL, precontext ]);
                }
                while (bigpatch.diffs.length !== 0 && patch.length1 < patch_size - this.Patch_Margin) {
                  var diff_type = bigpatch.diffs[0][0];
                  var diff_text = bigpatch.diffs[0][1];
                  if (diff_type === DIFF_INSERT) {
                    patch.length2 += diff_text.length;
                    start2 += diff_text.length;
                    patch.diffs.push(bigpatch.diffs.shift());
                    empty = false;
                  } else if (diff_type === DIFF_DELETE && patch.diffs.length == 1 && patch.diffs[0][0] == DIFF_EQUAL && diff_text.length > 2 * patch_size) {
                    patch.length1 += diff_text.length;
                    start1 += diff_text.length;
                    empty = false;
                    patch.diffs.push([ diff_type, diff_text ]);
                    bigpatch.diffs.shift();
                  } else {
                    diff_text = diff_text.substring(0, patch_size - patch.length1 - this.Patch_Margin);
                    patch.length1 += diff_text.length;
                    start1 += diff_text.length;
                    if (diff_type === DIFF_EQUAL) {
                      patch.length2 += diff_text.length;
                      start2 += diff_text.length;
                    } else {
                      empty = false;
                    }
                    patch.diffs.push([ diff_type, diff_text ]);
                    if (diff_text == bigpatch.diffs[0][1]) {
                      bigpatch.diffs.shift();
                    } else {
                      bigpatch.diffs[0][1] = bigpatch.diffs[0][1].substring(diff_text.length);
                    }
                  }
                }
                precontext = this.diff_text2(patch.diffs);
                precontext = precontext.substring(precontext.length - this.Patch_Margin);
                var postcontext = this.diff_text1(bigpatch.diffs).substring(0, this.Patch_Margin);
                if (postcontext !== "") {
                  patch.length1 += postcontext.length;
                  patch.length2 += postcontext.length;
                  if (patch.diffs.length !== 0 && patch.diffs[patch.diffs.length - 1][0] === DIFF_EQUAL) {
                    patch.diffs[patch.diffs.length - 1][1] += postcontext;
                  } else {
                    patch.diffs.push([ DIFF_EQUAL, postcontext ]);
                  }
                }
                if (!empty) {
                  patches.splice(++x, 0, patch);
                }
              }
            }
          };
          diff_match_patch.prototype.patch_toText = function(patches) {
            var text = [];
            for (var x = 0; x < patches.length; x++) {
              text[x] = patches[x];
            }
            return text.join("");
          };
          diff_match_patch.prototype.patch_fromText = function(textline) {
            var patches = [];
            if (!textline) {
              return patches;
            }
            var text = textline.split("\n");
            var textPointer = 0;
            var patchHeader = /^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;
            while (textPointer < text.length) {
              var m = text[textPointer].match(patchHeader);
              if (!m) {
                throw new Error("Invalid patch string: " + text[textPointer]);
              }
              var patch = new diff_match_patch.patch_obj;
              patches.push(patch);
              patch.start1 = parseInt(m[1], 10);
              if (m[2] === "") {
                patch.start1--;
                patch.length1 = 1;
              } else if (m[2] == "0") {
                patch.length1 = 0;
              } else {
                patch.start1--;
                patch.length1 = parseInt(m[2], 10);
              }
              patch.start2 = parseInt(m[3], 10);
              if (m[4] === "") {
                patch.start2--;
                patch.length2 = 1;
              } else if (m[4] == "0") {
                patch.length2 = 0;
              } else {
                patch.start2--;
                patch.length2 = parseInt(m[4], 10);
              }
              textPointer++;
              while (textPointer < text.length) {
                var sign = text[textPointer].charAt(0);
                try {
                  var line = decodeURI(text[textPointer].substring(1));
                } catch (ex) {
                  throw new Error("Illegal escape in patch_fromText: " + line);
                }
                if (sign == "-") {
                  patch.diffs.push([ DIFF_DELETE, line ]);
                } else if (sign == "+") {
                  patch.diffs.push([ DIFF_INSERT, line ]);
                } else if (sign == " ") {
                  patch.diffs.push([ DIFF_EQUAL, line ]);
                } else if (sign == "@") {
                  break;
                } else if (sign === "") {} else {
                  throw new Error('Invalid patch mode "' + sign + '" in: ' + line);
                }
                textPointer++;
              }
            }
            return patches;
          };
          diff_match_patch.patch_obj = function() {
            this.diffs = [];
            this.start1 = null;
            this.start2 = null;
            this.length1 = 0;
            this.length2 = 0;
          };
          diff_match_patch.patch_obj.prototype.toString = function() {
            var coords1, coords2;
            if (this.length1 === 0) {
              coords1 = this.start1 + ",0";
            } else if (this.length1 == 1) {
              coords1 = this.start1 + 1;
            } else {
              coords1 = this.start1 + 1 + "," + this.length1;
            }
            if (this.length2 === 0) {
              coords2 = this.start2 + ",0";
            } else if (this.length2 == 1) {
              coords2 = this.start2 + 1;
            } else {
              coords2 = this.start2 + 1 + "," + this.length2;
            }
            var text = [ "@@ -" + coords1 + " +" + coords2 + " @@\n" ];
            var op;
            for (var x = 0; x < this.diffs.length; x++) {
              switch (this.diffs[x][0]) {
               case DIFF_INSERT:
                op = "+";
                break;

               case DIFF_DELETE:
                op = "-";
                break;

               case DIFF_EQUAL:
                op = " ";
                break;
              }
              text[x + 1] = op + encodeURI(this.diffs[x][1]) + "\n";
            }
            return text.join("").replace(/%20/g, " ");
          };
          module.exports = diff_match_patch;
          module.exports["diff_match_patch"] = diff_match_patch;
          module.exports["DIFF_DELETE"] = DIFF_DELETE;
          module.exports["DIFF_INSERT"] = DIFF_INSERT;
          module.exports["DIFF_EQUAL"] = DIFF_EQUAL;
        }));
        var TEXT_DIFF = 2;
        var DEFAULT_MIN_LENGTH = 60;
        var cachedDiffPatch = null;
        var getDiffMatchPatch = function getDiffMatchPatch(required) {
          if (!cachedDiffPatch) {
            var instance = void 0;
            if (typeof diff_match_patch !== "undefined") {
              instance = typeof diff_match_patch === "function" ? new diff_match_patch : new diff_match_patch.diff_match_patch;
            } else if (diffMatchPatch) {
              try {
                instance = diffMatchPatch && new diffMatchPatch;
              } catch (err) {
                instance = null;
              }
            }
            if (!instance) {
              if (!required) {
                return null;
              }
              var error = new Error("text diff_match_patch library not found");
              error.diff_match_patch_not_found = true;
              throw error;
            }
            cachedDiffPatch = {
              diff: function diff(txt1, txt2) {
                return instance.patch_toText(instance.patch_make(txt1, txt2));
              },
              patch: function patch(txt1, _patch) {
                var results = instance.patch_apply(instance.patch_fromText(_patch), txt1);
                for (var i = 0; i < results[1].length; i++) {
                  if (!results[1][i]) {
                    var _error = new Error("text patch failed");
                    _error.textPatchFailed = true;
                  }
                }
                return results[0];
              }
            };
          }
          return cachedDiffPatch;
        };
        var diffFilter$3 = function textsDiffFilter(context) {
          if (context.leftType !== "string") {
            return;
          }
          var minLength = context.options && context.options.textDiff && context.options.textDiff.minLength || DEFAULT_MIN_LENGTH;
          if (context.left.length < minLength || context.right.length < minLength) {
            context.setResult([ context.left, context.right ]).exit();
            return;
          }
          var diffMatchPatch$$1 = getDiffMatchPatch();
          if (!diffMatchPatch$$1) {
            context.setResult([ context.left, context.right ]).exit();
            return;
          }
          var diff = diffMatchPatch$$1.diff;
          context.setResult([ diff(context.left, context.right), 0, TEXT_DIFF ]).exit();
        };
        diffFilter$3.filterName = "texts";
        var patchFilter$3 = function textsPatchFilter(context) {
          if (context.nested) {
            return;
          }
          if (context.delta[2] !== TEXT_DIFF) {
            return;
          }
          var patch = getDiffMatchPatch(true).patch;
          context.setResult(patch(context.left, context.delta[0])).exit();
        };
        patchFilter$3.filterName = "texts";
        var textDeltaReverse = function textDeltaReverse(delta) {
          var i = void 0;
          var l = void 0;
          var lines = void 0;
          var line = void 0;
          var lineTmp = void 0;
          var header = null;
          var headerRegex = /^@@ +-(\d+),(\d+) +\+(\d+),(\d+) +@@$/;
          var lineHeader = void 0;
          lines = delta.split("\n");
          for (i = 0, l = lines.length; i < l; i++) {
            line = lines[i];
            var lineStart = line.slice(0, 1);
            if (lineStart === "@") {
              header = headerRegex.exec(line);
              lineHeader = i;
              lines[lineHeader] = "@@ -" + header[3] + "," + header[4] + " +" + header[1] + "," + header[2] + " @@";
            } else if (lineStart === "+") {
              lines[i] = "-" + lines[i].slice(1);
              if (lines[i - 1].slice(0, 1) === "+") {
                lineTmp = lines[i];
                lines[i] = lines[i - 1];
                lines[i - 1] = lineTmp;
              }
            } else if (lineStart === "-") {
              lines[i] = "+" + lines[i].slice(1);
            }
          }
          return lines.join("\n");
        };
        var reverseFilter$3 = function textsReverseFilter(context) {
          if (context.nested) {
            return;
          }
          if (context.delta[2] !== TEXT_DIFF) {
            return;
          }
          context.setResult([ textDeltaReverse(context.delta[0]), 0, TEXT_DIFF ]).exit();
        };
        reverseFilter$3.filterName = "texts";
        var DiffPatcher = function() {
          function DiffPatcher(options) {
            classCallCheck(this, DiffPatcher);
            this.processor = new Processor(options);
            this.processor.pipe(new Pipe("diff").append(collectChildrenDiffFilter, diffFilter, diffFilter$2, diffFilter$3, objectsDiffFilter, diffFilter$1).shouldHaveResult());
            this.processor.pipe(new Pipe("patch").append(collectChildrenPatchFilter, collectChildrenPatchFilter$1, patchFilter, patchFilter$3, patchFilter$1, patchFilter$2).shouldHaveResult());
            this.processor.pipe(new Pipe("reverse").append(collectChildrenReverseFilter, collectChildrenReverseFilter$1, reverseFilter, reverseFilter$3, reverseFilter$1, reverseFilter$2).shouldHaveResult());
          }
          createClass(DiffPatcher, [ {
            key: "options",
            value: function options() {
              var _processor;
              return (_processor = this.processor).options.apply(_processor, arguments);
            }
          }, {
            key: "diff",
            value: function diff(left, right) {
              return this.processor.process(new DiffContext(left, right));
            }
          }, {
            key: "patch",
            value: function patch(left, delta) {
              return this.processor.process(new PatchContext(left, delta));
            }
          }, {
            key: "reverse",
            value: function reverse(delta) {
              return this.processor.process(new ReverseContext(delta));
            }
          }, {
            key: "unpatch",
            value: function unpatch(right, delta) {
              return this.patch(right, this.reverse(delta));
            }
          }, {
            key: "clone",
            value: function clone$$1(value) {
              return clone(value);
            }
          } ]);
          return DiffPatcher;
        }();
        var isArray$3 = typeof Array.isArray === "function" ? Array.isArray : function(a) {
          return a instanceof Array;
        };
        var getObjectKeys = typeof Object.keys === "function" ? function(obj) {
          return Object.keys(obj);
        } : function(obj) {
          var names = [];
          for (var property in obj) {
            if (Object.prototype.hasOwnProperty.call(obj, property)) {
              names.push(property);
            }
          }
          return names;
        };
        var trimUnderscore = function trimUnderscore(str) {
          if (str.substr(0, 1) === "_") {
            return str.slice(1);
          }
          return str;
        };
        var arrayKeyToSortNumber = function arrayKeyToSortNumber(key) {
          if (key === "_t") {
            return -1;
          } else {
            if (key.substr(0, 1) === "_") {
              return parseInt(key.slice(1), 10);
            } else {
              return parseInt(key, 10) + .1;
            }
          }
        };
        var arrayKeyComparer = function arrayKeyComparer(key1, key2) {
          return arrayKeyToSortNumber(key1) - arrayKeyToSortNumber(key2);
        };
        var BaseFormatter = function() {
          function BaseFormatter() {
            classCallCheck(this, BaseFormatter);
          }
          createClass(BaseFormatter, [ {
            key: "format",
            value: function format(delta, left) {
              var context = {};
              this.prepareContext(context);
              this.recurse(context, delta, left);
              return this.finalize(context);
            }
          }, {
            key: "prepareContext",
            value: function prepareContext(context) {
              context.buffer = [];
              context.out = function() {
                var _buffer;
                (_buffer = this.buffer).push.apply(_buffer, arguments);
              };
            }
          }, {
            key: "typeFormattterNotFound",
            value: function typeFormattterNotFound(context, deltaType) {
              throw new Error("cannot format delta type: " + deltaType);
            }
          }, {
            key: "typeFormattterErrorFormatter",
            value: function typeFormattterErrorFormatter(context, err) {
              return err.toString();
            }
          }, {
            key: "finalize",
            value: function finalize(_ref) {
              var buffer = _ref.buffer;
              if (isArray$3(buffer)) {
                return buffer.join("");
              }
            }
          }, {
            key: "recurse",
            value: function recurse(context, delta, left, key, leftKey, movedFrom, isLast) {
              var useMoveOriginHere = delta && movedFrom;
              var leftValue = useMoveOriginHere ? movedFrom.value : left;
              if (typeof delta === "undefined" && typeof key === "undefined") {
                return undefined;
              }
              var type = this.getDeltaType(delta, movedFrom);
              var nodeType = type === "node" ? delta._t === "a" ? "array" : "object" : "";
              if (typeof key !== "undefined") {
                this.nodeBegin(context, key, leftKey, type, nodeType, isLast);
              } else {
                this.rootBegin(context, type, nodeType);
              }
              var typeFormattter = void 0;
              try {
                typeFormattter = this["format_" + type] || this.typeFormattterNotFound(context, type);
                typeFormattter.call(this, context, delta, leftValue, key, leftKey, movedFrom);
              } catch (err) {
                this.typeFormattterErrorFormatter(context, err, delta, leftValue, key, leftKey, movedFrom);
                if (typeof console !== "undefined" && console.error) {
                  console.error(err.stack);
                }
              }
              if (typeof key !== "undefined") {
                this.nodeEnd(context, key, leftKey, type, nodeType, isLast);
              } else {
                this.rootEnd(context, type, nodeType);
              }
            }
          }, {
            key: "formatDeltaChildren",
            value: function formatDeltaChildren(context, delta, left) {
              var self = this;
              this.forEachDeltaKey(delta, left, (function(key, leftKey, movedFrom, isLast) {
                self.recurse(context, delta[key], left ? left[leftKey] : undefined, key, leftKey, movedFrom, isLast);
              }));
            }
          }, {
            key: "forEachDeltaKey",
            value: function forEachDeltaKey(delta, left, fn) {
              var keys = getObjectKeys(delta);
              var arrayKeys = delta._t === "a";
              var moveDestinations = {};
              var name = void 0;
              if (typeof left !== "undefined") {
                for (name in left) {
                  if (Object.prototype.hasOwnProperty.call(left, name)) {
                    if (typeof delta[name] === "undefined" && (!arrayKeys || typeof delta["_" + name] === "undefined")) {
                      keys.push(name);
                    }
                  }
                }
              }
              for (name in delta) {
                if (Object.prototype.hasOwnProperty.call(delta, name)) {
                  var value = delta[name];
                  if (isArray$3(value) && value[2] === 3) {
                    moveDestinations[value[1].toString()] = {
                      key: name,
                      value: left && left[parseInt(name.substr(1))]
                    };
                    if (this.includeMoveDestinations !== false) {
                      if (typeof left === "undefined" && typeof delta[value[1]] === "undefined") {
                        keys.push(value[1].toString());
                      }
                    }
                  }
                }
              }
              if (arrayKeys) {
                keys.sort(arrayKeyComparer);
              } else {
                keys.sort();
              }
              for (var index = 0, length = keys.length; index < length; index++) {
                var key = keys[index];
                if (arrayKeys && key === "_t") {
                  continue;
                }
                var leftKey = arrayKeys ? typeof key === "number" ? key : parseInt(trimUnderscore(key), 10) : key;
                var isLast = index === length - 1;
                fn(key, leftKey, moveDestinations[leftKey], isLast);
              }
            }
          }, {
            key: "getDeltaType",
            value: function getDeltaType(delta, movedFrom) {
              if (typeof delta === "undefined") {
                if (typeof movedFrom !== "undefined") {
                  return "movedestination";
                }
                return "unchanged";
              }
              if (isArray$3(delta)) {
                if (delta.length === 1) {
                  return "added";
                }
                if (delta.length === 2) {
                  return "modified";
                }
                if (delta.length === 3 && delta[2] === 0) {
                  return "deleted";
                }
                if (delta.length === 3 && delta[2] === 2) {
                  return "textdiff";
                }
                if (delta.length === 3 && delta[2] === 3) {
                  return "moved";
                }
              } else if ((typeof delta === "undefined" ? "undefined" : _typeof(delta)) === "object") {
                return "node";
              }
              return "unknown";
            }
          }, {
            key: "parseTextDiff",
            value: function parseTextDiff(value) {
              var output = [];
              var lines = value.split("\n@@ ");
              for (var i = 0, l = lines.length; i < l; i++) {
                var line = lines[i];
                var lineOutput = {
                  pieces: []
                };
                var location = /^(?:@@ )?[-+]?(\d+),(\d+)/.exec(line).slice(1);
                lineOutput.location = {
                  line: location[0],
                  chr: location[1]
                };
                var pieces = line.split("\n").slice(1);
                for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
                  var piece = pieces[pieceIndex];
                  if (!piece.length) {
                    continue;
                  }
                  var pieceOutput = {
                    type: "context"
                  };
                  if (piece.substr(0, 1) === "+") {
                    pieceOutput.type = "added";
                  } else if (piece.substr(0, 1) === "-") {
                    pieceOutput.type = "deleted";
                  }
                  pieceOutput.text = piece.slice(1);
                  lineOutput.pieces.push(pieceOutput);
                }
                output.push(lineOutput);
              }
              return output;
            }
          } ]);
          return BaseFormatter;
        }();
        var base = Object.freeze({
          default: BaseFormatter
        });
        var HtmlFormatter = function(_BaseFormatter) {
          inherits(HtmlFormatter, _BaseFormatter);
          function HtmlFormatter() {
            classCallCheck(this, HtmlFormatter);
            return possibleConstructorReturn(this, (HtmlFormatter.__proto__ || Object.getPrototypeOf(HtmlFormatter)).apply(this, arguments));
          }
          createClass(HtmlFormatter, [ {
            key: "typeFormattterErrorFormatter",
            value: function typeFormattterErrorFormatter(context, err) {
              context.out('<pre class="jsondiffpatch-error">' + err + "</pre>");
            }
          }, {
            key: "formatValue",
            value: function formatValue(context, value) {
              context.out("<pre>" + htmlEscape(JSON.stringify(value, null, 2)) + "</pre>");
            }
          }, {
            key: "formatTextDiffString",
            value: function formatTextDiffString(context, value) {
              var lines = this.parseTextDiff(value);
              context.out('<ul class="jsondiffpatch-textdiff">');
              for (var i = 0, l = lines.length; i < l; i++) {
                var line = lines[i];
                context.out('<li><div class="jsondiffpatch-textdiff-location">' + ('<span class="jsondiffpatch-textdiff-line-number">' + line.location.line + '</span><span class="jsondiffpatch-textdiff-char">' + line.location.chr + '</span></div><div class="jsondiffpatch-textdiff-line">'));
                var pieces = line.pieces;
                for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
                  var piece = pieces[pieceIndex];
                  context.out('<span class="jsondiffpatch-textdiff-' + piece.type + '">' + htmlEscape(decodeURI(piece.text)) + "</span>");
                }
                context.out("</div></li>");
              }
              context.out("</ul>");
            }
          }, {
            key: "rootBegin",
            value: function rootBegin(context, type, nodeType) {
              var nodeClass = "jsondiffpatch-" + type + (nodeType ? " jsondiffpatch-child-node-type-" + nodeType : "");
              context.out('<div class="jsondiffpatch-delta ' + nodeClass + '">');
            }
          }, {
            key: "rootEnd",
            value: function rootEnd(context) {
              context.out("</div>" + (context.hasArrows ? '<script type="text/javascript">setTimeout(' + (adjustArrows.toString() + ",10);<\/script>") : ""));
            }
          }, {
            key: "nodeBegin",
            value: function nodeBegin(context, key, leftKey, type, nodeType) {
              var nodeClass = "jsondiffpatch-" + type + (nodeType ? " jsondiffpatch-child-node-type-" + nodeType : "");
              context.out('<li class="' + nodeClass + '" data-key="' + leftKey + '">' + ('<div class="jsondiffpatch-property-name">' + leftKey + "</div>"));
            }
          }, {
            key: "nodeEnd",
            value: function nodeEnd(context) {
              context.out("</li>");
            }
          }, {
            key: "format_unchanged",
            value: function format_unchanged(context, delta, left) {
              if (typeof left === "undefined") {
                return;
              }
              context.out('<div class="jsondiffpatch-value">');
              this.formatValue(context, left);
              context.out("</div>");
            }
          }, {
            key: "format_movedestination",
            value: function format_movedestination(context, delta, left) {
              if (typeof left === "undefined") {
                return;
              }
              context.out('<div class="jsondiffpatch-value">');
              this.formatValue(context, left);
              context.out("</div>");
            }
          }, {
            key: "format_node",
            value: function format_node(context, delta, left) {
              var nodeType = delta._t === "a" ? "array" : "object";
              context.out('<ul class="jsondiffpatch-node jsondiffpatch-node-type-' + nodeType + '">');
              this.formatDeltaChildren(context, delta, left);
              context.out("</ul>");
            }
          }, {
            key: "format_added",
            value: function format_added(context, delta) {
              context.out('<div class="jsondiffpatch-value">');
              this.formatValue(context, delta[0]);
              context.out("</div>");
            }
          }, {
            key: "format_modified",
            value: function format_modified(context, delta) {
              context.out('<div class="jsondiffpatch-value jsondiffpatch-left-value">');
              this.formatValue(context, delta[0]);
              context.out("</div>" + '<div class="jsondiffpatch-value jsondiffpatch-right-value">');
              this.formatValue(context, delta[1]);
              context.out("</div>");
            }
          }, {
            key: "format_deleted",
            value: function format_deleted(context, delta) {
              context.out('<div class="jsondiffpatch-value">');
              this.formatValue(context, delta[0]);
              context.out("</div>");
            }
          }, {
            key: "format_moved",
            value: function format_moved(context, delta) {
              context.out('<div class="jsondiffpatch-value">');
              this.formatValue(context, delta[0]);
              context.out('</div><div class="jsondiffpatch-moved-destination">' + delta[1] + "</div>");
              context.out('<div class="jsondiffpatch-arrow" ' + 'style="position: relative; left: -34px;">\n          <svg width="30" height="60" ' + 'style="position: absolute; display: none;">\n          <defs>\n              <marker id="markerArrow" markerWidth="8" markerHeight="8"\n                 refx="2" refy="4"\n                     orient="auto" markerUnits="userSpaceOnUse">\n                  <path d="M1,1 L1,7 L7,4 L1,1" style="fill: #339;" />\n              </marker>\n          </defs>\n          <path d="M30,0 Q-10,25 26,50"\n            style="stroke: #88f; stroke-width: 2px; fill: none; ' + 'stroke-opacity: 0.5; marker-end: url(#markerArrow);"\n          ></path>\n          </svg>\n      </div>');
              context.hasArrows = true;
            }
          }, {
            key: "format_textdiff",
            value: function format_textdiff(context, delta) {
              context.out('<div class="jsondiffpatch-value">');
              this.formatTextDiffString(context, delta[0]);
              context.out("</div>");
            }
          } ]);
          return HtmlFormatter;
        }(BaseFormatter);
        function htmlEscape(text) {
          var html = text;
          var replacements = [ [ /&/g, "&amp;" ], [ /</g, "&lt;" ], [ />/g, "&gt;" ], [ /'/g, "&apos;" ], [ /"/g, "&quot;" ] ];
          for (var i = 0; i < replacements.length; i++) {
            html = html.replace(replacements[i][0], replacements[i][1]);
          }
          return html;
        }
        var adjustArrows = function jsondiffpatchHtmlFormatterAdjustArrows(nodeArg) {
          var node = nodeArg || document;
          var getElementText = function getElementText(_ref) {
            var textContent = _ref.textContent, innerText = _ref.innerText;
            return textContent || innerText;
          };
          var eachByQuery = function eachByQuery(el, query, fn) {
            var elems = el.querySelectorAll(query);
            for (var i = 0, l = elems.length; i < l; i++) {
              fn(elems[i]);
            }
          };
          var eachChildren = function eachChildren(_ref2, fn) {
            var children = _ref2.children;
            for (var i = 0, l = children.length; i < l; i++) {
              fn(children[i], i);
            }
          };
          eachByQuery(node, ".jsondiffpatch-arrow", (function(_ref3) {
            var parentNode = _ref3.parentNode, children = _ref3.children, style = _ref3.style;
            var arrowParent = parentNode;
            var svg = children[0];
            var path = svg.children[1];
            svg.style.display = "none";
            var destination = getElementText(arrowParent.querySelector(".jsondiffpatch-moved-destination"));
            var container = arrowParent.parentNode;
            var destinationElem = void 0;
            eachChildren(container, (function(child) {
              if (child.getAttribute("data-key") === destination) {
                destinationElem = child;
              }
            }));
            if (!destinationElem) {
              return;
            }
            try {
              var distance = destinationElem.offsetTop - arrowParent.offsetTop;
              svg.setAttribute("height", Math.abs(distance) + 6);
              style.top = -8 + (distance > 0 ? 0 : distance) + "px";
              var curve = distance > 0 ? "M30,0 Q-10," + Math.round(distance / 2) + " 26," + (distance - 4) : "M30," + -distance + " Q-10," + Math.round(-distance / 2) + " 26,4";
              path.setAttribute("d", curve);
              svg.style.display = "";
            } catch (err) {}
          }));
        };
        var showUnchanged = function showUnchanged(show, node, delay) {
          var el = node || document.body;
          var prefix = "jsondiffpatch-unchanged-";
          var classes = {
            showing: prefix + "showing",
            hiding: prefix + "hiding",
            visible: prefix + "visible",
            hidden: prefix + "hidden"
          };
          var list = el.classList;
          if (!list) {
            return;
          }
          if (!delay) {
            list.remove(classes.showing);
            list.remove(classes.hiding);
            list.remove(classes.visible);
            list.remove(classes.hidden);
            if (show === false) {
              list.add(classes.hidden);
            }
            return;
          }
          if (show === false) {
            list.remove(classes.showing);
            list.add(classes.visible);
            setTimeout((function() {
              list.add(classes.hiding);
            }), 10);
          } else {
            list.remove(classes.hiding);
            list.add(classes.showing);
            list.remove(classes.hidden);
          }
          var intervalId = setInterval((function() {
            adjustArrows(el);
          }), 100);
          setTimeout((function() {
            list.remove(classes.showing);
            list.remove(classes.hiding);
            if (show === false) {
              list.add(classes.hidden);
              list.remove(classes.visible);
            } else {
              list.add(classes.visible);
              list.remove(classes.hidden);
            }
            setTimeout((function() {
              list.remove(classes.visible);
              clearInterval(intervalId);
            }), delay + 400);
          }), delay);
        };
        var hideUnchanged = function hideUnchanged(node, delay) {
          return showUnchanged(false, node, delay);
        };
        var defaultInstance = void 0;
        function format(delta, left) {
          if (!defaultInstance) {
            defaultInstance = new HtmlFormatter;
          }
          return defaultInstance.format(delta, left);
        }
        var html = Object.freeze({
          showUnchanged,
          hideUnchanged,
          default: HtmlFormatter,
          format
        });
        var AnnotatedFormatter = function(_BaseFormatter) {
          inherits(AnnotatedFormatter, _BaseFormatter);
          function AnnotatedFormatter() {
            classCallCheck(this, AnnotatedFormatter);
            var _this = possibleConstructorReturn(this, (AnnotatedFormatter.__proto__ || Object.getPrototypeOf(AnnotatedFormatter)).call(this));
            _this.includeMoveDestinations = false;
            return _this;
          }
          createClass(AnnotatedFormatter, [ {
            key: "prepareContext",
            value: function prepareContext(context) {
              get(AnnotatedFormatter.prototype.__proto__ || Object.getPrototypeOf(AnnotatedFormatter.prototype), "prepareContext", this).call(this, context);
              context.indent = function(levels) {
                this.indentLevel = (this.indentLevel || 0) + (typeof levels === "undefined" ? 1 : levels);
                this.indentPad = new Array(this.indentLevel + 1).join("&nbsp;&nbsp;");
              };
              context.row = function(json, htmlNote) {
                context.out('<tr><td style="white-space: nowrap;">' + '<pre class="jsondiffpatch-annotated-indent"' + ' style="display: inline-block">');
                context.out(context.indentPad);
                context.out('</pre><pre style="display: inline-block">');
                context.out(json);
                context.out('</pre></td><td class="jsondiffpatch-delta-note"><div>');
                context.out(htmlNote);
                context.out("</div></td></tr>");
              };
            }
          }, {
            key: "typeFormattterErrorFormatter",
            value: function typeFormattterErrorFormatter(context, err) {
              context.row("", '<pre class="jsondiffpatch-error">' + err + "</pre>");
            }
          }, {
            key: "formatTextDiffString",
            value: function formatTextDiffString(context, value) {
              var lines = this.parseTextDiff(value);
              context.out('<ul class="jsondiffpatch-textdiff">');
              for (var i = 0, l = lines.length; i < l; i++) {
                var line = lines[i];
                context.out('<li><div class="jsondiffpatch-textdiff-location">' + ('<span class="jsondiffpatch-textdiff-line-number">' + line.location.line + '</span><span class="jsondiffpatch-textdiff-char">' + line.location.chr + '</span></div><div class="jsondiffpatch-textdiff-line">'));
                var pieces = line.pieces;
                for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
                  var piece = pieces[pieceIndex];
                  context.out('<span class="jsondiffpatch-textdiff-' + piece.type + '">' + piece.text + "</span>");
                }
                context.out("</div></li>");
              }
              context.out("</ul>");
            }
          }, {
            key: "rootBegin",
            value: function rootBegin(context, type, nodeType) {
              context.out('<table class="jsondiffpatch-annotated-delta">');
              if (type === "node") {
                context.row("{");
                context.indent();
              }
              if (nodeType === "array") {
                context.row('"_t": "a",', "Array delta (member names indicate array indices)");
              }
            }
          }, {
            key: "rootEnd",
            value: function rootEnd(context, type) {
              if (type === "node") {
                context.indent(-1);
                context.row("}");
              }
              context.out("</table>");
            }
          }, {
            key: "nodeBegin",
            value: function nodeBegin(context, key, leftKey, type, nodeType) {
              context.row("&quot;" + key + "&quot;: {");
              if (type === "node") {
                context.indent();
              }
              if (nodeType === "array") {
                context.row('"_t": "a",', "Array delta (member names indicate array indices)");
              }
            }
          }, {
            key: "nodeEnd",
            value: function nodeEnd(context, key, leftKey, type, nodeType, isLast) {
              if (type === "node") {
                context.indent(-1);
              }
              context.row("}" + (isLast ? "" : ","));
            }
          }, {
            key: "format_unchanged",
            value: function format_unchanged() {}
          }, {
            key: "format_movedestination",
            value: function format_movedestination() {}
          }, {
            key: "format_node",
            value: function format_node(context, delta, left) {
              this.formatDeltaChildren(context, delta, left);
            }
          } ]);
          return AnnotatedFormatter;
        }(BaseFormatter);
        var wrapPropertyName = function wrapPropertyName(name) {
          return '<pre style="display:inline-block">&quot;' + name + "&quot;</pre>";
        };
        var deltaAnnotations = {
          added: function added(delta, left, key, leftKey) {
            var formatLegend = " <pre>([newValue])</pre>";
            if (typeof leftKey === "undefined") {
              return "new value" + formatLegend;
            }
            if (typeof leftKey === "number") {
              return "insert at index " + leftKey + formatLegend;
            }
            return "add property " + wrapPropertyName(leftKey) + formatLegend;
          },
          modified: function modified(delta, left, key, leftKey) {
            var formatLegend = " <pre>([previousValue, newValue])</pre>";
            if (typeof leftKey === "undefined") {
              return "modify value" + formatLegend;
            }
            if (typeof leftKey === "number") {
              return "modify at index " + leftKey + formatLegend;
            }
            return "modify property " + wrapPropertyName(leftKey) + formatLegend;
          },
          deleted: function deleted(delta, left, key, leftKey) {
            var formatLegend = " <pre>([previousValue, 0, 0])</pre>";
            if (typeof leftKey === "undefined") {
              return "delete value" + formatLegend;
            }
            if (typeof leftKey === "number") {
              return "remove index " + leftKey + formatLegend;
            }
            return "delete property " + wrapPropertyName(leftKey) + formatLegend;
          },
          moved: function moved(delta, left, key, leftKey) {
            return 'move from <span title="(position to remove at original state)">' + ("index " + leftKey + '</span> to <span title="(position to insert at final') + (' state)">index ' + delta[1] + "</span>");
          },
          textdiff: function textdiff(delta, left, key, leftKey) {
            var location = typeof leftKey === "undefined" ? "" : typeof leftKey === "number" ? " at index " + leftKey : " at property " + wrapPropertyName(leftKey);
            return "text diff" + location + ', format is <a href="https://code.google.com/' + 'p/google-diff-match-patch/wiki/Unidiff">a variation of Unidiff</a>';
          }
        };
        var formatAnyChange = function formatAnyChange(context, delta) {
          var deltaType = this.getDeltaType(delta);
          var annotator = deltaAnnotations[deltaType];
          var htmlNote = annotator && annotator.apply(annotator, Array.prototype.slice.call(arguments, 1));
          var json = JSON.stringify(delta, null, 2);
          if (deltaType === "textdiff") {
            json = json.split("\\n").join('\\n"+\n   "');
          }
          context.indent();
          context.row(json, htmlNote);
          context.indent(-1);
        };
        AnnotatedFormatter.prototype.format_added = formatAnyChange;
        AnnotatedFormatter.prototype.format_modified = formatAnyChange;
        AnnotatedFormatter.prototype.format_deleted = formatAnyChange;
        AnnotatedFormatter.prototype.format_moved = formatAnyChange;
        AnnotatedFormatter.prototype.format_textdiff = formatAnyChange;
        var defaultInstance$1 = void 0;
        function format$1(delta, left) {
          if (!defaultInstance$1) {
            defaultInstance$1 = new AnnotatedFormatter;
          }
          return defaultInstance$1.format(delta, left);
        }
        var annotated = Object.freeze({
          default: AnnotatedFormatter,
          format: format$1
        });
        var OPERATIONS = {
          add: "add",
          remove: "remove",
          replace: "replace",
          move: "move"
        };
        var JSONFormatter = function(_BaseFormatter) {
          inherits(JSONFormatter, _BaseFormatter);
          function JSONFormatter() {
            classCallCheck(this, JSONFormatter);
            var _this = possibleConstructorReturn(this, (JSONFormatter.__proto__ || Object.getPrototypeOf(JSONFormatter)).call(this));
            _this.includeMoveDestinations = true;
            return _this;
          }
          createClass(JSONFormatter, [ {
            key: "prepareContext",
            value: function prepareContext(context) {
              get(JSONFormatter.prototype.__proto__ || Object.getPrototypeOf(JSONFormatter.prototype), "prepareContext", this).call(this, context);
              context.result = [];
              context.path = [];
              context.pushCurrentOp = function(obj) {
                var op = obj.op, value = obj.value;
                var val = {
                  op,
                  path: this.currentPath()
                };
                if (typeof value !== "undefined") {
                  val.value = value;
                }
                this.result.push(val);
              };
              context.pushMoveOp = function(to) {
                var from = this.currentPath();
                this.result.push({
                  op: OPERATIONS.move,
                  from,
                  path: this.toPath(to)
                });
              };
              context.currentPath = function() {
                return "/" + this.path.join("/");
              };
              context.toPath = function(toPath) {
                var to = this.path.slice();
                to[to.length - 1] = toPath;
                return "/" + to.join("/");
              };
            }
          }, {
            key: "typeFormattterErrorFormatter",
            value: function typeFormattterErrorFormatter(context, err) {
              context.out("[ERROR] " + err);
            }
          }, {
            key: "rootBegin",
            value: function rootBegin() {}
          }, {
            key: "rootEnd",
            value: function rootEnd() {}
          }, {
            key: "nodeBegin",
            value: function nodeBegin(_ref, key, leftKey) {
              var path = _ref.path;
              path.push(leftKey);
            }
          }, {
            key: "nodeEnd",
            value: function nodeEnd(_ref2) {
              var path = _ref2.path;
              path.pop();
            }
          }, {
            key: "format_unchanged",
            value: function format_unchanged() {}
          }, {
            key: "format_movedestination",
            value: function format_movedestination() {}
          }, {
            key: "format_node",
            value: function format_node(context, delta, left) {
              this.formatDeltaChildren(context, delta, left);
            }
          }, {
            key: "format_added",
            value: function format_added(context, delta) {
              context.pushCurrentOp({
                op: OPERATIONS.add,
                value: delta[0]
              });
            }
          }, {
            key: "format_modified",
            value: function format_modified(context, delta) {
              context.pushCurrentOp({
                op: OPERATIONS.replace,
                value: delta[1]
              });
            }
          }, {
            key: "format_deleted",
            value: function format_deleted(context) {
              context.pushCurrentOp({
                op: OPERATIONS.remove
              });
            }
          }, {
            key: "format_moved",
            value: function format_moved(context, delta) {
              var to = delta[1];
              context.pushMoveOp(to);
            }
          }, {
            key: "format_textdiff",
            value: function format_textdiff() {
              throw new Error("Not implemented");
            }
          }, {
            key: "format",
            value: function format(delta, left) {
              var context = {};
              this.prepareContext(context);
              this.recurse(context, delta, left);
              return context.result;
            }
          } ]);
          return JSONFormatter;
        }(BaseFormatter);
        var last = function last(arr) {
          return arr[arr.length - 1];
        };
        var sortBy = function sortBy(arr, pred) {
          arr.sort(pred);
          return arr;
        };
        var compareByIndexDesc = function compareByIndexDesc(indexA, indexB) {
          var lastA = parseInt(indexA, 10);
          var lastB = parseInt(indexB, 10);
          if (!(isNaN(lastA) || isNaN(lastB))) {
            return lastB - lastA;
          } else {
            return 0;
          }
        };
        var opsByDescendingOrder = function opsByDescendingOrder(removeOps) {
          return sortBy(removeOps, (function(a, b) {
            var splitA = a.path.split("/");
            var splitB = b.path.split("/");
            if (splitA.length !== splitB.length) {
              return splitA.length - splitB.length;
            } else {
              return compareByIndexDesc(last(splitA), last(splitB));
            }
          }));
        };
        var partitionOps = function partitionOps(arr, fns) {
          var initArr = Array(fns.length + 1).fill().map((function() {
            return [];
          }));
          return arr.map((function(item) {
            var position = fns.map((function(fn) {
              return fn(item);
            })).indexOf(true);
            if (position < 0) {
              position = fns.length;
            }
            return {
              item,
              position
            };
          })).reduce((function(acc, item) {
            acc[item.position].push(item.item);
            return acc;
          }), initArr);
        };
        var isMoveOp = function isMoveOp(_ref3) {
          var op = _ref3.op;
          return op === "move";
        };
        var isRemoveOp = function isRemoveOp(_ref4) {
          var op = _ref4.op;
          return op === "remove";
        };
        var reorderOps = function reorderOps(diff) {
          var _partitionOps = partitionOps(diff, [ isMoveOp, isRemoveOp ]), _partitionOps2 = slicedToArray(_partitionOps, 3), moveOps = _partitionOps2[0], removedOps = _partitionOps2[1], restOps = _partitionOps2[2];
          var removeOpsReverse = opsByDescendingOrder(removedOps);
          return [].concat(toConsumableArray(removeOpsReverse), toConsumableArray(moveOps), toConsumableArray(restOps));
        };
        var defaultInstance$2 = void 0;
        var format$2 = function format(delta, left) {
          if (!defaultInstance$2) {
            defaultInstance$2 = new JSONFormatter;
          }
          return reorderOps(defaultInstance$2.format(delta, left));
        };
        var log = function log(delta, left) {
          console.log(format$2(delta, left));
        };
        var jsonpatch = Object.freeze({
          default: JSONFormatter,
          partitionOps,
          format: format$2,
          log
        });
        function chalkColor(name) {
          return chalk && chalk[name] || function() {
            for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            return args;
          };
        }
        var colors = {
          added: chalkColor("green"),
          deleted: chalkColor("red"),
          movedestination: chalkColor("gray"),
          moved: chalkColor("yellow"),
          unchanged: chalkColor("gray"),
          error: chalkColor("white.bgRed"),
          textDiffLine: chalkColor("gray")
        };
        var ConsoleFormatter = function(_BaseFormatter) {
          inherits(ConsoleFormatter, _BaseFormatter);
          function ConsoleFormatter() {
            classCallCheck(this, ConsoleFormatter);
            var _this = possibleConstructorReturn(this, (ConsoleFormatter.__proto__ || Object.getPrototypeOf(ConsoleFormatter)).call(this));
            _this.includeMoveDestinations = false;
            return _this;
          }
          createClass(ConsoleFormatter, [ {
            key: "prepareContext",
            value: function prepareContext(context) {
              get(ConsoleFormatter.prototype.__proto__ || Object.getPrototypeOf(ConsoleFormatter.prototype), "prepareContext", this).call(this, context);
              context.indent = function(levels) {
                this.indentLevel = (this.indentLevel || 0) + (typeof levels === "undefined" ? 1 : levels);
                this.indentPad = new Array(this.indentLevel + 1).join("  ");
                this.outLine();
              };
              context.outLine = function() {
                this.buffer.push("\n" + (this.indentPad || ""));
              };
              context.out = function() {
                for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
                  args[_key2] = arguments[_key2];
                }
                for (var i = 0, l = args.length; i < l; i++) {
                  var lines = args[i].split("\n");
                  var text = lines.join("\n" + (this.indentPad || ""));
                  if (this.color && this.color[0]) {
                    text = this.color[0](text);
                  }
                  this.buffer.push(text);
                }
              };
              context.pushColor = function(color) {
                this.color = this.color || [];
                this.color.unshift(color);
              };
              context.popColor = function() {
                this.color = this.color || [];
                this.color.shift();
              };
            }
          }, {
            key: "typeFormattterErrorFormatter",
            value: function typeFormattterErrorFormatter(context, err) {
              context.pushColor(colors.error);
              context.out("[ERROR]" + err);
              context.popColor();
            }
          }, {
            key: "formatValue",
            value: function formatValue(context, value) {
              context.out(JSON.stringify(value, null, 2));
            }
          }, {
            key: "formatTextDiffString",
            value: function formatTextDiffString(context, value) {
              var lines = this.parseTextDiff(value);
              context.indent();
              for (var i = 0, l = lines.length; i < l; i++) {
                var line = lines[i];
                context.pushColor(colors.textDiffLine);
                context.out(line.location.line + "," + line.location.chr + " ");
                context.popColor();
                var pieces = line.pieces;
                for (var pieceIndex = 0, piecesLength = pieces.length; pieceIndex < piecesLength; pieceIndex++) {
                  var piece = pieces[pieceIndex];
                  context.pushColor(colors[piece.type]);
                  context.out(piece.text);
                  context.popColor();
                }
                if (i < l - 1) {
                  context.outLine();
                }
              }
              context.indent(-1);
            }
          }, {
            key: "rootBegin",
            value: function rootBegin(context, type, nodeType) {
              context.pushColor(colors[type]);
              if (type === "node") {
                context.out(nodeType === "array" ? "[" : "{");
                context.indent();
              }
            }
          }, {
            key: "rootEnd",
            value: function rootEnd(context, type, nodeType) {
              if (type === "node") {
                context.indent(-1);
                context.out(nodeType === "array" ? "]" : "}");
              }
              context.popColor();
            }
          }, {
            key: "nodeBegin",
            value: function nodeBegin(context, key, leftKey, type, nodeType) {
              context.pushColor(colors[type]);
              context.out(leftKey + ": ");
              if (type === "node") {
                context.out(nodeType === "array" ? "[" : "{");
                context.indent();
              }
            }
          }, {
            key: "nodeEnd",
            value: function nodeEnd(context, key, leftKey, type, nodeType, isLast) {
              if (type === "node") {
                context.indent(-1);
                context.out(nodeType === "array" ? "]" : "}" + (isLast ? "" : ","));
              }
              if (!isLast) {
                context.outLine();
              }
              context.popColor();
            }
          }, {
            key: "format_unchanged",
            value: function format_unchanged(context, delta, left) {
              if (typeof left === "undefined") {
                return;
              }
              this.formatValue(context, left);
            }
          }, {
            key: "format_movedestination",
            value: function format_movedestination(context, delta, left) {
              if (typeof left === "undefined") {
                return;
              }
              this.formatValue(context, left);
            }
          }, {
            key: "format_node",
            value: function format_node(context, delta, left) {
              this.formatDeltaChildren(context, delta, left);
            }
          }, {
            key: "format_added",
            value: function format_added(context, delta) {
              this.formatValue(context, delta[0]);
            }
          }, {
            key: "format_modified",
            value: function format_modified(context, delta) {
              context.pushColor(colors.deleted);
              this.formatValue(context, delta[0]);
              context.popColor();
              context.out(" => ");
              context.pushColor(colors.added);
              this.formatValue(context, delta[1]);
              context.popColor();
            }
          }, {
            key: "format_deleted",
            value: function format_deleted(context, delta) {
              this.formatValue(context, delta[0]);
            }
          }, {
            key: "format_moved",
            value: function format_moved(context, delta) {
              context.out("==> " + delta[1]);
            }
          }, {
            key: "format_textdiff",
            value: function format_textdiff(context, delta) {
              this.formatTextDiffString(context, delta[0]);
            }
          } ]);
          return ConsoleFormatter;
        }(BaseFormatter);
        var defaultInstance$3 = void 0;
        var format$3 = function format(delta, left) {
          if (!defaultInstance$3) {
            defaultInstance$3 = new ConsoleFormatter;
          }
          return defaultInstance$3.format(delta, left);
        };
        function log$1(delta, left) {
          console.log(format$3(delta, left));
        }
        var console$1 = Object.freeze({
          default: ConsoleFormatter,
          format: format$3,
          log: log$1
        });
        var index = Object.freeze({
          base,
          html,
          annotated,
          jsonpatch,
          console: console$1
        });
        function dateReviver(key, value) {
          var parts = void 0;
          if (typeof value === "string") {
            parts = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d*))?(Z|([+-])(\d{2}):(\d{2}))$/.exec(value);
            if (parts) {
              return new Date(Date.UTC(+parts[1], +parts[2] - 1, +parts[3], +parts[4], +parts[5], +parts[6], +(parts[7] || 0)));
            }
          }
          return value;
        }
        function create(options) {
          return new DiffPatcher(options);
        }
        var defaultInstance$4 = void 0;
        function diff() {
          if (!defaultInstance$4) {
            defaultInstance$4 = new DiffPatcher;
          }
          return defaultInstance$4.diff.apply(defaultInstance$4, arguments);
        }
        function patch() {
          if (!defaultInstance$4) {
            defaultInstance$4 = new DiffPatcher;
          }
          return defaultInstance$4.patch.apply(defaultInstance$4, arguments);
        }
        function unpatch() {
          if (!defaultInstance$4) {
            defaultInstance$4 = new DiffPatcher;
          }
          return defaultInstance$4.unpatch.apply(defaultInstance$4, arguments);
        }
        function reverse() {
          if (!defaultInstance$4) {
            defaultInstance$4 = new DiffPatcher;
          }
          return defaultInstance$4.reverse.apply(defaultInstance$4, arguments);
        }
        function clone$1() {
          if (!defaultInstance$4) {
            defaultInstance$4 = new DiffPatcher;
          }
          return defaultInstance$4.clone.apply(defaultInstance$4, arguments);
        }
        exports.DiffPatcher = DiffPatcher;
        exports.formatters = index;
        exports.console = console$1;
        exports.create = create;
        exports.dateReviver = dateReviver;
        exports.diff = diff;
        exports.patch = patch;
        exports.unpatch = unpatch;
        exports.reverse = reverse;
        exports.clone = clone$1;
        Object.defineProperty(exports, "__esModule", {
          value: true
        });
      }));
    },
    368(module) {
      var MAX_SAFE_INTEGER = 9007199254740991;
      var argsTag = "[object Arguments]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]";
      var reIsUint = /^(?:0|[1-9]\d*)$/;
      function apply(func, thisArg, args) {
        switch (args.length) {
         case 0:
          return func.call(thisArg);

         case 1:
          return func.call(thisArg, args[0]);

         case 2:
          return func.call(thisArg, args[0], args[1]);

         case 3:
          return func.call(thisArg, args[0], args[1], args[2]);
        }
        return func.apply(thisArg, args);
      }
      function baseTimes(n, iteratee) {
        var index = -1, result = Array(n);
        while (++index < n) {
          result[index] = iteratee(index);
        }
        return result;
      }
      var objectProto = Object.prototype;
      var hasOwnProperty = objectProto.hasOwnProperty;
      var objectToString = objectProto.toString;
      var propertyIsEnumerable = objectProto.propertyIsEnumerable;
      var nativeMax = Math.max;
      function arrayLikeKeys(value, inherited) {
        var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
        var length = result.length, skipIndexes = !!length;
        for (var key in value) {
          if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
            result.push(key);
          }
        }
        return result;
      }
      function assignValue(object, key, value) {
        var objValue = object[key];
        if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
          object[key] = value;
        }
      }
      function baseKeysIn(object) {
        if (!isObject(object)) {
          return nativeKeysIn(object);
        }
        var isProto = isPrototype(object), result = [];
        for (var key in object) {
          if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
            result.push(key);
          }
        }
        return result;
      }
      function baseRest(func, start) {
        start = nativeMax(start === undefined ? func.length - 1 : start, 0);
        return function() {
          var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
          while (++index < length) {
            array[index] = args[start + index];
          }
          index = -1;
          var otherArgs = Array(start + 1);
          while (++index < start) {
            otherArgs[index] = args[index];
          }
          otherArgs[start] = array;
          return apply(func, this, otherArgs);
        };
      }
      function copyObject(source, props, object, customizer) {
        object || (object = {});
        var index = -1, length = props.length;
        while (++index < length) {
          var key = props[index];
          var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
          assignValue(object, key, newValue === undefined ? source[key] : newValue);
        }
        return object;
      }
      function createAssigner(assigner) {
        return baseRest((function(object, sources) {
          var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
          customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, 
          customizer) : undefined;
          if (guard && isIterateeCall(sources[0], sources[1], guard)) {
            customizer = length < 3 ? undefined : customizer;
            length = 1;
          }
          object = Object(object);
          while (++index < length) {
            var source = sources[index];
            if (source) {
              assigner(object, source, index, customizer);
            }
          }
          return object;
        }));
      }
      function isIndex(value, length) {
        length = length == null ? MAX_SAFE_INTEGER : length;
        return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
      }
      function isIterateeCall(value, index, object) {
        if (!isObject(object)) {
          return false;
        }
        var type = typeof index;
        if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
          return eq(object[index], value);
        }
        return false;
      }
      function isPrototype(value) {
        var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
        return value === proto;
      }
      function nativeKeysIn(object) {
        var result = [];
        if (object != null) {
          for (var key in Object(object)) {
            result.push(key);
          }
        }
        return result;
      }
      function eq(value, other) {
        return value === other || value !== value && other !== other;
      }
      function isArguments(value) {
        return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
      }
      var isArray = Array.isArray;
      function isArrayLike(value) {
        return value != null && isLength(value.length) && !isFunction(value);
      }
      function isArrayLikeObject(value) {
        return isObjectLike(value) && isArrayLike(value);
      }
      function isFunction(value) {
        var tag = isObject(value) ? objectToString.call(value) : "";
        return tag == funcTag || tag == genTag;
      }
      function isLength(value) {
        return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
      }
      function isObject(value) {
        var type = typeof value;
        return !!value && (type == "object" || type == "function");
      }
      function isObjectLike(value) {
        return !!value && typeof value == "object";
      }
      var assignIn = createAssigner((function(object, source) {
        copyObject(source, keysIn(source), object);
      }));
      function keysIn(object) {
        return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
      }
      module.exports = assignIn;
    },
    2543(module, exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      var __WEBPACK_AMD_DEFINE_RESULT__;
      (function() {
        var undefined;
        var VERSION = "4.17.23";
        var LARGE_ARRAY_SIZE = 200;
        var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
        var HASH_UNDEFINED = "__lodash_hash_undefined__";
        var MAX_MEMOIZE_SIZE = 500;
        var PLACEHOLDER = "__lodash_placeholder__";
        var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
        var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
        var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
        var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
        var HOT_COUNT = 800, HOT_SPAN = 16;
        var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
        var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
        var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
        var wrapFlags = [ [ "ary", WRAP_ARY_FLAG ], [ "bind", WRAP_BIND_FLAG ], [ "bindKey", WRAP_BIND_KEY_FLAG ], [ "curry", WRAP_CURRY_FLAG ], [ "curryRight", WRAP_CURRY_RIGHT_FLAG ], [ "flip", WRAP_FLIP_FLAG ], [ "partial", WRAP_PARTIAL_FLAG ], [ "partialRight", WRAP_PARTIAL_RIGHT_FLAG ], [ "rearg", WRAP_REARG_FLAG ] ];
        var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
        var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
        var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
        var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
        var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
        var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
        var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
        var reTrimStart = /^\s+/;
        var reWhitespace = /\s/;
        var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
        var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
        var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
        var reEscapeChar = /\\(\\)?/g;
        var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
        var reFlags = /\w*$/;
        var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
        var reIsBinary = /^0b[01]+$/i;
        var reIsHostCtor = /^\[object .+?Constructor\]$/;
        var reIsOctal = /^0o[0-7]+$/i;
        var reIsUint = /^(?:0|[1-9]\d*)$/;
        var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
        var reNoMatch = /($^)/;
        var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
        var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
        var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
        var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [ rsNonAstral, rsRegional, rsSurrPair ].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [ rsDingbat, rsRegional, rsSurrPair ].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [ rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral ].join("|") + ")";
        var reApos = RegExp(rsApos, "g");
        var reComboMark = RegExp(rsCombo, "g");
        var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
        var reUnicodeWord = RegExp([ rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [ rsBreak, rsUpper, "$" ].join("|") + ")", rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [ rsBreak, rsUpper + rsMiscLower, "$" ].join("|") + ")", rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, rsUpper + "+" + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji ].join("|"), "g");
        var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
        var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
        var contextProps = [ "Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout" ];
        var templateCounter = -1;
        var typedArrayTags = {};
        typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
        typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
        var cloneableTags = {};
        cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
        cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
        var deburredLetters = {
          À: "A",
          Á: "A",
          Â: "A",
          Ã: "A",
          Ä: "A",
          Å: "A",
          à: "a",
          á: "a",
          â: "a",
          ã: "a",
          ä: "a",
          å: "a",
          Ç: "C",
          ç: "c",
          Ð: "D",
          ð: "d",
          È: "E",
          É: "E",
          Ê: "E",
          Ë: "E",
          è: "e",
          é: "e",
          ê: "e",
          ë: "e",
          Ì: "I",
          Í: "I",
          Î: "I",
          Ï: "I",
          ì: "i",
          í: "i",
          î: "i",
          ï: "i",
          Ñ: "N",
          ñ: "n",
          Ò: "O",
          Ó: "O",
          Ô: "O",
          Õ: "O",
          Ö: "O",
          Ø: "O",
          ò: "o",
          ó: "o",
          ô: "o",
          õ: "o",
          ö: "o",
          ø: "o",
          Ù: "U",
          Ú: "U",
          Û: "U",
          Ü: "U",
          ù: "u",
          ú: "u",
          û: "u",
          ü: "u",
          Ý: "Y",
          ý: "y",
          ÿ: "y",
          Æ: "Ae",
          æ: "ae",
          Þ: "Th",
          þ: "th",
          ß: "ss",
          Ā: "A",
          Ă: "A",
          Ą: "A",
          ā: "a",
          ă: "a",
          ą: "a",
          Ć: "C",
          Ĉ: "C",
          Ċ: "C",
          Č: "C",
          ć: "c",
          ĉ: "c",
          ċ: "c",
          č: "c",
          Ď: "D",
          Đ: "D",
          ď: "d",
          đ: "d",
          Ē: "E",
          Ĕ: "E",
          Ė: "E",
          Ę: "E",
          Ě: "E",
          ē: "e",
          ĕ: "e",
          ė: "e",
          ę: "e",
          ě: "e",
          Ĝ: "G",
          Ğ: "G",
          Ġ: "G",
          Ģ: "G",
          ĝ: "g",
          ğ: "g",
          ġ: "g",
          ģ: "g",
          Ĥ: "H",
          Ħ: "H",
          ĥ: "h",
          ħ: "h",
          Ĩ: "I",
          Ī: "I",
          Ĭ: "I",
          Į: "I",
          İ: "I",
          ĩ: "i",
          ī: "i",
          ĭ: "i",
          į: "i",
          ı: "i",
          Ĵ: "J",
          ĵ: "j",
          Ķ: "K",
          ķ: "k",
          ĸ: "k",
          Ĺ: "L",
          Ļ: "L",
          Ľ: "L",
          Ŀ: "L",
          Ł: "L",
          ĺ: "l",
          ļ: "l",
          ľ: "l",
          ŀ: "l",
          ł: "l",
          Ń: "N",
          Ņ: "N",
          Ň: "N",
          Ŋ: "N",
          ń: "n",
          ņ: "n",
          ň: "n",
          ŋ: "n",
          Ō: "O",
          Ŏ: "O",
          Ő: "O",
          ō: "o",
          ŏ: "o",
          ő: "o",
          Ŕ: "R",
          Ŗ: "R",
          Ř: "R",
          ŕ: "r",
          ŗ: "r",
          ř: "r",
          Ś: "S",
          Ŝ: "S",
          Ş: "S",
          Š: "S",
          ś: "s",
          ŝ: "s",
          ş: "s",
          š: "s",
          Ţ: "T",
          Ť: "T",
          Ŧ: "T",
          ţ: "t",
          ť: "t",
          ŧ: "t",
          Ũ: "U",
          Ū: "U",
          Ŭ: "U",
          Ů: "U",
          Ű: "U",
          Ų: "U",
          ũ: "u",
          ū: "u",
          ŭ: "u",
          ů: "u",
          ű: "u",
          ų: "u",
          Ŵ: "W",
          ŵ: "w",
          Ŷ: "Y",
          ŷ: "y",
          Ÿ: "Y",
          Ź: "Z",
          Ż: "Z",
          Ž: "Z",
          ź: "z",
          ż: "z",
          ž: "z",
          Ĳ: "IJ",
          ĳ: "ij",
          Œ: "Oe",
          œ: "oe",
          ŉ: "'n",
          ſ: "s"
        };
        var htmlEscapes = {
          "&": "&amp;",
          "<": "&lt;",
          ">": "&gt;",
          '"': "&quot;",
          "'": "&#39;"
        };
        var htmlUnescapes = {
          "&amp;": "&",
          "&lt;": "<",
          "&gt;": ">",
          "&quot;": '"',
          "&#39;": "'"
        };
        var stringEscapes = {
          "\\": "\\",
          "'": "'",
          "\n": "n",
          "\r": "r",
          "\u2028": "u2028",
          "\u2029": "u2029"
        };
        var freeParseFloat = parseFloat, freeParseInt = parseInt;
        var freeGlobal = typeof __webpack_require__.g == "object" && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
        var freeSelf = typeof self == "object" && self && self.Object === Object && self;
        var root = freeGlobal || freeSelf || Function("return this")();
        var freeExports = true && exports && !exports.nodeType && exports;
        var freeModule = freeExports && "object" == "object" && module && !module.nodeType && module;
        var moduleExports = freeModule && freeModule.exports === freeExports;
        var freeProcess = moduleExports && freeGlobal.process;
        var nodeUtil = function() {
          try {
            var types = freeModule && freeModule.require && freeModule.require("util").types;
            if (types) {
              return types;
            }
            return freeProcess && freeProcess.binding && freeProcess.binding("util");
          } catch (e) {}
        }();
        var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
        function apply(func, thisArg, args) {
          switch (args.length) {
           case 0:
            return func.call(thisArg);

           case 1:
            return func.call(thisArg, args[0]);

           case 2:
            return func.call(thisArg, args[0], args[1]);

           case 3:
            return func.call(thisArg, args[0], args[1], args[2]);
          }
          return func.apply(thisArg, args);
        }
        function arrayAggregator(array, setter, iteratee, accumulator) {
          var index = -1, length = array == null ? 0 : array.length;
          while (++index < length) {
            var value = array[index];
            setter(accumulator, value, iteratee(value), array);
          }
          return accumulator;
        }
        function arrayEach(array, iteratee) {
          var index = -1, length = array == null ? 0 : array.length;
          while (++index < length) {
            if (iteratee(array[index], index, array) === false) {
              break;
            }
          }
          return array;
        }
        function arrayEachRight(array, iteratee) {
          var length = array == null ? 0 : array.length;
          while (length--) {
            if (iteratee(array[length], length, array) === false) {
              break;
            }
          }
          return array;
        }
        function arrayEvery(array, predicate) {
          var index = -1, length = array == null ? 0 : array.length;
          while (++index < length) {
            if (!predicate(array[index], index, array)) {
              return false;
            }
          }
          return true;
        }
        function arrayFilter(array, predicate) {
          var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
          while (++index < length) {
            var value = array[index];
            if (predicate(value, index, array)) {
              result[resIndex++] = value;
            }
          }
          return result;
        }
        function arrayIncludes(array, value) {
          var length = array == null ? 0 : array.length;
          return !!length && baseIndexOf(array, value, 0) > -1;
        }
        function arrayIncludesWith(array, value, comparator) {
          var index = -1, length = array == null ? 0 : array.length;
          while (++index < length) {
            if (comparator(value, array[index])) {
              return true;
            }
          }
          return false;
        }
        function arrayMap(array, iteratee) {
          var index = -1, length = array == null ? 0 : array.length, result = Array(length);
          while (++index < length) {
            result[index] = iteratee(array[index], index, array);
          }
          return result;
        }
        function arrayPush(array, values) {
          var index = -1, length = values.length, offset = array.length;
          while (++index < length) {
            array[offset + index] = values[index];
          }
          return array;
        }
        function arrayReduce(array, iteratee, accumulator, initAccum) {
          var index = -1, length = array == null ? 0 : array.length;
          if (initAccum && length) {
            accumulator = array[++index];
          }
          while (++index < length) {
            accumulator = iteratee(accumulator, array[index], index, array);
          }
          return accumulator;
        }
        function arrayReduceRight(array, iteratee, accumulator, initAccum) {
          var length = array == null ? 0 : array.length;
          if (initAccum && length) {
            accumulator = array[--length];
          }
          while (length--) {
            accumulator = iteratee(accumulator, array[length], length, array);
          }
          return accumulator;
        }
        function arraySome(array, predicate) {
          var index = -1, length = array == null ? 0 : array.length;
          while (++index < length) {
            if (predicate(array[index], index, array)) {
              return true;
            }
          }
          return false;
        }
        var asciiSize = baseProperty("length");
        function asciiToArray(string) {
          return string.split("");
        }
        function asciiWords(string) {
          return string.match(reAsciiWord) || [];
        }
        function baseFindKey(collection, predicate, eachFunc) {
          var result;
          eachFunc(collection, (function(value, key, collection) {
            if (predicate(value, key, collection)) {
              result = key;
              return false;
            }
          }));
          return result;
        }
        function baseFindIndex(array, predicate, fromIndex, fromRight) {
          var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
          while (fromRight ? index-- : ++index < length) {
            if (predicate(array[index], index, array)) {
              return index;
            }
          }
          return -1;
        }
        function baseIndexOf(array, value, fromIndex) {
          return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
        }
        function baseIndexOfWith(array, value, fromIndex, comparator) {
          var index = fromIndex - 1, length = array.length;
          while (++index < length) {
            if (comparator(array[index], value)) {
              return index;
            }
          }
          return -1;
        }
        function baseIsNaN(value) {
          return value !== value;
        }
        function baseMean(array, iteratee) {
          var length = array == null ? 0 : array.length;
          return length ? baseSum(array, iteratee) / length : NAN;
        }
        function baseProperty(key) {
          return function(object) {
            return object == null ? undefined : object[key];
          };
        }
        function basePropertyOf(object) {
          return function(key) {
            return object == null ? undefined : object[key];
          };
        }
        function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
          eachFunc(collection, (function(value, index, collection) {
            accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection);
          }));
          return accumulator;
        }
        function baseSortBy(array, comparer) {
          var length = array.length;
          array.sort(comparer);
          while (length--) {
            array[length] = array[length].value;
          }
          return array;
        }
        function baseSum(array, iteratee) {
          var result, index = -1, length = array.length;
          while (++index < length) {
            var current = iteratee(array[index]);
            if (current !== undefined) {
              result = result === undefined ? current : result + current;
            }
          }
          return result;
        }
        function baseTimes(n, iteratee) {
          var index = -1, result = Array(n);
          while (++index < n) {
            result[index] = iteratee(index);
          }
          return result;
        }
        function baseToPairs(object, props) {
          return arrayMap(props, (function(key) {
            return [ key, object[key] ];
          }));
        }
        function baseTrim(string) {
          return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
        }
        function baseUnary(func) {
          return function(value) {
            return func(value);
          };
        }
        function baseValues(object, props) {
          return arrayMap(props, (function(key) {
            return object[key];
          }));
        }
        function cacheHas(cache, key) {
          return cache.has(key);
        }
        function charsStartIndex(strSymbols, chrSymbols) {
          var index = -1, length = strSymbols.length;
          while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
          return index;
        }
        function charsEndIndex(strSymbols, chrSymbols) {
          var index = strSymbols.length;
          while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
          return index;
        }
        function countHolders(array, placeholder) {
          var length = array.length, result = 0;
          while (length--) {
            if (array[length] === placeholder) {
              ++result;
            }
          }
          return result;
        }
        var deburrLetter = basePropertyOf(deburredLetters);
        var escapeHtmlChar = basePropertyOf(htmlEscapes);
        function escapeStringChar(chr) {
          return "\\" + stringEscapes[chr];
        }
        function getValue(object, key) {
          return object == null ? undefined : object[key];
        }
        function hasUnicode(string) {
          return reHasUnicode.test(string);
        }
        function hasUnicodeWord(string) {
          return reHasUnicodeWord.test(string);
        }
        function iteratorToArray(iterator) {
          var data, result = [];
          while (!(data = iterator.next()).done) {
            result.push(data.value);
          }
          return result;
        }
        function mapToArray(map) {
          var index = -1, result = Array(map.size);
          map.forEach((function(value, key) {
            result[++index] = [ key, value ];
          }));
          return result;
        }
        function overArg(func, transform) {
          return function(arg) {
            return func(transform(arg));
          };
        }
        function replaceHolders(array, placeholder) {
          var index = -1, length = array.length, resIndex = 0, result = [];
          while (++index < length) {
            var value = array[index];
            if (value === placeholder || value === PLACEHOLDER) {
              array[index] = PLACEHOLDER;
              result[resIndex++] = index;
            }
          }
          return result;
        }
        function setToArray(set) {
          var index = -1, result = Array(set.size);
          set.forEach((function(value) {
            result[++index] = value;
          }));
          return result;
        }
        function setToPairs(set) {
          var index = -1, result = Array(set.size);
          set.forEach((function(value) {
            result[++index] = [ value, value ];
          }));
          return result;
        }
        function strictIndexOf(array, value, fromIndex) {
          var index = fromIndex - 1, length = array.length;
          while (++index < length) {
            if (array[index] === value) {
              return index;
            }
          }
          return -1;
        }
        function strictLastIndexOf(array, value, fromIndex) {
          var index = fromIndex + 1;
          while (index--) {
            if (array[index] === value) {
              return index;
            }
          }
          return index;
        }
        function stringSize(string) {
          return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
        }
        function stringToArray(string) {
          return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
        }
        function trimmedEndIndex(string) {
          var index = string.length;
          while (index-- && reWhitespace.test(string.charAt(index))) {}
          return index;
        }
        var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
        function unicodeSize(string) {
          var result = reUnicode.lastIndex = 0;
          while (reUnicode.test(string)) {
            ++result;
          }
          return result;
        }
        function unicodeToArray(string) {
          return string.match(reUnicode) || [];
        }
        function unicodeWords(string) {
          return string.match(reUnicodeWord) || [];
        }
        var runInContext = function runInContext(context) {
          context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
          var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError;
          var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
          var coreJsData = context["__core-js_shared__"];
          var funcToString = funcProto.toString;
          var hasOwnProperty = objectProto.hasOwnProperty;
          var idCounter = 0;
          var maskSrcKey = function() {
            var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
            return uid ? "Symbol(src)_1." + uid : "";
          }();
          var nativeObjectToString = objectProto.toString;
          var objectCtorString = funcToString.call(Object);
          var oldDash = root._;
          var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
          var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, symIterator = Symbol ? Symbol.iterator : undefined, symToStringTag = Symbol ? Symbol.toStringTag : undefined;
          var defineProperty = function() {
            try {
              var func = getNative(Object, "defineProperty");
              func({}, "", {});
              return func;
            } catch (e) {}
          }();
          var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
          var nativeCeil = Math.ceil, nativeFloor = Math.floor, nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse;
          var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object, "create");
          var metaMap = WeakMap && new WeakMap;
          var realNames = {};
          var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
          var symbolProto = Symbol ? Symbol.prototype : undefined, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined;
          function lodash(value) {
            if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
              if (value instanceof LodashWrapper) {
                return value;
              }
              if (hasOwnProperty.call(value, "__wrapped__")) {
                return wrapperClone(value);
              }
            }
            return new LodashWrapper(value);
          }
          var baseCreate = function() {
            function object() {}
            return function(proto) {
              if (!isObject(proto)) {
                return {};
              }
              if (objectCreate) {
                return objectCreate(proto);
              }
              object.prototype = proto;
              var result = new object;
              object.prototype = undefined;
              return result;
            };
          }();
          function baseLodash() {}
          function LodashWrapper(value, chainAll) {
            this.__wrapped__ = value;
            this.__actions__ = [];
            this.__chain__ = !!chainAll;
            this.__index__ = 0;
            this.__values__ = undefined;
          }
          lodash.templateSettings = {
            escape: reEscape,
            evaluate: reEvaluate,
            interpolate: reInterpolate,
            variable: "",
            imports: {
              _: lodash
            }
          };
          lodash.prototype = baseLodash.prototype;
          lodash.prototype.constructor = lodash;
          LodashWrapper.prototype = baseCreate(baseLodash.prototype);
          LodashWrapper.prototype.constructor = LodashWrapper;
          function LazyWrapper(value) {
            this.__wrapped__ = value;
            this.__actions__ = [];
            this.__dir__ = 1;
            this.__filtered__ = false;
            this.__iteratees__ = [];
            this.__takeCount__ = MAX_ARRAY_LENGTH;
            this.__views__ = [];
          }
          function lazyClone() {
            var result = new LazyWrapper(this.__wrapped__);
            result.__actions__ = copyArray(this.__actions__);
            result.__dir__ = this.__dir__;
            result.__filtered__ = this.__filtered__;
            result.__iteratees__ = copyArray(this.__iteratees__);
            result.__takeCount__ = this.__takeCount__;
            result.__views__ = copyArray(this.__views__);
            return result;
          }
          function lazyReverse() {
            if (this.__filtered__) {
              var result = new LazyWrapper(this);
              result.__dir__ = -1;
              result.__filtered__ = true;
            } else {
              result = this.clone();
              result.__dir__ *= -1;
            }
            return result;
          }
          function lazyValue() {
            var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
            if (!isArr || !isRight && arrLength == length && takeCount == length) {
              return baseWrapperValue(array, this.__actions__);
            }
            var result = [];
            outer: while (length-- && resIndex < takeCount) {
              index += dir;
              var iterIndex = -1, value = array[index];
              while (++iterIndex < iterLength) {
                var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value);
                if (type == LAZY_MAP_FLAG) {
                  value = computed;
                } else if (!computed) {
                  if (type == LAZY_FILTER_FLAG) {
                    continue outer;
                  } else {
                    break outer;
                  }
                }
              }
              result[resIndex++] = value;
            }
            return result;
          }
          LazyWrapper.prototype = baseCreate(baseLodash.prototype);
          LazyWrapper.prototype.constructor = LazyWrapper;
          function Hash(entries) {
            var index = -1, length = entries == null ? 0 : entries.length;
            this.clear();
            while (++index < length) {
              var entry = entries[index];
              this.set(entry[0], entry[1]);
            }
          }
          function hashClear() {
            this.__data__ = nativeCreate ? nativeCreate(null) : {};
            this.size = 0;
          }
          function hashDelete(key) {
            var result = this.has(key) && delete this.__data__[key];
            this.size -= result ? 1 : 0;
            return result;
          }
          function hashGet(key) {
            var data = this.__data__;
            if (nativeCreate) {
              var result = data[key];
              return result === HASH_UNDEFINED ? undefined : result;
            }
            return hasOwnProperty.call(data, key) ? data[key] : undefined;
          }
          function hashHas(key) {
            var data = this.__data__;
            return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
          }
          function hashSet(key, value) {
            var data = this.__data__;
            this.size += this.has(key) ? 0 : 1;
            data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value;
            return this;
          }
          Hash.prototype.clear = hashClear;
          Hash.prototype["delete"] = hashDelete;
          Hash.prototype.get = hashGet;
          Hash.prototype.has = hashHas;
          Hash.prototype.set = hashSet;
          function ListCache(entries) {
            var index = -1, length = entries == null ? 0 : entries.length;
            this.clear();
            while (++index < length) {
              var entry = entries[index];
              this.set(entry[0], entry[1]);
            }
          }
          function listCacheClear() {
            this.__data__ = [];
            this.size = 0;
          }
          function listCacheDelete(key) {
            var data = this.__data__, index = assocIndexOf(data, key);
            if (index < 0) {
              return false;
            }
            var lastIndex = data.length - 1;
            if (index == lastIndex) {
              data.pop();
            } else {
              splice.call(data, index, 1);
            }
            --this.size;
            return true;
          }
          function listCacheGet(key) {
            var data = this.__data__, index = assocIndexOf(data, key);
            return index < 0 ? undefined : data[index][1];
          }
          function listCacheHas(key) {
            return assocIndexOf(this.__data__, key) > -1;
          }
          function listCacheSet(key, value) {
            var data = this.__data__, index = assocIndexOf(data, key);
            if (index < 0) {
              ++this.size;
              data.push([ key, value ]);
            } else {
              data[index][1] = value;
            }
            return this;
          }
          ListCache.prototype.clear = listCacheClear;
          ListCache.prototype["delete"] = listCacheDelete;
          ListCache.prototype.get = listCacheGet;
          ListCache.prototype.has = listCacheHas;
          ListCache.prototype.set = listCacheSet;
          function MapCache(entries) {
            var index = -1, length = entries == null ? 0 : entries.length;
            this.clear();
            while (++index < length) {
              var entry = entries[index];
              this.set(entry[0], entry[1]);
            }
          }
          function mapCacheClear() {
            this.size = 0;
            this.__data__ = {
              hash: new Hash,
              map: new (Map || ListCache),
              string: new Hash
            };
          }
          function mapCacheDelete(key) {
            var result = getMapData(this, key)["delete"](key);
            this.size -= result ? 1 : 0;
            return result;
          }
          function mapCacheGet(key) {
            return getMapData(this, key).get(key);
          }
          function mapCacheHas(key) {
            return getMapData(this, key).has(key);
          }
          function mapCacheSet(key, value) {
            var data = getMapData(this, key), size = data.size;
            data.set(key, value);
            this.size += data.size == size ? 0 : 1;
            return this;
          }
          MapCache.prototype.clear = mapCacheClear;
          MapCache.prototype["delete"] = mapCacheDelete;
          MapCache.prototype.get = mapCacheGet;
          MapCache.prototype.has = mapCacheHas;
          MapCache.prototype.set = mapCacheSet;
          function SetCache(values) {
            var index = -1, length = values == null ? 0 : values.length;
            this.__data__ = new MapCache;
            while (++index < length) {
              this.add(values[index]);
            }
          }
          function setCacheAdd(value) {
            this.__data__.set(value, HASH_UNDEFINED);
            return this;
          }
          function setCacheHas(value) {
            return this.__data__.has(value);
          }
          SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
          SetCache.prototype.has = setCacheHas;
          function Stack(entries) {
            var data = this.__data__ = new ListCache(entries);
            this.size = data.size;
          }
          function stackClear() {
            this.__data__ = new ListCache;
            this.size = 0;
          }
          function stackDelete(key) {
            var data = this.__data__, result = data["delete"](key);
            this.size = data.size;
            return result;
          }
          function stackGet(key) {
            return this.__data__.get(key);
          }
          function stackHas(key) {
            return this.__data__.has(key);
          }
          function stackSet(key, value) {
            var data = this.__data__;
            if (data instanceof ListCache) {
              var pairs = data.__data__;
              if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
                pairs.push([ key, value ]);
                this.size = ++data.size;
                return this;
              }
              data = this.__data__ = new MapCache(pairs);
            }
            data.set(key, value);
            this.size = data.size;
            return this;
          }
          Stack.prototype.clear = stackClear;
          Stack.prototype["delete"] = stackDelete;
          Stack.prototype.get = stackGet;
          Stack.prototype.has = stackHas;
          Stack.prototype.set = stackSet;
          function arrayLikeKeys(value, inherited) {
            var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
            for (var key in value) {
              if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) {
                result.push(key);
              }
            }
            return result;
          }
          function arraySample(array) {
            var length = array.length;
            return length ? array[baseRandom(0, length - 1)] : undefined;
          }
          function arraySampleSize(array, n) {
            return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
          }
          function arrayShuffle(array) {
            return shuffleSelf(copyArray(array));
          }
          function assignMergeValue(object, key, value) {
            if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) {
              baseAssignValue(object, key, value);
            }
          }
          function assignValue(object, key, value) {
            var objValue = object[key];
            if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) {
              baseAssignValue(object, key, value);
            }
          }
          function assocIndexOf(array, key) {
            var length = array.length;
            while (length--) {
              if (eq(array[length][0], key)) {
                return length;
              }
            }
            return -1;
          }
          function baseAggregator(collection, setter, iteratee, accumulator) {
            baseEach(collection, (function(value, key, collection) {
              setter(accumulator, value, iteratee(value), collection);
            }));
            return accumulator;
          }
          function baseAssign(object, source) {
            return object && copyObject(source, keys(source), object);
          }
          function baseAssignIn(object, source) {
            return object && copyObject(source, keysIn(source), object);
          }
          function baseAssignValue(object, key, value) {
            if (key == "__proto__" && defineProperty) {
              defineProperty(object, key, {
                configurable: true,
                enumerable: true,
                value,
                writable: true
              });
            } else {
              object[key] = value;
            }
          }
          function baseAt(object, paths) {
            var index = -1, length = paths.length, result = Array(length), skip = object == null;
            while (++index < length) {
              result[index] = skip ? undefined : get(object, paths[index]);
            }
            return result;
          }
          function baseClamp(number, lower, upper) {
            if (number === number) {
              if (upper !== undefined) {
                number = number <= upper ? number : upper;
              }
              if (lower !== undefined) {
                number = number >= lower ? number : lower;
              }
            }
            return number;
          }
          function baseClone(value, bitmask, customizer, key, object, stack) {
            var result, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
            if (customizer) {
              result = object ? customizer(value, key, object, stack) : customizer(value);
            }
            if (result !== undefined) {
              return result;
            }
            if (!isObject(value)) {
              return value;
            }
            var isArr = isArray(value);
            if (isArr) {
              result = initCloneArray(value);
              if (!isDeep) {
                return copyArray(value, result);
              }
            } else {
              var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
              if (isBuffer(value)) {
                return cloneBuffer(value, isDeep);
              }
              if (tag == objectTag || tag == argsTag || isFunc && !object) {
                result = isFlat || isFunc ? {} : initCloneObject(value);
                if (!isDeep) {
                  return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value));
                }
              } else {
                if (!cloneableTags[tag]) {
                  return object ? value : {};
                }
                result = initCloneByTag(value, tag, isDeep);
              }
            }
            stack || (stack = new Stack);
            var stacked = stack.get(value);
            if (stacked) {
              return stacked;
            }
            stack.set(value, result);
            if (isSet(value)) {
              value.forEach((function(subValue) {
                result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
              }));
            } else if (isMap(value)) {
              value.forEach((function(subValue, key) {
                result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
              }));
            }
            var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
            var props = isArr ? undefined : keysFunc(value);
            arrayEach(props || value, (function(subValue, key) {
              if (props) {
                key = subValue;
                subValue = value[key];
              }
              assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
            }));
            return result;
          }
          function baseConforms(source) {
            var props = keys(source);
            return function(object) {
              return baseConformsTo(object, source, props);
            };
          }
          function baseConformsTo(object, source, props) {
            var length = props.length;
            if (object == null) {
              return !length;
            }
            object = Object(object);
            while (length--) {
              var key = props[length], predicate = source[key], value = object[key];
              if (value === undefined && !(key in object) || !predicate(value)) {
                return false;
              }
            }
            return true;
          }
          function baseDelay(func, wait, args) {
            if (typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            return setTimeout((function() {
              func.apply(undefined, args);
            }), wait);
          }
          function baseDifference(array, values, iteratee, comparator) {
            var index = -1, includes = arrayIncludes, isCommon = true, length = array.length, result = [], valuesLength = values.length;
            if (!length) {
              return result;
            }
            if (iteratee) {
              values = arrayMap(values, baseUnary(iteratee));
            }
            if (comparator) {
              includes = arrayIncludesWith;
              isCommon = false;
            } else if (values.length >= LARGE_ARRAY_SIZE) {
              includes = cacheHas;
              isCommon = false;
              values = new SetCache(values);
            }
            outer: while (++index < length) {
              var value = array[index], computed = iteratee == null ? value : iteratee(value);
              value = comparator || value !== 0 ? value : 0;
              if (isCommon && computed === computed) {
                var valuesIndex = valuesLength;
                while (valuesIndex--) {
                  if (values[valuesIndex] === computed) {
                    continue outer;
                  }
                }
                result.push(value);
              } else if (!includes(values, computed, comparator)) {
                result.push(value);
              }
            }
            return result;
          }
          var baseEach = createBaseEach(baseForOwn);
          var baseEachRight = createBaseEach(baseForOwnRight, true);
          function baseEvery(collection, predicate) {
            var result = true;
            baseEach(collection, (function(value, index, collection) {
              result = !!predicate(value, index, collection);
              return result;
            }));
            return result;
          }
          function baseExtremum(array, iteratee, comparator) {
            var index = -1, length = array.length;
            while (++index < length) {
              var value = array[index], current = iteratee(value);
              if (current != null && (computed === undefined ? current === current && !isSymbol(current) : comparator(current, computed))) {
                var computed = current, result = value;
              }
            }
            return result;
          }
          function baseFill(array, value, start, end) {
            var length = array.length;
            start = toInteger(start);
            if (start < 0) {
              start = -start > length ? 0 : length + start;
            }
            end = end === undefined || end > length ? length : toInteger(end);
            if (end < 0) {
              end += length;
            }
            end = start > end ? 0 : toLength(end);
            while (start < end) {
              array[start++] = value;
            }
            return array;
          }
          function baseFilter(collection, predicate) {
            var result = [];
            baseEach(collection, (function(value, index, collection) {
              if (predicate(value, index, collection)) {
                result.push(value);
              }
            }));
            return result;
          }
          function baseFlatten(array, depth, predicate, isStrict, result) {
            var index = -1, length = array.length;
            predicate || (predicate = isFlattenable);
            result || (result = []);
            while (++index < length) {
              var value = array[index];
              if (depth > 0 && predicate(value)) {
                if (depth > 1) {
                  baseFlatten(value, depth - 1, predicate, isStrict, result);
                } else {
                  arrayPush(result, value);
                }
              } else if (!isStrict) {
                result[result.length] = value;
              }
            }
            return result;
          }
          var baseFor = createBaseFor();
          var baseForRight = createBaseFor(true);
          function baseForOwn(object, iteratee) {
            return object && baseFor(object, iteratee, keys);
          }
          function baseForOwnRight(object, iteratee) {
            return object && baseForRight(object, iteratee, keys);
          }
          function baseFunctions(object, props) {
            return arrayFilter(props, (function(key) {
              return isFunction(object[key]);
            }));
          }
          function baseGet(object, path) {
            path = castPath(path, object);
            var index = 0, length = path.length;
            while (object != null && index < length) {
              object = object[toKey(path[index++])];
            }
            return index && index == length ? object : undefined;
          }
          function baseGetAllKeys(object, keysFunc, symbolsFunc) {
            var result = keysFunc(object);
            return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
          }
          function baseGetTag(value) {
            if (value == null) {
              return value === undefined ? undefinedTag : nullTag;
            }
            return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
          }
          function baseGt(value, other) {
            return value > other;
          }
          function baseHas(object, key) {
            return object != null && hasOwnProperty.call(object, key);
          }
          function baseHasIn(object, key) {
            return object != null && key in Object(object);
          }
          function baseInRange(number, start, end) {
            return number >= nativeMin(start, end) && number < nativeMax(start, end);
          }
          function baseIntersection(arrays, iteratee, comparator) {
            var includes = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array(othLength), maxLength = Infinity, result = [];
            while (othIndex--) {
              var array = arrays[othIndex];
              if (othIndex && iteratee) {
                array = arrayMap(array, baseUnary(iteratee));
              }
              maxLength = nativeMin(array.length, maxLength);
              caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined;
            }
            array = arrays[0];
            var index = -1, seen = caches[0];
            outer: while (++index < length && result.length < maxLength) {
              var value = array[index], computed = iteratee ? iteratee(value) : value;
              value = comparator || value !== 0 ? value : 0;
              if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) {
                othIndex = othLength;
                while (--othIndex) {
                  var cache = caches[othIndex];
                  if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) {
                    continue outer;
                  }
                }
                if (seen) {
                  seen.push(computed);
                }
                result.push(value);
              }
            }
            return result;
          }
          function baseInverter(object, setter, iteratee, accumulator) {
            baseForOwn(object, (function(value, key, object) {
              setter(accumulator, iteratee(value), key, object);
            }));
            return accumulator;
          }
          function baseInvoke(object, path, args) {
            path = castPath(path, object);
            object = parent(object, path);
            var func = object == null ? object : object[toKey(last(path))];
            return func == null ? undefined : apply(func, object, args);
          }
          function baseIsArguments(value) {
            return isObjectLike(value) && baseGetTag(value) == argsTag;
          }
          function baseIsArrayBuffer(value) {
            return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
          }
          function baseIsDate(value) {
            return isObjectLike(value) && baseGetTag(value) == dateTag;
          }
          function baseIsEqual(value, other, bitmask, customizer, stack) {
            if (value === other) {
              return true;
            }
            if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
              return value !== value && other !== other;
            }
            return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
          }
          function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
            var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
            objTag = objTag == argsTag ? objectTag : objTag;
            othTag = othTag == argsTag ? objectTag : othTag;
            var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
            if (isSameTag && isBuffer(object)) {
              if (!isBuffer(other)) {
                return false;
              }
              objIsArr = true;
              objIsObj = false;
            }
            if (isSameTag && !objIsObj) {
              stack || (stack = new Stack);
              return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
            }
            if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
              var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
              if (objIsWrapped || othIsWrapped) {
                var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
                stack || (stack = new Stack);
                return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
              }
            }
            if (!isSameTag) {
              return false;
            }
            stack || (stack = new Stack);
            return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
          }
          function baseIsMap(value) {
            return isObjectLike(value) && getTag(value) == mapTag;
          }
          function baseIsMatch(object, source, matchData, customizer) {
            var index = matchData.length, length = index, noCustomizer = !customizer;
            if (object == null) {
              return !length;
            }
            object = Object(object);
            while (index--) {
              var data = matchData[index];
              if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
                return false;
              }
            }
            while (++index < length) {
              data = matchData[index];
              var key = data[0], objValue = object[key], srcValue = data[1];
              if (noCustomizer && data[2]) {
                if (objValue === undefined && !(key in object)) {
                  return false;
                }
              } else {
                var stack = new Stack;
                if (customizer) {
                  var result = customizer(objValue, srcValue, key, object, source, stack);
                }
                if (!(result === undefined ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result)) {
                  return false;
                }
              }
            }
            return true;
          }
          function baseIsNative(value) {
            if (!isObject(value) || isMasked(value)) {
              return false;
            }
            var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
            return pattern.test(toSource(value));
          }
          function baseIsRegExp(value) {
            return isObjectLike(value) && baseGetTag(value) == regexpTag;
          }
          function baseIsSet(value) {
            return isObjectLike(value) && getTag(value) == setTag;
          }
          function baseIsTypedArray(value) {
            return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
          }
          function baseIteratee(value) {
            if (typeof value == "function") {
              return value;
            }
            if (value == null) {
              return identity;
            }
            if (typeof value == "object") {
              return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
            }
            return property(value);
          }
          function baseKeys(object) {
            if (!isPrototype(object)) {
              return nativeKeys(object);
            }
            var result = [];
            for (var key in Object(object)) {
              if (hasOwnProperty.call(object, key) && key != "constructor") {
                result.push(key);
              }
            }
            return result;
          }
          function baseKeysIn(object) {
            if (!isObject(object)) {
              return nativeKeysIn(object);
            }
            var isProto = isPrototype(object), result = [];
            for (var key in object) {
              if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
                result.push(key);
              }
            }
            return result;
          }
          function baseLt(value, other) {
            return value < other;
          }
          function baseMap(collection, iteratee) {
            var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
            baseEach(collection, (function(value, key, collection) {
              result[++index] = iteratee(value, key, collection);
            }));
            return result;
          }
          function baseMatches(source) {
            var matchData = getMatchData(source);
            if (matchData.length == 1 && matchData[0][2]) {
              return matchesStrictComparable(matchData[0][0], matchData[0][1]);
            }
            return function(object) {
              return object === source || baseIsMatch(object, source, matchData);
            };
          }
          function baseMatchesProperty(path, srcValue) {
            if (isKey(path) && isStrictComparable(srcValue)) {
              return matchesStrictComparable(toKey(path), srcValue);
            }
            return function(object) {
              var objValue = get(object, path);
              return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
            };
          }
          function baseMerge(object, source, srcIndex, customizer, stack) {
            if (object === source) {
              return;
            }
            baseFor(source, (function(srcValue, key) {
              stack || (stack = new Stack);
              if (isObject(srcValue)) {
                baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
              } else {
                var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined;
                if (newValue === undefined) {
                  newValue = srcValue;
                }
                assignMergeValue(object, key, newValue);
              }
            }), keysIn);
          }
          function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
            var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
            if (stacked) {
              assignMergeValue(object, key, stacked);
              return;
            }
            var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined;
            var isCommon = newValue === undefined;
            if (isCommon) {
              var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
              newValue = srcValue;
              if (isArr || isBuff || isTyped) {
                if (isArray(objValue)) {
                  newValue = objValue;
                } else if (isArrayLikeObject(objValue)) {
                  newValue = copyArray(objValue);
                } else if (isBuff) {
                  isCommon = false;
                  newValue = cloneBuffer(srcValue, true);
                } else if (isTyped) {
                  isCommon = false;
                  newValue = cloneTypedArray(srcValue, true);
                } else {
                  newValue = [];
                }
              } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
                newValue = objValue;
                if (isArguments(objValue)) {
                  newValue = toPlainObject(objValue);
                } else if (!isObject(objValue) || isFunction(objValue)) {
                  newValue = initCloneObject(srcValue);
                }
              } else {
                isCommon = false;
              }
            }
            if (isCommon) {
              stack.set(srcValue, newValue);
              mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
              stack["delete"](srcValue);
            }
            assignMergeValue(object, key, newValue);
          }
          function baseNth(array, n) {
            var length = array.length;
            if (!length) {
              return;
            }
            n += n < 0 ? length : 0;
            return isIndex(n, length) ? array[n] : undefined;
          }
          function baseOrderBy(collection, iteratees, orders) {
            if (iteratees.length) {
              iteratees = arrayMap(iteratees, (function(iteratee) {
                if (isArray(iteratee)) {
                  return function(value) {
                    return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
                  };
                }
                return iteratee;
              }));
            } else {
              iteratees = [ identity ];
            }
            var index = -1;
            iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
            var result = baseMap(collection, (function(value, key, collection) {
              var criteria = arrayMap(iteratees, (function(iteratee) {
                return iteratee(value);
              }));
              return {
                criteria,
                index: ++index,
                value
              };
            }));
            return baseSortBy(result, (function(object, other) {
              return compareMultiple(object, other, orders);
            }));
          }
          function basePick(object, paths) {
            return basePickBy(object, paths, (function(value, path) {
              return hasIn(object, path);
            }));
          }
          function basePickBy(object, paths, predicate) {
            var index = -1, length = paths.length, result = {};
            while (++index < length) {
              var path = paths[index], value = baseGet(object, path);
              if (predicate(value, path)) {
                baseSet(result, castPath(path, object), value);
              }
            }
            return result;
          }
          function basePropertyDeep(path) {
            return function(object) {
              return baseGet(object, path);
            };
          }
          function basePullAll(array, values, iteratee, comparator) {
            var indexOf = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values.length, seen = array;
            if (array === values) {
              values = copyArray(values);
            }
            if (iteratee) {
              seen = arrayMap(array, baseUnary(iteratee));
            }
            while (++index < length) {
              var fromIndex = 0, value = values[index], computed = iteratee ? iteratee(value) : value;
              while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
                if (seen !== array) {
                  splice.call(seen, fromIndex, 1);
                }
                splice.call(array, fromIndex, 1);
              }
            }
            return array;
          }
          function basePullAt(array, indexes) {
            var length = array ? indexes.length : 0, lastIndex = length - 1;
            while (length--) {
              var index = indexes[length];
              if (length == lastIndex || index !== previous) {
                var previous = index;
                if (isIndex(index)) {
                  splice.call(array, index, 1);
                } else {
                  baseUnset(array, index);
                }
              }
            }
            return array;
          }
          function baseRandom(lower, upper) {
            return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
          }
          function baseRange(start, end, step, fromRight) {
            var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length);
            while (length--) {
              result[fromRight ? length : ++index] = start;
              start += step;
            }
            return result;
          }
          function baseRepeat(string, n) {
            var result = "";
            if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
              return result;
            }
            do {
              if (n % 2) {
                result += string;
              }
              n = nativeFloor(n / 2);
              if (n) {
                string += string;
              }
            } while (n);
            return result;
          }
          function baseRest(func, start) {
            return setToString(overRest(func, start, identity), func + "");
          }
          function baseSample(collection) {
            return arraySample(values(collection));
          }
          function baseSampleSize(collection, n) {
            var array = values(collection);
            return shuffleSelf(array, baseClamp(n, 0, array.length));
          }
          function baseSet(object, path, value, customizer) {
            if (!isObject(object)) {
              return object;
            }
            path = castPath(path, object);
            var index = -1, length = path.length, lastIndex = length - 1, nested = object;
            while (nested != null && ++index < length) {
              var key = toKey(path[index]), newValue = value;
              if (key === "__proto__" || key === "constructor" || key === "prototype") {
                return object;
              }
              if (index != lastIndex) {
                var objValue = nested[key];
                newValue = customizer ? customizer(objValue, key, nested) : undefined;
                if (newValue === undefined) {
                  newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
                }
              }
              assignValue(nested, key, newValue);
              nested = nested[key];
            }
            return object;
          }
          var baseSetData = !metaMap ? identity : function(func, data) {
            metaMap.set(func, data);
            return func;
          };
          var baseSetToString = !defineProperty ? identity : function(func, string) {
            return defineProperty(func, "toString", {
              configurable: true,
              enumerable: false,
              value: constant(string),
              writable: true
            });
          };
          function baseShuffle(collection) {
            return shuffleSelf(values(collection));
          }
          function baseSlice(array, start, end) {
            var index = -1, length = array.length;
            if (start < 0) {
              start = -start > length ? 0 : length + start;
            }
            end = end > length ? length : end;
            if (end < 0) {
              end += length;
            }
            length = start > end ? 0 : end - start >>> 0;
            start >>>= 0;
            var result = Array(length);
            while (++index < length) {
              result[index] = array[index + start];
            }
            return result;
          }
          function baseSome(collection, predicate) {
            var result;
            baseEach(collection, (function(value, index, collection) {
              result = predicate(value, index, collection);
              return !result;
            }));
            return !!result;
          }
          function baseSortedIndex(array, value, retHighest) {
            var low = 0, high = array == null ? low : array.length;
            if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
              while (low < high) {
                var mid = low + high >>> 1, computed = array[mid];
                if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
                  low = mid + 1;
                } else {
                  high = mid;
                }
              }
              return high;
            }
            return baseSortedIndexBy(array, value, identity, retHighest);
          }
          function baseSortedIndexBy(array, value, iteratee, retHighest) {
            var low = 0, high = array == null ? 0 : array.length;
            if (high === 0) {
              return 0;
            }
            value = iteratee(value);
            var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined;
            while (low < high) {
              var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), othIsDefined = computed !== undefined, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
              if (valIsNaN) {
                var setLow = retHighest || othIsReflexive;
              } else if (valIsUndefined) {
                setLow = othIsReflexive && (retHighest || othIsDefined);
              } else if (valIsNull) {
                setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
              } else if (valIsSymbol) {
                setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
              } else if (othIsNull || othIsSymbol) {
                setLow = false;
              } else {
                setLow = retHighest ? computed <= value : computed < value;
              }
              if (setLow) {
                low = mid + 1;
              } else {
                high = mid;
              }
            }
            return nativeMin(high, MAX_ARRAY_INDEX);
          }
          function baseSortedUniq(array, iteratee) {
            var index = -1, length = array.length, resIndex = 0, result = [];
            while (++index < length) {
              var value = array[index], computed = iteratee ? iteratee(value) : value;
              if (!index || !eq(computed, seen)) {
                var seen = computed;
                result[resIndex++] = value === 0 ? 0 : value;
              }
            }
            return result;
          }
          function baseToNumber(value) {
            if (typeof value == "number") {
              return value;
            }
            if (isSymbol(value)) {
              return NAN;
            }
            return +value;
          }
          function baseToString(value) {
            if (typeof value == "string") {
              return value;
            }
            if (isArray(value)) {
              return arrayMap(value, baseToString) + "";
            }
            if (isSymbol(value)) {
              return symbolToString ? symbolToString.call(value) : "";
            }
            var result = value + "";
            return result == "0" && 1 / value == -INFINITY ? "-0" : result;
          }
          function baseUniq(array, iteratee, comparator) {
            var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
            if (comparator) {
              isCommon = false;
              includes = arrayIncludesWith;
            } else if (length >= LARGE_ARRAY_SIZE) {
              var set = iteratee ? null : createSet(array);
              if (set) {
                return setToArray(set);
              }
              isCommon = false;
              includes = cacheHas;
              seen = new SetCache;
            } else {
              seen = iteratee ? [] : result;
            }
            outer: while (++index < length) {
              var value = array[index], computed = iteratee ? iteratee(value) : value;
              value = comparator || value !== 0 ? value : 0;
              if (isCommon && computed === computed) {
                var seenIndex = seen.length;
                while (seenIndex--) {
                  if (seen[seenIndex] === computed) {
                    continue outer;
                  }
                }
                if (iteratee) {
                  seen.push(computed);
                }
                result.push(value);
              } else if (!includes(seen, computed, comparator)) {
                if (seen !== result) {
                  seen.push(computed);
                }
                result.push(value);
              }
            }
            return result;
          }
          function baseUnset(object, path) {
            path = castPath(path, object);
            var index = -1, length = path.length;
            if (!length) {
              return true;
            }
            var isRootPrimitive = object == null || typeof object !== "object" && typeof object !== "function";
            while (++index < length) {
              var key = path[index];
              if (typeof key !== "string") {
                continue;
              }
              if (key === "__proto__" && !hasOwnProperty.call(object, "__proto__")) {
                return false;
              }
              if (key === "constructor" && index + 1 < length && typeof path[index + 1] === "string" && path[index + 1] === "prototype") {
                if (isRootPrimitive && index === 0) {
                  continue;
                }
                return false;
              }
            }
            var obj = parent(object, path);
            return obj == null || delete obj[toKey(last(path))];
          }
          function baseUpdate(object, path, updater, customizer) {
            return baseSet(object, path, updater(baseGet(object, path)), customizer);
          }
          function baseWhile(array, predicate, isDrop, fromRight) {
            var length = array.length, index = fromRight ? length : -1;
            while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {}
            return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
          }
          function baseWrapperValue(value, actions) {
            var result = value;
            if (result instanceof LazyWrapper) {
              result = result.value();
            }
            return arrayReduce(actions, (function(result, action) {
              return action.func.apply(action.thisArg, arrayPush([ result ], action.args));
            }), result);
          }
          function baseXor(arrays, iteratee, comparator) {
            var length = arrays.length;
            if (length < 2) {
              return length ? baseUniq(arrays[0]) : [];
            }
            var index = -1, result = Array(length);
            while (++index < length) {
              var array = arrays[index], othIndex = -1;
              while (++othIndex < length) {
                if (othIndex != index) {
                  result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
                }
              }
            }
            return baseUniq(baseFlatten(result, 1), iteratee, comparator);
          }
          function baseZipObject(props, values, assignFunc) {
            var index = -1, length = props.length, valsLength = values.length, result = {};
            while (++index < length) {
              var value = index < valsLength ? values[index] : undefined;
              assignFunc(result, props[index], value);
            }
            return result;
          }
          function castArrayLikeObject(value) {
            return isArrayLikeObject(value) ? value : [];
          }
          function castFunction(value) {
            return typeof value == "function" ? value : identity;
          }
          function castPath(value, object) {
            if (isArray(value)) {
              return value;
            }
            return isKey(value, object) ? [ value ] : stringToPath(toString(value));
          }
          var castRest = baseRest;
          function castSlice(array, start, end) {
            var length = array.length;
            end = end === undefined ? length : end;
            return !start && end >= length ? array : baseSlice(array, start, end);
          }
          var clearTimeout = ctxClearTimeout || function(id) {
            return root.clearTimeout(id);
          };
          function cloneBuffer(buffer, isDeep) {
            if (isDeep) {
              return buffer.slice();
            }
            var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
            buffer.copy(result);
            return result;
          }
          function cloneArrayBuffer(arrayBuffer) {
            var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
            new Uint8Array(result).set(new Uint8Array(arrayBuffer));
            return result;
          }
          function cloneDataView(dataView, isDeep) {
            var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
            return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
          }
          function cloneRegExp(regexp) {
            var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
            result.lastIndex = regexp.lastIndex;
            return result;
          }
          function cloneSymbol(symbol) {
            return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
          }
          function cloneTypedArray(typedArray, isDeep) {
            var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
            return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
          }
          function compareAscending(value, other) {
            if (value !== other) {
              var valIsDefined = value !== undefined, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
              var othIsDefined = other !== undefined, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
              if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
                return 1;
              }
              if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
                return -1;
              }
            }
            return 0;
          }
          function compareMultiple(object, other, orders) {
            var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
            while (++index < length) {
              var result = compareAscending(objCriteria[index], othCriteria[index]);
              if (result) {
                if (index >= ordersLength) {
                  return result;
                }
                var order = orders[index];
                return result * (order == "desc" ? -1 : 1);
              }
            }
            return object.index - other.index;
          }
          function composeArgs(args, partials, holders, isCurried) {
            var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(leftLength + rangeLength), isUncurried = !isCurried;
            while (++leftIndex < leftLength) {
              result[leftIndex] = partials[leftIndex];
            }
            while (++argsIndex < holdersLength) {
              if (isUncurried || argsIndex < argsLength) {
                result[holders[argsIndex]] = args[argsIndex];
              }
            }
            while (rangeLength--) {
              result[leftIndex++] = args[argsIndex++];
            }
            return result;
          }
          function composeArgsRight(args, partials, holders, isCurried) {
            var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result = Array(rangeLength + rightLength), isUncurried = !isCurried;
            while (++argsIndex < rangeLength) {
              result[argsIndex] = args[argsIndex];
            }
            var offset = argsIndex;
            while (++rightIndex < rightLength) {
              result[offset + rightIndex] = partials[rightIndex];
            }
            while (++holdersIndex < holdersLength) {
              if (isUncurried || argsIndex < argsLength) {
                result[offset + holders[holdersIndex]] = args[argsIndex++];
              }
            }
            return result;
          }
          function copyArray(source, array) {
            var index = -1, length = source.length;
            array || (array = Array(length));
            while (++index < length) {
              array[index] = source[index];
            }
            return array;
          }
          function copyObject(source, props, object, customizer) {
            var isNew = !object;
            object || (object = {});
            var index = -1, length = props.length;
            while (++index < length) {
              var key = props[index];
              var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined;
              if (newValue === undefined) {
                newValue = source[key];
              }
              if (isNew) {
                baseAssignValue(object, key, newValue);
              } else {
                assignValue(object, key, newValue);
              }
            }
            return object;
          }
          function copySymbols(source, object) {
            return copyObject(source, getSymbols(source), object);
          }
          function copySymbolsIn(source, object) {
            return copyObject(source, getSymbolsIn(source), object);
          }
          function createAggregator(setter, initializer) {
            return function(collection, iteratee) {
              var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
              return func(collection, setter, getIteratee(iteratee, 2), accumulator);
            };
          }
          function createAssigner(assigner) {
            return baseRest((function(object, sources) {
              var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, guard = length > 2 ? sources[2] : undefined;
              customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, 
              customizer) : undefined;
              if (guard && isIterateeCall(sources[0], sources[1], guard)) {
                customizer = length < 3 ? undefined : customizer;
                length = 1;
              }
              object = Object(object);
              while (++index < length) {
                var source = sources[index];
                if (source) {
                  assigner(object, source, index, customizer);
                }
              }
              return object;
            }));
          }
          function createBaseEach(eachFunc, fromRight) {
            return function(collection, iteratee) {
              if (collection == null) {
                return collection;
              }
              if (!isArrayLike(collection)) {
                return eachFunc(collection, iteratee);
              }
              var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection);
              while (fromRight ? index-- : ++index < length) {
                if (iteratee(iterable[index], index, iterable) === false) {
                  break;
                }
              }
              return collection;
            };
          }
          function createBaseFor(fromRight) {
            return function(object, iteratee, keysFunc) {
              var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
              while (length--) {
                var key = props[fromRight ? length : ++index];
                if (iteratee(iterable[key], key, iterable) === false) {
                  break;
                }
              }
              return object;
            };
          }
          function createBind(func, bitmask, thisArg) {
            var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
            function wrapper() {
              var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
              return fn.apply(isBind ? thisArg : this, arguments);
            }
            return wrapper;
          }
          function createCaseFirst(methodName) {
            return function(string) {
              string = toString(string);
              var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined;
              var chr = strSymbols ? strSymbols[0] : string.charAt(0);
              var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
              return chr[methodName]() + trailing;
            };
          }
          function createCompounder(callback) {
            return function(string) {
              return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
            };
          }
          function createCtor(Ctor) {
            return function() {
              var args = arguments;
              switch (args.length) {
               case 0:
                return new Ctor;

               case 1:
                return new Ctor(args[0]);

               case 2:
                return new Ctor(args[0], args[1]);

               case 3:
                return new Ctor(args[0], args[1], args[2]);

               case 4:
                return new Ctor(args[0], args[1], args[2], args[3]);

               case 5:
                return new Ctor(args[0], args[1], args[2], args[3], args[4]);

               case 6:
                return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);

               case 7:
                return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
              }
              var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args);
              return isObject(result) ? result : thisBinding;
            };
          }
          function createCurry(func, bitmask, arity) {
            var Ctor = createCtor(func);
            function wrapper() {
              var length = arguments.length, args = Array(length), index = length, placeholder = getHolder(wrapper);
              while (index--) {
                args[index] = arguments[index];
              }
              var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
              length -= holders.length;
              if (length < arity) {
                return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length);
              }
              var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
              return apply(fn, this, args);
            }
            return wrapper;
          }
          function createFind(findIndexFunc) {
            return function(collection, predicate, fromIndex) {
              var iterable = Object(collection);
              if (!isArrayLike(collection)) {
                var iteratee = getIteratee(predicate, 3);
                collection = keys(collection);
                predicate = function(key) {
                  return iteratee(iterable[key], key, iterable);
                };
              }
              var index = findIndexFunc(collection, predicate, fromIndex);
              return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
            };
          }
          function createFlow(fromRight) {
            return flatRest((function(funcs) {
              var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
              if (fromRight) {
                funcs.reverse();
              }
              while (index--) {
                var func = funcs[index];
                if (typeof func != "function") {
                  throw new TypeError(FUNC_ERROR_TEXT);
                }
                if (prereq && !wrapper && getFuncName(func) == "wrapper") {
                  var wrapper = new LodashWrapper([], true);
                }
              }
              index = wrapper ? index : length;
              while (++index < length) {
                func = funcs[index];
                var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined;
                if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
                  wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
                } else {
                  wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
                }
              }
              return function() {
                var args = arguments, value = args[0];
                if (wrapper && args.length == 1 && isArray(value)) {
                  return wrapper.plant(value).value();
                }
                var index = 0, result = length ? funcs[index].apply(this, args) : value;
                while (++index < length) {
                  result = funcs[index].call(this, result);
                }
                return result;
              };
            }));
          }
          function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
            var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined : createCtor(func);
            function wrapper() {
              var length = arguments.length, args = Array(length), index = length;
              while (index--) {
                args[index] = arguments[index];
              }
              if (isCurried) {
                var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
              }
              if (partials) {
                args = composeArgs(args, partials, holders, isCurried);
              }
              if (partialsRight) {
                args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
              }
              length -= holdersCount;
              if (isCurried && length < arity) {
                var newHolders = replaceHolders(args, placeholder);
                return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length);
              }
              var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
              length = args.length;
              if (argPos) {
                args = reorder(args, argPos);
              } else if (isFlip && length > 1) {
                args.reverse();
              }
              if (isAry && ary < length) {
                args.length = ary;
              }
              if (this && this !== root && this instanceof wrapper) {
                fn = Ctor || createCtor(fn);
              }
              return fn.apply(thisBinding, args);
            }
            return wrapper;
          }
          function createInverter(setter, toIteratee) {
            return function(object, iteratee) {
              return baseInverter(object, setter, toIteratee(iteratee), {});
            };
          }
          function createMathOperation(operator, defaultValue) {
            return function(value, other) {
              var result;
              if (value === undefined && other === undefined) {
                return defaultValue;
              }
              if (value !== undefined) {
                result = value;
              }
              if (other !== undefined) {
                if (result === undefined) {
                  return other;
                }
                if (typeof value == "string" || typeof other == "string") {
                  value = baseToString(value);
                  other = baseToString(other);
                } else {
                  value = baseToNumber(value);
                  other = baseToNumber(other);
                }
                result = operator(value, other);
              }
              return result;
            };
          }
          function createOver(arrayFunc) {
            return flatRest((function(iteratees) {
              iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
              return baseRest((function(args) {
                var thisArg = this;
                return arrayFunc(iteratees, (function(iteratee) {
                  return apply(iteratee, thisArg, args);
                }));
              }));
            }));
          }
          function createPadding(length, chars) {
            chars = chars === undefined ? " " : baseToString(chars);
            var charsLength = chars.length;
            if (charsLength < 2) {
              return charsLength ? baseRepeat(chars, length) : chars;
            }
            var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
            return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join("") : result.slice(0, length);
          }
          function createPartial(func, bitmask, thisArg, partials) {
            var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
            function wrapper() {
              var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
              while (++leftIndex < leftLength) {
                args[leftIndex] = partials[leftIndex];
              }
              while (argsLength--) {
                args[leftIndex++] = arguments[++argsIndex];
              }
              return apply(fn, isBind ? thisArg : this, args);
            }
            return wrapper;
          }
          function createRange(fromRight) {
            return function(start, end, step) {
              if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
                end = step = undefined;
              }
              start = toFinite(start);
              if (end === undefined) {
                end = start;
                start = 0;
              } else {
                end = toFinite(end);
              }
              step = step === undefined ? start < end ? 1 : -1 : toFinite(step);
              return baseRange(start, end, step, fromRight);
            };
          }
          function createRelationalOperation(operator) {
            return function(value, other) {
              if (!(typeof value == "string" && typeof other == "string")) {
                value = toNumber(value);
                other = toNumber(other);
              }
              return operator(value, other);
            };
          }
          function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
            var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, newPartials = isCurry ? partials : undefined, newPartialsRight = isCurry ? undefined : partials;
            bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
            bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
            if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
              bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
            }
            var newData = [ func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity ];
            var result = wrapFunc.apply(undefined, newData);
            if (isLaziable(func)) {
              setData(result, newData);
            }
            result.placeholder = placeholder;
            return setWrapToString(result, func, bitmask);
          }
          function createRound(methodName) {
            var func = Math[methodName];
            return function(number, precision) {
              number = toNumber(number);
              precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
              if (precision && nativeIsFinite(number)) {
                var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
                pair = (toString(value) + "e").split("e");
                return +(pair[0] + "e" + (+pair[1] - precision));
              }
              return func(number);
            };
          }
          var createSet = !(Set && 1 / setToArray(new Set([ , -0 ]))[1] == INFINITY) ? noop : function(values) {
            return new Set(values);
          };
          function createToPairs(keysFunc) {
            return function(object) {
              var tag = getTag(object);
              if (tag == mapTag) {
                return mapToArray(object);
              }
              if (tag == setTag) {
                return setToPairs(object);
              }
              return baseToPairs(object, keysFunc(object));
            };
          }
          function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
            var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
            if (!isBindKey && typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            var length = partials ? partials.length : 0;
            if (!length) {
              bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
              partials = holders = undefined;
            }
            ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
            arity = arity === undefined ? arity : toInteger(arity);
            length -= holders ? holders.length : 0;
            if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
              var partialsRight = partials, holdersRight = holders;
              partials = holders = undefined;
            }
            var data = isBindKey ? undefined : getData(func);
            var newData = [ func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity ];
            if (data) {
              mergeData(newData, data);
            }
            func = newData[0];
            bitmask = newData[1];
            thisArg = newData[2];
            partials = newData[3];
            holders = newData[4];
            arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
            if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
              bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
            }
            if (!bitmask || bitmask == WRAP_BIND_FLAG) {
              var result = createBind(func, bitmask, thisArg);
            } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
              result = createCurry(func, bitmask, arity);
            } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
              result = createPartial(func, bitmask, thisArg, partials);
            } else {
              result = createHybrid.apply(undefined, newData);
            }
            var setter = data ? baseSetData : setData;
            return setWrapToString(setter(result, newData), func, bitmask);
          }
          function customDefaultsAssignIn(objValue, srcValue, key, object) {
            if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
              return srcValue;
            }
            return objValue;
          }
          function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
            if (isObject(objValue) && isObject(srcValue)) {
              stack.set(srcValue, objValue);
              baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
              stack["delete"](srcValue);
            }
            return objValue;
          }
          function customOmitClone(value) {
            return isPlainObject(value) ? undefined : value;
          }
          function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
            var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
            if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
              return false;
            }
            var arrStacked = stack.get(array);
            var othStacked = stack.get(other);
            if (arrStacked && othStacked) {
              return arrStacked == other && othStacked == array;
            }
            var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache : undefined;
            stack.set(array, other);
            stack.set(other, array);
            while (++index < arrLength) {
              var arrValue = array[index], othValue = other[index];
              if (customizer) {
                var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
              }
              if (compared !== undefined) {
                if (compared) {
                  continue;
                }
                result = false;
                break;
              }
              if (seen) {
                if (!arraySome(other, (function(othValue, othIndex) {
                  if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                    return seen.push(othIndex);
                  }
                }))) {
                  result = false;
                  break;
                }
              } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
                result = false;
                break;
              }
            }
            stack["delete"](array);
            stack["delete"](other);
            return result;
          }
          function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
            switch (tag) {
             case dataViewTag:
              if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
                return false;
              }
              object = object.buffer;
              other = other.buffer;

             case arrayBufferTag:
              if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
                return false;
              }
              return true;

             case boolTag:
             case dateTag:
             case numberTag:
              return eq(+object, +other);

             case errorTag:
              return object.name == other.name && object.message == other.message;

             case regexpTag:
             case stringTag:
              return object == other + "";

             case mapTag:
              var convert = mapToArray;

             case setTag:
              var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
              convert || (convert = setToArray);
              if (object.size != other.size && !isPartial) {
                return false;
              }
              var stacked = stack.get(object);
              if (stacked) {
                return stacked == other;
              }
              bitmask |= COMPARE_UNORDERED_FLAG;
              stack.set(object, other);
              var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
              stack["delete"](object);
              return result;

             case symbolTag:
              if (symbolValueOf) {
                return symbolValueOf.call(object) == symbolValueOf.call(other);
              }
            }
            return false;
          }
          function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
            var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
            if (objLength != othLength && !isPartial) {
              return false;
            }
            var index = objLength;
            while (index--) {
              var key = objProps[index];
              if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
                return false;
              }
            }
            var objStacked = stack.get(object);
            var othStacked = stack.get(other);
            if (objStacked && othStacked) {
              return objStacked == other && othStacked == object;
            }
            var result = true;
            stack.set(object, other);
            stack.set(other, object);
            var skipCtor = isPartial;
            while (++index < objLength) {
              key = objProps[index];
              var objValue = object[key], othValue = other[key];
              if (customizer) {
                var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
              }
              if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
                result = false;
                break;
              }
              skipCtor || (skipCtor = key == "constructor");
            }
            if (result && !skipCtor) {
              var objCtor = object.constructor, othCtor = other.constructor;
              if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
                result = false;
              }
            }
            stack["delete"](object);
            stack["delete"](other);
            return result;
          }
          function flatRest(func) {
            return setToString(overRest(func, undefined, flatten), func + "");
          }
          function getAllKeys(object) {
            return baseGetAllKeys(object, keys, getSymbols);
          }
          function getAllKeysIn(object) {
            return baseGetAllKeys(object, keysIn, getSymbolsIn);
          }
          var getData = !metaMap ? noop : function(func) {
            return metaMap.get(func);
          };
          function getFuncName(func) {
            var result = func.name + "", array = realNames[result], length = hasOwnProperty.call(realNames, result) ? array.length : 0;
            while (length--) {
              var data = array[length], otherFunc = data.func;
              if (otherFunc == null || otherFunc == func) {
                return data.name;
              }
            }
            return result;
          }
          function getHolder(func) {
            var object = hasOwnProperty.call(lodash, "placeholder") ? lodash : func;
            return object.placeholder;
          }
          function getIteratee() {
            var result = lodash.iteratee || iteratee;
            result = result === iteratee ? baseIteratee : result;
            return arguments.length ? result(arguments[0], arguments[1]) : result;
          }
          function getMapData(map, key) {
            var data = map.__data__;
            return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
          }
          function getMatchData(object) {
            var result = keys(object), length = result.length;
            while (length--) {
              var key = result[length], value = object[key];
              result[length] = [ key, value, isStrictComparable(value) ];
            }
            return result;
          }
          function getNative(object, key) {
            var value = getValue(object, key);
            return baseIsNative(value) ? value : undefined;
          }
          function getRawTag(value) {
            var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
            try {
              value[symToStringTag] = undefined;
              var unmasked = true;
            } catch (e) {}
            var result = nativeObjectToString.call(value);
            if (unmasked) {
              if (isOwn) {
                value[symToStringTag] = tag;
              } else {
                delete value[symToStringTag];
              }
            }
            return result;
          }
          var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
            if (object == null) {
              return [];
            }
            object = Object(object);
            return arrayFilter(nativeGetSymbols(object), (function(symbol) {
              return propertyIsEnumerable.call(object, symbol);
            }));
          };
          var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
            var result = [];
            while (object) {
              arrayPush(result, getSymbols(object));
              object = getPrototype(object);
            }
            return result;
          };
          var getTag = baseGetTag;
          if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set) != setTag || WeakMap && getTag(new WeakMap) != weakMapTag) {
            getTag = function(value) {
              var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined, ctorString = Ctor ? toSource(Ctor) : "";
              if (ctorString) {
                switch (ctorString) {
                 case dataViewCtorString:
                  return dataViewTag;

                 case mapCtorString:
                  return mapTag;

                 case promiseCtorString:
                  return promiseTag;

                 case setCtorString:
                  return setTag;

                 case weakMapCtorString:
                  return weakMapTag;
                }
              }
              return result;
            };
          }
          function getView(start, end, transforms) {
            var index = -1, length = transforms.length;
            while (++index < length) {
              var data = transforms[index], size = data.size;
              switch (data.type) {
               case "drop":
                start += size;
                break;

               case "dropRight":
                end -= size;
                break;

               case "take":
                end = nativeMin(end, start + size);
                break;

               case "takeRight":
                start = nativeMax(start, end - size);
                break;
              }
            }
            return {
              start,
              end
            };
          }
          function getWrapDetails(source) {
            var match = source.match(reWrapDetails);
            return match ? match[1].split(reSplitDetails) : [];
          }
          function hasPath(object, path, hasFunc) {
            path = castPath(path, object);
            var index = -1, length = path.length, result = false;
            while (++index < length) {
              var key = toKey(path[index]);
              if (!(result = object != null && hasFunc(object, key))) {
                break;
              }
              object = object[key];
            }
            if (result || ++index != length) {
              return result;
            }
            length = object == null ? 0 : object.length;
            return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
          }
          function initCloneArray(array) {
            var length = array.length, result = new array.constructor(length);
            if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
              result.index = array.index;
              result.input = array.input;
            }
            return result;
          }
          function initCloneObject(object) {
            return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
          }
          function initCloneByTag(object, tag, isDeep) {
            var Ctor = object.constructor;
            switch (tag) {
             case arrayBufferTag:
              return cloneArrayBuffer(object);

             case boolTag:
             case dateTag:
              return new Ctor(+object);

             case dataViewTag:
              return cloneDataView(object, isDeep);

             case float32Tag:
             case float64Tag:
             case int8Tag:
             case int16Tag:
             case int32Tag:
             case uint8Tag:
             case uint8ClampedTag:
             case uint16Tag:
             case uint32Tag:
              return cloneTypedArray(object, isDeep);

             case mapTag:
              return new Ctor;

             case numberTag:
             case stringTag:
              return new Ctor(object);

             case regexpTag:
              return cloneRegExp(object);

             case setTag:
              return new Ctor;

             case symbolTag:
              return cloneSymbol(object);
            }
          }
          function insertWrapDetails(source, details) {
            var length = details.length;
            if (!length) {
              return source;
            }
            var lastIndex = length - 1;
            details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
            details = details.join(length > 2 ? ", " : " ");
            return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
          }
          function isFlattenable(value) {
            return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
          }
          function isIndex(value, length) {
            var type = typeof value;
            length = length == null ? MAX_SAFE_INTEGER : length;
            return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
          }
          function isIterateeCall(value, index, object) {
            if (!isObject(object)) {
              return false;
            }
            var type = typeof index;
            if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
              return eq(object[index], value);
            }
            return false;
          }
          function isKey(value, object) {
            if (isArray(value)) {
              return false;
            }
            var type = typeof value;
            if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
              return true;
            }
            return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object);
          }
          function isKeyable(value) {
            var type = typeof value;
            return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
          }
          function isLaziable(func) {
            var funcName = getFuncName(func), other = lodash[funcName];
            if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
              return false;
            }
            if (func === other) {
              return true;
            }
            var data = getData(other);
            return !!data && func === data[0];
          }
          function isMasked(func) {
            return !!maskSrcKey && maskSrcKey in func;
          }
          var isMaskable = coreJsData ? isFunction : stubFalse;
          function isPrototype(value) {
            var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
            return value === proto;
          }
          function isStrictComparable(value) {
            return value === value && !isObject(value);
          }
          function matchesStrictComparable(key, srcValue) {
            return function(object) {
              if (object == null) {
                return false;
              }
              return object[key] === srcValue && (srcValue !== undefined || key in Object(object));
            };
          }
          function memoizeCapped(func) {
            var result = memoize(func, (function(key) {
              if (cache.size === MAX_MEMOIZE_SIZE) {
                cache.clear();
              }
              return key;
            }));
            var cache = result.cache;
            return result;
          }
          function mergeData(data, source) {
            var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
            var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
            if (!(isCommon || isCombo)) {
              return data;
            }
            if (srcBitmask & WRAP_BIND_FLAG) {
              data[2] = source[2];
              newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
            }
            var value = source[3];
            if (value) {
              var partials = data[3];
              data[3] = partials ? composeArgs(partials, value, source[4]) : value;
              data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
            }
            value = source[5];
            if (value) {
              partials = data[5];
              data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
              data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
            }
            value = source[7];
            if (value) {
              data[7] = value;
            }
            if (srcBitmask & WRAP_ARY_FLAG) {
              data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
            }
            if (data[9] == null) {
              data[9] = source[9];
            }
            data[0] = source[0];
            data[1] = newBitmask;
            return data;
          }
          function nativeKeysIn(object) {
            var result = [];
            if (object != null) {
              for (var key in Object(object)) {
                result.push(key);
              }
            }
            return result;
          }
          function objectToString(value) {
            return nativeObjectToString.call(value);
          }
          function overRest(func, start, transform) {
            start = nativeMax(start === undefined ? func.length - 1 : start, 0);
            return function() {
              var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
              while (++index < length) {
                array[index] = args[start + index];
              }
              index = -1;
              var otherArgs = Array(start + 1);
              while (++index < start) {
                otherArgs[index] = args[index];
              }
              otherArgs[start] = transform(array);
              return apply(func, this, otherArgs);
            };
          }
          function parent(object, path) {
            return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
          }
          function reorder(array, indexes) {
            var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
            while (length--) {
              var index = indexes[length];
              array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
            }
            return array;
          }
          function safeGet(object, key) {
            if (key === "constructor" && typeof object[key] === "function") {
              return;
            }
            if (key == "__proto__") {
              return;
            }
            return object[key];
          }
          var setData = shortOut(baseSetData);
          var setTimeout = ctxSetTimeout || function(func, wait) {
            return root.setTimeout(func, wait);
          };
          var setToString = shortOut(baseSetToString);
          function setWrapToString(wrapper, reference, bitmask) {
            var source = reference + "";
            return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
          }
          function shortOut(func) {
            var count = 0, lastCalled = 0;
            return function() {
              var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
              lastCalled = stamp;
              if (remaining > 0) {
                if (++count >= HOT_COUNT) {
                  return arguments[0];
                }
              } else {
                count = 0;
              }
              return func.apply(undefined, arguments);
            };
          }
          function shuffleSelf(array, size) {
            var index = -1, length = array.length, lastIndex = length - 1;
            size = size === undefined ? length : size;
            while (++index < size) {
              var rand = baseRandom(index, lastIndex), value = array[rand];
              array[rand] = array[index];
              array[index] = value;
            }
            array.length = size;
            return array;
          }
          var stringToPath = memoizeCapped((function(string) {
            var result = [];
            if (string.charCodeAt(0) === 46) {
              result.push("");
            }
            string.replace(rePropName, (function(match, number, quote, subString) {
              result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
            }));
            return result;
          }));
          function toKey(value) {
            if (typeof value == "string" || isSymbol(value)) {
              return value;
            }
            var result = value + "";
            return result == "0" && 1 / value == -INFINITY ? "-0" : result;
          }
          function toSource(func) {
            if (func != null) {
              try {
                return funcToString.call(func);
              } catch (e) {}
              try {
                return func + "";
              } catch (e) {}
            }
            return "";
          }
          function updateWrapDetails(details, bitmask) {
            arrayEach(wrapFlags, (function(pair) {
              var value = "_." + pair[0];
              if (bitmask & pair[1] && !arrayIncludes(details, value)) {
                details.push(value);
              }
            }));
            return details.sort();
          }
          function wrapperClone(wrapper) {
            if (wrapper instanceof LazyWrapper) {
              return wrapper.clone();
            }
            var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
            result.__actions__ = copyArray(wrapper.__actions__);
            result.__index__ = wrapper.__index__;
            result.__values__ = wrapper.__values__;
            return result;
          }
          function chunk(array, size, guard) {
            if (guard ? isIterateeCall(array, size, guard) : size === undefined) {
              size = 1;
            } else {
              size = nativeMax(toInteger(size), 0);
            }
            var length = array == null ? 0 : array.length;
            if (!length || size < 1) {
              return [];
            }
            var index = 0, resIndex = 0, result = Array(nativeCeil(length / size));
            while (index < length) {
              result[resIndex++] = baseSlice(array, index, index += size);
            }
            return result;
          }
          function compact(array) {
            var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
            while (++index < length) {
              var value = array[index];
              if (value) {
                result[resIndex++] = value;
              }
            }
            return result;
          }
          function concat() {
            var length = arguments.length;
            if (!length) {
              return [];
            }
            var args = Array(length - 1), array = arguments[0], index = length;
            while (index--) {
              args[index - 1] = arguments[index];
            }
            return arrayPush(isArray(array) ? copyArray(array) : [ array ], baseFlatten(args, 1));
          }
          var difference = baseRest((function(array, values) {
            return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : [];
          }));
          var differenceBy = baseRest((function(array, values) {
            var iteratee = last(values);
            if (isArrayLikeObject(iteratee)) {
              iteratee = undefined;
            }
            return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : [];
          }));
          var differenceWith = baseRest((function(array, values) {
            var comparator = last(values);
            if (isArrayLikeObject(comparator)) {
              comparator = undefined;
            }
            return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : [];
          }));
          function drop(array, n, guard) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return [];
            }
            n = guard || n === undefined ? 1 : toInteger(n);
            return baseSlice(array, n < 0 ? 0 : n, length);
          }
          function dropRight(array, n, guard) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return [];
            }
            n = guard || n === undefined ? 1 : toInteger(n);
            n = length - n;
            return baseSlice(array, 0, n < 0 ? 0 : n);
          }
          function dropRightWhile(array, predicate) {
            return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
          }
          function dropWhile(array, predicate) {
            return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
          }
          function fill(array, value, start, end) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return [];
            }
            if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
              start = 0;
              end = length;
            }
            return baseFill(array, value, start, end);
          }
          function findIndex(array, predicate, fromIndex) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return -1;
            }
            var index = fromIndex == null ? 0 : toInteger(fromIndex);
            if (index < 0) {
              index = nativeMax(length + index, 0);
            }
            return baseFindIndex(array, getIteratee(predicate, 3), index);
          }
          function findLastIndex(array, predicate, fromIndex) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return -1;
            }
            var index = length - 1;
            if (fromIndex !== undefined) {
              index = toInteger(fromIndex);
              index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
            }
            return baseFindIndex(array, getIteratee(predicate, 3), index, true);
          }
          function flatten(array) {
            var length = array == null ? 0 : array.length;
            return length ? baseFlatten(array, 1) : [];
          }
          function flattenDeep(array) {
            var length = array == null ? 0 : array.length;
            return length ? baseFlatten(array, INFINITY) : [];
          }
          function flattenDepth(array, depth) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return [];
            }
            depth = depth === undefined ? 1 : toInteger(depth);
            return baseFlatten(array, depth);
          }
          function fromPairs(pairs) {
            var index = -1, length = pairs == null ? 0 : pairs.length, result = {};
            while (++index < length) {
              var pair = pairs[index];
              result[pair[0]] = pair[1];
            }
            return result;
          }
          function head(array) {
            return array && array.length ? array[0] : undefined;
          }
          function indexOf(array, value, fromIndex) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return -1;
            }
            var index = fromIndex == null ? 0 : toInteger(fromIndex);
            if (index < 0) {
              index = nativeMax(length + index, 0);
            }
            return baseIndexOf(array, value, index);
          }
          function initial(array) {
            var length = array == null ? 0 : array.length;
            return length ? baseSlice(array, 0, -1) : [];
          }
          var intersection = baseRest((function(arrays) {
            var mapped = arrayMap(arrays, castArrayLikeObject);
            return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
          }));
          var intersectionBy = baseRest((function(arrays) {
            var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
            if (iteratee === last(mapped)) {
              iteratee = undefined;
            } else {
              mapped.pop();
            }
            return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee, 2)) : [];
          }));
          var intersectionWith = baseRest((function(arrays) {
            var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
            comparator = typeof comparator == "function" ? comparator : undefined;
            if (comparator) {
              mapped.pop();
            }
            return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined, comparator) : [];
          }));
          function join(array, separator) {
            return array == null ? "" : nativeJoin.call(array, separator);
          }
          function last(array) {
            var length = array == null ? 0 : array.length;
            return length ? array[length - 1] : undefined;
          }
          function lastIndexOf(array, value, fromIndex) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return -1;
            }
            var index = length;
            if (fromIndex !== undefined) {
              index = toInteger(fromIndex);
              index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
            }
            return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
          }
          function nth(array, n) {
            return array && array.length ? baseNth(array, toInteger(n)) : undefined;
          }
          var pull = baseRest(pullAll);
          function pullAll(array, values) {
            return array && array.length && values && values.length ? basePullAll(array, values) : array;
          }
          function pullAllBy(array, values, iteratee) {
            return array && array.length && values && values.length ? basePullAll(array, values, getIteratee(iteratee, 2)) : array;
          }
          function pullAllWith(array, values, comparator) {
            return array && array.length && values && values.length ? basePullAll(array, values, undefined, comparator) : array;
          }
          var pullAt = flatRest((function(array, indexes) {
            var length = array == null ? 0 : array.length, result = baseAt(array, indexes);
            basePullAt(array, arrayMap(indexes, (function(index) {
              return isIndex(index, length) ? +index : index;
            })).sort(compareAscending));
            return result;
          }));
          function remove(array, predicate) {
            var result = [];
            if (!(array && array.length)) {
              return result;
            }
            var index = -1, indexes = [], length = array.length;
            predicate = getIteratee(predicate, 3);
            while (++index < length) {
              var value = array[index];
              if (predicate(value, index, array)) {
                result.push(value);
                indexes.push(index);
              }
            }
            basePullAt(array, indexes);
            return result;
          }
          function reverse(array) {
            return array == null ? array : nativeReverse.call(array);
          }
          function slice(array, start, end) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return [];
            }
            if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
              start = 0;
              end = length;
            } else {
              start = start == null ? 0 : toInteger(start);
              end = end === undefined ? length : toInteger(end);
            }
            return baseSlice(array, start, end);
          }
          function sortedIndex(array, value) {
            return baseSortedIndex(array, value);
          }
          function sortedIndexBy(array, value, iteratee) {
            return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
          }
          function sortedIndexOf(array, value) {
            var length = array == null ? 0 : array.length;
            if (length) {
              var index = baseSortedIndex(array, value);
              if (index < length && eq(array[index], value)) {
                return index;
              }
            }
            return -1;
          }
          function sortedLastIndex(array, value) {
            return baseSortedIndex(array, value, true);
          }
          function sortedLastIndexBy(array, value, iteratee) {
            return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
          }
          function sortedLastIndexOf(array, value) {
            var length = array == null ? 0 : array.length;
            if (length) {
              var index = baseSortedIndex(array, value, true) - 1;
              if (eq(array[index], value)) {
                return index;
              }
            }
            return -1;
          }
          function sortedUniq(array) {
            return array && array.length ? baseSortedUniq(array) : [];
          }
          function sortedUniqBy(array, iteratee) {
            return array && array.length ? baseSortedUniq(array, getIteratee(iteratee, 2)) : [];
          }
          function tail(array) {
            var length = array == null ? 0 : array.length;
            return length ? baseSlice(array, 1, length) : [];
          }
          function take(array, n, guard) {
            if (!(array && array.length)) {
              return [];
            }
            n = guard || n === undefined ? 1 : toInteger(n);
            return baseSlice(array, 0, n < 0 ? 0 : n);
          }
          function takeRight(array, n, guard) {
            var length = array == null ? 0 : array.length;
            if (!length) {
              return [];
            }
            n = guard || n === undefined ? 1 : toInteger(n);
            n = length - n;
            return baseSlice(array, n < 0 ? 0 : n, length);
          }
          function takeRightWhile(array, predicate) {
            return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
          }
          function takeWhile(array, predicate) {
            return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
          }
          var union = baseRest((function(arrays) {
            return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
          }));
          var unionBy = baseRest((function(arrays) {
            var iteratee = last(arrays);
            if (isArrayLikeObject(iteratee)) {
              iteratee = undefined;
            }
            return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
          }));
          var unionWith = baseRest((function(arrays) {
            var comparator = last(arrays);
            comparator = typeof comparator == "function" ? comparator : undefined;
            return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
          }));
          function uniq(array) {
            return array && array.length ? baseUniq(array) : [];
          }
          function uniqBy(array, iteratee) {
            return array && array.length ? baseUniq(array, getIteratee(iteratee, 2)) : [];
          }
          function uniqWith(array, comparator) {
            comparator = typeof comparator == "function" ? comparator : undefined;
            return array && array.length ? baseUniq(array, undefined, comparator) : [];
          }
          function unzip(array) {
            if (!(array && array.length)) {
              return [];
            }
            var length = 0;
            array = arrayFilter(array, (function(group) {
              if (isArrayLikeObject(group)) {
                length = nativeMax(group.length, length);
                return true;
              }
            }));
            return baseTimes(length, (function(index) {
              return arrayMap(array, baseProperty(index));
            }));
          }
          function unzipWith(array, iteratee) {
            if (!(array && array.length)) {
              return [];
            }
            var result = unzip(array);
            if (iteratee == null) {
              return result;
            }
            return arrayMap(result, (function(group) {
              return apply(iteratee, undefined, group);
            }));
          }
          var without = baseRest((function(array, values) {
            return isArrayLikeObject(array) ? baseDifference(array, values) : [];
          }));
          var xor = baseRest((function(arrays) {
            return baseXor(arrayFilter(arrays, isArrayLikeObject));
          }));
          var xorBy = baseRest((function(arrays) {
            var iteratee = last(arrays);
            if (isArrayLikeObject(iteratee)) {
              iteratee = undefined;
            }
            return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
          }));
          var xorWith = baseRest((function(arrays) {
            var comparator = last(arrays);
            comparator = typeof comparator == "function" ? comparator : undefined;
            return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
          }));
          var zip = baseRest(unzip);
          function zipObject(props, values) {
            return baseZipObject(props || [], values || [], assignValue);
          }
          function zipObjectDeep(props, values) {
            return baseZipObject(props || [], values || [], baseSet);
          }
          var zipWith = baseRest((function(arrays) {
            var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined;
            iteratee = typeof iteratee == "function" ? (arrays.pop(), iteratee) : undefined;
            return unzipWith(arrays, iteratee);
          }));
          function chain(value) {
            var result = lodash(value);
            result.__chain__ = true;
            return result;
          }
          function tap(value, interceptor) {
            interceptor(value);
            return value;
          }
          function thru(value, interceptor) {
            return interceptor(value);
          }
          var wrapperAt = flatRest((function(paths) {
            var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
              return baseAt(object, paths);
            };
            if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
              return this.thru(interceptor);
            }
            value = value.slice(start, +start + (length ? 1 : 0));
            value.__actions__.push({
              func: thru,
              args: [ interceptor ],
              thisArg: undefined
            });
            return new LodashWrapper(value, this.__chain__).thru((function(array) {
              if (length && !array.length) {
                array.push(undefined);
              }
              return array;
            }));
          }));
          function wrapperChain() {
            return chain(this);
          }
          function wrapperCommit() {
            return new LodashWrapper(this.value(), this.__chain__);
          }
          function wrapperNext() {
            if (this.__values__ === undefined) {
              this.__values__ = toArray(this.value());
            }
            var done = this.__index__ >= this.__values__.length, value = done ? undefined : this.__values__[this.__index__++];
            return {
              done,
              value
            };
          }
          function wrapperToIterator() {
            return this;
          }
          function wrapperPlant(value) {
            var result, parent = this;
            while (parent instanceof baseLodash) {
              var clone = wrapperClone(parent);
              clone.__index__ = 0;
              clone.__values__ = undefined;
              if (result) {
                previous.__wrapped__ = clone;
              } else {
                result = clone;
              }
              var previous = clone;
              parent = parent.__wrapped__;
            }
            previous.__wrapped__ = value;
            return result;
          }
          function wrapperReverse() {
            var value = this.__wrapped__;
            if (value instanceof LazyWrapper) {
              var wrapped = value;
              if (this.__actions__.length) {
                wrapped = new LazyWrapper(this);
              }
              wrapped = wrapped.reverse();
              wrapped.__actions__.push({
                func: thru,
                args: [ reverse ],
                thisArg: undefined
              });
              return new LodashWrapper(wrapped, this.__chain__);
            }
            return this.thru(reverse);
          }
          function wrapperValue() {
            return baseWrapperValue(this.__wrapped__, this.__actions__);
          }
          var countBy = createAggregator((function(result, value, key) {
            if (hasOwnProperty.call(result, key)) {
              ++result[key];
            } else {
              baseAssignValue(result, key, 1);
            }
          }));
          function every(collection, predicate, guard) {
            var func = isArray(collection) ? arrayEvery : baseEvery;
            if (guard && isIterateeCall(collection, predicate, guard)) {
              predicate = undefined;
            }
            return func(collection, getIteratee(predicate, 3));
          }
          function filter(collection, predicate) {
            var func = isArray(collection) ? arrayFilter : baseFilter;
            return func(collection, getIteratee(predicate, 3));
          }
          var find = createFind(findIndex);
          var findLast = createFind(findLastIndex);
          function flatMap(collection, iteratee) {
            return baseFlatten(map(collection, iteratee), 1);
          }
          function flatMapDeep(collection, iteratee) {
            return baseFlatten(map(collection, iteratee), INFINITY);
          }
          function flatMapDepth(collection, iteratee, depth) {
            depth = depth === undefined ? 1 : toInteger(depth);
            return baseFlatten(map(collection, iteratee), depth);
          }
          function forEach(collection, iteratee) {
            var func = isArray(collection) ? arrayEach : baseEach;
            return func(collection, getIteratee(iteratee, 3));
          }
          function forEachRight(collection, iteratee) {
            var func = isArray(collection) ? arrayEachRight : baseEachRight;
            return func(collection, getIteratee(iteratee, 3));
          }
          var groupBy = createAggregator((function(result, value, key) {
            if (hasOwnProperty.call(result, key)) {
              result[key].push(value);
            } else {
              baseAssignValue(result, key, [ value ]);
            }
          }));
          function includes(collection, value, fromIndex, guard) {
            collection = isArrayLike(collection) ? collection : values(collection);
            fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
            var length = collection.length;
            if (fromIndex < 0) {
              fromIndex = nativeMax(length + fromIndex, 0);
            }
            return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
          }
          var invokeMap = baseRest((function(collection, path, args) {
            var index = -1, isFunc = typeof path == "function", result = isArrayLike(collection) ? Array(collection.length) : [];
            baseEach(collection, (function(value) {
              result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
            }));
            return result;
          }));
          var keyBy = createAggregator((function(result, value, key) {
            baseAssignValue(result, key, value);
          }));
          function map(collection, iteratee) {
            var func = isArray(collection) ? arrayMap : baseMap;
            return func(collection, getIteratee(iteratee, 3));
          }
          function orderBy(collection, iteratees, orders, guard) {
            if (collection == null) {
              return [];
            }
            if (!isArray(iteratees)) {
              iteratees = iteratees == null ? [] : [ iteratees ];
            }
            orders = guard ? undefined : orders;
            if (!isArray(orders)) {
              orders = orders == null ? [] : [ orders ];
            }
            return baseOrderBy(collection, iteratees, orders);
          }
          var partition = createAggregator((function(result, value, key) {
            result[key ? 0 : 1].push(value);
          }), (function() {
            return [ [], [] ];
          }));
          function reduce(collection, iteratee, accumulator) {
            var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
            return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
          }
          function reduceRight(collection, iteratee, accumulator) {
            var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
            return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
          }
          function reject(collection, predicate) {
            var func = isArray(collection) ? arrayFilter : baseFilter;
            return func(collection, negate(getIteratee(predicate, 3)));
          }
          function sample(collection) {
            var func = isArray(collection) ? arraySample : baseSample;
            return func(collection);
          }
          function sampleSize(collection, n, guard) {
            if (guard ? isIterateeCall(collection, n, guard) : n === undefined) {
              n = 1;
            } else {
              n = toInteger(n);
            }
            var func = isArray(collection) ? arraySampleSize : baseSampleSize;
            return func(collection, n);
          }
          function shuffle(collection) {
            var func = isArray(collection) ? arrayShuffle : baseShuffle;
            return func(collection);
          }
          function size(collection) {
            if (collection == null) {
              return 0;
            }
            if (isArrayLike(collection)) {
              return isString(collection) ? stringSize(collection) : collection.length;
            }
            var tag = getTag(collection);
            if (tag == mapTag || tag == setTag) {
              return collection.size;
            }
            return baseKeys(collection).length;
          }
          function some(collection, predicate, guard) {
            var func = isArray(collection) ? arraySome : baseSome;
            if (guard && isIterateeCall(collection, predicate, guard)) {
              predicate = undefined;
            }
            return func(collection, getIteratee(predicate, 3));
          }
          var sortBy = baseRest((function(collection, iteratees) {
            if (collection == null) {
              return [];
            }
            var length = iteratees.length;
            if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
              iteratees = [];
            } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
              iteratees = [ iteratees[0] ];
            }
            return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
          }));
          var now = ctxNow || function() {
            return root.Date.now();
          };
          function after(n, func) {
            if (typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            n = toInteger(n);
            return function() {
              if (--n < 1) {
                return func.apply(this, arguments);
              }
            };
          }
          function ary(func, n, guard) {
            n = guard ? undefined : n;
            n = func && n == null ? func.length : n;
            return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
          }
          function before(n, func) {
            var result;
            if (typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            n = toInteger(n);
            return function() {
              if (--n > 0) {
                result = func.apply(this, arguments);
              }
              if (n <= 1) {
                func = undefined;
              }
              return result;
            };
          }
          var bind = baseRest((function(func, thisArg, partials) {
            var bitmask = WRAP_BIND_FLAG;
            if (partials.length) {
              var holders = replaceHolders(partials, getHolder(bind));
              bitmask |= WRAP_PARTIAL_FLAG;
            }
            return createWrap(func, bitmask, thisArg, partials, holders);
          }));
          var bindKey = baseRest((function(object, key, partials) {
            var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
            if (partials.length) {
              var holders = replaceHolders(partials, getHolder(bindKey));
              bitmask |= WRAP_PARTIAL_FLAG;
            }
            return createWrap(key, bitmask, object, partials, holders);
          }));
          function curry(func, arity, guard) {
            arity = guard ? undefined : arity;
            var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
            result.placeholder = curry.placeholder;
            return result;
          }
          function curryRight(func, arity, guard) {
            arity = guard ? undefined : arity;
            var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
            result.placeholder = curryRight.placeholder;
            return result;
          }
          function debounce(func, wait, options) {
            var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
            if (typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            wait = toNumber(wait) || 0;
            if (isObject(options)) {
              leading = !!options.leading;
              maxing = "maxWait" in options;
              maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
              trailing = "trailing" in options ? !!options.trailing : trailing;
            }
            function invokeFunc(time) {
              var args = lastArgs, thisArg = lastThis;
              lastArgs = lastThis = undefined;
              lastInvokeTime = time;
              result = func.apply(thisArg, args);
              return result;
            }
            function leadingEdge(time) {
              lastInvokeTime = time;
              timerId = setTimeout(timerExpired, wait);
              return leading ? invokeFunc(time) : result;
            }
            function remainingWait(time) {
              var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
              return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
            }
            function shouldInvoke(time) {
              var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
              return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
            }
            function timerExpired() {
              var time = now();
              if (shouldInvoke(time)) {
                return trailingEdge(time);
              }
              timerId = setTimeout(timerExpired, remainingWait(time));
            }
            function trailingEdge(time) {
              timerId = undefined;
              if (trailing && lastArgs) {
                return invokeFunc(time);
              }
              lastArgs = lastThis = undefined;
              return result;
            }
            function cancel() {
              if (timerId !== undefined) {
                clearTimeout(timerId);
              }
              lastInvokeTime = 0;
              lastArgs = lastCallTime = lastThis = timerId = undefined;
            }
            function flush() {
              return timerId === undefined ? result : trailingEdge(now());
            }
            function debounced() {
              var time = now(), isInvoking = shouldInvoke(time);
              lastArgs = arguments;
              lastThis = this;
              lastCallTime = time;
              if (isInvoking) {
                if (timerId === undefined) {
                  return leadingEdge(lastCallTime);
                }
                if (maxing) {
                  clearTimeout(timerId);
                  timerId = setTimeout(timerExpired, wait);
                  return invokeFunc(lastCallTime);
                }
              }
              if (timerId === undefined) {
                timerId = setTimeout(timerExpired, wait);
              }
              return result;
            }
            debounced.cancel = cancel;
            debounced.flush = flush;
            return debounced;
          }
          var defer = baseRest((function(func, args) {
            return baseDelay(func, 1, args);
          }));
          var delay = baseRest((function(func, wait, args) {
            return baseDelay(func, toNumber(wait) || 0, args);
          }));
          function flip(func) {
            return createWrap(func, WRAP_FLIP_FLAG);
          }
          function memoize(func, resolver) {
            if (typeof func != "function" || resolver != null && typeof resolver != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            var memoized = function() {
              var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
              if (cache.has(key)) {
                return cache.get(key);
              }
              var result = func.apply(this, args);
              memoized.cache = cache.set(key, result) || cache;
              return result;
            };
            memoized.cache = new (memoize.Cache || MapCache);
            return memoized;
          }
          memoize.Cache = MapCache;
          function negate(predicate) {
            if (typeof predicate != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            return function() {
              var args = arguments;
              switch (args.length) {
               case 0:
                return !predicate.call(this);

               case 1:
                return !predicate.call(this, args[0]);

               case 2:
                return !predicate.call(this, args[0], args[1]);

               case 3:
                return !predicate.call(this, args[0], args[1], args[2]);
              }
              return !predicate.apply(this, args);
            };
          }
          function once(func) {
            return before(2, func);
          }
          var overArgs = castRest((function(func, transforms) {
            transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
            var funcsLength = transforms.length;
            return baseRest((function(args) {
              var index = -1, length = nativeMin(args.length, funcsLength);
              while (++index < length) {
                args[index] = transforms[index].call(this, args[index]);
              }
              return apply(func, this, args);
            }));
          }));
          var partial = baseRest((function(func, partials) {
            var holders = replaceHolders(partials, getHolder(partial));
            return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
          }));
          var partialRight = baseRest((function(func, partials) {
            var holders = replaceHolders(partials, getHolder(partialRight));
            return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
          }));
          var rearg = flatRest((function(func, indexes) {
            return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
          }));
          function rest(func, start) {
            if (typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            start = start === undefined ? start : toInteger(start);
            return baseRest(func, start);
          }
          function spread(func, start) {
            if (typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            start = start == null ? 0 : nativeMax(toInteger(start), 0);
            return baseRest((function(args) {
              var array = args[start], otherArgs = castSlice(args, 0, start);
              if (array) {
                arrayPush(otherArgs, array);
              }
              return apply(func, this, otherArgs);
            }));
          }
          function throttle(func, wait, options) {
            var leading = true, trailing = true;
            if (typeof func != "function") {
              throw new TypeError(FUNC_ERROR_TEXT);
            }
            if (isObject(options)) {
              leading = "leading" in options ? !!options.leading : leading;
              trailing = "trailing" in options ? !!options.trailing : trailing;
            }
            return debounce(func, wait, {
              leading,
              maxWait: wait,
              trailing
            });
          }
          function unary(func) {
            return ary(func, 1);
          }
          function wrap(value, wrapper) {
            return partial(castFunction(wrapper), value);
          }
          function castArray() {
            if (!arguments.length) {
              return [];
            }
            var value = arguments[0];
            return isArray(value) ? value : [ value ];
          }
          function clone(value) {
            return baseClone(value, CLONE_SYMBOLS_FLAG);
          }
          function cloneWith(value, customizer) {
            customizer = typeof customizer == "function" ? customizer : undefined;
            return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
          }
          function cloneDeep(value) {
            return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
          }
          function cloneDeepWith(value, customizer) {
            customizer = typeof customizer == "function" ? customizer : undefined;
            return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
          }
          function conformsTo(object, source) {
            return source == null || baseConformsTo(object, source, keys(source));
          }
          function eq(value, other) {
            return value === other || value !== value && other !== other;
          }
          var gt = createRelationalOperation(baseGt);
          var gte = createRelationalOperation((function(value, other) {
            return value >= other;
          }));
          var isArguments = baseIsArguments(function() {
            return arguments;
          }()) ? baseIsArguments : function(value) {
            return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
          };
          var isArray = Array.isArray;
          var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
          function isArrayLike(value) {
            return value != null && isLength(value.length) && !isFunction(value);
          }
          function isArrayLikeObject(value) {
            return isObjectLike(value) && isArrayLike(value);
          }
          function isBoolean(value) {
            return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
          }
          var isBuffer = nativeIsBuffer || stubFalse;
          var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
          function isElement(value) {
            return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
          }
          function isEmpty(value) {
            if (value == null) {
              return true;
            }
            if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
              return !value.length;
            }
            var tag = getTag(value);
            if (tag == mapTag || tag == setTag) {
              return !value.size;
            }
            if (isPrototype(value)) {
              return !baseKeys(value).length;
            }
            for (var key in value) {
              if (hasOwnProperty.call(value, key)) {
                return false;
              }
            }
            return true;
          }
          function isEqual(value, other) {
            return baseIsEqual(value, other);
          }
          function isEqualWith(value, other, customizer) {
            customizer = typeof customizer == "function" ? customizer : undefined;
            var result = customizer ? customizer(value, other) : undefined;
            return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
          }
          function isError(value) {
            if (!isObjectLike(value)) {
              return false;
            }
            var tag = baseGetTag(value);
            return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
          }
          function isFinite(value) {
            return typeof value == "number" && nativeIsFinite(value);
          }
          function isFunction(value) {
            if (!isObject(value)) {
              return false;
            }
            var tag = baseGetTag(value);
            return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
          }
          function isInteger(value) {
            return typeof value == "number" && value == toInteger(value);
          }
          function isLength(value) {
            return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
          }
          function isObject(value) {
            var type = typeof value;
            return value != null && (type == "object" || type == "function");
          }
          function isObjectLike(value) {
            return value != null && typeof value == "object";
          }
          var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
          function isMatch(object, source) {
            return object === source || baseIsMatch(object, source, getMatchData(source));
          }
          function isMatchWith(object, source, customizer) {
            customizer = typeof customizer == "function" ? customizer : undefined;
            return baseIsMatch(object, source, getMatchData(source), customizer);
          }
          function isNaN(value) {
            return isNumber(value) && value != +value;
          }
          function isNative(value) {
            if (isMaskable(value)) {
              throw new Error(CORE_ERROR_TEXT);
            }
            return baseIsNative(value);
          }
          function isNull(value) {
            return value === null;
          }
          function isNil(value) {
            return value == null;
          }
          function isNumber(value) {
            return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
          }
          function isPlainObject(value) {
            if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
              return false;
            }
            var proto = getPrototype(value);
            if (proto === null) {
              return true;
            }
            var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
            return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
          }
          var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
          function isSafeInteger(value) {
            return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
          }
          var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
          function isString(value) {
            return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
          }
          function isSymbol(value) {
            return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
          }
          var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
          function isUndefined(value) {
            return value === undefined;
          }
          function isWeakMap(value) {
            return isObjectLike(value) && getTag(value) == weakMapTag;
          }
          function isWeakSet(value) {
            return isObjectLike(value) && baseGetTag(value) == weakSetTag;
          }
          var lt = createRelationalOperation(baseLt);
          var lte = createRelationalOperation((function(value, other) {
            return value <= other;
          }));
          function toArray(value) {
            if (!value) {
              return [];
            }
            if (isArrayLike(value)) {
              return isString(value) ? stringToArray(value) : copyArray(value);
            }
            if (symIterator && value[symIterator]) {
              return iteratorToArray(value[symIterator]());
            }
            var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
            return func(value);
          }
          function toFinite(value) {
            if (!value) {
              return value === 0 ? value : 0;
            }
            value = toNumber(value);
            if (value === INFINITY || value === -INFINITY) {
              var sign = value < 0 ? -1 : 1;
              return sign * MAX_INTEGER;
            }
            return value === value ? value : 0;
          }
          function toInteger(value) {
            var result = toFinite(value), remainder = result % 1;
            return result === result ? remainder ? result - remainder : result : 0;
          }
          function toLength(value) {
            return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
          }
          function toNumber(value) {
            if (typeof value == "number") {
              return value;
            }
            if (isSymbol(value)) {
              return NAN;
            }
            if (isObject(value)) {
              var other = typeof value.valueOf == "function" ? value.valueOf() : value;
              value = isObject(other) ? other + "" : other;
            }
            if (typeof value != "string") {
              return value === 0 ? value : +value;
            }
            value = baseTrim(value);
            var isBinary = reIsBinary.test(value);
            return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
          }
          function toPlainObject(value) {
            return copyObject(value, keysIn(value));
          }
          function toSafeInteger(value) {
            return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
          }
          function toString(value) {
            return value == null ? "" : baseToString(value);
          }
          var assign = createAssigner((function(object, source) {
            if (isPrototype(source) || isArrayLike(source)) {
              copyObject(source, keys(source), object);
              return;
            }
            for (var key in source) {
              if (hasOwnProperty.call(source, key)) {
                assignValue(object, key, source[key]);
              }
            }
          }));
          var assignIn = createAssigner((function(object, source) {
            copyObject(source, keysIn(source), object);
          }));
          var assignInWith = createAssigner((function(object, source, srcIndex, customizer) {
            copyObject(source, keysIn(source), object, customizer);
          }));
          var assignWith = createAssigner((function(object, source, srcIndex, customizer) {
            copyObject(source, keys(source), object, customizer);
          }));
          var at = flatRest(baseAt);
          function create(prototype, properties) {
            var result = baseCreate(prototype);
            return properties == null ? result : baseAssign(result, properties);
          }
          var defaults = baseRest((function(object, sources) {
            object = Object(object);
            var index = -1;
            var length = sources.length;
            var guard = length > 2 ? sources[2] : undefined;
            if (guard && isIterateeCall(sources[0], sources[1], guard)) {
              length = 1;
            }
            while (++index < length) {
              var source = sources[index];
              var props = keysIn(source);
              var propsIndex = -1;
              var propsLength = props.length;
              while (++propsIndex < propsLength) {
                var key = props[propsIndex];
                var value = object[key];
                if (value === undefined || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
                  object[key] = source[key];
                }
              }
            }
            return object;
          }));
          var defaultsDeep = baseRest((function(args) {
            args.push(undefined, customDefaultsMerge);
            return apply(mergeWith, undefined, args);
          }));
          function findKey(object, predicate) {
            return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
          }
          function findLastKey(object, predicate) {
            return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
          }
          function forIn(object, iteratee) {
            return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn);
          }
          function forInRight(object, iteratee) {
            return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn);
          }
          function forOwn(object, iteratee) {
            return object && baseForOwn(object, getIteratee(iteratee, 3));
          }
          function forOwnRight(object, iteratee) {
            return object && baseForOwnRight(object, getIteratee(iteratee, 3));
          }
          function functions(object) {
            return object == null ? [] : baseFunctions(object, keys(object));
          }
          function functionsIn(object) {
            return object == null ? [] : baseFunctions(object, keysIn(object));
          }
          function get(object, path, defaultValue) {
            var result = object == null ? undefined : baseGet(object, path);
            return result === undefined ? defaultValue : result;
          }
          function has(object, path) {
            return object != null && hasPath(object, path, baseHas);
          }
          function hasIn(object, path) {
            return object != null && hasPath(object, path, baseHasIn);
          }
          var invert = createInverter((function(result, value, key) {
            if (value != null && typeof value.toString != "function") {
              value = nativeObjectToString.call(value);
            }
            result[value] = key;
          }), constant(identity));
          var invertBy = createInverter((function(result, value, key) {
            if (value != null && typeof value.toString != "function") {
              value = nativeObjectToString.call(value);
            }
            if (hasOwnProperty.call(result, value)) {
              result[value].push(key);
            } else {
              result[value] = [ key ];
            }
          }), getIteratee);
          var invoke = baseRest(baseInvoke);
          function keys(object) {
            return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
          }
          function keysIn(object) {
            return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
          }
          function mapKeys(object, iteratee) {
            var result = {};
            iteratee = getIteratee(iteratee, 3);
            baseForOwn(object, (function(value, key, object) {
              baseAssignValue(result, iteratee(value, key, object), value);
            }));
            return result;
          }
          function mapValues(object, iteratee) {
            var result = {};
            iteratee = getIteratee(iteratee, 3);
            baseForOwn(object, (function(value, key, object) {
              baseAssignValue(result, key, iteratee(value, key, object));
            }));
            return result;
          }
          var merge = createAssigner((function(object, source, srcIndex) {
            baseMerge(object, source, srcIndex);
          }));
          var mergeWith = createAssigner((function(object, source, srcIndex, customizer) {
            baseMerge(object, source, srcIndex, customizer);
          }));
          var omit = flatRest((function(object, paths) {
            var result = {};
            if (object == null) {
              return result;
            }
            var isDeep = false;
            paths = arrayMap(paths, (function(path) {
              path = castPath(path, object);
              isDeep || (isDeep = path.length > 1);
              return path;
            }));
            copyObject(object, getAllKeysIn(object), result);
            if (isDeep) {
              result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
            }
            var length = paths.length;
            while (length--) {
              baseUnset(result, paths[length]);
            }
            return result;
          }));
          function omitBy(object, predicate) {
            return pickBy(object, negate(getIteratee(predicate)));
          }
          var pick = flatRest((function(object, paths) {
            return object == null ? {} : basePick(object, paths);
          }));
          function pickBy(object, predicate) {
            if (object == null) {
              return {};
            }
            var props = arrayMap(getAllKeysIn(object), (function(prop) {
              return [ prop ];
            }));
            predicate = getIteratee(predicate);
            return basePickBy(object, props, (function(value, path) {
              return predicate(value, path[0]);
            }));
          }
          function result(object, path, defaultValue) {
            path = castPath(path, object);
            var index = -1, length = path.length;
            if (!length) {
              length = 1;
              object = undefined;
            }
            while (++index < length) {
              var value = object == null ? undefined : object[toKey(path[index])];
              if (value === undefined) {
                index = length;
                value = defaultValue;
              }
              object = isFunction(value) ? value.call(object) : value;
            }
            return object;
          }
          function set(object, path, value) {
            return object == null ? object : baseSet(object, path, value);
          }
          function setWith(object, path, value, customizer) {
            customizer = typeof customizer == "function" ? customizer : undefined;
            return object == null ? object : baseSet(object, path, value, customizer);
          }
          var toPairs = createToPairs(keys);
          var toPairsIn = createToPairs(keysIn);
          function transform(object, iteratee, accumulator) {
            var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
            iteratee = getIteratee(iteratee, 4);
            if (accumulator == null) {
              var Ctor = object && object.constructor;
              if (isArrLike) {
                accumulator = isArr ? new Ctor : [];
              } else if (isObject(object)) {
                accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
              } else {
                accumulator = {};
              }
            }
            (isArrLike ? arrayEach : baseForOwn)(object, (function(value, index, object) {
              return iteratee(accumulator, value, index, object);
            }));
            return accumulator;
          }
          function unset(object, path) {
            return object == null ? true : baseUnset(object, path);
          }
          function update(object, path, updater) {
            return object == null ? object : baseUpdate(object, path, castFunction(updater));
          }
          function updateWith(object, path, updater, customizer) {
            customizer = typeof customizer == "function" ? customizer : undefined;
            return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
          }
          function values(object) {
            return object == null ? [] : baseValues(object, keys(object));
          }
          function valuesIn(object) {
            return object == null ? [] : baseValues(object, keysIn(object));
          }
          function clamp(number, lower, upper) {
            if (upper === undefined) {
              upper = lower;
              lower = undefined;
            }
            if (upper !== undefined) {
              upper = toNumber(upper);
              upper = upper === upper ? upper : 0;
            }
            if (lower !== undefined) {
              lower = toNumber(lower);
              lower = lower === lower ? lower : 0;
            }
            return baseClamp(toNumber(number), lower, upper);
          }
          function inRange(number, start, end) {
            start = toFinite(start);
            if (end === undefined) {
              end = start;
              start = 0;
            } else {
              end = toFinite(end);
            }
            number = toNumber(number);
            return baseInRange(number, start, end);
          }
          function random(lower, upper, floating) {
            if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
              upper = floating = undefined;
            }
            if (floating === undefined) {
              if (typeof upper == "boolean") {
                floating = upper;
                upper = undefined;
              } else if (typeof lower == "boolean") {
                floating = lower;
                lower = undefined;
              }
            }
            if (lower === undefined && upper === undefined) {
              lower = 0;
              upper = 1;
            } else {
              lower = toFinite(lower);
              if (upper === undefined) {
                upper = lower;
                lower = 0;
              } else {
                upper = toFinite(upper);
              }
            }
            if (lower > upper) {
              var temp = lower;
              lower = upper;
              upper = temp;
            }
            if (floating || lower % 1 || upper % 1) {
              var rand = nativeRandom();
              return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
            }
            return baseRandom(lower, upper);
          }
          var camelCase = createCompounder((function(result, word, index) {
            word = word.toLowerCase();
            return result + (index ? capitalize(word) : word);
          }));
          function capitalize(string) {
            return upperFirst(toString(string).toLowerCase());
          }
          function deburr(string) {
            string = toString(string);
            return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
          }
          function endsWith(string, target, position) {
            string = toString(string);
            target = baseToString(target);
            var length = string.length;
            position = position === undefined ? length : baseClamp(toInteger(position), 0, length);
            var end = position;
            position -= target.length;
            return position >= 0 && string.slice(position, end) == target;
          }
          function escape(string) {
            string = toString(string);
            return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
          }
          function escapeRegExp(string) {
            string = toString(string);
            return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
          }
          var kebabCase = createCompounder((function(result, word, index) {
            return result + (index ? "-" : "") + word.toLowerCase();
          }));
          var lowerCase = createCompounder((function(result, word, index) {
            return result + (index ? " " : "") + word.toLowerCase();
          }));
          var lowerFirst = createCaseFirst("toLowerCase");
          function pad(string, length, chars) {
            string = toString(string);
            length = toInteger(length);
            var strLength = length ? stringSize(string) : 0;
            if (!length || strLength >= length) {
              return string;
            }
            var mid = (length - strLength) / 2;
            return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
          }
          function padEnd(string, length, chars) {
            string = toString(string);
            length = toInteger(length);
            var strLength = length ? stringSize(string) : 0;
            return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
          }
          function padStart(string, length, chars) {
            string = toString(string);
            length = toInteger(length);
            var strLength = length ? stringSize(string) : 0;
            return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
          }
          function parseInt(string, radix, guard) {
            if (guard || radix == null) {
              radix = 0;
            } else if (radix) {
              radix = +radix;
            }
            return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
          }
          function repeat(string, n, guard) {
            if (guard ? isIterateeCall(string, n, guard) : n === undefined) {
              n = 1;
            } else {
              n = toInteger(n);
            }
            return baseRepeat(toString(string), n);
          }
          function replace() {
            var args = arguments, string = toString(args[0]);
            return args.length < 3 ? string : string.replace(args[1], args[2]);
          }
          var snakeCase = createCompounder((function(result, word, index) {
            return result + (index ? "_" : "") + word.toLowerCase();
          }));
          function split(string, separator, limit) {
            if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
              separator = limit = undefined;
            }
            limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
            if (!limit) {
              return [];
            }
            string = toString(string);
            if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
              separator = baseToString(separator);
              if (!separator && hasUnicode(string)) {
                return castSlice(stringToArray(string), 0, limit);
              }
            }
            return string.split(separator, limit);
          }
          var startCase = createCompounder((function(result, word, index) {
            return result + (index ? " " : "") + upperFirst(word);
          }));
          function startsWith(string, target, position) {
            string = toString(string);
            position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
            target = baseToString(target);
            return string.slice(position, position + target.length) == target;
          }
          function template(string, options, guard) {
            var settings = lodash.templateSettings;
            if (guard && isIterateeCall(string, options, guard)) {
              options = undefined;
            }
            string = toString(string);
            options = assignInWith({}, options, settings, customDefaultsAssignIn);
            var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
            var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
            var reDelimiters = RegExp((options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", "g");
            var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
            string.replace(reDelimiters, (function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
              interpolateValue || (interpolateValue = esTemplateValue);
              source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
              if (escapeValue) {
                isEscaping = true;
                source += "' +\n__e(" + escapeValue + ") +\n'";
              }
              if (evaluateValue) {
                isEvaluating = true;
                source += "';\n" + evaluateValue + ";\n__p += '";
              }
              if (interpolateValue) {
                source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
              }
              index = offset + match.length;
              return match;
            }));
            source += "';\n";
            var variable = hasOwnProperty.call(options, "variable") && options.variable;
            if (!variable) {
              source = "with (obj) {\n" + source + "\n}\n";
            } else if (reForbiddenIdentifierChars.test(variable)) {
              throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
            }
            source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
            source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\n" + "function print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
            var result = attempt((function() {
              return Function(importsKeys, sourceURL + "return " + source).apply(undefined, importsValues);
            }));
            result.source = source;
            if (isError(result)) {
              throw result;
            }
            return result;
          }
          function toLower(value) {
            return toString(value).toLowerCase();
          }
          function toUpper(value) {
            return toString(value).toUpperCase();
          }
          function trim(string, chars, guard) {
            string = toString(string);
            if (string && (guard || chars === undefined)) {
              return baseTrim(string);
            }
            if (!string || !(chars = baseToString(chars))) {
              return string;
            }
            var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
            return castSlice(strSymbols, start, end).join("");
          }
          function trimEnd(string, chars, guard) {
            string = toString(string);
            if (string && (guard || chars === undefined)) {
              return string.slice(0, trimmedEndIndex(string) + 1);
            }
            if (!string || !(chars = baseToString(chars))) {
              return string;
            }
            var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
            return castSlice(strSymbols, 0, end).join("");
          }
          function trimStart(string, chars, guard) {
            string = toString(string);
            if (string && (guard || chars === undefined)) {
              return string.replace(reTrimStart, "");
            }
            if (!string || !(chars = baseToString(chars))) {
              return string;
            }
            var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
            return castSlice(strSymbols, start).join("");
          }
          function truncate(string, options) {
            var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
            if (isObject(options)) {
              var separator = "separator" in options ? options.separator : separator;
              length = "length" in options ? toInteger(options.length) : length;
              omission = "omission" in options ? baseToString(options.omission) : omission;
            }
            string = toString(string);
            var strLength = string.length;
            if (hasUnicode(string)) {
              var strSymbols = stringToArray(string);
              strLength = strSymbols.length;
            }
            if (length >= strLength) {
              return string;
            }
            var end = length - stringSize(omission);
            if (end < 1) {
              return omission;
            }
            var result = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
            if (separator === undefined) {
              return result + omission;
            }
            if (strSymbols) {
              end += result.length - end;
            }
            if (isRegExp(separator)) {
              if (string.slice(end).search(separator)) {
                var match, substring = result;
                if (!separator.global) {
                  separator = RegExp(separator.source, toString(reFlags.exec(separator)) + "g");
                }
                separator.lastIndex = 0;
                while (match = separator.exec(substring)) {
                  var newEnd = match.index;
                }
                result = result.slice(0, newEnd === undefined ? end : newEnd);
              }
            } else if (string.indexOf(baseToString(separator), end) != end) {
              var index = result.lastIndexOf(separator);
              if (index > -1) {
                result = result.slice(0, index);
              }
            }
            return result + omission;
          }
          function unescape(string) {
            string = toString(string);
            return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
          }
          var upperCase = createCompounder((function(result, word, index) {
            return result + (index ? " " : "") + word.toUpperCase();
          }));
          var upperFirst = createCaseFirst("toUpperCase");
          function words(string, pattern, guard) {
            string = toString(string);
            pattern = guard ? undefined : pattern;
            if (pattern === undefined) {
              return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
            }
            return string.match(pattern) || [];
          }
          var attempt = baseRest((function(func, args) {
            try {
              return apply(func, undefined, args);
            } catch (e) {
              return isError(e) ? e : new Error(e);
            }
          }));
          var bindAll = flatRest((function(object, methodNames) {
            arrayEach(methodNames, (function(key) {
              key = toKey(key);
              baseAssignValue(object, key, bind(object[key], object));
            }));
            return object;
          }));
          function cond(pairs) {
            var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
            pairs = !length ? [] : arrayMap(pairs, (function(pair) {
              if (typeof pair[1] != "function") {
                throw new TypeError(FUNC_ERROR_TEXT);
              }
              return [ toIteratee(pair[0]), pair[1] ];
            }));
            return baseRest((function(args) {
              var index = -1;
              while (++index < length) {
                var pair = pairs[index];
                if (apply(pair[0], this, args)) {
                  return apply(pair[1], this, args);
                }
              }
            }));
          }
          function conforms(source) {
            return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
          }
          function constant(value) {
            return function() {
              return value;
            };
          }
          function defaultTo(value, defaultValue) {
            return value == null || value !== value ? defaultValue : value;
          }
          var flow = createFlow();
          var flowRight = createFlow(true);
          function identity(value) {
            return value;
          }
          function iteratee(func) {
            return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
          }
          function matches(source) {
            return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
          }
          function matchesProperty(path, srcValue) {
            return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
          }
          var method = baseRest((function(path, args) {
            return function(object) {
              return baseInvoke(object, path, args);
            };
          }));
          var methodOf = baseRest((function(object, args) {
            return function(path) {
              return baseInvoke(object, path, args);
            };
          }));
          function mixin(object, source, options) {
            var props = keys(source), methodNames = baseFunctions(source, props);
            if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
              options = source;
              source = object;
              object = this;
              methodNames = baseFunctions(source, keys(source));
            }
            var chain = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
            arrayEach(methodNames, (function(methodName) {
              var func = source[methodName];
              object[methodName] = func;
              if (isFunc) {
                object.prototype[methodName] = function() {
                  var chainAll = this.__chain__;
                  if (chain || chainAll) {
                    var result = object(this.__wrapped__), actions = result.__actions__ = copyArray(this.__actions__);
                    actions.push({
                      func,
                      args: arguments,
                      thisArg: object
                    });
                    result.__chain__ = chainAll;
                    return result;
                  }
                  return func.apply(object, arrayPush([ this.value() ], arguments));
                };
              }
            }));
            return object;
          }
          function noConflict() {
            if (root._ === this) {
              root._ = oldDash;
            }
            return this;
          }
          function noop() {}
          function nthArg(n) {
            n = toInteger(n);
            return baseRest((function(args) {
              return baseNth(args, n);
            }));
          }
          var over = createOver(arrayMap);
          var overEvery = createOver(arrayEvery);
          var overSome = createOver(arraySome);
          function property(path) {
            return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
          }
          function propertyOf(object) {
            return function(path) {
              return object == null ? undefined : baseGet(object, path);
            };
          }
          var range = createRange();
          var rangeRight = createRange(true);
          function stubArray() {
            return [];
          }
          function stubFalse() {
            return false;
          }
          function stubObject() {
            return {};
          }
          function stubString() {
            return "";
          }
          function stubTrue() {
            return true;
          }
          function times(n, iteratee) {
            n = toInteger(n);
            if (n < 1 || n > MAX_SAFE_INTEGER) {
              return [];
            }
            var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
            iteratee = getIteratee(iteratee);
            n -= MAX_ARRAY_LENGTH;
            var result = baseTimes(length, iteratee);
            while (++index < n) {
              iteratee(index);
            }
            return result;
          }
          function toPath(value) {
            if (isArray(value)) {
              return arrayMap(value, toKey);
            }
            return isSymbol(value) ? [ value ] : copyArray(stringToPath(toString(value)));
          }
          function uniqueId(prefix) {
            var id = ++idCounter;
            return toString(prefix) + id;
          }
          var add = createMathOperation((function(augend, addend) {
            return augend + addend;
          }), 0);
          var ceil = createRound("ceil");
          var divide = createMathOperation((function(dividend, divisor) {
            return dividend / divisor;
          }), 1);
          var floor = createRound("floor");
          function max(array) {
            return array && array.length ? baseExtremum(array, identity, baseGt) : undefined;
          }
          function maxBy(array, iteratee) {
            return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined;
          }
          function mean(array) {
            return baseMean(array, identity);
          }
          function meanBy(array, iteratee) {
            return baseMean(array, getIteratee(iteratee, 2));
          }
          function min(array) {
            return array && array.length ? baseExtremum(array, identity, baseLt) : undefined;
          }
          function minBy(array, iteratee) {
            return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined;
          }
          var multiply = createMathOperation((function(multiplier, multiplicand) {
            return multiplier * multiplicand;
          }), 1);
          var round = createRound("round");
          var subtract = createMathOperation((function(minuend, subtrahend) {
            return minuend - subtrahend;
          }), 0);
          function sum(array) {
            return array && array.length ? baseSum(array, identity) : 0;
          }
          function sumBy(array, iteratee) {
            return array && array.length ? baseSum(array, getIteratee(iteratee, 2)) : 0;
          }
          lodash.after = after;
          lodash.ary = ary;
          lodash.assign = assign;
          lodash.assignIn = assignIn;
          lodash.assignInWith = assignInWith;
          lodash.assignWith = assignWith;
          lodash.at = at;
          lodash.before = before;
          lodash.bind = bind;
          lodash.bindAll = bindAll;
          lodash.bindKey = bindKey;
          lodash.castArray = castArray;
          lodash.chain = chain;
          lodash.chunk = chunk;
          lodash.compact = compact;
          lodash.concat = concat;
          lodash.cond = cond;
          lodash.conforms = conforms;
          lodash.constant = constant;
          lodash.countBy = countBy;
          lodash.create = create;
          lodash.curry = curry;
          lodash.curryRight = curryRight;
          lodash.debounce = debounce;
          lodash.defaults = defaults;
          lodash.defaultsDeep = defaultsDeep;
          lodash.defer = defer;
          lodash.delay = delay;
          lodash.difference = difference;
          lodash.differenceBy = differenceBy;
          lodash.differenceWith = differenceWith;
          lodash.drop = drop;
          lodash.dropRight = dropRight;
          lodash.dropRightWhile = dropRightWhile;
          lodash.dropWhile = dropWhile;
          lodash.fill = fill;
          lodash.filter = filter;
          lodash.flatMap = flatMap;
          lodash.flatMapDeep = flatMapDeep;
          lodash.flatMapDepth = flatMapDepth;
          lodash.flatten = flatten;
          lodash.flattenDeep = flattenDeep;
          lodash.flattenDepth = flattenDepth;
          lodash.flip = flip;
          lodash.flow = flow;
          lodash.flowRight = flowRight;
          lodash.fromPairs = fromPairs;
          lodash.functions = functions;
          lodash.functionsIn = functionsIn;
          lodash.groupBy = groupBy;
          lodash.initial = initial;
          lodash.intersection = intersection;
          lodash.intersectionBy = intersectionBy;
          lodash.intersectionWith = intersectionWith;
          lodash.invert = invert;
          lodash.invertBy = invertBy;
          lodash.invokeMap = invokeMap;
          lodash.iteratee = iteratee;
          lodash.keyBy = keyBy;
          lodash.keys = keys;
          lodash.keysIn = keysIn;
          lodash.map = map;
          lodash.mapKeys = mapKeys;
          lodash.mapValues = mapValues;
          lodash.matches = matches;
          lodash.matchesProperty = matchesProperty;
          lodash.memoize = memoize;
          lodash.merge = merge;
          lodash.mergeWith = mergeWith;
          lodash.method = method;
          lodash.methodOf = methodOf;
          lodash.mixin = mixin;
          lodash.negate = negate;
          lodash.nthArg = nthArg;
          lodash.omit = omit;
          lodash.omitBy = omitBy;
          lodash.once = once;
          lodash.orderBy = orderBy;
          lodash.over = over;
          lodash.overArgs = overArgs;
          lodash.overEvery = overEvery;
          lodash.overSome = overSome;
          lodash.partial = partial;
          lodash.partialRight = partialRight;
          lodash.partition = partition;
          lodash.pick = pick;
          lodash.pickBy = pickBy;
          lodash.property = property;
          lodash.propertyOf = propertyOf;
          lodash.pull = pull;
          lodash.pullAll = pullAll;
          lodash.pullAllBy = pullAllBy;
          lodash.pullAllWith = pullAllWith;
          lodash.pullAt = pullAt;
          lodash.range = range;
          lodash.rangeRight = rangeRight;
          lodash.rearg = rearg;
          lodash.reject = reject;
          lodash.remove = remove;
          lodash.rest = rest;
          lodash.reverse = reverse;
          lodash.sampleSize = sampleSize;
          lodash.set = set;
          lodash.setWith = setWith;
          lodash.shuffle = shuffle;
          lodash.slice = slice;
          lodash.sortBy = sortBy;
          lodash.sortedUniq = sortedUniq;
          lodash.sortedUniqBy = sortedUniqBy;
          lodash.split = split;
          lodash.spread = spread;
          lodash.tail = tail;
          lodash.take = take;
          lodash.takeRight = takeRight;
          lodash.takeRightWhile = takeRightWhile;
          lodash.takeWhile = takeWhile;
          lodash.tap = tap;
          lodash.throttle = throttle;
          lodash.thru = thru;
          lodash.toArray = toArray;
          lodash.toPairs = toPairs;
          lodash.toPairsIn = toPairsIn;
          lodash.toPath = toPath;
          lodash.toPlainObject = toPlainObject;
          lodash.transform = transform;
          lodash.unary = unary;
          lodash.union = union;
          lodash.unionBy = unionBy;
          lodash.unionWith = unionWith;
          lodash.uniq = uniq;
          lodash.uniqBy = uniqBy;
          lodash.uniqWith = uniqWith;
          lodash.unset = unset;
          lodash.unzip = unzip;
          lodash.unzipWith = unzipWith;
          lodash.update = update;
          lodash.updateWith = updateWith;
          lodash.values = values;
          lodash.valuesIn = valuesIn;
          lodash.without = without;
          lodash.words = words;
          lodash.wrap = wrap;
          lodash.xor = xor;
          lodash.xorBy = xorBy;
          lodash.xorWith = xorWith;
          lodash.zip = zip;
          lodash.zipObject = zipObject;
          lodash.zipObjectDeep = zipObjectDeep;
          lodash.zipWith = zipWith;
          lodash.entries = toPairs;
          lodash.entriesIn = toPairsIn;
          lodash.extend = assignIn;
          lodash.extendWith = assignInWith;
          mixin(lodash, lodash);
          lodash.add = add;
          lodash.attempt = attempt;
          lodash.camelCase = camelCase;
          lodash.capitalize = capitalize;
          lodash.ceil = ceil;
          lodash.clamp = clamp;
          lodash.clone = clone;
          lodash.cloneDeep = cloneDeep;
          lodash.cloneDeepWith = cloneDeepWith;
          lodash.cloneWith = cloneWith;
          lodash.conformsTo = conformsTo;
          lodash.deburr = deburr;
          lodash.defaultTo = defaultTo;
          lodash.divide = divide;
          lodash.endsWith = endsWith;
          lodash.eq = eq;
          lodash.escape = escape;
          lodash.escapeRegExp = escapeRegExp;
          lodash.every = every;
          lodash.find = find;
          lodash.findIndex = findIndex;
          lodash.findKey = findKey;
          lodash.findLast = findLast;
          lodash.findLastIndex = findLastIndex;
          lodash.findLastKey = findLastKey;
          lodash.floor = floor;
          lodash.forEach = forEach;
          lodash.forEachRight = forEachRight;
          lodash.forIn = forIn;
          lodash.forInRight = forInRight;
          lodash.forOwn = forOwn;
          lodash.forOwnRight = forOwnRight;
          lodash.get = get;
          lodash.gt = gt;
          lodash.gte = gte;
          lodash.has = has;
          lodash.hasIn = hasIn;
          lodash.head = head;
          lodash.identity = identity;
          lodash.includes = includes;
          lodash.indexOf = indexOf;
          lodash.inRange = inRange;
          lodash.invoke = invoke;
          lodash.isArguments = isArguments;
          lodash.isArray = isArray;
          lodash.isArrayBuffer = isArrayBuffer;
          lodash.isArrayLike = isArrayLike;
          lodash.isArrayLikeObject = isArrayLikeObject;
          lodash.isBoolean = isBoolean;
          lodash.isBuffer = isBuffer;
          lodash.isDate = isDate;
          lodash.isElement = isElement;
          lodash.isEmpty = isEmpty;
          lodash.isEqual = isEqual;
          lodash.isEqualWith = isEqualWith;
          lodash.isError = isError;
          lodash.isFinite = isFinite;
          lodash.isFunction = isFunction;
          lodash.isInteger = isInteger;
          lodash.isLength = isLength;
          lodash.isMap = isMap;
          lodash.isMatch = isMatch;
          lodash.isMatchWith = isMatchWith;
          lodash.isNaN = isNaN;
          lodash.isNative = isNative;
          lodash.isNil = isNil;
          lodash.isNull = isNull;
          lodash.isNumber = isNumber;
          lodash.isObject = isObject;
          lodash.isObjectLike = isObjectLike;
          lodash.isPlainObject = isPlainObject;
          lodash.isRegExp = isRegExp;
          lodash.isSafeInteger = isSafeInteger;
          lodash.isSet = isSet;
          lodash.isString = isString;
          lodash.isSymbol = isSymbol;
          lodash.isTypedArray = isTypedArray;
          lodash.isUndefined = isUndefined;
          lodash.isWeakMap = isWeakMap;
          lodash.isWeakSet = isWeakSet;
          lodash.join = join;
          lodash.kebabCase = kebabCase;
          lodash.last = last;
          lodash.lastIndexOf = lastIndexOf;
          lodash.lowerCase = lowerCase;
          lodash.lowerFirst = lowerFirst;
          lodash.lt = lt;
          lodash.lte = lte;
          lodash.max = max;
          lodash.maxBy = maxBy;
          lodash.mean = mean;
          lodash.meanBy = meanBy;
          lodash.min = min;
          lodash.minBy = minBy;
          lodash.stubArray = stubArray;
          lodash.stubFalse = stubFalse;
          lodash.stubObject = stubObject;
          lodash.stubString = stubString;
          lodash.stubTrue = stubTrue;
          lodash.multiply = multiply;
          lodash.nth = nth;
          lodash.noConflict = noConflict;
          lodash.noop = noop;
          lodash.now = now;
          lodash.pad = pad;
          lodash.padEnd = padEnd;
          lodash.padStart = padStart;
          lodash.parseInt = parseInt;
          lodash.random = random;
          lodash.reduce = reduce;
          lodash.reduceRight = reduceRight;
          lodash.repeat = repeat;
          lodash.replace = replace;
          lodash.result = result;
          lodash.round = round;
          lodash.runInContext = runInContext;
          lodash.sample = sample;
          lodash.size = size;
          lodash.snakeCase = snakeCase;
          lodash.some = some;
          lodash.sortedIndex = sortedIndex;
          lodash.sortedIndexBy = sortedIndexBy;
          lodash.sortedIndexOf = sortedIndexOf;
          lodash.sortedLastIndex = sortedLastIndex;
          lodash.sortedLastIndexBy = sortedLastIndexBy;
          lodash.sortedLastIndexOf = sortedLastIndexOf;
          lodash.startCase = startCase;
          lodash.startsWith = startsWith;
          lodash.subtract = subtract;
          lodash.sum = sum;
          lodash.sumBy = sumBy;
          lodash.template = template;
          lodash.times = times;
          lodash.toFinite = toFinite;
          lodash.toInteger = toInteger;
          lodash.toLength = toLength;
          lodash.toLower = toLower;
          lodash.toNumber = toNumber;
          lodash.toSafeInteger = toSafeInteger;
          lodash.toString = toString;
          lodash.toUpper = toUpper;
          lodash.trim = trim;
          lodash.trimEnd = trimEnd;
          lodash.trimStart = trimStart;
          lodash.truncate = truncate;
          lodash.unescape = unescape;
          lodash.uniqueId = uniqueId;
          lodash.upperCase = upperCase;
          lodash.upperFirst = upperFirst;
          lodash.each = forEach;
          lodash.eachRight = forEachRight;
          lodash.first = head;
          mixin(lodash, function() {
            var source = {};
            baseForOwn(lodash, (function(func, methodName) {
              if (!hasOwnProperty.call(lodash.prototype, methodName)) {
                source[methodName] = func;
              }
            }));
            return source;
          }(), {
            chain: false
          });
          lodash.VERSION = VERSION;
          arrayEach([ "bind", "bindKey", "curry", "curryRight", "partial", "partialRight" ], (function(methodName) {
            lodash[methodName].placeholder = lodash;
          }));
          arrayEach([ "drop", "take" ], (function(methodName, index) {
            LazyWrapper.prototype[methodName] = function(n) {
              n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
              var result = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
              if (result.__filtered__) {
                result.__takeCount__ = nativeMin(n, result.__takeCount__);
              } else {
                result.__views__.push({
                  size: nativeMin(n, MAX_ARRAY_LENGTH),
                  type: methodName + (result.__dir__ < 0 ? "Right" : "")
                });
              }
              return result;
            };
            LazyWrapper.prototype[methodName + "Right"] = function(n) {
              return this.reverse()[methodName](n).reverse();
            };
          }));
          arrayEach([ "filter", "map", "takeWhile" ], (function(methodName, index) {
            var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
            LazyWrapper.prototype[methodName] = function(iteratee) {
              var result = this.clone();
              result.__iteratees__.push({
                iteratee: getIteratee(iteratee, 3),
                type
              });
              result.__filtered__ = result.__filtered__ || isFilter;
              return result;
            };
          }));
          arrayEach([ "head", "last" ], (function(methodName, index) {
            var takeName = "take" + (index ? "Right" : "");
            LazyWrapper.prototype[methodName] = function() {
              return this[takeName](1).value()[0];
            };
          }));
          arrayEach([ "initial", "tail" ], (function(methodName, index) {
            var dropName = "drop" + (index ? "" : "Right");
            LazyWrapper.prototype[methodName] = function() {
              return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
            };
          }));
          LazyWrapper.prototype.compact = function() {
            return this.filter(identity);
          };
          LazyWrapper.prototype.find = function(predicate) {
            return this.filter(predicate).head();
          };
          LazyWrapper.prototype.findLast = function(predicate) {
            return this.reverse().find(predicate);
          };
          LazyWrapper.prototype.invokeMap = baseRest((function(path, args) {
            if (typeof path == "function") {
              return new LazyWrapper(this);
            }
            return this.map((function(value) {
              return baseInvoke(value, path, args);
            }));
          }));
          LazyWrapper.prototype.reject = function(predicate) {
            return this.filter(negate(getIteratee(predicate)));
          };
          LazyWrapper.prototype.slice = function(start, end) {
            start = toInteger(start);
            var result = this;
            if (result.__filtered__ && (start > 0 || end < 0)) {
              return new LazyWrapper(result);
            }
            if (start < 0) {
              result = result.takeRight(-start);
            } else if (start) {
              result = result.drop(start);
            }
            if (end !== undefined) {
              end = toInteger(end);
              result = end < 0 ? result.dropRight(-end) : result.take(end - start);
            }
            return result;
          };
          LazyWrapper.prototype.takeRightWhile = function(predicate) {
            return this.reverse().takeWhile(predicate).reverse();
          };
          LazyWrapper.prototype.toArray = function() {
            return this.take(MAX_ARRAY_LENGTH);
          };
          baseForOwn(LazyWrapper.prototype, (function(func, methodName) {
            var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
            if (!lodashFunc) {
              return;
            }
            lodash.prototype[methodName] = function() {
              var value = this.__wrapped__, args = isTaker ? [ 1 ] : arguments, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray(value);
              var interceptor = function(value) {
                var result = lodashFunc.apply(lodash, arrayPush([ value ], args));
                return isTaker && chainAll ? result[0] : result;
              };
              if (useLazy && checkIteratee && typeof iteratee == "function" && iteratee.length != 1) {
                isLazy = useLazy = false;
              }
              var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
              if (!retUnwrapped && useLazy) {
                value = onlyLazy ? value : new LazyWrapper(this);
                var result = func.apply(value, args);
                result.__actions__.push({
                  func: thru,
                  args: [ interceptor ],
                  thisArg: undefined
                });
                return new LodashWrapper(result, chainAll);
              }
              if (isUnwrapped && onlyLazy) {
                return func.apply(this, args);
              }
              result = this.thru(interceptor);
              return isUnwrapped ? isTaker ? result.value()[0] : result.value() : result;
            };
          }));
          arrayEach([ "pop", "push", "shift", "sort", "splice", "unshift" ], (function(methodName) {
            var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
            lodash.prototype[methodName] = function() {
              var args = arguments;
              if (retUnwrapped && !this.__chain__) {
                var value = this.value();
                return func.apply(isArray(value) ? value : [], args);
              }
              return this[chainName]((function(value) {
                return func.apply(isArray(value) ? value : [], args);
              }));
            };
          }));
          baseForOwn(LazyWrapper.prototype, (function(func, methodName) {
            var lodashFunc = lodash[methodName];
            if (lodashFunc) {
              var key = lodashFunc.name + "";
              if (!hasOwnProperty.call(realNames, key)) {
                realNames[key] = [];
              }
              realNames[key].push({
                name: methodName,
                func: lodashFunc
              });
            }
          }));
          realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [ {
            name: "wrapper",
            func: undefined
          } ];
          LazyWrapper.prototype.clone = lazyClone;
          LazyWrapper.prototype.reverse = lazyReverse;
          LazyWrapper.prototype.value = lazyValue;
          lodash.prototype.at = wrapperAt;
          lodash.prototype.chain = wrapperChain;
          lodash.prototype.commit = wrapperCommit;
          lodash.prototype.next = wrapperNext;
          lodash.prototype.plant = wrapperPlant;
          lodash.prototype.reverse = wrapperReverse;
          lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
          lodash.prototype.first = lodash.prototype.head;
          if (symIterator) {
            lodash.prototype[symIterator] = wrapperToIterator;
          }
          return lodash;
        };
        var _ = runInContext();
        if (true) {
          root._ = _;
          !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
            return _;
          }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
        } else {}
      }).call(this);
    },
    1514(module) {
      "use strict";
      module.exports = Math.abs;
    },
    8968(module) {
      "use strict";
      module.exports = Math.floor;
    },
    4459(module) {
      "use strict";
      module.exports = Number.isNaN || function isNaN(a) {
        return a !== a;
      };
    },
    6188(module) {
      "use strict";
      module.exports = Math.max;
    },
    8002(module) {
      "use strict";
      module.exports = Math.min;
    },
    5880(module) {
      "use strict";
      module.exports = Math.pow;
    },
    414(module) {
      "use strict";
      module.exports = Math.round;
    },
    3093(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var $isNaN = __webpack_require__(4459);
      module.exports = function sign(number) {
        if ($isNaN(number) || number === 0) {
          return number;
        }
        return number < 0 ? -1 : +1;
      };
    },
    8276(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var HashBase = __webpack_require__(4729);
      var Buffer = __webpack_require__(2861).Buffer;
      var ARRAY16 = new Array(16);
      function MD5() {
        HashBase.call(this, 64);
        this._a = 1732584193;
        this._b = 4023233417;
        this._c = 2562383102;
        this._d = 271733878;
      }
      inherits(MD5, HashBase);
      MD5.prototype._update = function() {
        var M = ARRAY16;
        for (var i = 0; i < 16; ++i) M[i] = this._block.readInt32LE(i * 4);
        var a = this._a;
        var b = this._b;
        var c = this._c;
        var d = this._d;
        a = fnF(a, b, c, d, M[0], 3614090360, 7);
        d = fnF(d, a, b, c, M[1], 3905402710, 12);
        c = fnF(c, d, a, b, M[2], 606105819, 17);
        b = fnF(b, c, d, a, M[3], 3250441966, 22);
        a = fnF(a, b, c, d, M[4], 4118548399, 7);
        d = fnF(d, a, b, c, M[5], 1200080426, 12);
        c = fnF(c, d, a, b, M[6], 2821735955, 17);
        b = fnF(b, c, d, a, M[7], 4249261313, 22);
        a = fnF(a, b, c, d, M[8], 1770035416, 7);
        d = fnF(d, a, b, c, M[9], 2336552879, 12);
        c = fnF(c, d, a, b, M[10], 4294925233, 17);
        b = fnF(b, c, d, a, M[11], 2304563134, 22);
        a = fnF(a, b, c, d, M[12], 1804603682, 7);
        d = fnF(d, a, b, c, M[13], 4254626195, 12);
        c = fnF(c, d, a, b, M[14], 2792965006, 17);
        b = fnF(b, c, d, a, M[15], 1236535329, 22);
        a = fnG(a, b, c, d, M[1], 4129170786, 5);
        d = fnG(d, a, b, c, M[6], 3225465664, 9);
        c = fnG(c, d, a, b, M[11], 643717713, 14);
        b = fnG(b, c, d, a, M[0], 3921069994, 20);
        a = fnG(a, b, c, d, M[5], 3593408605, 5);
        d = fnG(d, a, b, c, M[10], 38016083, 9);
        c = fnG(c, d, a, b, M[15], 3634488961, 14);
        b = fnG(b, c, d, a, M[4], 3889429448, 20);
        a = fnG(a, b, c, d, M[9], 568446438, 5);
        d = fnG(d, a, b, c, M[14], 3275163606, 9);
        c = fnG(c, d, a, b, M[3], 4107603335, 14);
        b = fnG(b, c, d, a, M[8], 1163531501, 20);
        a = fnG(a, b, c, d, M[13], 2850285829, 5);
        d = fnG(d, a, b, c, M[2], 4243563512, 9);
        c = fnG(c, d, a, b, M[7], 1735328473, 14);
        b = fnG(b, c, d, a, M[12], 2368359562, 20);
        a = fnH(a, b, c, d, M[5], 4294588738, 4);
        d = fnH(d, a, b, c, M[8], 2272392833, 11);
        c = fnH(c, d, a, b, M[11], 1839030562, 16);
        b = fnH(b, c, d, a, M[14], 4259657740, 23);
        a = fnH(a, b, c, d, M[1], 2763975236, 4);
        d = fnH(d, a, b, c, M[4], 1272893353, 11);
        c = fnH(c, d, a, b, M[7], 4139469664, 16);
        b = fnH(b, c, d, a, M[10], 3200236656, 23);
        a = fnH(a, b, c, d, M[13], 681279174, 4);
        d = fnH(d, a, b, c, M[0], 3936430074, 11);
        c = fnH(c, d, a, b, M[3], 3572445317, 16);
        b = fnH(b, c, d, a, M[6], 76029189, 23);
        a = fnH(a, b, c, d, M[9], 3654602809, 4);
        d = fnH(d, a, b, c, M[12], 3873151461, 11);
        c = fnH(c, d, a, b, M[15], 530742520, 16);
        b = fnH(b, c, d, a, M[2], 3299628645, 23);
        a = fnI(a, b, c, d, M[0], 4096336452, 6);
        d = fnI(d, a, b, c, M[7], 1126891415, 10);
        c = fnI(c, d, a, b, M[14], 2878612391, 15);
        b = fnI(b, c, d, a, M[5], 4237533241, 21);
        a = fnI(a, b, c, d, M[12], 1700485571, 6);
        d = fnI(d, a, b, c, M[3], 2399980690, 10);
        c = fnI(c, d, a, b, M[10], 4293915773, 15);
        b = fnI(b, c, d, a, M[1], 2240044497, 21);
        a = fnI(a, b, c, d, M[8], 1873313359, 6);
        d = fnI(d, a, b, c, M[15], 4264355552, 10);
        c = fnI(c, d, a, b, M[6], 2734768916, 15);
        b = fnI(b, c, d, a, M[13], 1309151649, 21);
        a = fnI(a, b, c, d, M[4], 4149444226, 6);
        d = fnI(d, a, b, c, M[11], 3174756917, 10);
        c = fnI(c, d, a, b, M[2], 718787259, 15);
        b = fnI(b, c, d, a, M[9], 3951481745, 21);
        this._a = this._a + a | 0;
        this._b = this._b + b | 0;
        this._c = this._c + c | 0;
        this._d = this._d + d | 0;
      };
      MD5.prototype._digest = function() {
        this._block[this._blockOffset++] = 128;
        if (this._blockOffset > 56) {
          this._block.fill(0, this._blockOffset, 64);
          this._update();
          this._blockOffset = 0;
        }
        this._block.fill(0, this._blockOffset, 56);
        this._block.writeUInt32LE(this._length[0], 56);
        this._block.writeUInt32LE(this._length[1], 60);
        this._update();
        var buffer = Buffer.allocUnsafe(16);
        buffer.writeInt32LE(this._a, 0);
        buffer.writeInt32LE(this._b, 4);
        buffer.writeInt32LE(this._c, 8);
        buffer.writeInt32LE(this._d, 12);
        return buffer;
      };
      function rotl(x, n) {
        return x << n | x >>> 32 - n;
      }
      function fnF(a, b, c, d, m, k, s) {
        return rotl(a + (b & c | ~b & d) + m + k | 0, s) + b | 0;
      }
      function fnG(a, b, c, d, m, k, s) {
        return rotl(a + (b & d | c & ~d) + m + k | 0, s) + b | 0;
      }
      function fnH(a, b, c, d, m, k, s) {
        return rotl(a + (b ^ c ^ d) + m + k | 0, s) + b | 0;
      }
      function fnI(a, b, c, d, m, k, s) {
        return rotl(a + (c ^ (b | ~d)) + m + k | 0, s) + b | 0;
      }
      module.exports = MD5;
    },
    2244(module, __unused_webpack_exports, __webpack_require__) {
      var bn = __webpack_require__(1158);
      var brorand = __webpack_require__(5037);
      function MillerRabin(rand) {
        this.rand = rand || new brorand.Rand;
      }
      module.exports = MillerRabin;
      MillerRabin.create = function create(rand) {
        return new MillerRabin(rand);
      };
      MillerRabin.prototype._randbelow = function _randbelow(n) {
        var len = n.bitLength();
        var min_bytes = Math.ceil(len / 8);
        do {
          var a = new bn(this.rand.generate(min_bytes));
        } while (a.cmp(n) >= 0);
        return a;
      };
      MillerRabin.prototype._randrange = function _randrange(start, stop) {
        var size = stop.sub(start);
        return start.add(this._randbelow(size));
      };
      MillerRabin.prototype.test = function test(n, k, cb) {
        var len = n.bitLength();
        var red = bn.mont(n);
        var rone = new bn(1).toRed(red);
        if (!k) k = Math.max(1, len / 48 | 0);
        var n1 = n.subn(1);
        for (var s = 0; !n1.testn(s); s++) {}
        var d = n.shrn(s);
        var rn1 = n1.toRed(red);
        var prime = true;
        for (;k > 0; k--) {
          var a = this._randrange(new bn(2), n1);
          if (cb) cb(a);
          var x = a.toRed(red).redPow(d);
          if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue;
          for (var i = 1; i < s; i++) {
            x = x.redSqr();
            if (x.cmp(rone) === 0) return false;
            if (x.cmp(rn1) === 0) break;
          }
          if (i === s) return false;
        }
        return prime;
      };
      MillerRabin.prototype.getDivisor = function getDivisor(n, k) {
        var len = n.bitLength();
        var red = bn.mont(n);
        var rone = new bn(1).toRed(red);
        if (!k) k = Math.max(1, len / 48 | 0);
        var n1 = n.subn(1);
        for (var s = 0; !n1.testn(s); s++) {}
        var d = n.shrn(s);
        var rn1 = n1.toRed(red);
        for (;k > 0; k--) {
          var a = this._randrange(new bn(2), n1);
          var g = n.gcd(a);
          if (g.cmpn(1) !== 0) return g;
          var x = a.toRed(red).redPow(d);
          if (x.cmp(rone) === 0 || x.cmp(rn1) === 0) continue;
          for (var i = 1; i < s; i++) {
            x = x.redSqr();
            if (x.cmp(rone) === 0) return x.fromRed().subn(1).gcd(n);
            if (x.cmp(rn1) === 0) break;
          }
          if (i === s) {
            x = x.redSqr();
            return x.fromRed().subn(1).gcd(n);
          }
        }
        return false;
      };
    },
    1158(module, __unused_webpack_exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      (function(module, exports) {
        "use strict";
        function assert(val, msg) {
          if (!val) throw new Error(msg || "Assertion failed");
        }
        function inherits(ctor, superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {};
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor;
          ctor.prototype.constructor = ctor;
        }
        function BN(number, base, endian) {
          if (BN.isBN(number)) {
            return number;
          }
          this.negative = 0;
          this.words = null;
          this.length = 0;
          this.red = null;
          if (number !== null) {
            if (base === "le" || base === "be") {
              endian = base;
              base = 10;
            }
            this._init(number || 0, base || 10, endian || "be");
          }
        }
        if (typeof module === "object") {
          module.exports = BN;
        } else {
          exports.BN = BN;
        }
        BN.BN = BN;
        BN.wordSize = 26;
        var Buffer;
        try {
          if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
            Buffer = window.Buffer;
          } else {
            Buffer = __webpack_require__(4688).Buffer;
          }
        } catch (e) {}
        BN.isBN = function isBN(num) {
          if (num instanceof BN) {
            return true;
          }
          return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
        };
        BN.max = function max(left, right) {
          if (left.cmp(right) > 0) return left;
          return right;
        };
        BN.min = function min(left, right) {
          if (left.cmp(right) < 0) return left;
          return right;
        };
        BN.prototype._init = function init(number, base, endian) {
          if (typeof number === "number") {
            return this._initNumber(number, base, endian);
          }
          if (typeof number === "object") {
            return this._initArray(number, base, endian);
          }
          if (base === "hex") {
            base = 16;
          }
          assert(base === (base | 0) && base >= 2 && base <= 36);
          number = number.toString().replace(/\s+/g, "");
          var start = 0;
          if (number[0] === "-") {
            start++;
            this.negative = 1;
          }
          if (start < number.length) {
            if (base === 16) {
              this._parseHex(number, start, endian);
            } else {
              this._parseBase(number, base, start);
              if (endian === "le") {
                this._initArray(this.toArray(), base, endian);
              }
            }
          }
        };
        BN.prototype._initNumber = function _initNumber(number, base, endian) {
          if (number < 0) {
            this.negative = 1;
            number = -number;
          }
          if (number < 67108864) {
            this.words = [ number & 67108863 ];
            this.length = 1;
          } else if (number < 4503599627370496) {
            this.words = [ number & 67108863, number / 67108864 & 67108863 ];
            this.length = 2;
          } else {
            assert(number < 9007199254740992);
            this.words = [ number & 67108863, number / 67108864 & 67108863, 1 ];
            this.length = 3;
          }
          if (endian !== "le") return;
          this._initArray(this.toArray(), base, endian);
        };
        BN.prototype._initArray = function _initArray(number, base, endian) {
          assert(typeof number.length === "number");
          if (number.length <= 0) {
            this.words = [ 0 ];
            this.length = 1;
            return this;
          }
          this.length = Math.ceil(number.length / 3);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var j, w;
          var off = 0;
          if (endian === "be") {
            for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
              w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          } else if (endian === "le") {
            for (i = 0, j = 0; i < number.length; i += 3) {
              w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          }
          return this.strip();
        };
        function parseHex4Bits(string, index) {
          var c = string.charCodeAt(index);
          if (c >= 65 && c <= 70) {
            return c - 55;
          } else if (c >= 97 && c <= 102) {
            return c - 87;
          } else {
            return c - 48 & 15;
          }
        }
        function parseHexByte(string, lowerBound, index) {
          var r = parseHex4Bits(string, index);
          if (index - 1 >= lowerBound) {
            r |= parseHex4Bits(string, index - 1) << 4;
          }
          return r;
        }
        BN.prototype._parseHex = function _parseHex(number, start, endian) {
          this.length = Math.ceil((number.length - start) / 6);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var off = 0;
          var j = 0;
          var w;
          if (endian === "be") {
            for (i = number.length - 1; i >= start; i -= 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          } else {
            var parseLength = number.length - start;
            for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          }
          this.strip();
        };
        function parseBase(str, start, end, mul) {
          var r = 0;
          var len = Math.min(str.length, end);
          for (var i = start; i < len; i++) {
            var c = str.charCodeAt(i) - 48;
            r *= mul;
            if (c >= 49) {
              r += c - 49 + 10;
            } else if (c >= 17) {
              r += c - 17 + 10;
            } else {
              r += c;
            }
          }
          return r;
        }
        BN.prototype._parseBase = function _parseBase(number, base, start) {
          this.words = [ 0 ];
          this.length = 1;
          for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
            limbLen++;
          }
          limbLen--;
          limbPow = limbPow / base | 0;
          var total = number.length - start;
          var mod = total % limbLen;
          var end = Math.min(total, total - mod) + start;
          var word = 0;
          for (var i = start; i < end; i += limbLen) {
            word = parseBase(number, i, i + limbLen, base);
            this.imuln(limbPow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          if (mod !== 0) {
            var pow = 1;
            word = parseBase(number, i, number.length, base);
            for (i = 0; i < mod; i++) {
              pow *= base;
            }
            this.imuln(pow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          this.strip();
        };
        BN.prototype.copy = function copy(dest) {
          dest.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            dest.words[i] = this.words[i];
          }
          dest.length = this.length;
          dest.negative = this.negative;
          dest.red = this.red;
        };
        BN.prototype.clone = function clone() {
          var r = new BN(null);
          this.copy(r);
          return r;
        };
        BN.prototype._expand = function _expand(size) {
          while (this.length < size) {
            this.words[this.length++] = 0;
          }
          return this;
        };
        BN.prototype.strip = function strip() {
          while (this.length > 1 && this.words[this.length - 1] === 0) {
            this.length--;
          }
          return this._normSign();
        };
        BN.prototype._normSign = function _normSign() {
          if (this.length === 1 && this.words[0] === 0) {
            this.negative = 0;
          }
          return this;
        };
        BN.prototype.inspect = function inspect() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
        };
        var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ];
        var groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];
        var groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ];
        BN.prototype.toString = function toString(base, padding) {
          base = base || 10;
          padding = padding | 0 || 1;
          var out;
          if (base === 16 || base === "hex") {
            out = "";
            var off = 0;
            var carry = 0;
            for (var i = 0; i < this.length; i++) {
              var w = this.words[i];
              var word = ((w << off | carry) & 16777215).toString(16);
              carry = w >>> 24 - off & 16777215;
              off += 2;
              if (off >= 26) {
                off -= 26;
                i--;
              }
              if (carry !== 0 || i !== this.length - 1) {
                out = zeros[6 - word.length] + word + out;
              } else {
                out = word + out;
              }
            }
            if (carry !== 0) {
              out = carry.toString(16) + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          if (base === (base | 0) && base >= 2 && base <= 36) {
            var groupSize = groupSizes[base];
            var groupBase = groupBases[base];
            out = "";
            var c = this.clone();
            c.negative = 0;
            while (!c.isZero()) {
              var r = c.modn(groupBase).toString(base);
              c = c.idivn(groupBase);
              if (!c.isZero()) {
                out = zeros[groupSize - r.length] + r + out;
              } else {
                out = r + out;
              }
            }
            if (this.isZero()) {
              out = "0" + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          assert(false, "Base should be between 2 and 36");
        };
        BN.prototype.toNumber = function toNumber() {
          var ret = this.words[0];
          if (this.length === 2) {
            ret += this.words[1] * 67108864;
          } else if (this.length === 3 && this.words[2] === 1) {
            ret += 4503599627370496 + this.words[1] * 67108864;
          } else if (this.length > 2) {
            assert(false, "Number can only safely store up to 53 bits");
          }
          return this.negative !== 0 ? -ret : ret;
        };
        BN.prototype.toJSON = function toJSON() {
          return this.toString(16);
        };
        BN.prototype.toBuffer = function toBuffer(endian, length) {
          assert(typeof Buffer !== "undefined");
          return this.toArrayLike(Buffer, endian, length);
        };
        BN.prototype.toArray = function toArray(endian, length) {
          return this.toArrayLike(Array, endian, length);
        };
        BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
          var byteLength = this.byteLength();
          var reqLength = length || Math.max(1, byteLength);
          assert(byteLength <= reqLength, "byte array longer than desired length");
          assert(reqLength > 0, "Requested array length <= 0");
          this.strip();
          var littleEndian = endian === "le";
          var res = new ArrayType(reqLength);
          var b, i;
          var q = this.clone();
          if (!littleEndian) {
            for (i = 0; i < reqLength - byteLength; i++) {
              res[i] = 0;
            }
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[reqLength - i - 1] = b;
            }
          } else {
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[i] = b;
            }
            for (;i < reqLength; i++) {
              res[i] = 0;
            }
          }
          return res;
        };
        if (Math.clz32) {
          BN.prototype._countBits = function _countBits(w) {
            return 32 - Math.clz32(w);
          };
        } else {
          BN.prototype._countBits = function _countBits(w) {
            var t = w;
            var r = 0;
            if (t >= 4096) {
              r += 13;
              t >>>= 13;
            }
            if (t >= 64) {
              r += 7;
              t >>>= 7;
            }
            if (t >= 8) {
              r += 4;
              t >>>= 4;
            }
            if (t >= 2) {
              r += 2;
              t >>>= 2;
            }
            return r + t;
          };
        }
        BN.prototype._zeroBits = function _zeroBits(w) {
          if (w === 0) return 26;
          var t = w;
          var r = 0;
          if ((t & 8191) === 0) {
            r += 13;
            t >>>= 13;
          }
          if ((t & 127) === 0) {
            r += 7;
            t >>>= 7;
          }
          if ((t & 15) === 0) {
            r += 4;
            t >>>= 4;
          }
          if ((t & 3) === 0) {
            r += 2;
            t >>>= 2;
          }
          if ((t & 1) === 0) {
            r++;
          }
          return r;
        };
        BN.prototype.bitLength = function bitLength() {
          var w = this.words[this.length - 1];
          var hi = this._countBits(w);
          return (this.length - 1) * 26 + hi;
        };
        function toBitArray(num) {
          var w = new Array(num.bitLength());
          for (var bit = 0; bit < w.length; bit++) {
            var off = bit / 26 | 0;
            var wbit = bit % 26;
            w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
          }
          return w;
        }
        BN.prototype.zeroBits = function zeroBits() {
          if (this.isZero()) return 0;
          var r = 0;
          for (var i = 0; i < this.length; i++) {
            var b = this._zeroBits(this.words[i]);
            r += b;
            if (b !== 26) break;
          }
          return r;
        };
        BN.prototype.byteLength = function byteLength() {
          return Math.ceil(this.bitLength() / 8);
        };
        BN.prototype.toTwos = function toTwos(width) {
          if (this.negative !== 0) {
            return this.abs().inotn(width).iaddn(1);
          }
          return this.clone();
        };
        BN.prototype.fromTwos = function fromTwos(width) {
          if (this.testn(width - 1)) {
            return this.notn(width).iaddn(1).ineg();
          }
          return this.clone();
        };
        BN.prototype.isNeg = function isNeg() {
          return this.negative !== 0;
        };
        BN.prototype.neg = function neg() {
          return this.clone().ineg();
        };
        BN.prototype.ineg = function ineg() {
          if (!this.isZero()) {
            this.negative ^= 1;
          }
          return this;
        };
        BN.prototype.iuor = function iuor(num) {
          while (this.length < num.length) {
            this.words[this.length++] = 0;
          }
          for (var i = 0; i < num.length; i++) {
            this.words[i] = this.words[i] | num.words[i];
          }
          return this.strip();
        };
        BN.prototype.ior = function ior(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuor(num);
        };
        BN.prototype.or = function or(num) {
          if (this.length > num.length) return this.clone().ior(num);
          return num.clone().ior(this);
        };
        BN.prototype.uor = function uor(num) {
          if (this.length > num.length) return this.clone().iuor(num);
          return num.clone().iuor(this);
        };
        BN.prototype.iuand = function iuand(num) {
          var b;
          if (this.length > num.length) {
            b = num;
          } else {
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = this.words[i] & num.words[i];
          }
          this.length = b.length;
          return this.strip();
        };
        BN.prototype.iand = function iand(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuand(num);
        };
        BN.prototype.and = function and(num) {
          if (this.length > num.length) return this.clone().iand(num);
          return num.clone().iand(this);
        };
        BN.prototype.uand = function uand(num) {
          if (this.length > num.length) return this.clone().iuand(num);
          return num.clone().iuand(this);
        };
        BN.prototype.iuxor = function iuxor(num) {
          var a;
          var b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = a.words[i] ^ b.words[i];
          }
          if (this !== a) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = a.length;
          return this.strip();
        };
        BN.prototype.ixor = function ixor(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuxor(num);
        };
        BN.prototype.xor = function xor(num) {
          if (this.length > num.length) return this.clone().ixor(num);
          return num.clone().ixor(this);
        };
        BN.prototype.uxor = function uxor(num) {
          if (this.length > num.length) return this.clone().iuxor(num);
          return num.clone().iuxor(this);
        };
        BN.prototype.inotn = function inotn(width) {
          assert(typeof width === "number" && width >= 0);
          var bytesNeeded = Math.ceil(width / 26) | 0;
          var bitsLeft = width % 26;
          this._expand(bytesNeeded);
          if (bitsLeft > 0) {
            bytesNeeded--;
          }
          for (var i = 0; i < bytesNeeded; i++) {
            this.words[i] = ~this.words[i] & 67108863;
          }
          if (bitsLeft > 0) {
            this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
          }
          return this.strip();
        };
        BN.prototype.notn = function notn(width) {
          return this.clone().inotn(width);
        };
        BN.prototype.setn = function setn(bit, val) {
          assert(typeof bit === "number" && bit >= 0);
          var off = bit / 26 | 0;
          var wbit = bit % 26;
          this._expand(off + 1);
          if (val) {
            this.words[off] = this.words[off] | 1 << wbit;
          } else {
            this.words[off] = this.words[off] & ~(1 << wbit);
          }
          return this.strip();
        };
        BN.prototype.iadd = function iadd(num) {
          var r;
          if (this.negative !== 0 && num.negative === 0) {
            this.negative = 0;
            r = this.isub(num);
            this.negative ^= 1;
            return this._normSign();
          } else if (this.negative === 0 && num.negative !== 0) {
            num.negative = 0;
            r = this.isub(num);
            num.negative = 1;
            return r._normSign();
          }
          var a, b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          this.length = a.length;
          if (carry !== 0) {
            this.words[this.length] = carry;
            this.length++;
          } else if (a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          return this;
        };
        BN.prototype.add = function add(num) {
          var res;
          if (num.negative !== 0 && this.negative === 0) {
            num.negative = 0;
            res = this.sub(num);
            num.negative ^= 1;
            return res;
          } else if (num.negative === 0 && this.negative !== 0) {
            this.negative = 0;
            res = num.sub(this);
            this.negative = 1;
            return res;
          }
          if (this.length > num.length) return this.clone().iadd(num);
          return num.clone().iadd(this);
        };
        BN.prototype.isub = function isub(num) {
          if (num.negative !== 0) {
            num.negative = 0;
            var r = this.iadd(num);
            num.negative = 1;
            return r._normSign();
          } else if (this.negative !== 0) {
            this.negative = 0;
            this.iadd(num);
            this.negative = 1;
            return this._normSign();
          }
          var cmp = this.cmp(num);
          if (cmp === 0) {
            this.negative = 0;
            this.length = 1;
            this.words[0] = 0;
            return this;
          }
          var a, b;
          if (cmp > 0) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          if (carry === 0 && i < a.length && a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = Math.max(this.length, i);
          if (a !== this) {
            this.negative = 1;
          }
          return this.strip();
        };
        BN.prototype.sub = function sub(num) {
          return this.clone().isub(num);
        };
        function smallMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          var len = self.length + num.length | 0;
          out.length = len;
          len = len - 1 | 0;
          var a = self.words[0] | 0;
          var b = num.words[0] | 0;
          var r = a * b;
          var lo = r & 67108863;
          var carry = r / 67108864 | 0;
          out.words[0] = lo;
          for (var k = 1; k < len; k++) {
            var ncarry = carry >>> 26;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j | 0;
              a = self.words[i] | 0;
              b = num.words[j] | 0;
              r = a * b + rword;
              ncarry += r / 67108864 | 0;
              rword = r & 67108863;
            }
            out.words[k] = rword | 0;
            carry = ncarry | 0;
          }
          if (carry !== 0) {
            out.words[k] = carry | 0;
          } else {
            out.length--;
          }
          return out.strip();
        }
        var comb10MulTo = function comb10MulTo(self, num, out) {
          var a = self.words;
          var b = num.words;
          var o = out.words;
          var c = 0;
          var lo;
          var mid;
          var hi;
          var a0 = a[0] | 0;
          var al0 = a0 & 8191;
          var ah0 = a0 >>> 13;
          var a1 = a[1] | 0;
          var al1 = a1 & 8191;
          var ah1 = a1 >>> 13;
          var a2 = a[2] | 0;
          var al2 = a2 & 8191;
          var ah2 = a2 >>> 13;
          var a3 = a[3] | 0;
          var al3 = a3 & 8191;
          var ah3 = a3 >>> 13;
          var a4 = a[4] | 0;
          var al4 = a4 & 8191;
          var ah4 = a4 >>> 13;
          var a5 = a[5] | 0;
          var al5 = a5 & 8191;
          var ah5 = a5 >>> 13;
          var a6 = a[6] | 0;
          var al6 = a6 & 8191;
          var ah6 = a6 >>> 13;
          var a7 = a[7] | 0;
          var al7 = a7 & 8191;
          var ah7 = a7 >>> 13;
          var a8 = a[8] | 0;
          var al8 = a8 & 8191;
          var ah8 = a8 >>> 13;
          var a9 = a[9] | 0;
          var al9 = a9 & 8191;
          var ah9 = a9 >>> 13;
          var b0 = b[0] | 0;
          var bl0 = b0 & 8191;
          var bh0 = b0 >>> 13;
          var b1 = b[1] | 0;
          var bl1 = b1 & 8191;
          var bh1 = b1 >>> 13;
          var b2 = b[2] | 0;
          var bl2 = b2 & 8191;
          var bh2 = b2 >>> 13;
          var b3 = b[3] | 0;
          var bl3 = b3 & 8191;
          var bh3 = b3 >>> 13;
          var b4 = b[4] | 0;
          var bl4 = b4 & 8191;
          var bh4 = b4 >>> 13;
          var b5 = b[5] | 0;
          var bl5 = b5 & 8191;
          var bh5 = b5 >>> 13;
          var b6 = b[6] | 0;
          var bl6 = b6 & 8191;
          var bh6 = b6 >>> 13;
          var b7 = b[7] | 0;
          var bl7 = b7 & 8191;
          var bh7 = b7 >>> 13;
          var b8 = b[8] | 0;
          var bl8 = b8 & 8191;
          var bh8 = b8 >>> 13;
          var b9 = b[9] | 0;
          var bl9 = b9 & 8191;
          var bh9 = b9 >>> 13;
          out.negative = self.negative ^ num.negative;
          out.length = 19;
          lo = Math.imul(al0, bl0);
          mid = Math.imul(al0, bh0);
          mid = mid + Math.imul(ah0, bl0) | 0;
          hi = Math.imul(ah0, bh0);
          var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
          w0 &= 67108863;
          lo = Math.imul(al1, bl0);
          mid = Math.imul(al1, bh0);
          mid = mid + Math.imul(ah1, bl0) | 0;
          hi = Math.imul(ah1, bh0);
          lo = lo + Math.imul(al0, bl1) | 0;
          mid = mid + Math.imul(al0, bh1) | 0;
          mid = mid + Math.imul(ah0, bl1) | 0;
          hi = hi + Math.imul(ah0, bh1) | 0;
          var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
          w1 &= 67108863;
          lo = Math.imul(al2, bl0);
          mid = Math.imul(al2, bh0);
          mid = mid + Math.imul(ah2, bl0) | 0;
          hi = Math.imul(ah2, bh0);
          lo = lo + Math.imul(al1, bl1) | 0;
          mid = mid + Math.imul(al1, bh1) | 0;
          mid = mid + Math.imul(ah1, bl1) | 0;
          hi = hi + Math.imul(ah1, bh1) | 0;
          lo = lo + Math.imul(al0, bl2) | 0;
          mid = mid + Math.imul(al0, bh2) | 0;
          mid = mid + Math.imul(ah0, bl2) | 0;
          hi = hi + Math.imul(ah0, bh2) | 0;
          var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
          w2 &= 67108863;
          lo = Math.imul(al3, bl0);
          mid = Math.imul(al3, bh0);
          mid = mid + Math.imul(ah3, bl0) | 0;
          hi = Math.imul(ah3, bh0);
          lo = lo + Math.imul(al2, bl1) | 0;
          mid = mid + Math.imul(al2, bh1) | 0;
          mid = mid + Math.imul(ah2, bl1) | 0;
          hi = hi + Math.imul(ah2, bh1) | 0;
          lo = lo + Math.imul(al1, bl2) | 0;
          mid = mid + Math.imul(al1, bh2) | 0;
          mid = mid + Math.imul(ah1, bl2) | 0;
          hi = hi + Math.imul(ah1, bh2) | 0;
          lo = lo + Math.imul(al0, bl3) | 0;
          mid = mid + Math.imul(al0, bh3) | 0;
          mid = mid + Math.imul(ah0, bl3) | 0;
          hi = hi + Math.imul(ah0, bh3) | 0;
          var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
          w3 &= 67108863;
          lo = Math.imul(al4, bl0);
          mid = Math.imul(al4, bh0);
          mid = mid + Math.imul(ah4, bl0) | 0;
          hi = Math.imul(ah4, bh0);
          lo = lo + Math.imul(al3, bl1) | 0;
          mid = mid + Math.imul(al3, bh1) | 0;
          mid = mid + Math.imul(ah3, bl1) | 0;
          hi = hi + Math.imul(ah3, bh1) | 0;
          lo = lo + Math.imul(al2, bl2) | 0;
          mid = mid + Math.imul(al2, bh2) | 0;
          mid = mid + Math.imul(ah2, bl2) | 0;
          hi = hi + Math.imul(ah2, bh2) | 0;
          lo = lo + Math.imul(al1, bl3) | 0;
          mid = mid + Math.imul(al1, bh3) | 0;
          mid = mid + Math.imul(ah1, bl3) | 0;
          hi = hi + Math.imul(ah1, bh3) | 0;
          lo = lo + Math.imul(al0, bl4) | 0;
          mid = mid + Math.imul(al0, bh4) | 0;
          mid = mid + Math.imul(ah0, bl4) | 0;
          hi = hi + Math.imul(ah0, bh4) | 0;
          var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
          w4 &= 67108863;
          lo = Math.imul(al5, bl0);
          mid = Math.imul(al5, bh0);
          mid = mid + Math.imul(ah5, bl0) | 0;
          hi = Math.imul(ah5, bh0);
          lo = lo + Math.imul(al4, bl1) | 0;
          mid = mid + Math.imul(al4, bh1) | 0;
          mid = mid + Math.imul(ah4, bl1) | 0;
          hi = hi + Math.imul(ah4, bh1) | 0;
          lo = lo + Math.imul(al3, bl2) | 0;
          mid = mid + Math.imul(al3, bh2) | 0;
          mid = mid + Math.imul(ah3, bl2) | 0;
          hi = hi + Math.imul(ah3, bh2) | 0;
          lo = lo + Math.imul(al2, bl3) | 0;
          mid = mid + Math.imul(al2, bh3) | 0;
          mid = mid + Math.imul(ah2, bl3) | 0;
          hi = hi + Math.imul(ah2, bh3) | 0;
          lo = lo + Math.imul(al1, bl4) | 0;
          mid = mid + Math.imul(al1, bh4) | 0;
          mid = mid + Math.imul(ah1, bl4) | 0;
          hi = hi + Math.imul(ah1, bh4) | 0;
          lo = lo + Math.imul(al0, bl5) | 0;
          mid = mid + Math.imul(al0, bh5) | 0;
          mid = mid + Math.imul(ah0, bl5) | 0;
          hi = hi + Math.imul(ah0, bh5) | 0;
          var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
          w5 &= 67108863;
          lo = Math.imul(al6, bl0);
          mid = Math.imul(al6, bh0);
          mid = mid + Math.imul(ah6, bl0) | 0;
          hi = Math.imul(ah6, bh0);
          lo = lo + Math.imul(al5, bl1) | 0;
          mid = mid + Math.imul(al5, bh1) | 0;
          mid = mid + Math.imul(ah5, bl1) | 0;
          hi = hi + Math.imul(ah5, bh1) | 0;
          lo = lo + Math.imul(al4, bl2) | 0;
          mid = mid + Math.imul(al4, bh2) | 0;
          mid = mid + Math.imul(ah4, bl2) | 0;
          hi = hi + Math.imul(ah4, bh2) | 0;
          lo = lo + Math.imul(al3, bl3) | 0;
          mid = mid + Math.imul(al3, bh3) | 0;
          mid = mid + Math.imul(ah3, bl3) | 0;
          hi = hi + Math.imul(ah3, bh3) | 0;
          lo = lo + Math.imul(al2, bl4) | 0;
          mid = mid + Math.imul(al2, bh4) | 0;
          mid = mid + Math.imul(ah2, bl4) | 0;
          hi = hi + Math.imul(ah2, bh4) | 0;
          lo = lo + Math.imul(al1, bl5) | 0;
          mid = mid + Math.imul(al1, bh5) | 0;
          mid = mid + Math.imul(ah1, bl5) | 0;
          hi = hi + Math.imul(ah1, bh5) | 0;
          lo = lo + Math.imul(al0, bl6) | 0;
          mid = mid + Math.imul(al0, bh6) | 0;
          mid = mid + Math.imul(ah0, bl6) | 0;
          hi = hi + Math.imul(ah0, bh6) | 0;
          var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
          w6 &= 67108863;
          lo = Math.imul(al7, bl0);
          mid = Math.imul(al7, bh0);
          mid = mid + Math.imul(ah7, bl0) | 0;
          hi = Math.imul(ah7, bh0);
          lo = lo + Math.imul(al6, bl1) | 0;
          mid = mid + Math.imul(al6, bh1) | 0;
          mid = mid + Math.imul(ah6, bl1) | 0;
          hi = hi + Math.imul(ah6, bh1) | 0;
          lo = lo + Math.imul(al5, bl2) | 0;
          mid = mid + Math.imul(al5, bh2) | 0;
          mid = mid + Math.imul(ah5, bl2) | 0;
          hi = hi + Math.imul(ah5, bh2) | 0;
          lo = lo + Math.imul(al4, bl3) | 0;
          mid = mid + Math.imul(al4, bh3) | 0;
          mid = mid + Math.imul(ah4, bl3) | 0;
          hi = hi + Math.imul(ah4, bh3) | 0;
          lo = lo + Math.imul(al3, bl4) | 0;
          mid = mid + Math.imul(al3, bh4) | 0;
          mid = mid + Math.imul(ah3, bl4) | 0;
          hi = hi + Math.imul(ah3, bh4) | 0;
          lo = lo + Math.imul(al2, bl5) | 0;
          mid = mid + Math.imul(al2, bh5) | 0;
          mid = mid + Math.imul(ah2, bl5) | 0;
          hi = hi + Math.imul(ah2, bh5) | 0;
          lo = lo + Math.imul(al1, bl6) | 0;
          mid = mid + Math.imul(al1, bh6) | 0;
          mid = mid + Math.imul(ah1, bl6) | 0;
          hi = hi + Math.imul(ah1, bh6) | 0;
          lo = lo + Math.imul(al0, bl7) | 0;
          mid = mid + Math.imul(al0, bh7) | 0;
          mid = mid + Math.imul(ah0, bl7) | 0;
          hi = hi + Math.imul(ah0, bh7) | 0;
          var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
          w7 &= 67108863;
          lo = Math.imul(al8, bl0);
          mid = Math.imul(al8, bh0);
          mid = mid + Math.imul(ah8, bl0) | 0;
          hi = Math.imul(ah8, bh0);
          lo = lo + Math.imul(al7, bl1) | 0;
          mid = mid + Math.imul(al7, bh1) | 0;
          mid = mid + Math.imul(ah7, bl1) | 0;
          hi = hi + Math.imul(ah7, bh1) | 0;
          lo = lo + Math.imul(al6, bl2) | 0;
          mid = mid + Math.imul(al6, bh2) | 0;
          mid = mid + Math.imul(ah6, bl2) | 0;
          hi = hi + Math.imul(ah6, bh2) | 0;
          lo = lo + Math.imul(al5, bl3) | 0;
          mid = mid + Math.imul(al5, bh3) | 0;
          mid = mid + Math.imul(ah5, bl3) | 0;
          hi = hi + Math.imul(ah5, bh3) | 0;
          lo = lo + Math.imul(al4, bl4) | 0;
          mid = mid + Math.imul(al4, bh4) | 0;
          mid = mid + Math.imul(ah4, bl4) | 0;
          hi = hi + Math.imul(ah4, bh4) | 0;
          lo = lo + Math.imul(al3, bl5) | 0;
          mid = mid + Math.imul(al3, bh5) | 0;
          mid = mid + Math.imul(ah3, bl5) | 0;
          hi = hi + Math.imul(ah3, bh5) | 0;
          lo = lo + Math.imul(al2, bl6) | 0;
          mid = mid + Math.imul(al2, bh6) | 0;
          mid = mid + Math.imul(ah2, bl6) | 0;
          hi = hi + Math.imul(ah2, bh6) | 0;
          lo = lo + Math.imul(al1, bl7) | 0;
          mid = mid + Math.imul(al1, bh7) | 0;
          mid = mid + Math.imul(ah1, bl7) | 0;
          hi = hi + Math.imul(ah1, bh7) | 0;
          lo = lo + Math.imul(al0, bl8) | 0;
          mid = mid + Math.imul(al0, bh8) | 0;
          mid = mid + Math.imul(ah0, bl8) | 0;
          hi = hi + Math.imul(ah0, bh8) | 0;
          var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
          w8 &= 67108863;
          lo = Math.imul(al9, bl0);
          mid = Math.imul(al9, bh0);
          mid = mid + Math.imul(ah9, bl0) | 0;
          hi = Math.imul(ah9, bh0);
          lo = lo + Math.imul(al8, bl1) | 0;
          mid = mid + Math.imul(al8, bh1) | 0;
          mid = mid + Math.imul(ah8, bl1) | 0;
          hi = hi + Math.imul(ah8, bh1) | 0;
          lo = lo + Math.imul(al7, bl2) | 0;
          mid = mid + Math.imul(al7, bh2) | 0;
          mid = mid + Math.imul(ah7, bl2) | 0;
          hi = hi + Math.imul(ah7, bh2) | 0;
          lo = lo + Math.imul(al6, bl3) | 0;
          mid = mid + Math.imul(al6, bh3) | 0;
          mid = mid + Math.imul(ah6, bl3) | 0;
          hi = hi + Math.imul(ah6, bh3) | 0;
          lo = lo + Math.imul(al5, bl4) | 0;
          mid = mid + Math.imul(al5, bh4) | 0;
          mid = mid + Math.imul(ah5, bl4) | 0;
          hi = hi + Math.imul(ah5, bh4) | 0;
          lo = lo + Math.imul(al4, bl5) | 0;
          mid = mid + Math.imul(al4, bh5) | 0;
          mid = mid + Math.imul(ah4, bl5) | 0;
          hi = hi + Math.imul(ah4, bh5) | 0;
          lo = lo + Math.imul(al3, bl6) | 0;
          mid = mid + Math.imul(al3, bh6) | 0;
          mid = mid + Math.imul(ah3, bl6) | 0;
          hi = hi + Math.imul(ah3, bh6) | 0;
          lo = lo + Math.imul(al2, bl7) | 0;
          mid = mid + Math.imul(al2, bh7) | 0;
          mid = mid + Math.imul(ah2, bl7) | 0;
          hi = hi + Math.imul(ah2, bh7) | 0;
          lo = lo + Math.imul(al1, bl8) | 0;
          mid = mid + Math.imul(al1, bh8) | 0;
          mid = mid + Math.imul(ah1, bl8) | 0;
          hi = hi + Math.imul(ah1, bh8) | 0;
          lo = lo + Math.imul(al0, bl9) | 0;
          mid = mid + Math.imul(al0, bh9) | 0;
          mid = mid + Math.imul(ah0, bl9) | 0;
          hi = hi + Math.imul(ah0, bh9) | 0;
          var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
          w9 &= 67108863;
          lo = Math.imul(al9, bl1);
          mid = Math.imul(al9, bh1);
          mid = mid + Math.imul(ah9, bl1) | 0;
          hi = Math.imul(ah9, bh1);
          lo = lo + Math.imul(al8, bl2) | 0;
          mid = mid + Math.imul(al8, bh2) | 0;
          mid = mid + Math.imul(ah8, bl2) | 0;
          hi = hi + Math.imul(ah8, bh2) | 0;
          lo = lo + Math.imul(al7, bl3) | 0;
          mid = mid + Math.imul(al7, bh3) | 0;
          mid = mid + Math.imul(ah7, bl3) | 0;
          hi = hi + Math.imul(ah7, bh3) | 0;
          lo = lo + Math.imul(al6, bl4) | 0;
          mid = mid + Math.imul(al6, bh4) | 0;
          mid = mid + Math.imul(ah6, bl4) | 0;
          hi = hi + Math.imul(ah6, bh4) | 0;
          lo = lo + Math.imul(al5, bl5) | 0;
          mid = mid + Math.imul(al5, bh5) | 0;
          mid = mid + Math.imul(ah5, bl5) | 0;
          hi = hi + Math.imul(ah5, bh5) | 0;
          lo = lo + Math.imul(al4, bl6) | 0;
          mid = mid + Math.imul(al4, bh6) | 0;
          mid = mid + Math.imul(ah4, bl6) | 0;
          hi = hi + Math.imul(ah4, bh6) | 0;
          lo = lo + Math.imul(al3, bl7) | 0;
          mid = mid + Math.imul(al3, bh7) | 0;
          mid = mid + Math.imul(ah3, bl7) | 0;
          hi = hi + Math.imul(ah3, bh7) | 0;
          lo = lo + Math.imul(al2, bl8) | 0;
          mid = mid + Math.imul(al2, bh8) | 0;
          mid = mid + Math.imul(ah2, bl8) | 0;
          hi = hi + Math.imul(ah2, bh8) | 0;
          lo = lo + Math.imul(al1, bl9) | 0;
          mid = mid + Math.imul(al1, bh9) | 0;
          mid = mid + Math.imul(ah1, bl9) | 0;
          hi = hi + Math.imul(ah1, bh9) | 0;
          var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
          w10 &= 67108863;
          lo = Math.imul(al9, bl2);
          mid = Math.imul(al9, bh2);
          mid = mid + Math.imul(ah9, bl2) | 0;
          hi = Math.imul(ah9, bh2);
          lo = lo + Math.imul(al8, bl3) | 0;
          mid = mid + Math.imul(al8, bh3) | 0;
          mid = mid + Math.imul(ah8, bl3) | 0;
          hi = hi + Math.imul(ah8, bh3) | 0;
          lo = lo + Math.imul(al7, bl4) | 0;
          mid = mid + Math.imul(al7, bh4) | 0;
          mid = mid + Math.imul(ah7, bl4) | 0;
          hi = hi + Math.imul(ah7, bh4) | 0;
          lo = lo + Math.imul(al6, bl5) | 0;
          mid = mid + Math.imul(al6, bh5) | 0;
          mid = mid + Math.imul(ah6, bl5) | 0;
          hi = hi + Math.imul(ah6, bh5) | 0;
          lo = lo + Math.imul(al5, bl6) | 0;
          mid = mid + Math.imul(al5, bh6) | 0;
          mid = mid + Math.imul(ah5, bl6) | 0;
          hi = hi + Math.imul(ah5, bh6) | 0;
          lo = lo + Math.imul(al4, bl7) | 0;
          mid = mid + Math.imul(al4, bh7) | 0;
          mid = mid + Math.imul(ah4, bl7) | 0;
          hi = hi + Math.imul(ah4, bh7) | 0;
          lo = lo + Math.imul(al3, bl8) | 0;
          mid = mid + Math.imul(al3, bh8) | 0;
          mid = mid + Math.imul(ah3, bl8) | 0;
          hi = hi + Math.imul(ah3, bh8) | 0;
          lo = lo + Math.imul(al2, bl9) | 0;
          mid = mid + Math.imul(al2, bh9) | 0;
          mid = mid + Math.imul(ah2, bl9) | 0;
          hi = hi + Math.imul(ah2, bh9) | 0;
          var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
          w11 &= 67108863;
          lo = Math.imul(al9, bl3);
          mid = Math.imul(al9, bh3);
          mid = mid + Math.imul(ah9, bl3) | 0;
          hi = Math.imul(ah9, bh3);
          lo = lo + Math.imul(al8, bl4) | 0;
          mid = mid + Math.imul(al8, bh4) | 0;
          mid = mid + Math.imul(ah8, bl4) | 0;
          hi = hi + Math.imul(ah8, bh4) | 0;
          lo = lo + Math.imul(al7, bl5) | 0;
          mid = mid + Math.imul(al7, bh5) | 0;
          mid = mid + Math.imul(ah7, bl5) | 0;
          hi = hi + Math.imul(ah7, bh5) | 0;
          lo = lo + Math.imul(al6, bl6) | 0;
          mid = mid + Math.imul(al6, bh6) | 0;
          mid = mid + Math.imul(ah6, bl6) | 0;
          hi = hi + Math.imul(ah6, bh6) | 0;
          lo = lo + Math.imul(al5, bl7) | 0;
          mid = mid + Math.imul(al5, bh7) | 0;
          mid = mid + Math.imul(ah5, bl7) | 0;
          hi = hi + Math.imul(ah5, bh7) | 0;
          lo = lo + Math.imul(al4, bl8) | 0;
          mid = mid + Math.imul(al4, bh8) | 0;
          mid = mid + Math.imul(ah4, bl8) | 0;
          hi = hi + Math.imul(ah4, bh8) | 0;
          lo = lo + Math.imul(al3, bl9) | 0;
          mid = mid + Math.imul(al3, bh9) | 0;
          mid = mid + Math.imul(ah3, bl9) | 0;
          hi = hi + Math.imul(ah3, bh9) | 0;
          var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
          w12 &= 67108863;
          lo = Math.imul(al9, bl4);
          mid = Math.imul(al9, bh4);
          mid = mid + Math.imul(ah9, bl4) | 0;
          hi = Math.imul(ah9, bh4);
          lo = lo + Math.imul(al8, bl5) | 0;
          mid = mid + Math.imul(al8, bh5) | 0;
          mid = mid + Math.imul(ah8, bl5) | 0;
          hi = hi + Math.imul(ah8, bh5) | 0;
          lo = lo + Math.imul(al7, bl6) | 0;
          mid = mid + Math.imul(al7, bh6) | 0;
          mid = mid + Math.imul(ah7, bl6) | 0;
          hi = hi + Math.imul(ah7, bh6) | 0;
          lo = lo + Math.imul(al6, bl7) | 0;
          mid = mid + Math.imul(al6, bh7) | 0;
          mid = mid + Math.imul(ah6, bl7) | 0;
          hi = hi + Math.imul(ah6, bh7) | 0;
          lo = lo + Math.imul(al5, bl8) | 0;
          mid = mid + Math.imul(al5, bh8) | 0;
          mid = mid + Math.imul(ah5, bl8) | 0;
          hi = hi + Math.imul(ah5, bh8) | 0;
          lo = lo + Math.imul(al4, bl9) | 0;
          mid = mid + Math.imul(al4, bh9) | 0;
          mid = mid + Math.imul(ah4, bl9) | 0;
          hi = hi + Math.imul(ah4, bh9) | 0;
          var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
          w13 &= 67108863;
          lo = Math.imul(al9, bl5);
          mid = Math.imul(al9, bh5);
          mid = mid + Math.imul(ah9, bl5) | 0;
          hi = Math.imul(ah9, bh5);
          lo = lo + Math.imul(al8, bl6) | 0;
          mid = mid + Math.imul(al8, bh6) | 0;
          mid = mid + Math.imul(ah8, bl6) | 0;
          hi = hi + Math.imul(ah8, bh6) | 0;
          lo = lo + Math.imul(al7, bl7) | 0;
          mid = mid + Math.imul(al7, bh7) | 0;
          mid = mid + Math.imul(ah7, bl7) | 0;
          hi = hi + Math.imul(ah7, bh7) | 0;
          lo = lo + Math.imul(al6, bl8) | 0;
          mid = mid + Math.imul(al6, bh8) | 0;
          mid = mid + Math.imul(ah6, bl8) | 0;
          hi = hi + Math.imul(ah6, bh8) | 0;
          lo = lo + Math.imul(al5, bl9) | 0;
          mid = mid + Math.imul(al5, bh9) | 0;
          mid = mid + Math.imul(ah5, bl9) | 0;
          hi = hi + Math.imul(ah5, bh9) | 0;
          var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
          w14 &= 67108863;
          lo = Math.imul(al9, bl6);
          mid = Math.imul(al9, bh6);
          mid = mid + Math.imul(ah9, bl6) | 0;
          hi = Math.imul(ah9, bh6);
          lo = lo + Math.imul(al8, bl7) | 0;
          mid = mid + Math.imul(al8, bh7) | 0;
          mid = mid + Math.imul(ah8, bl7) | 0;
          hi = hi + Math.imul(ah8, bh7) | 0;
          lo = lo + Math.imul(al7, bl8) | 0;
          mid = mid + Math.imul(al7, bh8) | 0;
          mid = mid + Math.imul(ah7, bl8) | 0;
          hi = hi + Math.imul(ah7, bh8) | 0;
          lo = lo + Math.imul(al6, bl9) | 0;
          mid = mid + Math.imul(al6, bh9) | 0;
          mid = mid + Math.imul(ah6, bl9) | 0;
          hi = hi + Math.imul(ah6, bh9) | 0;
          var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
          w15 &= 67108863;
          lo = Math.imul(al9, bl7);
          mid = Math.imul(al9, bh7);
          mid = mid + Math.imul(ah9, bl7) | 0;
          hi = Math.imul(ah9, bh7);
          lo = lo + Math.imul(al8, bl8) | 0;
          mid = mid + Math.imul(al8, bh8) | 0;
          mid = mid + Math.imul(ah8, bl8) | 0;
          hi = hi + Math.imul(ah8, bh8) | 0;
          lo = lo + Math.imul(al7, bl9) | 0;
          mid = mid + Math.imul(al7, bh9) | 0;
          mid = mid + Math.imul(ah7, bl9) | 0;
          hi = hi + Math.imul(ah7, bh9) | 0;
          var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
          w16 &= 67108863;
          lo = Math.imul(al9, bl8);
          mid = Math.imul(al9, bh8);
          mid = mid + Math.imul(ah9, bl8) | 0;
          hi = Math.imul(ah9, bh8);
          lo = lo + Math.imul(al8, bl9) | 0;
          mid = mid + Math.imul(al8, bh9) | 0;
          mid = mid + Math.imul(ah8, bl9) | 0;
          hi = hi + Math.imul(ah8, bh9) | 0;
          var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
          w17 &= 67108863;
          lo = Math.imul(al9, bl9);
          mid = Math.imul(al9, bh9);
          mid = mid + Math.imul(ah9, bl9) | 0;
          hi = Math.imul(ah9, bh9);
          var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
          w18 &= 67108863;
          o[0] = w0;
          o[1] = w1;
          o[2] = w2;
          o[3] = w3;
          o[4] = w4;
          o[5] = w5;
          o[6] = w6;
          o[7] = w7;
          o[8] = w8;
          o[9] = w9;
          o[10] = w10;
          o[11] = w11;
          o[12] = w12;
          o[13] = w13;
          o[14] = w14;
          o[15] = w15;
          o[16] = w16;
          o[17] = w17;
          o[18] = w18;
          if (c !== 0) {
            o[19] = c;
            out.length++;
          }
          return out;
        };
        if (!Math.imul) {
          comb10MulTo = smallMulTo;
        }
        function bigMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          out.length = self.length + num.length;
          var carry = 0;
          var hncarry = 0;
          for (var k = 0; k < out.length - 1; k++) {
            var ncarry = hncarry;
            hncarry = 0;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j;
              var a = self.words[i] | 0;
              var b = num.words[j] | 0;
              var r = a * b;
              var lo = r & 67108863;
              ncarry = ncarry + (r / 67108864 | 0) | 0;
              lo = lo + rword | 0;
              rword = lo & 67108863;
              ncarry = ncarry + (lo >>> 26) | 0;
              hncarry += ncarry >>> 26;
              ncarry &= 67108863;
            }
            out.words[k] = rword;
            carry = ncarry;
            ncarry = hncarry;
          }
          if (carry !== 0) {
            out.words[k] = carry;
          } else {
            out.length--;
          }
          return out.strip();
        }
        function jumboMulTo(self, num, out) {
          var fftm = new FFTM;
          return fftm.mulp(self, num, out);
        }
        BN.prototype.mulTo = function mulTo(num, out) {
          var res;
          var len = this.length + num.length;
          if (this.length === 10 && num.length === 10) {
            res = comb10MulTo(this, num, out);
          } else if (len < 63) {
            res = smallMulTo(this, num, out);
          } else if (len < 1024) {
            res = bigMulTo(this, num, out);
          } else {
            res = jumboMulTo(this, num, out);
          }
          return res;
        };
        function FFTM(x, y) {
          this.x = x;
          this.y = y;
        }
        FFTM.prototype.makeRBT = function makeRBT(N) {
          var t = new Array(N);
          var l = BN.prototype._countBits(N) - 1;
          for (var i = 0; i < N; i++) {
            t[i] = this.revBin(i, l, N);
          }
          return t;
        };
        FFTM.prototype.revBin = function revBin(x, l, N) {
          if (x === 0 || x === N - 1) return x;
          var rb = 0;
          for (var i = 0; i < l; i++) {
            rb |= (x & 1) << l - i - 1;
            x >>= 1;
          }
          return rb;
        };
        FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
          for (var i = 0; i < N; i++) {
            rtws[i] = rws[rbt[i]];
            itws[i] = iws[rbt[i]];
          }
        };
        FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
          this.permute(rbt, rws, iws, rtws, itws, N);
          for (var s = 1; s < N; s <<= 1) {
            var l = s << 1;
            var rtwdf = Math.cos(2 * Math.PI / l);
            var itwdf = Math.sin(2 * Math.PI / l);
            for (var p = 0; p < N; p += l) {
              var rtwdf_ = rtwdf;
              var itwdf_ = itwdf;
              for (var j = 0; j < s; j++) {
                var re = rtws[p + j];
                var ie = itws[p + j];
                var ro = rtws[p + j + s];
                var io = itws[p + j + s];
                var rx = rtwdf_ * ro - itwdf_ * io;
                io = rtwdf_ * io + itwdf_ * ro;
                ro = rx;
                rtws[p + j] = re + ro;
                itws[p + j] = ie + io;
                rtws[p + j + s] = re - ro;
                itws[p + j + s] = ie - io;
                if (j !== l) {
                  rx = rtwdf * rtwdf_ - itwdf * itwdf_;
                  itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
                  rtwdf_ = rx;
                }
              }
            }
          }
        };
        FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
          var N = Math.max(m, n) | 1;
          var odd = N & 1;
          var i = 0;
          for (N = N / 2 | 0; N; N = N >>> 1) {
            i++;
          }
          return 1 << i + 1 + odd;
        };
        FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
          if (N <= 1) return;
          for (var i = 0; i < N / 2; i++) {
            var t = rws[i];
            rws[i] = rws[N - i - 1];
            rws[N - i - 1] = t;
            t = iws[i];
            iws[i] = -iws[N - i - 1];
            iws[N - i - 1] = -t;
          }
        };
        FFTM.prototype.normalize13b = function normalize13b(ws, N) {
          var carry = 0;
          for (var i = 0; i < N / 2; i++) {
            var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
            ws[i] = w & 67108863;
            if (w < 67108864) {
              carry = 0;
            } else {
              carry = w / 67108864 | 0;
            }
          }
          return ws;
        };
        FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
          var carry = 0;
          for (var i = 0; i < len; i++) {
            carry = carry + (ws[i] | 0);
            rws[2 * i] = carry & 8191;
            carry = carry >>> 13;
            rws[2 * i + 1] = carry & 8191;
            carry = carry >>> 13;
          }
          for (i = 2 * len; i < N; ++i) {
            rws[i] = 0;
          }
          assert(carry === 0);
          assert((carry & ~8191) === 0);
        };
        FFTM.prototype.stub = function stub(N) {
          var ph = new Array(N);
          for (var i = 0; i < N; i++) {
            ph[i] = 0;
          }
          return ph;
        };
        FFTM.prototype.mulp = function mulp(x, y, out) {
          var N = 2 * this.guessLen13b(x.length, y.length);
          var rbt = this.makeRBT(N);
          var _ = this.stub(N);
          var rws = new Array(N);
          var rwst = new Array(N);
          var iwst = new Array(N);
          var nrws = new Array(N);
          var nrwst = new Array(N);
          var niwst = new Array(N);
          var rmws = out.words;
          rmws.length = N;
          this.convert13b(x.words, x.length, rws, N);
          this.convert13b(y.words, y.length, nrws, N);
          this.transform(rws, _, rwst, iwst, N, rbt);
          this.transform(nrws, _, nrwst, niwst, N, rbt);
          for (var i = 0; i < N; i++) {
            var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
            iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
            rwst[i] = rx;
          }
          this.conjugate(rwst, iwst, N);
          this.transform(rwst, iwst, rmws, _, N, rbt);
          this.conjugate(rmws, _, N);
          this.normalize13b(rmws, N);
          out.negative = x.negative ^ y.negative;
          out.length = x.length + y.length;
          return out.strip();
        };
        BN.prototype.mul = function mul(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return this.mulTo(num, out);
        };
        BN.prototype.mulf = function mulf(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return jumboMulTo(this, num, out);
        };
        BN.prototype.imul = function imul(num) {
          return this.clone().mulTo(num, this);
        };
        BN.prototype.imuln = function imuln(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          var carry = 0;
          for (var i = 0; i < this.length; i++) {
            var w = (this.words[i] | 0) * num;
            var lo = (w & 67108863) + (carry & 67108863);
            carry >>= 26;
            carry += w / 67108864 | 0;
            carry += lo >>> 26;
            this.words[i] = lo & 67108863;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          this.length = num === 0 ? 1 : this.length;
          return this;
        };
        BN.prototype.muln = function muln(num) {
          return this.clone().imuln(num);
        };
        BN.prototype.sqr = function sqr() {
          return this.mul(this);
        };
        BN.prototype.isqr = function isqr() {
          return this.imul(this.clone());
        };
        BN.prototype.pow = function pow(num) {
          var w = toBitArray(num);
          if (w.length === 0) return new BN(1);
          var res = this;
          for (var i = 0; i < w.length; i++, res = res.sqr()) {
            if (w[i] !== 0) break;
          }
          if (++i < w.length) {
            for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
              if (w[i] === 0) continue;
              res = res.mul(q);
            }
          }
          return res;
        };
        BN.prototype.iushln = function iushln(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          var carryMask = 67108863 >>> 26 - r << 26 - r;
          var i;
          if (r !== 0) {
            var carry = 0;
            for (i = 0; i < this.length; i++) {
              var newCarry = this.words[i] & carryMask;
              var c = (this.words[i] | 0) - newCarry << r;
              this.words[i] = c | carry;
              carry = newCarry >>> 26 - r;
            }
            if (carry) {
              this.words[i] = carry;
              this.length++;
            }
          }
          if (s !== 0) {
            for (i = this.length - 1; i >= 0; i--) {
              this.words[i + s] = this.words[i];
            }
            for (i = 0; i < s; i++) {
              this.words[i] = 0;
            }
            this.length += s;
          }
          return this.strip();
        };
        BN.prototype.ishln = function ishln(bits) {
          assert(this.negative === 0);
          return this.iushln(bits);
        };
        BN.prototype.iushrn = function iushrn(bits, hint, extended) {
          assert(typeof bits === "number" && bits >= 0);
          var h;
          if (hint) {
            h = (hint - hint % 26) / 26;
          } else {
            h = 0;
          }
          var r = bits % 26;
          var s = Math.min((bits - r) / 26, this.length);
          var mask = 67108863 ^ 67108863 >>> r << r;
          var maskedWords = extended;
          h -= s;
          h = Math.max(0, h);
          if (maskedWords) {
            for (var i = 0; i < s; i++) {
              maskedWords.words[i] = this.words[i];
            }
            maskedWords.length = s;
          }
          if (s === 0) {} else if (this.length > s) {
            this.length -= s;
            for (i = 0; i < this.length; i++) {
              this.words[i] = this.words[i + s];
            }
          } else {
            this.words[0] = 0;
            this.length = 1;
          }
          var carry = 0;
          for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
            var word = this.words[i] | 0;
            this.words[i] = carry << 26 - r | word >>> r;
            carry = word & mask;
          }
          if (maskedWords && carry !== 0) {
            maskedWords.words[maskedWords.length++] = carry;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.ishrn = function ishrn(bits, hint, extended) {
          assert(this.negative === 0);
          return this.iushrn(bits, hint, extended);
        };
        BN.prototype.shln = function shln(bits) {
          return this.clone().ishln(bits);
        };
        BN.prototype.ushln = function ushln(bits) {
          return this.clone().iushln(bits);
        };
        BN.prototype.shrn = function shrn(bits) {
          return this.clone().ishrn(bits);
        };
        BN.prototype.ushrn = function ushrn(bits) {
          return this.clone().iushrn(bits);
        };
        BN.prototype.testn = function testn(bit) {
          assert(typeof bit === "number" && bit >= 0);
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) return false;
          var w = this.words[s];
          return !!(w & q);
        };
        BN.prototype.imaskn = function imaskn(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          assert(this.negative === 0, "imaskn works only with positive numbers");
          if (this.length <= s) {
            return this;
          }
          if (r !== 0) {
            s++;
          }
          this.length = Math.min(s, this.length);
          if (r !== 0) {
            var mask = 67108863 ^ 67108863 >>> r << r;
            this.words[this.length - 1] &= mask;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.maskn = function maskn(bits) {
          return this.clone().imaskn(bits);
        };
        BN.prototype.iaddn = function iaddn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.isubn(-num);
          if (this.negative !== 0) {
            if (this.length === 1 && (this.words[0] | 0) < num) {
              this.words[0] = num - (this.words[0] | 0);
              this.negative = 0;
              return this;
            }
            this.negative = 0;
            this.isubn(num);
            this.negative = 1;
            return this;
          }
          return this._iaddn(num);
        };
        BN.prototype._iaddn = function _iaddn(num) {
          this.words[0] += num;
          for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
            this.words[i] -= 67108864;
            if (i === this.length - 1) {
              this.words[i + 1] = 1;
            } else {
              this.words[i + 1]++;
            }
          }
          this.length = Math.max(this.length, i + 1);
          return this;
        };
        BN.prototype.isubn = function isubn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.iaddn(-num);
          if (this.negative !== 0) {
            this.negative = 0;
            this.iaddn(num);
            this.negative = 1;
            return this;
          }
          this.words[0] -= num;
          if (this.length === 1 && this.words[0] < 0) {
            this.words[0] = -this.words[0];
            this.negative = 1;
          } else {
            for (var i = 0; i < this.length && this.words[i] < 0; i++) {
              this.words[i] += 67108864;
              this.words[i + 1] -= 1;
            }
          }
          return this.strip();
        };
        BN.prototype.addn = function addn(num) {
          return this.clone().iaddn(num);
        };
        BN.prototype.subn = function subn(num) {
          return this.clone().isubn(num);
        };
        BN.prototype.iabs = function iabs() {
          this.negative = 0;
          return this;
        };
        BN.prototype.abs = function abs() {
          return this.clone().iabs();
        };
        BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
          var len = num.length + shift;
          var i;
          this._expand(len);
          var w;
          var carry = 0;
          for (i = 0; i < num.length; i++) {
            w = (this.words[i + shift] | 0) + carry;
            var right = (num.words[i] | 0) * mul;
            w -= right & 67108863;
            carry = (w >> 26) - (right / 67108864 | 0);
            this.words[i + shift] = w & 67108863;
          }
          for (;i < this.length - shift; i++) {
            w = (this.words[i + shift] | 0) + carry;
            carry = w >> 26;
            this.words[i + shift] = w & 67108863;
          }
          if (carry === 0) return this.strip();
          assert(carry === -1);
          carry = 0;
          for (i = 0; i < this.length; i++) {
            w = -(this.words[i] | 0) + carry;
            carry = w >> 26;
            this.words[i] = w & 67108863;
          }
          this.negative = 1;
          return this.strip();
        };
        BN.prototype._wordDiv = function _wordDiv(num, mode) {
          var shift = this.length - num.length;
          var a = this.clone();
          var b = num;
          var bhi = b.words[b.length - 1] | 0;
          var bhiBits = this._countBits(bhi);
          shift = 26 - bhiBits;
          if (shift !== 0) {
            b = b.ushln(shift);
            a.iushln(shift);
            bhi = b.words[b.length - 1] | 0;
          }
          var m = a.length - b.length;
          var q;
          if (mode !== "mod") {
            q = new BN(null);
            q.length = m + 1;
            q.words = new Array(q.length);
            for (var i = 0; i < q.length; i++) {
              q.words[i] = 0;
            }
          }
          var diff = a.clone()._ishlnsubmul(b, 1, m);
          if (diff.negative === 0) {
            a = diff;
            if (q) {
              q.words[m] = 1;
            }
          }
          for (var j = m - 1; j >= 0; j--) {
            var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
            qj = Math.min(qj / bhi | 0, 67108863);
            a._ishlnsubmul(b, qj, j);
            while (a.negative !== 0) {
              qj--;
              a.negative = 0;
              a._ishlnsubmul(b, 1, j);
              if (!a.isZero()) {
                a.negative ^= 1;
              }
            }
            if (q) {
              q.words[j] = qj;
            }
          }
          if (q) {
            q.strip();
          }
          a.strip();
          if (mode !== "div" && shift !== 0) {
            a.iushrn(shift);
          }
          return {
            div: q || null,
            mod: a
          };
        };
        BN.prototype.divmod = function divmod(num, mode, positive) {
          assert(!num.isZero());
          if (this.isZero()) {
            return {
              div: new BN(0),
              mod: new BN(0)
            };
          }
          var div, mod, res;
          if (this.negative !== 0 && num.negative === 0) {
            res = this.neg().divmod(num, mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.iadd(num);
              }
            }
            return {
              div,
              mod
            };
          }
          if (this.negative === 0 && num.negative !== 0) {
            res = this.divmod(num.neg(), mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            return {
              div,
              mod: res.mod
            };
          }
          if ((this.negative & num.negative) !== 0) {
            res = this.neg().divmod(num.neg(), mode);
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.isub(num);
              }
            }
            return {
              div: res.div,
              mod
            };
          }
          if (num.length > this.length || this.cmp(num) < 0) {
            return {
              div: new BN(0),
              mod: this
            };
          }
          if (num.length === 1) {
            if (mode === "div") {
              return {
                div: this.divn(num.words[0]),
                mod: null
              };
            }
            if (mode === "mod") {
              return {
                div: null,
                mod: new BN(this.modn(num.words[0]))
              };
            }
            return {
              div: this.divn(num.words[0]),
              mod: new BN(this.modn(num.words[0]))
            };
          }
          return this._wordDiv(num, mode);
        };
        BN.prototype.div = function div(num) {
          return this.divmod(num, "div", false).div;
        };
        BN.prototype.mod = function mod(num) {
          return this.divmod(num, "mod", false).mod;
        };
        BN.prototype.umod = function umod(num) {
          return this.divmod(num, "mod", true).mod;
        };
        BN.prototype.divRound = function divRound(num) {
          var dm = this.divmod(num);
          if (dm.mod.isZero()) return dm.div;
          var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
          var half = num.ushrn(1);
          var r2 = num.andln(1);
          var cmp = mod.cmp(half);
          if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
          return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
        };
        BN.prototype.modn = function modn(num) {
          assert(num <= 67108863);
          var p = (1 << 26) % num;
          var acc = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            acc = (p * acc + (this.words[i] | 0)) % num;
          }
          return acc;
        };
        BN.prototype.idivn = function idivn(num) {
          assert(num <= 67108863);
          var carry = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var w = (this.words[i] | 0) + carry * 67108864;
            this.words[i] = w / num | 0;
            carry = w % num;
          }
          return this.strip();
        };
        BN.prototype.divn = function divn(num) {
          return this.clone().idivn(num);
        };
        BN.prototype.egcd = function egcd(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var x = this;
          var y = p.clone();
          if (x.negative !== 0) {
            x = x.umod(p);
          } else {
            x = x.clone();
          }
          var A = new BN(1);
          var B = new BN(0);
          var C = new BN(0);
          var D = new BN(1);
          var g = 0;
          while (x.isEven() && y.isEven()) {
            x.iushrn(1);
            y.iushrn(1);
            ++g;
          }
          var yp = y.clone();
          var xp = x.clone();
          while (!x.isZero()) {
            for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              x.iushrn(i);
              while (i-- > 0) {
                if (A.isOdd() || B.isOdd()) {
                  A.iadd(yp);
                  B.isub(xp);
                }
                A.iushrn(1);
                B.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              y.iushrn(j);
              while (j-- > 0) {
                if (C.isOdd() || D.isOdd()) {
                  C.iadd(yp);
                  D.isub(xp);
                }
                C.iushrn(1);
                D.iushrn(1);
              }
            }
            if (x.cmp(y) >= 0) {
              x.isub(y);
              A.isub(C);
              B.isub(D);
            } else {
              y.isub(x);
              C.isub(A);
              D.isub(B);
            }
          }
          return {
            a: C,
            b: D,
            gcd: y.iushln(g)
          };
        };
        BN.prototype._invmp = function _invmp(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var a = this;
          var b = p.clone();
          if (a.negative !== 0) {
            a = a.umod(p);
          } else {
            a = a.clone();
          }
          var x1 = new BN(1);
          var x2 = new BN(0);
          var delta = b.clone();
          while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
            for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              a.iushrn(i);
              while (i-- > 0) {
                if (x1.isOdd()) {
                  x1.iadd(delta);
                }
                x1.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              b.iushrn(j);
              while (j-- > 0) {
                if (x2.isOdd()) {
                  x2.iadd(delta);
                }
                x2.iushrn(1);
              }
            }
            if (a.cmp(b) >= 0) {
              a.isub(b);
              x1.isub(x2);
            } else {
              b.isub(a);
              x2.isub(x1);
            }
          }
          var res;
          if (a.cmpn(1) === 0) {
            res = x1;
          } else {
            res = x2;
          }
          if (res.cmpn(0) < 0) {
            res.iadd(p);
          }
          return res;
        };
        BN.prototype.gcd = function gcd(num) {
          if (this.isZero()) return num.abs();
          if (num.isZero()) return this.abs();
          var a = this.clone();
          var b = num.clone();
          a.negative = 0;
          b.negative = 0;
          for (var shift = 0; a.isEven() && b.isEven(); shift++) {
            a.iushrn(1);
            b.iushrn(1);
          }
          do {
            while (a.isEven()) {
              a.iushrn(1);
            }
            while (b.isEven()) {
              b.iushrn(1);
            }
            var r = a.cmp(b);
            if (r < 0) {
              var t = a;
              a = b;
              b = t;
            } else if (r === 0 || b.cmpn(1) === 0) {
              break;
            }
            a.isub(b);
          } while (true);
          return b.iushln(shift);
        };
        BN.prototype.invm = function invm(num) {
          return this.egcd(num).a.umod(num);
        };
        BN.prototype.isEven = function isEven() {
          return (this.words[0] & 1) === 0;
        };
        BN.prototype.isOdd = function isOdd() {
          return (this.words[0] & 1) === 1;
        };
        BN.prototype.andln = function andln(num) {
          return this.words[0] & num;
        };
        BN.prototype.bincn = function bincn(bit) {
          assert(typeof bit === "number");
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) {
            this._expand(s + 1);
            this.words[s] |= q;
            return this;
          }
          var carry = q;
          for (var i = s; carry !== 0 && i < this.length; i++) {
            var w = this.words[i] | 0;
            w += carry;
            carry = w >>> 26;
            w &= 67108863;
            this.words[i] = w;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          return this;
        };
        BN.prototype.isZero = function isZero() {
          return this.length === 1 && this.words[0] === 0;
        };
        BN.prototype.cmpn = function cmpn(num) {
          var negative = num < 0;
          if (this.negative !== 0 && !negative) return -1;
          if (this.negative === 0 && negative) return 1;
          this.strip();
          var res;
          if (this.length > 1) {
            res = 1;
          } else {
            if (negative) {
              num = -num;
            }
            assert(num <= 67108863, "Number is too big");
            var w = this.words[0] | 0;
            res = w === num ? 0 : w < num ? -1 : 1;
          }
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.cmp = function cmp(num) {
          if (this.negative !== 0 && num.negative === 0) return -1;
          if (this.negative === 0 && num.negative !== 0) return 1;
          var res = this.ucmp(num);
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.ucmp = function ucmp(num) {
          if (this.length > num.length) return 1;
          if (this.length < num.length) return -1;
          var res = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var a = this.words[i] | 0;
            var b = num.words[i] | 0;
            if (a === b) continue;
            if (a < b) {
              res = -1;
            } else if (a > b) {
              res = 1;
            }
            break;
          }
          return res;
        };
        BN.prototype.gtn = function gtn(num) {
          return this.cmpn(num) === 1;
        };
        BN.prototype.gt = function gt(num) {
          return this.cmp(num) === 1;
        };
        BN.prototype.gten = function gten(num) {
          return this.cmpn(num) >= 0;
        };
        BN.prototype.gte = function gte(num) {
          return this.cmp(num) >= 0;
        };
        BN.prototype.ltn = function ltn(num) {
          return this.cmpn(num) === -1;
        };
        BN.prototype.lt = function lt(num) {
          return this.cmp(num) === -1;
        };
        BN.prototype.lten = function lten(num) {
          return this.cmpn(num) <= 0;
        };
        BN.prototype.lte = function lte(num) {
          return this.cmp(num) <= 0;
        };
        BN.prototype.eqn = function eqn(num) {
          return this.cmpn(num) === 0;
        };
        BN.prototype.eq = function eq(num) {
          return this.cmp(num) === 0;
        };
        BN.red = function red(num) {
          return new Red(num);
        };
        BN.prototype.toRed = function toRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          assert(this.negative === 0, "red works only with positives");
          return ctx.convertTo(this)._forceRed(ctx);
        };
        BN.prototype.fromRed = function fromRed() {
          assert(this.red, "fromRed works only with numbers in reduction context");
          return this.red.convertFrom(this);
        };
        BN.prototype._forceRed = function _forceRed(ctx) {
          this.red = ctx;
          return this;
        };
        BN.prototype.forceRed = function forceRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          return this._forceRed(ctx);
        };
        BN.prototype.redAdd = function redAdd(num) {
          assert(this.red, "redAdd works only with red numbers");
          return this.red.add(this, num);
        };
        BN.prototype.redIAdd = function redIAdd(num) {
          assert(this.red, "redIAdd works only with red numbers");
          return this.red.iadd(this, num);
        };
        BN.prototype.redSub = function redSub(num) {
          assert(this.red, "redSub works only with red numbers");
          return this.red.sub(this, num);
        };
        BN.prototype.redISub = function redISub(num) {
          assert(this.red, "redISub works only with red numbers");
          return this.red.isub(this, num);
        };
        BN.prototype.redShl = function redShl(num) {
          assert(this.red, "redShl works only with red numbers");
          return this.red.shl(this, num);
        };
        BN.prototype.redMul = function redMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.mul(this, num);
        };
        BN.prototype.redIMul = function redIMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.imul(this, num);
        };
        BN.prototype.redSqr = function redSqr() {
          assert(this.red, "redSqr works only with red numbers");
          this.red._verify1(this);
          return this.red.sqr(this);
        };
        BN.prototype.redISqr = function redISqr() {
          assert(this.red, "redISqr works only with red numbers");
          this.red._verify1(this);
          return this.red.isqr(this);
        };
        BN.prototype.redSqrt = function redSqrt() {
          assert(this.red, "redSqrt works only with red numbers");
          this.red._verify1(this);
          return this.red.sqrt(this);
        };
        BN.prototype.redInvm = function redInvm() {
          assert(this.red, "redInvm works only with red numbers");
          this.red._verify1(this);
          return this.red.invm(this);
        };
        BN.prototype.redNeg = function redNeg() {
          assert(this.red, "redNeg works only with red numbers");
          this.red._verify1(this);
          return this.red.neg(this);
        };
        BN.prototype.redPow = function redPow(num) {
          assert(this.red && !num.red, "redPow(normalNum)");
          this.red._verify1(this);
          return this.red.pow(this, num);
        };
        var primes = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };
        function MPrime(name, p) {
          this.name = name;
          this.p = new BN(p, 16);
          this.n = this.p.bitLength();
          this.k = new BN(1).iushln(this.n).isub(this.p);
          this.tmp = this._tmp();
        }
        MPrime.prototype._tmp = function _tmp() {
          var tmp = new BN(null);
          tmp.words = new Array(Math.ceil(this.n / 13));
          return tmp;
        };
        MPrime.prototype.ireduce = function ireduce(num) {
          var r = num;
          var rlen;
          do {
            this.split(r, this.tmp);
            r = this.imulK(r);
            r = r.iadd(this.tmp);
            rlen = r.bitLength();
          } while (rlen > this.n);
          var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
          if (cmp === 0) {
            r.words[0] = 0;
            r.length = 1;
          } else if (cmp > 0) {
            r.isub(this.p);
          } else {
            if (r.strip !== undefined) {
              r.strip();
            } else {
              r._strip();
            }
          }
          return r;
        };
        MPrime.prototype.split = function split(input, out) {
          input.iushrn(this.n, 0, out);
        };
        MPrime.prototype.imulK = function imulK(num) {
          return num.imul(this.k);
        };
        function K256() {
          MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
        }
        inherits(K256, MPrime);
        K256.prototype.split = function split(input, output) {
          var mask = 4194303;
          var outLen = Math.min(input.length, 9);
          for (var i = 0; i < outLen; i++) {
            output.words[i] = input.words[i];
          }
          output.length = outLen;
          if (input.length <= 9) {
            input.words[0] = 0;
            input.length = 1;
            return;
          }
          var prev = input.words[9];
          output.words[output.length++] = prev & mask;
          for (i = 10; i < input.length; i++) {
            var next = input.words[i] | 0;
            input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
            prev = next;
          }
          prev >>>= 22;
          input.words[i - 10] = prev;
          if (prev === 0 && input.length > 10) {
            input.length -= 10;
          } else {
            input.length -= 9;
          }
        };
        K256.prototype.imulK = function imulK(num) {
          num.words[num.length] = 0;
          num.words[num.length + 1] = 0;
          num.length += 2;
          var lo = 0;
          for (var i = 0; i < num.length; i++) {
            var w = num.words[i] | 0;
            lo += w * 977;
            num.words[i] = lo & 67108863;
            lo = w * 64 + (lo / 67108864 | 0);
          }
          if (num.words[num.length - 1] === 0) {
            num.length--;
            if (num.words[num.length - 1] === 0) {
              num.length--;
            }
          }
          return num;
        };
        function P224() {
          MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
        }
        inherits(P224, MPrime);
        function P192() {
          MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
        }
        inherits(P192, MPrime);
        function P25519() {
          MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
        }
        inherits(P25519, MPrime);
        P25519.prototype.imulK = function imulK(num) {
          var carry = 0;
          for (var i = 0; i < num.length; i++) {
            var hi = (num.words[i] | 0) * 19 + carry;
            var lo = hi & 67108863;
            hi >>>= 26;
            num.words[i] = lo;
            carry = hi;
          }
          if (carry !== 0) {
            num.words[num.length++] = carry;
          }
          return num;
        };
        BN._prime = function prime(name) {
          if (primes[name]) return primes[name];
          var prime;
          if (name === "k256") {
            prime = new K256;
          } else if (name === "p224") {
            prime = new P224;
          } else if (name === "p192") {
            prime = new P192;
          } else if (name === "p25519") {
            prime = new P25519;
          } else {
            throw new Error("Unknown prime " + name);
          }
          primes[name] = prime;
          return prime;
        };
        function Red(m) {
          if (typeof m === "string") {
            var prime = BN._prime(m);
            this.m = prime.p;
            this.prime = prime;
          } else {
            assert(m.gtn(1), "modulus must be greater than 1");
            this.m = m;
            this.prime = null;
          }
        }
        Red.prototype._verify1 = function _verify1(a) {
          assert(a.negative === 0, "red works only with positives");
          assert(a.red, "red works only with red numbers");
        };
        Red.prototype._verify2 = function _verify2(a, b) {
          assert((a.negative | b.negative) === 0, "red works only with positives");
          assert(a.red && a.red === b.red, "red works only with red numbers");
        };
        Red.prototype.imod = function imod(a) {
          if (this.prime) return this.prime.ireduce(a)._forceRed(this);
          return a.umod(this.m)._forceRed(this);
        };
        Red.prototype.neg = function neg(a) {
          if (a.isZero()) {
            return a.clone();
          }
          return this.m.sub(a)._forceRed(this);
        };
        Red.prototype.add = function add(a, b) {
          this._verify2(a, b);
          var res = a.add(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.iadd = function iadd(a, b) {
          this._verify2(a, b);
          var res = a.iadd(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res;
        };
        Red.prototype.sub = function sub(a, b) {
          this._verify2(a, b);
          var res = a.sub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.isub = function isub(a, b) {
          this._verify2(a, b);
          var res = a.isub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res;
        };
        Red.prototype.shl = function shl(a, num) {
          this._verify1(a);
          return this.imod(a.ushln(num));
        };
        Red.prototype.imul = function imul(a, b) {
          this._verify2(a, b);
          return this.imod(a.imul(b));
        };
        Red.prototype.mul = function mul(a, b) {
          this._verify2(a, b);
          return this.imod(a.mul(b));
        };
        Red.prototype.isqr = function isqr(a) {
          return this.imul(a, a.clone());
        };
        Red.prototype.sqr = function sqr(a) {
          return this.mul(a, a);
        };
        Red.prototype.sqrt = function sqrt(a) {
          if (a.isZero()) return a.clone();
          var mod3 = this.m.andln(3);
          assert(mod3 % 2 === 1);
          if (mod3 === 3) {
            var pow = this.m.add(new BN(1)).iushrn(2);
            return this.pow(a, pow);
          }
          var q = this.m.subn(1);
          var s = 0;
          while (!q.isZero() && q.andln(1) === 0) {
            s++;
            q.iushrn(1);
          }
          assert(!q.isZero());
          var one = new BN(1).toRed(this);
          var nOne = one.redNeg();
          var lpow = this.m.subn(1).iushrn(1);
          var z = this.m.bitLength();
          z = new BN(2 * z * z).toRed(this);
          while (this.pow(z, lpow).cmp(nOne) !== 0) {
            z.redIAdd(nOne);
          }
          var c = this.pow(z, q);
          var r = this.pow(a, q.addn(1).iushrn(1));
          var t = this.pow(a, q);
          var m = s;
          while (t.cmp(one) !== 0) {
            var tmp = t;
            for (var i = 0; tmp.cmp(one) !== 0; i++) {
              tmp = tmp.redSqr();
            }
            assert(i < m);
            var b = this.pow(c, new BN(1).iushln(m - i - 1));
            r = r.redMul(b);
            c = b.redSqr();
            t = t.redMul(c);
            m = i;
          }
          return r;
        };
        Red.prototype.invm = function invm(a) {
          var inv = a._invmp(this.m);
          if (inv.negative !== 0) {
            inv.negative = 0;
            return this.imod(inv).redNeg();
          } else {
            return this.imod(inv);
          }
        };
        Red.prototype.pow = function pow(a, num) {
          if (num.isZero()) return new BN(1).toRed(this);
          if (num.cmpn(1) === 0) return a.clone();
          var windowSize = 4;
          var wnd = new Array(1 << windowSize);
          wnd[0] = new BN(1).toRed(this);
          wnd[1] = a;
          for (var i = 2; i < wnd.length; i++) {
            wnd[i] = this.mul(wnd[i - 1], a);
          }
          var res = wnd[0];
          var current = 0;
          var currentLen = 0;
          var start = num.bitLength() % 26;
          if (start === 0) {
            start = 26;
          }
          for (i = num.length - 1; i >= 0; i--) {
            var word = num.words[i];
            for (var j = start - 1; j >= 0; j--) {
              var bit = word >> j & 1;
              if (res !== wnd[0]) {
                res = this.sqr(res);
              }
              if (bit === 0 && current === 0) {
                currentLen = 0;
                continue;
              }
              current <<= 1;
              current |= bit;
              currentLen++;
              if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
              res = this.mul(res, wnd[current]);
              currentLen = 0;
              current = 0;
            }
            start = 26;
          }
          return res;
        };
        Red.prototype.convertTo = function convertTo(num) {
          var r = num.umod(this.m);
          return r === num ? r.clone() : r;
        };
        Red.prototype.convertFrom = function convertFrom(num) {
          var res = num.clone();
          res.red = null;
          return res;
        };
        BN.mont = function mont(num) {
          return new Mont(num);
        };
        function Mont(m) {
          Red.call(this, m);
          this.shift = this.m.bitLength();
          if (this.shift % 26 !== 0) {
            this.shift += 26 - this.shift % 26;
          }
          this.r = new BN(1).iushln(this.shift);
          this.r2 = this.imod(this.r.sqr());
          this.rinv = this.r._invmp(this.m);
          this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
          this.minv = this.minv.umod(this.r);
          this.minv = this.r.sub(this.minv);
        }
        inherits(Mont, Red);
        Mont.prototype.convertTo = function convertTo(num) {
          return this.imod(num.ushln(this.shift));
        };
        Mont.prototype.convertFrom = function convertFrom(num) {
          var r = this.imod(num.mul(this.rinv));
          r.red = null;
          return r;
        };
        Mont.prototype.imul = function imul(a, b) {
          if (a.isZero() || b.isZero()) {
            a.words[0] = 0;
            a.length = 1;
            return a;
          }
          var t = a.imul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.mul = function mul(a, b) {
          if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
          var t = a.mul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.invm = function invm(a) {
          var res = this.imod(a._invmp(this.m).mul(this.r2));
          return res._forceRed(this);
        };
      })(false || module, this);
    },
    3349(module) {
      module.exports = assert;
      function assert(val, msg) {
        if (!val) throw new Error(msg || "Assertion failed");
      }
      assert.equal = function assertEqual(l, r, msg) {
        if (l != r) throw new Error(msg || "Assertion failed: " + l + " != " + r);
      };
    },
    4367(__unused_webpack_module, exports) {
      "use strict";
      var utils = exports;
      function toArray(msg, enc) {
        if (Array.isArray(msg)) return msg.slice();
        if (!msg) return [];
        var res = [];
        if (typeof msg !== "string") {
          for (var i = 0; i < msg.length; i++) res[i] = msg[i] | 0;
          return res;
        }
        if (enc === "hex") {
          msg = msg.replace(/[^a-z0-9]+/gi, "");
          if (msg.length % 2 !== 0) msg = "0" + msg;
          for (var i = 0; i < msg.length; i += 2) res.push(parseInt(msg[i] + msg[i + 1], 16));
        } else {
          for (var i = 0; i < msg.length; i++) {
            var c = msg.charCodeAt(i);
            var hi = c >> 8;
            var lo = c & 255;
            if (hi) res.push(hi, lo); else res.push(lo);
          }
        }
        return res;
      }
      utils.toArray = toArray;
      function zero2(word) {
        if (word.length === 1) return "0" + word; else return word;
      }
      utils.zero2 = zero2;
      function toHex(msg) {
        var res = "";
        for (var i = 0; i < msg.length; i++) res += zero2(msg[i].toString(16));
        return res;
      }
      utils.toHex = toHex;
      utils.encode = function encode(arr, enc) {
        if (enc === "hex") return toHex(arr); else return arr;
      };
    },
    1137(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var asn1 = __webpack_require__(7568);
      exports.certificate = __webpack_require__(6413);
      var RSAPrivateKey = asn1.define("RSAPrivateKey", (function() {
        this.seq().obj(this.key("version")["int"](), this.key("modulus")["int"](), this.key("publicExponent")["int"](), this.key("privateExponent")["int"](), this.key("prime1")["int"](), this.key("prime2")["int"](), this.key("exponent1")["int"](), this.key("exponent2")["int"](), this.key("coefficient")["int"]());
      }));
      exports.RSAPrivateKey = RSAPrivateKey;
      var RSAPublicKey = asn1.define("RSAPublicKey", (function() {
        this.seq().obj(this.key("modulus")["int"](), this.key("publicExponent")["int"]());
      }));
      exports.RSAPublicKey = RSAPublicKey;
      var AlgorithmIdentifier = asn1.define("AlgorithmIdentifier", (function() {
        this.seq().obj(this.key("algorithm").objid(), this.key("none").null_().optional(), this.key("curve").objid().optional(), this.key("params").seq().obj(this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"]()).optional());
      }));
      var PublicKey = asn1.define("SubjectPublicKeyInfo", (function() {
        this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr());
      }));
      exports.PublicKey = PublicKey;
      var PrivateKeyInfo = asn1.define("PrivateKeyInfo", (function() {
        this.seq().obj(this.key("version")["int"](), this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPrivateKey").octstr());
      }));
      exports.PrivateKey = PrivateKeyInfo;
      var EncryptedPrivateKeyInfo = asn1.define("EncryptedPrivateKeyInfo", (function() {
        this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(), this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(), this.key("kdeparams").seq().obj(this.key("salt").octstr(), this.key("iters")["int"]())), this.key("cipher").seq().obj(this.key("algo").objid(), this.key("iv").octstr()))), this.key("subjectPrivateKey").octstr());
      }));
      exports.EncryptedPrivateKey = EncryptedPrivateKeyInfo;
      var DSAPrivateKey = asn1.define("DSAPrivateKey", (function() {
        this.seq().obj(this.key("version")["int"](), this.key("p")["int"](), this.key("q")["int"](), this.key("g")["int"](), this.key("pub_key")["int"](), this.key("priv_key")["int"]());
      }));
      exports.DSAPrivateKey = DSAPrivateKey;
      exports.DSAparam = asn1.define("DSAparam", (function() {
        this["int"]();
      }));
      var ECParameters = asn1.define("ECParameters", (function() {
        this.choice({
          namedCurve: this.objid()
        });
      }));
      var ECPrivateKey = asn1.define("ECPrivateKey", (function() {
        this.seq().obj(this.key("version")["int"](), this.key("privateKey").octstr(), this.key("parameters").optional().explicit(0).use(ECParameters), this.key("publicKey").optional().explicit(1).bitstr());
      }));
      exports.ECPrivateKey = ECPrivateKey;
      exports.signature = asn1.define("signature", (function() {
        this.seq().obj(this.key("r")["int"](), this.key("s")["int"]());
      }));
    },
    6413(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var asn = __webpack_require__(7568);
      var Time = asn.define("Time", (function() {
        this.choice({
          utcTime: this.utctime(),
          generalTime: this.gentime()
        });
      }));
      var AttributeTypeValue = asn.define("AttributeTypeValue", (function() {
        this.seq().obj(this.key("type").objid(), this.key("value").any());
      }));
      var AlgorithmIdentifier = asn.define("AlgorithmIdentifier", (function() {
        this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional(), this.key("curve").objid().optional());
      }));
      var SubjectPublicKeyInfo = asn.define("SubjectPublicKeyInfo", (function() {
        this.seq().obj(this.key("algorithm").use(AlgorithmIdentifier), this.key("subjectPublicKey").bitstr());
      }));
      var RelativeDistinguishedName = asn.define("RelativeDistinguishedName", (function() {
        this.setof(AttributeTypeValue);
      }));
      var RDNSequence = asn.define("RDNSequence", (function() {
        this.seqof(RelativeDistinguishedName);
      }));
      var Name = asn.define("Name", (function() {
        this.choice({
          rdnSequence: this.use(RDNSequence)
        });
      }));
      var Validity = asn.define("Validity", (function() {
        this.seq().obj(this.key("notBefore").use(Time), this.key("notAfter").use(Time));
      }));
      var Extension = asn.define("Extension", (function() {
        this.seq().obj(this.key("extnID").objid(), this.key("critical").bool().def(false), this.key("extnValue").octstr());
      }));
      var TBSCertificate = asn.define("TBSCertificate", (function() {
        this.seq().obj(this.key("version").explicit(0)["int"]().optional(), this.key("serialNumber")["int"](), this.key("signature").use(AlgorithmIdentifier), this.key("issuer").use(Name), this.key("validity").use(Validity), this.key("subject").use(Name), this.key("subjectPublicKeyInfo").use(SubjectPublicKeyInfo), this.key("issuerUniqueID").implicit(1).bitstr().optional(), this.key("subjectUniqueID").implicit(2).bitstr().optional(), this.key("extensions").explicit(3).seqof(Extension).optional());
      }));
      var X509Certificate = asn.define("X509Certificate", (function() {
        this.seq().obj(this.key("tbsCertificate").use(TBSCertificate), this.key("signatureAlgorithm").use(AlgorithmIdentifier), this.key("signatureValue").bitstr());
      }));
      module.exports = X509Certificate;
    },
    4101(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m;
      var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m;
      var fullRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m;
      var evp = __webpack_require__(8078);
      var ciphers = __webpack_require__(1241);
      var Buffer = __webpack_require__(2861).Buffer;
      module.exports = function(okey, password) {
        var key = okey.toString();
        var match = key.match(findProc);
        var decrypted;
        if (!match) {
          var match2 = key.match(fullRegex);
          decrypted = Buffer.from(match2[2].replace(/[\r\n]/g, ""), "base64");
        } else {
          var suite = "aes" + match[1];
          var iv = Buffer.from(match[2], "hex");
          var cipherText = Buffer.from(match[3].replace(/[\r\n]/g, ""), "base64");
          var cipherKey = evp(password, iv.slice(0, 8), parseInt(match[1], 10)).key;
          var out = [];
          var cipher = ciphers.createDecipheriv(suite, cipherKey, iv);
          out.push(cipher.update(cipherText));
          out.push(cipher["final"]());
          decrypted = Buffer.concat(out);
        }
        var tag = key.match(startRegex)[1];
        return {
          tag,
          data: decrypted
        };
      };
    },
    8170(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var asn1 = __webpack_require__(1137);
      var aesid = __webpack_require__(5579);
      var fixProc = __webpack_require__(4101);
      var ciphers = __webpack_require__(1241);
      var pbkdf2Sync = __webpack_require__(8396).pbkdf2Sync;
      var Buffer = __webpack_require__(2861).Buffer;
      function decrypt(data, password) {
        var salt = data.algorithm.decrypt.kde.kdeparams.salt;
        var iters = parseInt(data.algorithm.decrypt.kde.kdeparams.iters.toString(), 10);
        var algo = aesid[data.algorithm.decrypt.cipher.algo.join(".")];
        var iv = data.algorithm.decrypt.cipher.iv;
        var cipherText = data.subjectPrivateKey;
        var keylen = parseInt(algo.split("-")[1], 10) / 8;
        var key = pbkdf2Sync(password, salt, iters, keylen, "sha1");
        var cipher = ciphers.createDecipheriv(algo, key, iv);
        var out = [];
        out.push(cipher.update(cipherText));
        out.push(cipher["final"]());
        return Buffer.concat(out);
      }
      function parseKeys(buffer) {
        var password;
        if (typeof buffer === "object" && !Buffer.isBuffer(buffer)) {
          password = buffer.passphrase;
          buffer = buffer.key;
        }
        if (typeof buffer === "string") {
          buffer = Buffer.from(buffer);
        }
        var stripped = fixProc(buffer, password);
        var type = stripped.tag;
        var data = stripped.data;
        var subtype, ndata;
        switch (type) {
         case "CERTIFICATE":
          ndata = asn1.certificate.decode(data, "der").tbsCertificate.subjectPublicKeyInfo;

         case "PUBLIC KEY":
          if (!ndata) {
            ndata = asn1.PublicKey.decode(data, "der");
          }
          subtype = ndata.algorithm.algorithm.join(".");
          switch (subtype) {
           case "1.2.840.113549.1.1.1":
            return asn1.RSAPublicKey.decode(ndata.subjectPublicKey.data, "der");

           case "1.2.840.10045.2.1":
            ndata.subjectPrivateKey = ndata.subjectPublicKey;
            return {
              type: "ec",
              data: ndata
            };

           case "1.2.840.10040.4.1":
            ndata.algorithm.params.pub_key = asn1.DSAparam.decode(ndata.subjectPublicKey.data, "der");
            return {
              type: "dsa",
              data: ndata.algorithm.params
            };

           default:
            throw new Error("unknown key id " + subtype);
          }

         case "ENCRYPTED PRIVATE KEY":
          data = asn1.EncryptedPrivateKey.decode(data, "der");
          data = decrypt(data, password);

         case "PRIVATE KEY":
          ndata = asn1.PrivateKey.decode(data, "der");
          subtype = ndata.algorithm.algorithm.join(".");
          switch (subtype) {
           case "1.2.840.113549.1.1.1":
            return asn1.RSAPrivateKey.decode(ndata.subjectPrivateKey, "der");

           case "1.2.840.10045.2.1":
            return {
              curve: ndata.algorithm.curve,
              privateKey: asn1.ECPrivateKey.decode(ndata.subjectPrivateKey, "der").privateKey
            };

           case "1.2.840.10040.4.1":
            ndata.algorithm.params.priv_key = asn1.DSAparam.decode(ndata.subjectPrivateKey, "der");
            return {
              type: "dsa",
              params: ndata.algorithm.params
            };

           default:
            throw new Error("unknown key id " + subtype);
          }

         case "RSA PUBLIC KEY":
          return asn1.RSAPublicKey.decode(data, "der");

         case "RSA PRIVATE KEY":
          return asn1.RSAPrivateKey.decode(data, "der");

         case "DSA PRIVATE KEY":
          return {
            type: "dsa",
            params: asn1.DSAPrivateKey.decode(data, "der")
          };

         case "EC PRIVATE KEY":
          data = asn1.ECPrivateKey.decode(data, "der");
          return {
            curve: data.parameters.value,
            privateKey: data.privateKey
          };

         default:
          throw new Error("unknown key type " + type);
        }
      }
      parseKeys.signature = asn1.signature;
      module.exports = parseKeys;
    },
    8396(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      exports.pbkdf2 = __webpack_require__(3832);
      exports.pbkdf2Sync = __webpack_require__(1352);
    },
    3832(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var checkParameters = __webpack_require__(4196);
      var defaultEncoding = __webpack_require__(2455);
      var sync = __webpack_require__(1352);
      var toBuffer = __webpack_require__(3382);
      var ZERO_BUF;
      var subtle = __webpack_require__.g.crypto && __webpack_require__.g.crypto.subtle;
      var toBrowser = {
        sha: "SHA-1",
        "sha-1": "SHA-1",
        sha1: "SHA-1",
        sha256: "SHA-256",
        "sha-256": "SHA-256",
        sha384: "SHA-384",
        "sha-384": "SHA-384",
        "sha-512": "SHA-512",
        sha512: "SHA-512"
      };
      var checks = [];
      var nextTick;
      function getNextTick() {
        if (nextTick) {
          return nextTick;
        }
        if (__webpack_require__.g.process && __webpack_require__.g.process.nextTick) {
          nextTick = __webpack_require__.g.process.nextTick;
        } else if (__webpack_require__.g.queueMicrotask) {
          nextTick = __webpack_require__.g.queueMicrotask;
        } else if (__webpack_require__.g.setImmediate) {
          nextTick = __webpack_require__.g.setImmediate;
        } else {
          nextTick = __webpack_require__.g.setTimeout;
        }
        return nextTick;
      }
      function browserPbkdf2(password, salt, iterations, length, algo) {
        return subtle.importKey("raw", password, {
          name: "PBKDF2"
        }, false, [ "deriveBits" ]).then((function(key) {
          return subtle.deriveBits({
            name: "PBKDF2",
            salt,
            iterations,
            hash: {
              name: algo
            }
          }, key, length << 3);
        })).then((function(res) {
          return Buffer.from(res);
        }));
      }
      function checkNative(algo) {
        if (__webpack_require__.g.process && !__webpack_require__.g.process.browser) {
          return Promise.resolve(false);
        }
        if (!subtle || !subtle.importKey || !subtle.deriveBits) {
          return Promise.resolve(false);
        }
        if (checks[algo] !== undefined) {
          return checks[algo];
        }
        ZERO_BUF = ZERO_BUF || Buffer.alloc(8);
        var prom = browserPbkdf2(ZERO_BUF, ZERO_BUF, 10, 128, algo).then((function() {
          return true;
        }), (function() {
          return false;
        }));
        checks[algo] = prom;
        return prom;
      }
      function resolvePromise(promise, callback) {
        promise.then((function(out) {
          getNextTick()((function() {
            callback(null, out);
          }));
        }), (function(e) {
          getNextTick()((function() {
            callback(e);
          }));
        }));
      }
      module.exports = function(password, salt, iterations, keylen, digest, callback) {
        if (typeof digest === "function") {
          callback = digest;
          digest = undefined;
        }
        checkParameters(iterations, keylen);
        password = toBuffer(password, defaultEncoding, "Password");
        salt = toBuffer(salt, defaultEncoding, "Salt");
        if (typeof callback !== "function") {
          throw new Error("No callback provided to pbkdf2");
        }
        digest = digest || "sha1";
        var algo = toBrowser[digest.toLowerCase()];
        if (!algo || typeof __webpack_require__.g.Promise !== "function") {
          getNextTick()((function() {
            var out;
            try {
              out = sync(password, salt, iterations, keylen, digest);
            } catch (e) {
              callback(e);
              return;
            }
            callback(null, out);
          }));
          return;
        }
        resolvePromise(checkNative(algo).then((function(resp) {
          if (resp) {
            return browserPbkdf2(password, salt, iterations, keylen, algo);
          }
          return sync(password, salt, iterations, keylen, digest);
        })), callback);
      };
    },
    2455(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var defaultEncoding;
      if (__webpack_require__.g.process && __webpack_require__.g.process.browser) {
        defaultEncoding = "utf-8";
      } else if (__webpack_require__.g.process && __webpack_require__.g.process.version) {
        var pVersionMajor = parseInt(process.version.split(".")[0].slice(1), 10);
        defaultEncoding = pVersionMajor >= 6 ? "utf-8" : "binary";
      } else {
        defaultEncoding = "utf-8";
      }
      module.exports = defaultEncoding;
    },
    4196(module) {
      "use strict";
      var $isFinite = isFinite;
      var MAX_ALLOC = Math.pow(2, 30) - 1;
      module.exports = function(iterations, keylen) {
        if (typeof iterations !== "number") {
          throw new TypeError("Iterations not a number");
        }
        if (iterations < 0 || !$isFinite(iterations)) {
          throw new TypeError("Bad iterations");
        }
        if (typeof keylen !== "number") {
          throw new TypeError("Key length not a number");
        }
        if (keylen < 0 || keylen > MAX_ALLOC || keylen !== keylen) {
          throw new TypeError("Bad key length");
        }
      };
    },
    1352(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var md5 = __webpack_require__(320);
      var RIPEMD160 = __webpack_require__(6011);
      var sha = __webpack_require__(2802);
      var Buffer = __webpack_require__(2861).Buffer;
      var checkParameters = __webpack_require__(4196);
      var defaultEncoding = __webpack_require__(2455);
      var toBuffer = __webpack_require__(3382);
      var ZEROS = Buffer.alloc(128);
      var sizes = {
        __proto__: null,
        md5: 16,
        sha1: 20,
        sha224: 28,
        sha256: 32,
        sha384: 48,
        sha512: 64,
        "sha512-256": 32,
        ripemd160: 20,
        rmd160: 20
      };
      var mapping = {
        __proto__: null,
        "sha-1": "sha1",
        "sha-224": "sha224",
        "sha-256": "sha256",
        "sha-384": "sha384",
        "sha-512": "sha512",
        "ripemd-160": "ripemd160"
      };
      function rmd160Func(data) {
        return (new RIPEMD160).update(data).digest();
      }
      function getDigest(alg) {
        function shaFunc(data) {
          return sha(alg).update(data).digest();
        }
        if (alg === "rmd160" || alg === "ripemd160") {
          return rmd160Func;
        }
        if (alg === "md5") {
          return md5;
        }
        return shaFunc;
      }
      function Hmac(alg, key, saltLen) {
        var hash = getDigest(alg);
        var blocksize = alg === "sha512" || alg === "sha384" ? 128 : 64;
        if (key.length > blocksize) {
          key = hash(key);
        } else if (key.length < blocksize) {
          key = Buffer.concat([ key, ZEROS ], blocksize);
        }
        var ipad = Buffer.allocUnsafe(blocksize + sizes[alg]);
        var opad = Buffer.allocUnsafe(blocksize + sizes[alg]);
        for (var i = 0; i < blocksize; i++) {
          ipad[i] = key[i] ^ 54;
          opad[i] = key[i] ^ 92;
        }
        var ipad1 = Buffer.allocUnsafe(blocksize + saltLen + 4);
        ipad.copy(ipad1, 0, 0, blocksize);
        this.ipad1 = ipad1;
        this.ipad2 = ipad;
        this.opad = opad;
        this.alg = alg;
        this.blocksize = blocksize;
        this.hash = hash;
        this.size = sizes[alg];
      }
      Hmac.prototype.run = function(data, ipad) {
        data.copy(ipad, this.blocksize);
        var h = this.hash(ipad);
        h.copy(this.opad, this.blocksize);
        return this.hash(this.opad);
      };
      function pbkdf2(password, salt, iterations, keylen, digest) {
        checkParameters(iterations, keylen);
        password = toBuffer(password, defaultEncoding, "Password");
        salt = toBuffer(salt, defaultEncoding, "Salt");
        var lowerDigest = (digest || "sha1").toLowerCase();
        var mappedDigest = mapping[lowerDigest] || lowerDigest;
        var size = sizes[mappedDigest];
        if (typeof size !== "number" || !size) {
          throw new TypeError("Digest algorithm not supported: " + digest);
        }
        var hmac = new Hmac(mappedDigest, password, salt.length);
        var DK = Buffer.allocUnsafe(keylen);
        var block1 = Buffer.allocUnsafe(salt.length + 4);
        salt.copy(block1, 0, 0, salt.length);
        var destPos = 0;
        var hLen = size;
        var l = Math.ceil(keylen / hLen);
        for (var i = 1; i <= l; i++) {
          block1.writeUInt32BE(i, salt.length);
          var T = hmac.run(block1, hmac.ipad1);
          var U = T;
          for (var j = 1; j < iterations; j++) {
            U = hmac.run(U, hmac.ipad2);
            for (var k = 0; k < hLen; k++) {
              T[k] ^= U[k];
            }
          }
          T.copy(DK, destPos);
          destPos += hLen;
        }
        return DK;
      }
      module.exports = pbkdf2;
    },
    3382(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var toBuffer = __webpack_require__(5377);
      var useUint8Array = typeof Uint8Array !== "undefined";
      var useArrayBuffer = useUint8Array && typeof ArrayBuffer !== "undefined";
      var isView = useArrayBuffer && ArrayBuffer.isView;
      module.exports = function(thing, encoding, name) {
        if (typeof thing === "string" || Buffer.isBuffer(thing) || useUint8Array && thing instanceof Uint8Array || isView && isView(thing)) {
          return toBuffer(thing, encoding);
        }
        throw new TypeError(name + " must be a string, a Buffer, a Uint8Array, or a DataView");
      };
    },
    6578(module) {
      "use strict";
      module.exports = [ "Float16Array", "Float32Array", "Float64Array", "Int8Array", "Int16Array", "Int32Array", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "BigInt64Array", "BigUint64Array" ];
    },
    3225(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      if (typeof process === "undefined" || !process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
        module.exports = {
          nextTick
        };
      } else {
        module.exports = process;
      }
      function nextTick(fn, arg1, arg2, arg3) {
        if (typeof fn !== "function") {
          throw new TypeError('"callback" argument must be a function');
        }
        var len = arguments.length;
        var args, i;
        switch (len) {
         case 0:
         case 1:
          return process.nextTick(fn);

         case 2:
          return process.nextTick((function afterTickOne() {
            fn.call(null, arg1);
          }));

         case 3:
          return process.nextTick((function afterTickTwo() {
            fn.call(null, arg1, arg2);
          }));

         case 4:
          return process.nextTick((function afterTickThree() {
            fn.call(null, arg1, arg2, arg3);
          }));

         default:
          args = new Array(len - 1);
          i = 0;
          while (i < args.length) {
            args[i++] = arguments[i];
          }
          return process.nextTick((function afterTick() {
            fn.apply(null, args);
          }));
        }
      }
    },
    5606(module) {
      var process = module.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 (e) {
            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 (e) {
            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;
      };
    },
    7168(__unused_webpack_module, exports, __webpack_require__) {
      exports.publicEncrypt = __webpack_require__(8902);
      exports.privateDecrypt = __webpack_require__(7362);
      exports.privateEncrypt = function privateEncrypt(key, buf) {
        return exports.publicEncrypt(key, buf, true);
      };
      exports.publicDecrypt = function publicDecrypt(key, buf) {
        return exports.privateDecrypt(key, buf, true);
      };
    },
    8206(module, __unused_webpack_exports, __webpack_require__) {
      var createHash = __webpack_require__(7108);
      var Buffer = __webpack_require__(2861).Buffer;
      module.exports = function(seed, len) {
        var t = Buffer.alloc(0);
        var i = 0;
        var c;
        while (t.length < len) {
          c = i2ops(i++);
          t = Buffer.concat([ t, createHash("sha1").update(seed).update(c).digest() ]);
        }
        return t.slice(0, len);
      };
      function i2ops(c) {
        var out = Buffer.allocUnsafe(4);
        out.writeUInt32BE(c, 0);
        return out;
      }
    },
    4890(module, __unused_webpack_exports, __webpack_require__) {
      module = __webpack_require__.nmd(module);
      (function(module, exports) {
        "use strict";
        function assert(val, msg) {
          if (!val) throw new Error(msg || "Assertion failed");
        }
        function inherits(ctor, superCtor) {
          ctor.super_ = superCtor;
          var TempCtor = function() {};
          TempCtor.prototype = superCtor.prototype;
          ctor.prototype = new TempCtor;
          ctor.prototype.constructor = ctor;
        }
        function BN(number, base, endian) {
          if (BN.isBN(number)) {
            return number;
          }
          this.negative = 0;
          this.words = null;
          this.length = 0;
          this.red = null;
          if (number !== null) {
            if (base === "le" || base === "be") {
              endian = base;
              base = 10;
            }
            this._init(number || 0, base || 10, endian || "be");
          }
        }
        if (typeof module === "object") {
          module.exports = BN;
        } else {
          exports.BN = BN;
        }
        BN.BN = BN;
        BN.wordSize = 26;
        var Buffer;
        try {
          if (typeof window !== "undefined" && typeof window.Buffer !== "undefined") {
            Buffer = window.Buffer;
          } else {
            Buffer = __webpack_require__(1069).Buffer;
          }
        } catch (e) {}
        BN.isBN = function isBN(num) {
          if (num instanceof BN) {
            return true;
          }
          return num !== null && typeof num === "object" && num.constructor.wordSize === BN.wordSize && Array.isArray(num.words);
        };
        BN.max = function max(left, right) {
          if (left.cmp(right) > 0) return left;
          return right;
        };
        BN.min = function min(left, right) {
          if (left.cmp(right) < 0) return left;
          return right;
        };
        BN.prototype._init = function init(number, base, endian) {
          if (typeof number === "number") {
            return this._initNumber(number, base, endian);
          }
          if (typeof number === "object") {
            return this._initArray(number, base, endian);
          }
          if (base === "hex") {
            base = 16;
          }
          assert(base === (base | 0) && base >= 2 && base <= 36);
          number = number.toString().replace(/\s+/g, "");
          var start = 0;
          if (number[0] === "-") {
            start++;
            this.negative = 1;
          }
          if (start < number.length) {
            if (base === 16) {
              this._parseHex(number, start, endian);
            } else {
              this._parseBase(number, base, start);
              if (endian === "le") {
                this._initArray(this.toArray(), base, endian);
              }
            }
          }
        };
        BN.prototype._initNumber = function _initNumber(number, base, endian) {
          if (number < 0) {
            this.negative = 1;
            number = -number;
          }
          if (number < 67108864) {
            this.words = [ number & 67108863 ];
            this.length = 1;
          } else if (number < 4503599627370496) {
            this.words = [ number & 67108863, number / 67108864 & 67108863 ];
            this.length = 2;
          } else {
            assert(number < 9007199254740992);
            this.words = [ number & 67108863, number / 67108864 & 67108863, 1 ];
            this.length = 3;
          }
          if (endian !== "le") return;
          this._initArray(this.toArray(), base, endian);
        };
        BN.prototype._initArray = function _initArray(number, base, endian) {
          assert(typeof number.length === "number");
          if (number.length <= 0) {
            this.words = [ 0 ];
            this.length = 1;
            return this;
          }
          this.length = Math.ceil(number.length / 3);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var j, w;
          var off = 0;
          if (endian === "be") {
            for (i = number.length - 1, j = 0; i >= 0; i -= 3) {
              w = number[i] | number[i - 1] << 8 | number[i - 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          } else if (endian === "le") {
            for (i = 0, j = 0; i < number.length; i += 3) {
              w = number[i] | number[i + 1] << 8 | number[i + 2] << 16;
              this.words[j] |= w << off & 67108863;
              this.words[j + 1] = w >>> 26 - off & 67108863;
              off += 24;
              if (off >= 26) {
                off -= 26;
                j++;
              }
            }
          }
          return this.strip();
        };
        function parseHex4Bits(string, index) {
          var c = string.charCodeAt(index);
          if (c >= 65 && c <= 70) {
            return c - 55;
          } else if (c >= 97 && c <= 102) {
            return c - 87;
          } else {
            return c - 48 & 15;
          }
        }
        function parseHexByte(string, lowerBound, index) {
          var r = parseHex4Bits(string, index);
          if (index - 1 >= lowerBound) {
            r |= parseHex4Bits(string, index - 1) << 4;
          }
          return r;
        }
        BN.prototype._parseHex = function _parseHex(number, start, endian) {
          this.length = Math.ceil((number.length - start) / 6);
          this.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            this.words[i] = 0;
          }
          var off = 0;
          var j = 0;
          var w;
          if (endian === "be") {
            for (i = number.length - 1; i >= start; i -= 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          } else {
            var parseLength = number.length - start;
            for (i = parseLength % 2 === 0 ? start + 1 : start; i < number.length; i += 2) {
              w = parseHexByte(number, start, i) << off;
              this.words[j] |= w & 67108863;
              if (off >= 18) {
                off -= 18;
                j += 1;
                this.words[j] |= w >>> 26;
              } else {
                off += 8;
              }
            }
          }
          this.strip();
        };
        function parseBase(str, start, end, mul) {
          var r = 0;
          var len = Math.min(str.length, end);
          for (var i = start; i < len; i++) {
            var c = str.charCodeAt(i) - 48;
            r *= mul;
            if (c >= 49) {
              r += c - 49 + 10;
            } else if (c >= 17) {
              r += c - 17 + 10;
            } else {
              r += c;
            }
          }
          return r;
        }
        BN.prototype._parseBase = function _parseBase(number, base, start) {
          this.words = [ 0 ];
          this.length = 1;
          for (var limbLen = 0, limbPow = 1; limbPow <= 67108863; limbPow *= base) {
            limbLen++;
          }
          limbLen--;
          limbPow = limbPow / base | 0;
          var total = number.length - start;
          var mod = total % limbLen;
          var end = Math.min(total, total - mod) + start;
          var word = 0;
          for (var i = start; i < end; i += limbLen) {
            word = parseBase(number, i, i + limbLen, base);
            this.imuln(limbPow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          if (mod !== 0) {
            var pow = 1;
            word = parseBase(number, i, number.length, base);
            for (i = 0; i < mod; i++) {
              pow *= base;
            }
            this.imuln(pow);
            if (this.words[0] + word < 67108864) {
              this.words[0] += word;
            } else {
              this._iaddn(word);
            }
          }
          this.strip();
        };
        BN.prototype.copy = function copy(dest) {
          dest.words = new Array(this.length);
          for (var i = 0; i < this.length; i++) {
            dest.words[i] = this.words[i];
          }
          dest.length = this.length;
          dest.negative = this.negative;
          dest.red = this.red;
        };
        BN.prototype.clone = function clone() {
          var r = new BN(null);
          this.copy(r);
          return r;
        };
        BN.prototype._expand = function _expand(size) {
          while (this.length < size) {
            this.words[this.length++] = 0;
          }
          return this;
        };
        BN.prototype.strip = function strip() {
          while (this.length > 1 && this.words[this.length - 1] === 0) {
            this.length--;
          }
          return this._normSign();
        };
        BN.prototype._normSign = function _normSign() {
          if (this.length === 1 && this.words[0] === 0) {
            this.negative = 0;
          }
          return this;
        };
        BN.prototype.inspect = function inspect() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">";
        };
        var zeros = [ "", "0", "00", "000", "0000", "00000", "000000", "0000000", "00000000", "000000000", "0000000000", "00000000000", "000000000000", "0000000000000", "00000000000000", "000000000000000", "0000000000000000", "00000000000000000", "000000000000000000", "0000000000000000000", "00000000000000000000", "000000000000000000000", "0000000000000000000000", "00000000000000000000000", "000000000000000000000000", "0000000000000000000000000" ];
        var groupSizes = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ];
        var groupBases = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 1e7, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64e6, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 243e5, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ];
        BN.prototype.toString = function toString(base, padding) {
          base = base || 10;
          padding = padding | 0 || 1;
          var out;
          if (base === 16 || base === "hex") {
            out = "";
            var off = 0;
            var carry = 0;
            for (var i = 0; i < this.length; i++) {
              var w = this.words[i];
              var word = ((w << off | carry) & 16777215).toString(16);
              carry = w >>> 24 - off & 16777215;
              off += 2;
              if (off >= 26) {
                off -= 26;
                i--;
              }
              if (carry !== 0 || i !== this.length - 1) {
                out = zeros[6 - word.length] + word + out;
              } else {
                out = word + out;
              }
            }
            if (carry !== 0) {
              out = carry.toString(16) + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          if (base === (base | 0) && base >= 2 && base <= 36) {
            var groupSize = groupSizes[base];
            var groupBase = groupBases[base];
            out = "";
            var c = this.clone();
            c.negative = 0;
            while (!c.isZero()) {
              var r = c.modn(groupBase).toString(base);
              c = c.idivn(groupBase);
              if (!c.isZero()) {
                out = zeros[groupSize - r.length] + r + out;
              } else {
                out = r + out;
              }
            }
            if (this.isZero()) {
              out = "0" + out;
            }
            while (out.length % padding !== 0) {
              out = "0" + out;
            }
            if (this.negative !== 0) {
              out = "-" + out;
            }
            return out;
          }
          assert(false, "Base should be between 2 and 36");
        };
        BN.prototype.toNumber = function toNumber() {
          var ret = this.words[0];
          if (this.length === 2) {
            ret += this.words[1] * 67108864;
          } else if (this.length === 3 && this.words[2] === 1) {
            ret += 4503599627370496 + this.words[1] * 67108864;
          } else if (this.length > 2) {
            assert(false, "Number can only safely store up to 53 bits");
          }
          return this.negative !== 0 ? -ret : ret;
        };
        BN.prototype.toJSON = function toJSON() {
          return this.toString(16);
        };
        BN.prototype.toBuffer = function toBuffer(endian, length) {
          assert(typeof Buffer !== "undefined");
          return this.toArrayLike(Buffer, endian, length);
        };
        BN.prototype.toArray = function toArray(endian, length) {
          return this.toArrayLike(Array, endian, length);
        };
        BN.prototype.toArrayLike = function toArrayLike(ArrayType, endian, length) {
          var byteLength = this.byteLength();
          var reqLength = length || Math.max(1, byteLength);
          assert(byteLength <= reqLength, "byte array longer than desired length");
          assert(reqLength > 0, "Requested array length <= 0");
          this.strip();
          var littleEndian = endian === "le";
          var res = new ArrayType(reqLength);
          var b, i;
          var q = this.clone();
          if (!littleEndian) {
            for (i = 0; i < reqLength - byteLength; i++) {
              res[i] = 0;
            }
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[reqLength - i - 1] = b;
            }
          } else {
            for (i = 0; !q.isZero(); i++) {
              b = q.andln(255);
              q.iushrn(8);
              res[i] = b;
            }
            for (;i < reqLength; i++) {
              res[i] = 0;
            }
          }
          return res;
        };
        if (Math.clz32) {
          BN.prototype._countBits = function _countBits(w) {
            return 32 - Math.clz32(w);
          };
        } else {
          BN.prototype._countBits = function _countBits(w) {
            var t = w;
            var r = 0;
            if (t >= 4096) {
              r += 13;
              t >>>= 13;
            }
            if (t >= 64) {
              r += 7;
              t >>>= 7;
            }
            if (t >= 8) {
              r += 4;
              t >>>= 4;
            }
            if (t >= 2) {
              r += 2;
              t >>>= 2;
            }
            return r + t;
          };
        }
        BN.prototype._zeroBits = function _zeroBits(w) {
          if (w === 0) return 26;
          var t = w;
          var r = 0;
          if ((t & 8191) === 0) {
            r += 13;
            t >>>= 13;
          }
          if ((t & 127) === 0) {
            r += 7;
            t >>>= 7;
          }
          if ((t & 15) === 0) {
            r += 4;
            t >>>= 4;
          }
          if ((t & 3) === 0) {
            r += 2;
            t >>>= 2;
          }
          if ((t & 1) === 0) {
            r++;
          }
          return r;
        };
        BN.prototype.bitLength = function bitLength() {
          var w = this.words[this.length - 1];
          var hi = this._countBits(w);
          return (this.length - 1) * 26 + hi;
        };
        function toBitArray(num) {
          var w = new Array(num.bitLength());
          for (var bit = 0; bit < w.length; bit++) {
            var off = bit / 26 | 0;
            var wbit = bit % 26;
            w[bit] = (num.words[off] & 1 << wbit) >>> wbit;
          }
          return w;
        }
        BN.prototype.zeroBits = function zeroBits() {
          if (this.isZero()) return 0;
          var r = 0;
          for (var i = 0; i < this.length; i++) {
            var b = this._zeroBits(this.words[i]);
            r += b;
            if (b !== 26) break;
          }
          return r;
        };
        BN.prototype.byteLength = function byteLength() {
          return Math.ceil(this.bitLength() / 8);
        };
        BN.prototype.toTwos = function toTwos(width) {
          if (this.negative !== 0) {
            return this.abs().inotn(width).iaddn(1);
          }
          return this.clone();
        };
        BN.prototype.fromTwos = function fromTwos(width) {
          if (this.testn(width - 1)) {
            return this.notn(width).iaddn(1).ineg();
          }
          return this.clone();
        };
        BN.prototype.isNeg = function isNeg() {
          return this.negative !== 0;
        };
        BN.prototype.neg = function neg() {
          return this.clone().ineg();
        };
        BN.prototype.ineg = function ineg() {
          if (!this.isZero()) {
            this.negative ^= 1;
          }
          return this;
        };
        BN.prototype.iuor = function iuor(num) {
          while (this.length < num.length) {
            this.words[this.length++] = 0;
          }
          for (var i = 0; i < num.length; i++) {
            this.words[i] = this.words[i] | num.words[i];
          }
          return this.strip();
        };
        BN.prototype.ior = function ior(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuor(num);
        };
        BN.prototype.or = function or(num) {
          if (this.length > num.length) return this.clone().ior(num);
          return num.clone().ior(this);
        };
        BN.prototype.uor = function uor(num) {
          if (this.length > num.length) return this.clone().iuor(num);
          return num.clone().iuor(this);
        };
        BN.prototype.iuand = function iuand(num) {
          var b;
          if (this.length > num.length) {
            b = num;
          } else {
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = this.words[i] & num.words[i];
          }
          this.length = b.length;
          return this.strip();
        };
        BN.prototype.iand = function iand(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuand(num);
        };
        BN.prototype.and = function and(num) {
          if (this.length > num.length) return this.clone().iand(num);
          return num.clone().iand(this);
        };
        BN.prototype.uand = function uand(num) {
          if (this.length > num.length) return this.clone().iuand(num);
          return num.clone().iuand(this);
        };
        BN.prototype.iuxor = function iuxor(num) {
          var a;
          var b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          for (var i = 0; i < b.length; i++) {
            this.words[i] = a.words[i] ^ b.words[i];
          }
          if (this !== a) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = a.length;
          return this.strip();
        };
        BN.prototype.ixor = function ixor(num) {
          assert((this.negative | num.negative) === 0);
          return this.iuxor(num);
        };
        BN.prototype.xor = function xor(num) {
          if (this.length > num.length) return this.clone().ixor(num);
          return num.clone().ixor(this);
        };
        BN.prototype.uxor = function uxor(num) {
          if (this.length > num.length) return this.clone().iuxor(num);
          return num.clone().iuxor(this);
        };
        BN.prototype.inotn = function inotn(width) {
          assert(typeof width === "number" && width >= 0);
          var bytesNeeded = Math.ceil(width / 26) | 0;
          var bitsLeft = width % 26;
          this._expand(bytesNeeded);
          if (bitsLeft > 0) {
            bytesNeeded--;
          }
          for (var i = 0; i < bytesNeeded; i++) {
            this.words[i] = ~this.words[i] & 67108863;
          }
          if (bitsLeft > 0) {
            this.words[i] = ~this.words[i] & 67108863 >> 26 - bitsLeft;
          }
          return this.strip();
        };
        BN.prototype.notn = function notn(width) {
          return this.clone().inotn(width);
        };
        BN.prototype.setn = function setn(bit, val) {
          assert(typeof bit === "number" && bit >= 0);
          var off = bit / 26 | 0;
          var wbit = bit % 26;
          this._expand(off + 1);
          if (val) {
            this.words[off] = this.words[off] | 1 << wbit;
          } else {
            this.words[off] = this.words[off] & ~(1 << wbit);
          }
          return this.strip();
        };
        BN.prototype.iadd = function iadd(num) {
          var r;
          if (this.negative !== 0 && num.negative === 0) {
            this.negative = 0;
            r = this.isub(num);
            this.negative ^= 1;
            return this._normSign();
          } else if (this.negative === 0 && num.negative !== 0) {
            num.negative = 0;
            r = this.isub(num);
            num.negative = 1;
            return r._normSign();
          }
          var a, b;
          if (this.length > num.length) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) + (b.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            this.words[i] = r & 67108863;
            carry = r >>> 26;
          }
          this.length = a.length;
          if (carry !== 0) {
            this.words[this.length] = carry;
            this.length++;
          } else if (a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          return this;
        };
        BN.prototype.add = function add(num) {
          var res;
          if (num.negative !== 0 && this.negative === 0) {
            num.negative = 0;
            res = this.sub(num);
            num.negative ^= 1;
            return res;
          } else if (num.negative === 0 && this.negative !== 0) {
            this.negative = 0;
            res = num.sub(this);
            this.negative = 1;
            return res;
          }
          if (this.length > num.length) return this.clone().iadd(num);
          return num.clone().iadd(this);
        };
        BN.prototype.isub = function isub(num) {
          if (num.negative !== 0) {
            num.negative = 0;
            var r = this.iadd(num);
            num.negative = 1;
            return r._normSign();
          } else if (this.negative !== 0) {
            this.negative = 0;
            this.iadd(num);
            this.negative = 1;
            return this._normSign();
          }
          var cmp = this.cmp(num);
          if (cmp === 0) {
            this.negative = 0;
            this.length = 1;
            this.words[0] = 0;
            return this;
          }
          var a, b;
          if (cmp > 0) {
            a = this;
            b = num;
          } else {
            a = num;
            b = this;
          }
          var carry = 0;
          for (var i = 0; i < b.length; i++) {
            r = (a.words[i] | 0) - (b.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          for (;carry !== 0 && i < a.length; i++) {
            r = (a.words[i] | 0) + carry;
            carry = r >> 26;
            this.words[i] = r & 67108863;
          }
          if (carry === 0 && i < a.length && a !== this) {
            for (;i < a.length; i++) {
              this.words[i] = a.words[i];
            }
          }
          this.length = Math.max(this.length, i);
          if (a !== this) {
            this.negative = 1;
          }
          return this.strip();
        };
        BN.prototype.sub = function sub(num) {
          return this.clone().isub(num);
        };
        function smallMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          var len = self.length + num.length | 0;
          out.length = len;
          len = len - 1 | 0;
          var a = self.words[0] | 0;
          var b = num.words[0] | 0;
          var r = a * b;
          var lo = r & 67108863;
          var carry = r / 67108864 | 0;
          out.words[0] = lo;
          for (var k = 1; k < len; k++) {
            var ncarry = carry >>> 26;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j | 0;
              a = self.words[i] | 0;
              b = num.words[j] | 0;
              r = a * b + rword;
              ncarry += r / 67108864 | 0;
              rword = r & 67108863;
            }
            out.words[k] = rword | 0;
            carry = ncarry | 0;
          }
          if (carry !== 0) {
            out.words[k] = carry | 0;
          } else {
            out.length--;
          }
          return out.strip();
        }
        var comb10MulTo = function comb10MulTo(self, num, out) {
          var a = self.words;
          var b = num.words;
          var o = out.words;
          var c = 0;
          var lo;
          var mid;
          var hi;
          var a0 = a[0] | 0;
          var al0 = a0 & 8191;
          var ah0 = a0 >>> 13;
          var a1 = a[1] | 0;
          var al1 = a1 & 8191;
          var ah1 = a1 >>> 13;
          var a2 = a[2] | 0;
          var al2 = a2 & 8191;
          var ah2 = a2 >>> 13;
          var a3 = a[3] | 0;
          var al3 = a3 & 8191;
          var ah3 = a3 >>> 13;
          var a4 = a[4] | 0;
          var al4 = a4 & 8191;
          var ah4 = a4 >>> 13;
          var a5 = a[5] | 0;
          var al5 = a5 & 8191;
          var ah5 = a5 >>> 13;
          var a6 = a[6] | 0;
          var al6 = a6 & 8191;
          var ah6 = a6 >>> 13;
          var a7 = a[7] | 0;
          var al7 = a7 & 8191;
          var ah7 = a7 >>> 13;
          var a8 = a[8] | 0;
          var al8 = a8 & 8191;
          var ah8 = a8 >>> 13;
          var a9 = a[9] | 0;
          var al9 = a9 & 8191;
          var ah9 = a9 >>> 13;
          var b0 = b[0] | 0;
          var bl0 = b0 & 8191;
          var bh0 = b0 >>> 13;
          var b1 = b[1] | 0;
          var bl1 = b1 & 8191;
          var bh1 = b1 >>> 13;
          var b2 = b[2] | 0;
          var bl2 = b2 & 8191;
          var bh2 = b2 >>> 13;
          var b3 = b[3] | 0;
          var bl3 = b3 & 8191;
          var bh3 = b3 >>> 13;
          var b4 = b[4] | 0;
          var bl4 = b4 & 8191;
          var bh4 = b4 >>> 13;
          var b5 = b[5] | 0;
          var bl5 = b5 & 8191;
          var bh5 = b5 >>> 13;
          var b6 = b[6] | 0;
          var bl6 = b6 & 8191;
          var bh6 = b6 >>> 13;
          var b7 = b[7] | 0;
          var bl7 = b7 & 8191;
          var bh7 = b7 >>> 13;
          var b8 = b[8] | 0;
          var bl8 = b8 & 8191;
          var bh8 = b8 >>> 13;
          var b9 = b[9] | 0;
          var bl9 = b9 & 8191;
          var bh9 = b9 >>> 13;
          out.negative = self.negative ^ num.negative;
          out.length = 19;
          lo = Math.imul(al0, bl0);
          mid = Math.imul(al0, bh0);
          mid = mid + Math.imul(ah0, bl0) | 0;
          hi = Math.imul(ah0, bh0);
          var w0 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w0 >>> 26) | 0;
          w0 &= 67108863;
          lo = Math.imul(al1, bl0);
          mid = Math.imul(al1, bh0);
          mid = mid + Math.imul(ah1, bl0) | 0;
          hi = Math.imul(ah1, bh0);
          lo = lo + Math.imul(al0, bl1) | 0;
          mid = mid + Math.imul(al0, bh1) | 0;
          mid = mid + Math.imul(ah0, bl1) | 0;
          hi = hi + Math.imul(ah0, bh1) | 0;
          var w1 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w1 >>> 26) | 0;
          w1 &= 67108863;
          lo = Math.imul(al2, bl0);
          mid = Math.imul(al2, bh0);
          mid = mid + Math.imul(ah2, bl0) | 0;
          hi = Math.imul(ah2, bh0);
          lo = lo + Math.imul(al1, bl1) | 0;
          mid = mid + Math.imul(al1, bh1) | 0;
          mid = mid + Math.imul(ah1, bl1) | 0;
          hi = hi + Math.imul(ah1, bh1) | 0;
          lo = lo + Math.imul(al0, bl2) | 0;
          mid = mid + Math.imul(al0, bh2) | 0;
          mid = mid + Math.imul(ah0, bl2) | 0;
          hi = hi + Math.imul(ah0, bh2) | 0;
          var w2 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w2 >>> 26) | 0;
          w2 &= 67108863;
          lo = Math.imul(al3, bl0);
          mid = Math.imul(al3, bh0);
          mid = mid + Math.imul(ah3, bl0) | 0;
          hi = Math.imul(ah3, bh0);
          lo = lo + Math.imul(al2, bl1) | 0;
          mid = mid + Math.imul(al2, bh1) | 0;
          mid = mid + Math.imul(ah2, bl1) | 0;
          hi = hi + Math.imul(ah2, bh1) | 0;
          lo = lo + Math.imul(al1, bl2) | 0;
          mid = mid + Math.imul(al1, bh2) | 0;
          mid = mid + Math.imul(ah1, bl2) | 0;
          hi = hi + Math.imul(ah1, bh2) | 0;
          lo = lo + Math.imul(al0, bl3) | 0;
          mid = mid + Math.imul(al0, bh3) | 0;
          mid = mid + Math.imul(ah0, bl3) | 0;
          hi = hi + Math.imul(ah0, bh3) | 0;
          var w3 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w3 >>> 26) | 0;
          w3 &= 67108863;
          lo = Math.imul(al4, bl0);
          mid = Math.imul(al4, bh0);
          mid = mid + Math.imul(ah4, bl0) | 0;
          hi = Math.imul(ah4, bh0);
          lo = lo + Math.imul(al3, bl1) | 0;
          mid = mid + Math.imul(al3, bh1) | 0;
          mid = mid + Math.imul(ah3, bl1) | 0;
          hi = hi + Math.imul(ah3, bh1) | 0;
          lo = lo + Math.imul(al2, bl2) | 0;
          mid = mid + Math.imul(al2, bh2) | 0;
          mid = mid + Math.imul(ah2, bl2) | 0;
          hi = hi + Math.imul(ah2, bh2) | 0;
          lo = lo + Math.imul(al1, bl3) | 0;
          mid = mid + Math.imul(al1, bh3) | 0;
          mid = mid + Math.imul(ah1, bl3) | 0;
          hi = hi + Math.imul(ah1, bh3) | 0;
          lo = lo + Math.imul(al0, bl4) | 0;
          mid = mid + Math.imul(al0, bh4) | 0;
          mid = mid + Math.imul(ah0, bl4) | 0;
          hi = hi + Math.imul(ah0, bh4) | 0;
          var w4 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w4 >>> 26) | 0;
          w4 &= 67108863;
          lo = Math.imul(al5, bl0);
          mid = Math.imul(al5, bh0);
          mid = mid + Math.imul(ah5, bl0) | 0;
          hi = Math.imul(ah5, bh0);
          lo = lo + Math.imul(al4, bl1) | 0;
          mid = mid + Math.imul(al4, bh1) | 0;
          mid = mid + Math.imul(ah4, bl1) | 0;
          hi = hi + Math.imul(ah4, bh1) | 0;
          lo = lo + Math.imul(al3, bl2) | 0;
          mid = mid + Math.imul(al3, bh2) | 0;
          mid = mid + Math.imul(ah3, bl2) | 0;
          hi = hi + Math.imul(ah3, bh2) | 0;
          lo = lo + Math.imul(al2, bl3) | 0;
          mid = mid + Math.imul(al2, bh3) | 0;
          mid = mid + Math.imul(ah2, bl3) | 0;
          hi = hi + Math.imul(ah2, bh3) | 0;
          lo = lo + Math.imul(al1, bl4) | 0;
          mid = mid + Math.imul(al1, bh4) | 0;
          mid = mid + Math.imul(ah1, bl4) | 0;
          hi = hi + Math.imul(ah1, bh4) | 0;
          lo = lo + Math.imul(al0, bl5) | 0;
          mid = mid + Math.imul(al0, bh5) | 0;
          mid = mid + Math.imul(ah0, bl5) | 0;
          hi = hi + Math.imul(ah0, bh5) | 0;
          var w5 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w5 >>> 26) | 0;
          w5 &= 67108863;
          lo = Math.imul(al6, bl0);
          mid = Math.imul(al6, bh0);
          mid = mid + Math.imul(ah6, bl0) | 0;
          hi = Math.imul(ah6, bh0);
          lo = lo + Math.imul(al5, bl1) | 0;
          mid = mid + Math.imul(al5, bh1) | 0;
          mid = mid + Math.imul(ah5, bl1) | 0;
          hi = hi + Math.imul(ah5, bh1) | 0;
          lo = lo + Math.imul(al4, bl2) | 0;
          mid = mid + Math.imul(al4, bh2) | 0;
          mid = mid + Math.imul(ah4, bl2) | 0;
          hi = hi + Math.imul(ah4, bh2) | 0;
          lo = lo + Math.imul(al3, bl3) | 0;
          mid = mid + Math.imul(al3, bh3) | 0;
          mid = mid + Math.imul(ah3, bl3) | 0;
          hi = hi + Math.imul(ah3, bh3) | 0;
          lo = lo + Math.imul(al2, bl4) | 0;
          mid = mid + Math.imul(al2, bh4) | 0;
          mid = mid + Math.imul(ah2, bl4) | 0;
          hi = hi + Math.imul(ah2, bh4) | 0;
          lo = lo + Math.imul(al1, bl5) | 0;
          mid = mid + Math.imul(al1, bh5) | 0;
          mid = mid + Math.imul(ah1, bl5) | 0;
          hi = hi + Math.imul(ah1, bh5) | 0;
          lo = lo + Math.imul(al0, bl6) | 0;
          mid = mid + Math.imul(al0, bh6) | 0;
          mid = mid + Math.imul(ah0, bl6) | 0;
          hi = hi + Math.imul(ah0, bh6) | 0;
          var w6 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w6 >>> 26) | 0;
          w6 &= 67108863;
          lo = Math.imul(al7, bl0);
          mid = Math.imul(al7, bh0);
          mid = mid + Math.imul(ah7, bl0) | 0;
          hi = Math.imul(ah7, bh0);
          lo = lo + Math.imul(al6, bl1) | 0;
          mid = mid + Math.imul(al6, bh1) | 0;
          mid = mid + Math.imul(ah6, bl1) | 0;
          hi = hi + Math.imul(ah6, bh1) | 0;
          lo = lo + Math.imul(al5, bl2) | 0;
          mid = mid + Math.imul(al5, bh2) | 0;
          mid = mid + Math.imul(ah5, bl2) | 0;
          hi = hi + Math.imul(ah5, bh2) | 0;
          lo = lo + Math.imul(al4, bl3) | 0;
          mid = mid + Math.imul(al4, bh3) | 0;
          mid = mid + Math.imul(ah4, bl3) | 0;
          hi = hi + Math.imul(ah4, bh3) | 0;
          lo = lo + Math.imul(al3, bl4) | 0;
          mid = mid + Math.imul(al3, bh4) | 0;
          mid = mid + Math.imul(ah3, bl4) | 0;
          hi = hi + Math.imul(ah3, bh4) | 0;
          lo = lo + Math.imul(al2, bl5) | 0;
          mid = mid + Math.imul(al2, bh5) | 0;
          mid = mid + Math.imul(ah2, bl5) | 0;
          hi = hi + Math.imul(ah2, bh5) | 0;
          lo = lo + Math.imul(al1, bl6) | 0;
          mid = mid + Math.imul(al1, bh6) | 0;
          mid = mid + Math.imul(ah1, bl6) | 0;
          hi = hi + Math.imul(ah1, bh6) | 0;
          lo = lo + Math.imul(al0, bl7) | 0;
          mid = mid + Math.imul(al0, bh7) | 0;
          mid = mid + Math.imul(ah0, bl7) | 0;
          hi = hi + Math.imul(ah0, bh7) | 0;
          var w7 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w7 >>> 26) | 0;
          w7 &= 67108863;
          lo = Math.imul(al8, bl0);
          mid = Math.imul(al8, bh0);
          mid = mid + Math.imul(ah8, bl0) | 0;
          hi = Math.imul(ah8, bh0);
          lo = lo + Math.imul(al7, bl1) | 0;
          mid = mid + Math.imul(al7, bh1) | 0;
          mid = mid + Math.imul(ah7, bl1) | 0;
          hi = hi + Math.imul(ah7, bh1) | 0;
          lo = lo + Math.imul(al6, bl2) | 0;
          mid = mid + Math.imul(al6, bh2) | 0;
          mid = mid + Math.imul(ah6, bl2) | 0;
          hi = hi + Math.imul(ah6, bh2) | 0;
          lo = lo + Math.imul(al5, bl3) | 0;
          mid = mid + Math.imul(al5, bh3) | 0;
          mid = mid + Math.imul(ah5, bl3) | 0;
          hi = hi + Math.imul(ah5, bh3) | 0;
          lo = lo + Math.imul(al4, bl4) | 0;
          mid = mid + Math.imul(al4, bh4) | 0;
          mid = mid + Math.imul(ah4, bl4) | 0;
          hi = hi + Math.imul(ah4, bh4) | 0;
          lo = lo + Math.imul(al3, bl5) | 0;
          mid = mid + Math.imul(al3, bh5) | 0;
          mid = mid + Math.imul(ah3, bl5) | 0;
          hi = hi + Math.imul(ah3, bh5) | 0;
          lo = lo + Math.imul(al2, bl6) | 0;
          mid = mid + Math.imul(al2, bh6) | 0;
          mid = mid + Math.imul(ah2, bl6) | 0;
          hi = hi + Math.imul(ah2, bh6) | 0;
          lo = lo + Math.imul(al1, bl7) | 0;
          mid = mid + Math.imul(al1, bh7) | 0;
          mid = mid + Math.imul(ah1, bl7) | 0;
          hi = hi + Math.imul(ah1, bh7) | 0;
          lo = lo + Math.imul(al0, bl8) | 0;
          mid = mid + Math.imul(al0, bh8) | 0;
          mid = mid + Math.imul(ah0, bl8) | 0;
          hi = hi + Math.imul(ah0, bh8) | 0;
          var w8 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w8 >>> 26) | 0;
          w8 &= 67108863;
          lo = Math.imul(al9, bl0);
          mid = Math.imul(al9, bh0);
          mid = mid + Math.imul(ah9, bl0) | 0;
          hi = Math.imul(ah9, bh0);
          lo = lo + Math.imul(al8, bl1) | 0;
          mid = mid + Math.imul(al8, bh1) | 0;
          mid = mid + Math.imul(ah8, bl1) | 0;
          hi = hi + Math.imul(ah8, bh1) | 0;
          lo = lo + Math.imul(al7, bl2) | 0;
          mid = mid + Math.imul(al7, bh2) | 0;
          mid = mid + Math.imul(ah7, bl2) | 0;
          hi = hi + Math.imul(ah7, bh2) | 0;
          lo = lo + Math.imul(al6, bl3) | 0;
          mid = mid + Math.imul(al6, bh3) | 0;
          mid = mid + Math.imul(ah6, bl3) | 0;
          hi = hi + Math.imul(ah6, bh3) | 0;
          lo = lo + Math.imul(al5, bl4) | 0;
          mid = mid + Math.imul(al5, bh4) | 0;
          mid = mid + Math.imul(ah5, bl4) | 0;
          hi = hi + Math.imul(ah5, bh4) | 0;
          lo = lo + Math.imul(al4, bl5) | 0;
          mid = mid + Math.imul(al4, bh5) | 0;
          mid = mid + Math.imul(ah4, bl5) | 0;
          hi = hi + Math.imul(ah4, bh5) | 0;
          lo = lo + Math.imul(al3, bl6) | 0;
          mid = mid + Math.imul(al3, bh6) | 0;
          mid = mid + Math.imul(ah3, bl6) | 0;
          hi = hi + Math.imul(ah3, bh6) | 0;
          lo = lo + Math.imul(al2, bl7) | 0;
          mid = mid + Math.imul(al2, bh7) | 0;
          mid = mid + Math.imul(ah2, bl7) | 0;
          hi = hi + Math.imul(ah2, bh7) | 0;
          lo = lo + Math.imul(al1, bl8) | 0;
          mid = mid + Math.imul(al1, bh8) | 0;
          mid = mid + Math.imul(ah1, bl8) | 0;
          hi = hi + Math.imul(ah1, bh8) | 0;
          lo = lo + Math.imul(al0, bl9) | 0;
          mid = mid + Math.imul(al0, bh9) | 0;
          mid = mid + Math.imul(ah0, bl9) | 0;
          hi = hi + Math.imul(ah0, bh9) | 0;
          var w9 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w9 >>> 26) | 0;
          w9 &= 67108863;
          lo = Math.imul(al9, bl1);
          mid = Math.imul(al9, bh1);
          mid = mid + Math.imul(ah9, bl1) | 0;
          hi = Math.imul(ah9, bh1);
          lo = lo + Math.imul(al8, bl2) | 0;
          mid = mid + Math.imul(al8, bh2) | 0;
          mid = mid + Math.imul(ah8, bl2) | 0;
          hi = hi + Math.imul(ah8, bh2) | 0;
          lo = lo + Math.imul(al7, bl3) | 0;
          mid = mid + Math.imul(al7, bh3) | 0;
          mid = mid + Math.imul(ah7, bl3) | 0;
          hi = hi + Math.imul(ah7, bh3) | 0;
          lo = lo + Math.imul(al6, bl4) | 0;
          mid = mid + Math.imul(al6, bh4) | 0;
          mid = mid + Math.imul(ah6, bl4) | 0;
          hi = hi + Math.imul(ah6, bh4) | 0;
          lo = lo + Math.imul(al5, bl5) | 0;
          mid = mid + Math.imul(al5, bh5) | 0;
          mid = mid + Math.imul(ah5, bl5) | 0;
          hi = hi + Math.imul(ah5, bh5) | 0;
          lo = lo + Math.imul(al4, bl6) | 0;
          mid = mid + Math.imul(al4, bh6) | 0;
          mid = mid + Math.imul(ah4, bl6) | 0;
          hi = hi + Math.imul(ah4, bh6) | 0;
          lo = lo + Math.imul(al3, bl7) | 0;
          mid = mid + Math.imul(al3, bh7) | 0;
          mid = mid + Math.imul(ah3, bl7) | 0;
          hi = hi + Math.imul(ah3, bh7) | 0;
          lo = lo + Math.imul(al2, bl8) | 0;
          mid = mid + Math.imul(al2, bh8) | 0;
          mid = mid + Math.imul(ah2, bl8) | 0;
          hi = hi + Math.imul(ah2, bh8) | 0;
          lo = lo + Math.imul(al1, bl9) | 0;
          mid = mid + Math.imul(al1, bh9) | 0;
          mid = mid + Math.imul(ah1, bl9) | 0;
          hi = hi + Math.imul(ah1, bh9) | 0;
          var w10 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w10 >>> 26) | 0;
          w10 &= 67108863;
          lo = Math.imul(al9, bl2);
          mid = Math.imul(al9, bh2);
          mid = mid + Math.imul(ah9, bl2) | 0;
          hi = Math.imul(ah9, bh2);
          lo = lo + Math.imul(al8, bl3) | 0;
          mid = mid + Math.imul(al8, bh3) | 0;
          mid = mid + Math.imul(ah8, bl3) | 0;
          hi = hi + Math.imul(ah8, bh3) | 0;
          lo = lo + Math.imul(al7, bl4) | 0;
          mid = mid + Math.imul(al7, bh4) | 0;
          mid = mid + Math.imul(ah7, bl4) | 0;
          hi = hi + Math.imul(ah7, bh4) | 0;
          lo = lo + Math.imul(al6, bl5) | 0;
          mid = mid + Math.imul(al6, bh5) | 0;
          mid = mid + Math.imul(ah6, bl5) | 0;
          hi = hi + Math.imul(ah6, bh5) | 0;
          lo = lo + Math.imul(al5, bl6) | 0;
          mid = mid + Math.imul(al5, bh6) | 0;
          mid = mid + Math.imul(ah5, bl6) | 0;
          hi = hi + Math.imul(ah5, bh6) | 0;
          lo = lo + Math.imul(al4, bl7) | 0;
          mid = mid + Math.imul(al4, bh7) | 0;
          mid = mid + Math.imul(ah4, bl7) | 0;
          hi = hi + Math.imul(ah4, bh7) | 0;
          lo = lo + Math.imul(al3, bl8) | 0;
          mid = mid + Math.imul(al3, bh8) | 0;
          mid = mid + Math.imul(ah3, bl8) | 0;
          hi = hi + Math.imul(ah3, bh8) | 0;
          lo = lo + Math.imul(al2, bl9) | 0;
          mid = mid + Math.imul(al2, bh9) | 0;
          mid = mid + Math.imul(ah2, bl9) | 0;
          hi = hi + Math.imul(ah2, bh9) | 0;
          var w11 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w11 >>> 26) | 0;
          w11 &= 67108863;
          lo = Math.imul(al9, bl3);
          mid = Math.imul(al9, bh3);
          mid = mid + Math.imul(ah9, bl3) | 0;
          hi = Math.imul(ah9, bh3);
          lo = lo + Math.imul(al8, bl4) | 0;
          mid = mid + Math.imul(al8, bh4) | 0;
          mid = mid + Math.imul(ah8, bl4) | 0;
          hi = hi + Math.imul(ah8, bh4) | 0;
          lo = lo + Math.imul(al7, bl5) | 0;
          mid = mid + Math.imul(al7, bh5) | 0;
          mid = mid + Math.imul(ah7, bl5) | 0;
          hi = hi + Math.imul(ah7, bh5) | 0;
          lo = lo + Math.imul(al6, bl6) | 0;
          mid = mid + Math.imul(al6, bh6) | 0;
          mid = mid + Math.imul(ah6, bl6) | 0;
          hi = hi + Math.imul(ah6, bh6) | 0;
          lo = lo + Math.imul(al5, bl7) | 0;
          mid = mid + Math.imul(al5, bh7) | 0;
          mid = mid + Math.imul(ah5, bl7) | 0;
          hi = hi + Math.imul(ah5, bh7) | 0;
          lo = lo + Math.imul(al4, bl8) | 0;
          mid = mid + Math.imul(al4, bh8) | 0;
          mid = mid + Math.imul(ah4, bl8) | 0;
          hi = hi + Math.imul(ah4, bh8) | 0;
          lo = lo + Math.imul(al3, bl9) | 0;
          mid = mid + Math.imul(al3, bh9) | 0;
          mid = mid + Math.imul(ah3, bl9) | 0;
          hi = hi + Math.imul(ah3, bh9) | 0;
          var w12 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w12 >>> 26) | 0;
          w12 &= 67108863;
          lo = Math.imul(al9, bl4);
          mid = Math.imul(al9, bh4);
          mid = mid + Math.imul(ah9, bl4) | 0;
          hi = Math.imul(ah9, bh4);
          lo = lo + Math.imul(al8, bl5) | 0;
          mid = mid + Math.imul(al8, bh5) | 0;
          mid = mid + Math.imul(ah8, bl5) | 0;
          hi = hi + Math.imul(ah8, bh5) | 0;
          lo = lo + Math.imul(al7, bl6) | 0;
          mid = mid + Math.imul(al7, bh6) | 0;
          mid = mid + Math.imul(ah7, bl6) | 0;
          hi = hi + Math.imul(ah7, bh6) | 0;
          lo = lo + Math.imul(al6, bl7) | 0;
          mid = mid + Math.imul(al6, bh7) | 0;
          mid = mid + Math.imul(ah6, bl7) | 0;
          hi = hi + Math.imul(ah6, bh7) | 0;
          lo = lo + Math.imul(al5, bl8) | 0;
          mid = mid + Math.imul(al5, bh8) | 0;
          mid = mid + Math.imul(ah5, bl8) | 0;
          hi = hi + Math.imul(ah5, bh8) | 0;
          lo = lo + Math.imul(al4, bl9) | 0;
          mid = mid + Math.imul(al4, bh9) | 0;
          mid = mid + Math.imul(ah4, bl9) | 0;
          hi = hi + Math.imul(ah4, bh9) | 0;
          var w13 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w13 >>> 26) | 0;
          w13 &= 67108863;
          lo = Math.imul(al9, bl5);
          mid = Math.imul(al9, bh5);
          mid = mid + Math.imul(ah9, bl5) | 0;
          hi = Math.imul(ah9, bh5);
          lo = lo + Math.imul(al8, bl6) | 0;
          mid = mid + Math.imul(al8, bh6) | 0;
          mid = mid + Math.imul(ah8, bl6) | 0;
          hi = hi + Math.imul(ah8, bh6) | 0;
          lo = lo + Math.imul(al7, bl7) | 0;
          mid = mid + Math.imul(al7, bh7) | 0;
          mid = mid + Math.imul(ah7, bl7) | 0;
          hi = hi + Math.imul(ah7, bh7) | 0;
          lo = lo + Math.imul(al6, bl8) | 0;
          mid = mid + Math.imul(al6, bh8) | 0;
          mid = mid + Math.imul(ah6, bl8) | 0;
          hi = hi + Math.imul(ah6, bh8) | 0;
          lo = lo + Math.imul(al5, bl9) | 0;
          mid = mid + Math.imul(al5, bh9) | 0;
          mid = mid + Math.imul(ah5, bl9) | 0;
          hi = hi + Math.imul(ah5, bh9) | 0;
          var w14 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w14 >>> 26) | 0;
          w14 &= 67108863;
          lo = Math.imul(al9, bl6);
          mid = Math.imul(al9, bh6);
          mid = mid + Math.imul(ah9, bl6) | 0;
          hi = Math.imul(ah9, bh6);
          lo = lo + Math.imul(al8, bl7) | 0;
          mid = mid + Math.imul(al8, bh7) | 0;
          mid = mid + Math.imul(ah8, bl7) | 0;
          hi = hi + Math.imul(ah8, bh7) | 0;
          lo = lo + Math.imul(al7, bl8) | 0;
          mid = mid + Math.imul(al7, bh8) | 0;
          mid = mid + Math.imul(ah7, bl8) | 0;
          hi = hi + Math.imul(ah7, bh8) | 0;
          lo = lo + Math.imul(al6, bl9) | 0;
          mid = mid + Math.imul(al6, bh9) | 0;
          mid = mid + Math.imul(ah6, bl9) | 0;
          hi = hi + Math.imul(ah6, bh9) | 0;
          var w15 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w15 >>> 26) | 0;
          w15 &= 67108863;
          lo = Math.imul(al9, bl7);
          mid = Math.imul(al9, bh7);
          mid = mid + Math.imul(ah9, bl7) | 0;
          hi = Math.imul(ah9, bh7);
          lo = lo + Math.imul(al8, bl8) | 0;
          mid = mid + Math.imul(al8, bh8) | 0;
          mid = mid + Math.imul(ah8, bl8) | 0;
          hi = hi + Math.imul(ah8, bh8) | 0;
          lo = lo + Math.imul(al7, bl9) | 0;
          mid = mid + Math.imul(al7, bh9) | 0;
          mid = mid + Math.imul(ah7, bl9) | 0;
          hi = hi + Math.imul(ah7, bh9) | 0;
          var w16 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w16 >>> 26) | 0;
          w16 &= 67108863;
          lo = Math.imul(al9, bl8);
          mid = Math.imul(al9, bh8);
          mid = mid + Math.imul(ah9, bl8) | 0;
          hi = Math.imul(ah9, bh8);
          lo = lo + Math.imul(al8, bl9) | 0;
          mid = mid + Math.imul(al8, bh9) | 0;
          mid = mid + Math.imul(ah8, bl9) | 0;
          hi = hi + Math.imul(ah8, bh9) | 0;
          var w17 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w17 >>> 26) | 0;
          w17 &= 67108863;
          lo = Math.imul(al9, bl9);
          mid = Math.imul(al9, bh9);
          mid = mid + Math.imul(ah9, bl9) | 0;
          hi = Math.imul(ah9, bh9);
          var w18 = (c + lo | 0) + ((mid & 8191) << 13) | 0;
          c = (hi + (mid >>> 13) | 0) + (w18 >>> 26) | 0;
          w18 &= 67108863;
          o[0] = w0;
          o[1] = w1;
          o[2] = w2;
          o[3] = w3;
          o[4] = w4;
          o[5] = w5;
          o[6] = w6;
          o[7] = w7;
          o[8] = w8;
          o[9] = w9;
          o[10] = w10;
          o[11] = w11;
          o[12] = w12;
          o[13] = w13;
          o[14] = w14;
          o[15] = w15;
          o[16] = w16;
          o[17] = w17;
          o[18] = w18;
          if (c !== 0) {
            o[19] = c;
            out.length++;
          }
          return out;
        };
        if (!Math.imul) {
          comb10MulTo = smallMulTo;
        }
        function bigMulTo(self, num, out) {
          out.negative = num.negative ^ self.negative;
          out.length = self.length + num.length;
          var carry = 0;
          var hncarry = 0;
          for (var k = 0; k < out.length - 1; k++) {
            var ncarry = hncarry;
            hncarry = 0;
            var rword = carry & 67108863;
            var maxJ = Math.min(k, num.length - 1);
            for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) {
              var i = k - j;
              var a = self.words[i] | 0;
              var b = num.words[j] | 0;
              var r = a * b;
              var lo = r & 67108863;
              ncarry = ncarry + (r / 67108864 | 0) | 0;
              lo = lo + rword | 0;
              rword = lo & 67108863;
              ncarry = ncarry + (lo >>> 26) | 0;
              hncarry += ncarry >>> 26;
              ncarry &= 67108863;
            }
            out.words[k] = rword;
            carry = ncarry;
            ncarry = hncarry;
          }
          if (carry !== 0) {
            out.words[k] = carry;
          } else {
            out.length--;
          }
          return out.strip();
        }
        function jumboMulTo(self, num, out) {
          var fftm = new FFTM;
          return fftm.mulp(self, num, out);
        }
        BN.prototype.mulTo = function mulTo(num, out) {
          var res;
          var len = this.length + num.length;
          if (this.length === 10 && num.length === 10) {
            res = comb10MulTo(this, num, out);
          } else if (len < 63) {
            res = smallMulTo(this, num, out);
          } else if (len < 1024) {
            res = bigMulTo(this, num, out);
          } else {
            res = jumboMulTo(this, num, out);
          }
          return res;
        };
        function FFTM(x, y) {
          this.x = x;
          this.y = y;
        }
        FFTM.prototype.makeRBT = function makeRBT(N) {
          var t = new Array(N);
          var l = BN.prototype._countBits(N) - 1;
          for (var i = 0; i < N; i++) {
            t[i] = this.revBin(i, l, N);
          }
          return t;
        };
        FFTM.prototype.revBin = function revBin(x, l, N) {
          if (x === 0 || x === N - 1) return x;
          var rb = 0;
          for (var i = 0; i < l; i++) {
            rb |= (x & 1) << l - i - 1;
            x >>= 1;
          }
          return rb;
        };
        FFTM.prototype.permute = function permute(rbt, rws, iws, rtws, itws, N) {
          for (var i = 0; i < N; i++) {
            rtws[i] = rws[rbt[i]];
            itws[i] = iws[rbt[i]];
          }
        };
        FFTM.prototype.transform = function transform(rws, iws, rtws, itws, N, rbt) {
          this.permute(rbt, rws, iws, rtws, itws, N);
          for (var s = 1; s < N; s <<= 1) {
            var l = s << 1;
            var rtwdf = Math.cos(2 * Math.PI / l);
            var itwdf = Math.sin(2 * Math.PI / l);
            for (var p = 0; p < N; p += l) {
              var rtwdf_ = rtwdf;
              var itwdf_ = itwdf;
              for (var j = 0; j < s; j++) {
                var re = rtws[p + j];
                var ie = itws[p + j];
                var ro = rtws[p + j + s];
                var io = itws[p + j + s];
                var rx = rtwdf_ * ro - itwdf_ * io;
                io = rtwdf_ * io + itwdf_ * ro;
                ro = rx;
                rtws[p + j] = re + ro;
                itws[p + j] = ie + io;
                rtws[p + j + s] = re - ro;
                itws[p + j + s] = ie - io;
                if (j !== l) {
                  rx = rtwdf * rtwdf_ - itwdf * itwdf_;
                  itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_;
                  rtwdf_ = rx;
                }
              }
            }
          }
        };
        FFTM.prototype.guessLen13b = function guessLen13b(n, m) {
          var N = Math.max(m, n) | 1;
          var odd = N & 1;
          var i = 0;
          for (N = N / 2 | 0; N; N = N >>> 1) {
            i++;
          }
          return 1 << i + 1 + odd;
        };
        FFTM.prototype.conjugate = function conjugate(rws, iws, N) {
          if (N <= 1) return;
          for (var i = 0; i < N / 2; i++) {
            var t = rws[i];
            rws[i] = rws[N - i - 1];
            rws[N - i - 1] = t;
            t = iws[i];
            iws[i] = -iws[N - i - 1];
            iws[N - i - 1] = -t;
          }
        };
        FFTM.prototype.normalize13b = function normalize13b(ws, N) {
          var carry = 0;
          for (var i = 0; i < N / 2; i++) {
            var w = Math.round(ws[2 * i + 1] / N) * 8192 + Math.round(ws[2 * i] / N) + carry;
            ws[i] = w & 67108863;
            if (w < 67108864) {
              carry = 0;
            } else {
              carry = w / 67108864 | 0;
            }
          }
          return ws;
        };
        FFTM.prototype.convert13b = function convert13b(ws, len, rws, N) {
          var carry = 0;
          for (var i = 0; i < len; i++) {
            carry = carry + (ws[i] | 0);
            rws[2 * i] = carry & 8191;
            carry = carry >>> 13;
            rws[2 * i + 1] = carry & 8191;
            carry = carry >>> 13;
          }
          for (i = 2 * len; i < N; ++i) {
            rws[i] = 0;
          }
          assert(carry === 0);
          assert((carry & ~8191) === 0);
        };
        FFTM.prototype.stub = function stub(N) {
          var ph = new Array(N);
          for (var i = 0; i < N; i++) {
            ph[i] = 0;
          }
          return ph;
        };
        FFTM.prototype.mulp = function mulp(x, y, out) {
          var N = 2 * this.guessLen13b(x.length, y.length);
          var rbt = this.makeRBT(N);
          var _ = this.stub(N);
          var rws = new Array(N);
          var rwst = new Array(N);
          var iwst = new Array(N);
          var nrws = new Array(N);
          var nrwst = new Array(N);
          var niwst = new Array(N);
          var rmws = out.words;
          rmws.length = N;
          this.convert13b(x.words, x.length, rws, N);
          this.convert13b(y.words, y.length, nrws, N);
          this.transform(rws, _, rwst, iwst, N, rbt);
          this.transform(nrws, _, nrwst, niwst, N, rbt);
          for (var i = 0; i < N; i++) {
            var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i];
            iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i];
            rwst[i] = rx;
          }
          this.conjugate(rwst, iwst, N);
          this.transform(rwst, iwst, rmws, _, N, rbt);
          this.conjugate(rmws, _, N);
          this.normalize13b(rmws, N);
          out.negative = x.negative ^ y.negative;
          out.length = x.length + y.length;
          return out.strip();
        };
        BN.prototype.mul = function mul(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return this.mulTo(num, out);
        };
        BN.prototype.mulf = function mulf(num) {
          var out = new BN(null);
          out.words = new Array(this.length + num.length);
          return jumboMulTo(this, num, out);
        };
        BN.prototype.imul = function imul(num) {
          return this.clone().mulTo(num, this);
        };
        BN.prototype.imuln = function imuln(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          var carry = 0;
          for (var i = 0; i < this.length; i++) {
            var w = (this.words[i] | 0) * num;
            var lo = (w & 67108863) + (carry & 67108863);
            carry >>= 26;
            carry += w / 67108864 | 0;
            carry += lo >>> 26;
            this.words[i] = lo & 67108863;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          this.length = num === 0 ? 1 : this.length;
          return this;
        };
        BN.prototype.muln = function muln(num) {
          return this.clone().imuln(num);
        };
        BN.prototype.sqr = function sqr() {
          return this.mul(this);
        };
        BN.prototype.isqr = function isqr() {
          return this.imul(this.clone());
        };
        BN.prototype.pow = function pow(num) {
          var w = toBitArray(num);
          if (w.length === 0) return new BN(1);
          var res = this;
          for (var i = 0; i < w.length; i++, res = res.sqr()) {
            if (w[i] !== 0) break;
          }
          if (++i < w.length) {
            for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) {
              if (w[i] === 0) continue;
              res = res.mul(q);
            }
          }
          return res;
        };
        BN.prototype.iushln = function iushln(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          var carryMask = 67108863 >>> 26 - r << 26 - r;
          var i;
          if (r !== 0) {
            var carry = 0;
            for (i = 0; i < this.length; i++) {
              var newCarry = this.words[i] & carryMask;
              var c = (this.words[i] | 0) - newCarry << r;
              this.words[i] = c | carry;
              carry = newCarry >>> 26 - r;
            }
            if (carry) {
              this.words[i] = carry;
              this.length++;
            }
          }
          if (s !== 0) {
            for (i = this.length - 1; i >= 0; i--) {
              this.words[i + s] = this.words[i];
            }
            for (i = 0; i < s; i++) {
              this.words[i] = 0;
            }
            this.length += s;
          }
          return this.strip();
        };
        BN.prototype.ishln = function ishln(bits) {
          assert(this.negative === 0);
          return this.iushln(bits);
        };
        BN.prototype.iushrn = function iushrn(bits, hint, extended) {
          assert(typeof bits === "number" && bits >= 0);
          var h;
          if (hint) {
            h = (hint - hint % 26) / 26;
          } else {
            h = 0;
          }
          var r = bits % 26;
          var s = Math.min((bits - r) / 26, this.length);
          var mask = 67108863 ^ 67108863 >>> r << r;
          var maskedWords = extended;
          h -= s;
          h = Math.max(0, h);
          if (maskedWords) {
            for (var i = 0; i < s; i++) {
              maskedWords.words[i] = this.words[i];
            }
            maskedWords.length = s;
          }
          if (s === 0) {} else if (this.length > s) {
            this.length -= s;
            for (i = 0; i < this.length; i++) {
              this.words[i] = this.words[i + s];
            }
          } else {
            this.words[0] = 0;
            this.length = 1;
          }
          var carry = 0;
          for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) {
            var word = this.words[i] | 0;
            this.words[i] = carry << 26 - r | word >>> r;
            carry = word & mask;
          }
          if (maskedWords && carry !== 0) {
            maskedWords.words[maskedWords.length++] = carry;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.ishrn = function ishrn(bits, hint, extended) {
          assert(this.negative === 0);
          return this.iushrn(bits, hint, extended);
        };
        BN.prototype.shln = function shln(bits) {
          return this.clone().ishln(bits);
        };
        BN.prototype.ushln = function ushln(bits) {
          return this.clone().iushln(bits);
        };
        BN.prototype.shrn = function shrn(bits) {
          return this.clone().ishrn(bits);
        };
        BN.prototype.ushrn = function ushrn(bits) {
          return this.clone().iushrn(bits);
        };
        BN.prototype.testn = function testn(bit) {
          assert(typeof bit === "number" && bit >= 0);
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) return false;
          var w = this.words[s];
          return !!(w & q);
        };
        BN.prototype.imaskn = function imaskn(bits) {
          assert(typeof bits === "number" && bits >= 0);
          var r = bits % 26;
          var s = (bits - r) / 26;
          assert(this.negative === 0, "imaskn works only with positive numbers");
          if (this.length <= s) {
            return this;
          }
          if (r !== 0) {
            s++;
          }
          this.length = Math.min(s, this.length);
          if (r !== 0) {
            var mask = 67108863 ^ 67108863 >>> r << r;
            this.words[this.length - 1] &= mask;
          }
          if (this.length === 0) {
            this.words[0] = 0;
            this.length = 1;
          }
          return this.strip();
        };
        BN.prototype.maskn = function maskn(bits) {
          return this.clone().imaskn(bits);
        };
        BN.prototype.iaddn = function iaddn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.isubn(-num);
          if (this.negative !== 0) {
            if (this.length === 1 && (this.words[0] | 0) < num) {
              this.words[0] = num - (this.words[0] | 0);
              this.negative = 0;
              return this;
            }
            this.negative = 0;
            this.isubn(num);
            this.negative = 1;
            return this;
          }
          return this._iaddn(num);
        };
        BN.prototype._iaddn = function _iaddn(num) {
          this.words[0] += num;
          for (var i = 0; i < this.length && this.words[i] >= 67108864; i++) {
            this.words[i] -= 67108864;
            if (i === this.length - 1) {
              this.words[i + 1] = 1;
            } else {
              this.words[i + 1]++;
            }
          }
          this.length = Math.max(this.length, i + 1);
          return this;
        };
        BN.prototype.isubn = function isubn(num) {
          assert(typeof num === "number");
          assert(num < 67108864);
          if (num < 0) return this.iaddn(-num);
          if (this.negative !== 0) {
            this.negative = 0;
            this.iaddn(num);
            this.negative = 1;
            return this;
          }
          this.words[0] -= num;
          if (this.length === 1 && this.words[0] < 0) {
            this.words[0] = -this.words[0];
            this.negative = 1;
          } else {
            for (var i = 0; i < this.length && this.words[i] < 0; i++) {
              this.words[i] += 67108864;
              this.words[i + 1] -= 1;
            }
          }
          return this.strip();
        };
        BN.prototype.addn = function addn(num) {
          return this.clone().iaddn(num);
        };
        BN.prototype.subn = function subn(num) {
          return this.clone().isubn(num);
        };
        BN.prototype.iabs = function iabs() {
          this.negative = 0;
          return this;
        };
        BN.prototype.abs = function abs() {
          return this.clone().iabs();
        };
        BN.prototype._ishlnsubmul = function _ishlnsubmul(num, mul, shift) {
          var len = num.length + shift;
          var i;
          this._expand(len);
          var w;
          var carry = 0;
          for (i = 0; i < num.length; i++) {
            w = (this.words[i + shift] | 0) + carry;
            var right = (num.words[i] | 0) * mul;
            w -= right & 67108863;
            carry = (w >> 26) - (right / 67108864 | 0);
            this.words[i + shift] = w & 67108863;
          }
          for (;i < this.length - shift; i++) {
            w = (this.words[i + shift] | 0) + carry;
            carry = w >> 26;
            this.words[i + shift] = w & 67108863;
          }
          if (carry === 0) return this.strip();
          assert(carry === -1);
          carry = 0;
          for (i = 0; i < this.length; i++) {
            w = -(this.words[i] | 0) + carry;
            carry = w >> 26;
            this.words[i] = w & 67108863;
          }
          this.negative = 1;
          return this.strip();
        };
        BN.prototype._wordDiv = function _wordDiv(num, mode) {
          var shift = this.length - num.length;
          var a = this.clone();
          var b = num;
          var bhi = b.words[b.length - 1] | 0;
          var bhiBits = this._countBits(bhi);
          shift = 26 - bhiBits;
          if (shift !== 0) {
            b = b.ushln(shift);
            a.iushln(shift);
            bhi = b.words[b.length - 1] | 0;
          }
          var m = a.length - b.length;
          var q;
          if (mode !== "mod") {
            q = new BN(null);
            q.length = m + 1;
            q.words = new Array(q.length);
            for (var i = 0; i < q.length; i++) {
              q.words[i] = 0;
            }
          }
          var diff = a.clone()._ishlnsubmul(b, 1, m);
          if (diff.negative === 0) {
            a = diff;
            if (q) {
              q.words[m] = 1;
            }
          }
          for (var j = m - 1; j >= 0; j--) {
            var qj = (a.words[b.length + j] | 0) * 67108864 + (a.words[b.length + j - 1] | 0);
            qj = Math.min(qj / bhi | 0, 67108863);
            a._ishlnsubmul(b, qj, j);
            while (a.negative !== 0) {
              qj--;
              a.negative = 0;
              a._ishlnsubmul(b, 1, j);
              if (!a.isZero()) {
                a.negative ^= 1;
              }
            }
            if (q) {
              q.words[j] = qj;
            }
          }
          if (q) {
            q.strip();
          }
          a.strip();
          if (mode !== "div" && shift !== 0) {
            a.iushrn(shift);
          }
          return {
            div: q || null,
            mod: a
          };
        };
        BN.prototype.divmod = function divmod(num, mode, positive) {
          assert(!num.isZero());
          if (this.isZero()) {
            return {
              div: new BN(0),
              mod: new BN(0)
            };
          }
          var div, mod, res;
          if (this.negative !== 0 && num.negative === 0) {
            res = this.neg().divmod(num, mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.iadd(num);
              }
            }
            return {
              div,
              mod
            };
          }
          if (this.negative === 0 && num.negative !== 0) {
            res = this.divmod(num.neg(), mode);
            if (mode !== "mod") {
              div = res.div.neg();
            }
            return {
              div,
              mod: res.mod
            };
          }
          if ((this.negative & num.negative) !== 0) {
            res = this.neg().divmod(num.neg(), mode);
            if (mode !== "div") {
              mod = res.mod.neg();
              if (positive && mod.negative !== 0) {
                mod.isub(num);
              }
            }
            return {
              div: res.div,
              mod
            };
          }
          if (num.length > this.length || this.cmp(num) < 0) {
            return {
              div: new BN(0),
              mod: this
            };
          }
          if (num.length === 1) {
            if (mode === "div") {
              return {
                div: this.divn(num.words[0]),
                mod: null
              };
            }
            if (mode === "mod") {
              return {
                div: null,
                mod: new BN(this.modn(num.words[0]))
              };
            }
            return {
              div: this.divn(num.words[0]),
              mod: new BN(this.modn(num.words[0]))
            };
          }
          return this._wordDiv(num, mode);
        };
        BN.prototype.div = function div(num) {
          return this.divmod(num, "div", false).div;
        };
        BN.prototype.mod = function mod(num) {
          return this.divmod(num, "mod", false).mod;
        };
        BN.prototype.umod = function umod(num) {
          return this.divmod(num, "mod", true).mod;
        };
        BN.prototype.divRound = function divRound(num) {
          var dm = this.divmod(num);
          if (dm.mod.isZero()) return dm.div;
          var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod;
          var half = num.ushrn(1);
          var r2 = num.andln(1);
          var cmp = mod.cmp(half);
          if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div;
          return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1);
        };
        BN.prototype.modn = function modn(num) {
          assert(num <= 67108863);
          var p = (1 << 26) % num;
          var acc = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            acc = (p * acc + (this.words[i] | 0)) % num;
          }
          return acc;
        };
        BN.prototype.idivn = function idivn(num) {
          assert(num <= 67108863);
          var carry = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var w = (this.words[i] | 0) + carry * 67108864;
            this.words[i] = w / num | 0;
            carry = w % num;
          }
          return this.strip();
        };
        BN.prototype.divn = function divn(num) {
          return this.clone().idivn(num);
        };
        BN.prototype.egcd = function egcd(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var x = this;
          var y = p.clone();
          if (x.negative !== 0) {
            x = x.umod(p);
          } else {
            x = x.clone();
          }
          var A = new BN(1);
          var B = new BN(0);
          var C = new BN(0);
          var D = new BN(1);
          var g = 0;
          while (x.isEven() && y.isEven()) {
            x.iushrn(1);
            y.iushrn(1);
            ++g;
          }
          var yp = y.clone();
          var xp = x.clone();
          while (!x.isZero()) {
            for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              x.iushrn(i);
              while (i-- > 0) {
                if (A.isOdd() || B.isOdd()) {
                  A.iadd(yp);
                  B.isub(xp);
                }
                A.iushrn(1);
                B.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              y.iushrn(j);
              while (j-- > 0) {
                if (C.isOdd() || D.isOdd()) {
                  C.iadd(yp);
                  D.isub(xp);
                }
                C.iushrn(1);
                D.iushrn(1);
              }
            }
            if (x.cmp(y) >= 0) {
              x.isub(y);
              A.isub(C);
              B.isub(D);
            } else {
              y.isub(x);
              C.isub(A);
              D.isub(B);
            }
          }
          return {
            a: C,
            b: D,
            gcd: y.iushln(g)
          };
        };
        BN.prototype._invmp = function _invmp(p) {
          assert(p.negative === 0);
          assert(!p.isZero());
          var a = this;
          var b = p.clone();
          if (a.negative !== 0) {
            a = a.umod(p);
          } else {
            a = a.clone();
          }
          var x1 = new BN(1);
          var x2 = new BN(0);
          var delta = b.clone();
          while (a.cmpn(1) > 0 && b.cmpn(1) > 0) {
            for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1) ;
            if (i > 0) {
              a.iushrn(i);
              while (i-- > 0) {
                if (x1.isOdd()) {
                  x1.iadd(delta);
                }
                x1.iushrn(1);
              }
            }
            for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1) ;
            if (j > 0) {
              b.iushrn(j);
              while (j-- > 0) {
                if (x2.isOdd()) {
                  x2.iadd(delta);
                }
                x2.iushrn(1);
              }
            }
            if (a.cmp(b) >= 0) {
              a.isub(b);
              x1.isub(x2);
            } else {
              b.isub(a);
              x2.isub(x1);
            }
          }
          var res;
          if (a.cmpn(1) === 0) {
            res = x1;
          } else {
            res = x2;
          }
          if (res.cmpn(0) < 0) {
            res.iadd(p);
          }
          return res;
        };
        BN.prototype.gcd = function gcd(num) {
          if (this.isZero()) return num.abs();
          if (num.isZero()) return this.abs();
          var a = this.clone();
          var b = num.clone();
          a.negative = 0;
          b.negative = 0;
          for (var shift = 0; a.isEven() && b.isEven(); shift++) {
            a.iushrn(1);
            b.iushrn(1);
          }
          do {
            while (a.isEven()) {
              a.iushrn(1);
            }
            while (b.isEven()) {
              b.iushrn(1);
            }
            var r = a.cmp(b);
            if (r < 0) {
              var t = a;
              a = b;
              b = t;
            } else if (r === 0 || b.cmpn(1) === 0) {
              break;
            }
            a.isub(b);
          } while (true);
          return b.iushln(shift);
        };
        BN.prototype.invm = function invm(num) {
          return this.egcd(num).a.umod(num);
        };
        BN.prototype.isEven = function isEven() {
          return (this.words[0] & 1) === 0;
        };
        BN.prototype.isOdd = function isOdd() {
          return (this.words[0] & 1) === 1;
        };
        BN.prototype.andln = function andln(num) {
          return this.words[0] & num;
        };
        BN.prototype.bincn = function bincn(bit) {
          assert(typeof bit === "number");
          var r = bit % 26;
          var s = (bit - r) / 26;
          var q = 1 << r;
          if (this.length <= s) {
            this._expand(s + 1);
            this.words[s] |= q;
            return this;
          }
          var carry = q;
          for (var i = s; carry !== 0 && i < this.length; i++) {
            var w = this.words[i] | 0;
            w += carry;
            carry = w >>> 26;
            w &= 67108863;
            this.words[i] = w;
          }
          if (carry !== 0) {
            this.words[i] = carry;
            this.length++;
          }
          return this;
        };
        BN.prototype.isZero = function isZero() {
          return this.length === 1 && this.words[0] === 0;
        };
        BN.prototype.cmpn = function cmpn(num) {
          var negative = num < 0;
          if (this.negative !== 0 && !negative) return -1;
          if (this.negative === 0 && negative) return 1;
          this.strip();
          var res;
          if (this.length > 1) {
            res = 1;
          } else {
            if (negative) {
              num = -num;
            }
            assert(num <= 67108863, "Number is too big");
            var w = this.words[0] | 0;
            res = w === num ? 0 : w < num ? -1 : 1;
          }
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.cmp = function cmp(num) {
          if (this.negative !== 0 && num.negative === 0) return -1;
          if (this.negative === 0 && num.negative !== 0) return 1;
          var res = this.ucmp(num);
          if (this.negative !== 0) return -res | 0;
          return res;
        };
        BN.prototype.ucmp = function ucmp(num) {
          if (this.length > num.length) return 1;
          if (this.length < num.length) return -1;
          var res = 0;
          for (var i = this.length - 1; i >= 0; i--) {
            var a = this.words[i] | 0;
            var b = num.words[i] | 0;
            if (a === b) continue;
            if (a < b) {
              res = -1;
            } else if (a > b) {
              res = 1;
            }
            break;
          }
          return res;
        };
        BN.prototype.gtn = function gtn(num) {
          return this.cmpn(num) === 1;
        };
        BN.prototype.gt = function gt(num) {
          return this.cmp(num) === 1;
        };
        BN.prototype.gten = function gten(num) {
          return this.cmpn(num) >= 0;
        };
        BN.prototype.gte = function gte(num) {
          return this.cmp(num) >= 0;
        };
        BN.prototype.ltn = function ltn(num) {
          return this.cmpn(num) === -1;
        };
        BN.prototype.lt = function lt(num) {
          return this.cmp(num) === -1;
        };
        BN.prototype.lten = function lten(num) {
          return this.cmpn(num) <= 0;
        };
        BN.prototype.lte = function lte(num) {
          return this.cmp(num) <= 0;
        };
        BN.prototype.eqn = function eqn(num) {
          return this.cmpn(num) === 0;
        };
        BN.prototype.eq = function eq(num) {
          return this.cmp(num) === 0;
        };
        BN.red = function red(num) {
          return new Red(num);
        };
        BN.prototype.toRed = function toRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          assert(this.negative === 0, "red works only with positives");
          return ctx.convertTo(this)._forceRed(ctx);
        };
        BN.prototype.fromRed = function fromRed() {
          assert(this.red, "fromRed works only with numbers in reduction context");
          return this.red.convertFrom(this);
        };
        BN.prototype._forceRed = function _forceRed(ctx) {
          this.red = ctx;
          return this;
        };
        BN.prototype.forceRed = function forceRed(ctx) {
          assert(!this.red, "Already a number in reduction context");
          return this._forceRed(ctx);
        };
        BN.prototype.redAdd = function redAdd(num) {
          assert(this.red, "redAdd works only with red numbers");
          return this.red.add(this, num);
        };
        BN.prototype.redIAdd = function redIAdd(num) {
          assert(this.red, "redIAdd works only with red numbers");
          return this.red.iadd(this, num);
        };
        BN.prototype.redSub = function redSub(num) {
          assert(this.red, "redSub works only with red numbers");
          return this.red.sub(this, num);
        };
        BN.prototype.redISub = function redISub(num) {
          assert(this.red, "redISub works only with red numbers");
          return this.red.isub(this, num);
        };
        BN.prototype.redShl = function redShl(num) {
          assert(this.red, "redShl works only with red numbers");
          return this.red.shl(this, num);
        };
        BN.prototype.redMul = function redMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.mul(this, num);
        };
        BN.prototype.redIMul = function redIMul(num) {
          assert(this.red, "redMul works only with red numbers");
          this.red._verify2(this, num);
          return this.red.imul(this, num);
        };
        BN.prototype.redSqr = function redSqr() {
          assert(this.red, "redSqr works only with red numbers");
          this.red._verify1(this);
          return this.red.sqr(this);
        };
        BN.prototype.redISqr = function redISqr() {
          assert(this.red, "redISqr works only with red numbers");
          this.red._verify1(this);
          return this.red.isqr(this);
        };
        BN.prototype.redSqrt = function redSqrt() {
          assert(this.red, "redSqrt works only with red numbers");
          this.red._verify1(this);
          return this.red.sqrt(this);
        };
        BN.prototype.redInvm = function redInvm() {
          assert(this.red, "redInvm works only with red numbers");
          this.red._verify1(this);
          return this.red.invm(this);
        };
        BN.prototype.redNeg = function redNeg() {
          assert(this.red, "redNeg works only with red numbers");
          this.red._verify1(this);
          return this.red.neg(this);
        };
        BN.prototype.redPow = function redPow(num) {
          assert(this.red && !num.red, "redPow(normalNum)");
          this.red._verify1(this);
          return this.red.pow(this, num);
        };
        var primes = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };
        function MPrime(name, p) {
          this.name = name;
          this.p = new BN(p, 16);
          this.n = this.p.bitLength();
          this.k = new BN(1).iushln(this.n).isub(this.p);
          this.tmp = this._tmp();
        }
        MPrime.prototype._tmp = function _tmp() {
          var tmp = new BN(null);
          tmp.words = new Array(Math.ceil(this.n / 13));
          return tmp;
        };
        MPrime.prototype.ireduce = function ireduce(num) {
          var r = num;
          var rlen;
          do {
            this.split(r, this.tmp);
            r = this.imulK(r);
            r = r.iadd(this.tmp);
            rlen = r.bitLength();
          } while (rlen > this.n);
          var cmp = rlen < this.n ? -1 : r.ucmp(this.p);
          if (cmp === 0) {
            r.words[0] = 0;
            r.length = 1;
          } else if (cmp > 0) {
            r.isub(this.p);
          } else {
            if (r.strip !== undefined) {
              r.strip();
            } else {
              r._strip();
            }
          }
          return r;
        };
        MPrime.prototype.split = function split(input, out) {
          input.iushrn(this.n, 0, out);
        };
        MPrime.prototype.imulK = function imulK(num) {
          return num.imul(this.k);
        };
        function K256() {
          MPrime.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
        }
        inherits(K256, MPrime);
        K256.prototype.split = function split(input, output) {
          var mask = 4194303;
          var outLen = Math.min(input.length, 9);
          for (var i = 0; i < outLen; i++) {
            output.words[i] = input.words[i];
          }
          output.length = outLen;
          if (input.length <= 9) {
            input.words[0] = 0;
            input.length = 1;
            return;
          }
          var prev = input.words[9];
          output.words[output.length++] = prev & mask;
          for (i = 10; i < input.length; i++) {
            var next = input.words[i] | 0;
            input.words[i - 10] = (next & mask) << 4 | prev >>> 22;
            prev = next;
          }
          prev >>>= 22;
          input.words[i - 10] = prev;
          if (prev === 0 && input.length > 10) {
            input.length -= 10;
          } else {
            input.length -= 9;
          }
        };
        K256.prototype.imulK = function imulK(num) {
          num.words[num.length] = 0;
          num.words[num.length + 1] = 0;
          num.length += 2;
          var lo = 0;
          for (var i = 0; i < num.length; i++) {
            var w = num.words[i] | 0;
            lo += w * 977;
            num.words[i] = lo & 67108863;
            lo = w * 64 + (lo / 67108864 | 0);
          }
          if (num.words[num.length - 1] === 0) {
            num.length--;
            if (num.words[num.length - 1] === 0) {
              num.length--;
            }
          }
          return num;
        };
        function P224() {
          MPrime.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
        }
        inherits(P224, MPrime);
        function P192() {
          MPrime.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
        }
        inherits(P192, MPrime);
        function P25519() {
          MPrime.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
        }
        inherits(P25519, MPrime);
        P25519.prototype.imulK = function imulK(num) {
          var carry = 0;
          for (var i = 0; i < num.length; i++) {
            var hi = (num.words[i] | 0) * 19 + carry;
            var lo = hi & 67108863;
            hi >>>= 26;
            num.words[i] = lo;
            carry = hi;
          }
          if (carry !== 0) {
            num.words[num.length++] = carry;
          }
          return num;
        };
        BN._prime = function prime(name) {
          if (primes[name]) return primes[name];
          var prime;
          if (name === "k256") {
            prime = new K256;
          } else if (name === "p224") {
            prime = new P224;
          } else if (name === "p192") {
            prime = new P192;
          } else if (name === "p25519") {
            prime = new P25519;
          } else {
            throw new Error("Unknown prime " + name);
          }
          primes[name] = prime;
          return prime;
        };
        function Red(m) {
          if (typeof m === "string") {
            var prime = BN._prime(m);
            this.m = prime.p;
            this.prime = prime;
          } else {
            assert(m.gtn(1), "modulus must be greater than 1");
            this.m = m;
            this.prime = null;
          }
        }
        Red.prototype._verify1 = function _verify1(a) {
          assert(a.negative === 0, "red works only with positives");
          assert(a.red, "red works only with red numbers");
        };
        Red.prototype._verify2 = function _verify2(a, b) {
          assert((a.negative | b.negative) === 0, "red works only with positives");
          assert(a.red && a.red === b.red, "red works only with red numbers");
        };
        Red.prototype.imod = function imod(a) {
          if (this.prime) return this.prime.ireduce(a)._forceRed(this);
          return a.umod(this.m)._forceRed(this);
        };
        Red.prototype.neg = function neg(a) {
          if (a.isZero()) {
            return a.clone();
          }
          return this.m.sub(a)._forceRed(this);
        };
        Red.prototype.add = function add(a, b) {
          this._verify2(a, b);
          var res = a.add(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.iadd = function iadd(a, b) {
          this._verify2(a, b);
          var res = a.iadd(b);
          if (res.cmp(this.m) >= 0) {
            res.isub(this.m);
          }
          return res;
        };
        Red.prototype.sub = function sub(a, b) {
          this._verify2(a, b);
          var res = a.sub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Red.prototype.isub = function isub(a, b) {
          this._verify2(a, b);
          var res = a.isub(b);
          if (res.cmpn(0) < 0) {
            res.iadd(this.m);
          }
          return res;
        };
        Red.prototype.shl = function shl(a, num) {
          this._verify1(a);
          return this.imod(a.ushln(num));
        };
        Red.prototype.imul = function imul(a, b) {
          this._verify2(a, b);
          return this.imod(a.imul(b));
        };
        Red.prototype.mul = function mul(a, b) {
          this._verify2(a, b);
          return this.imod(a.mul(b));
        };
        Red.prototype.isqr = function isqr(a) {
          return this.imul(a, a.clone());
        };
        Red.prototype.sqr = function sqr(a) {
          return this.mul(a, a);
        };
        Red.prototype.sqrt = function sqrt(a) {
          if (a.isZero()) return a.clone();
          var mod3 = this.m.andln(3);
          assert(mod3 % 2 === 1);
          if (mod3 === 3) {
            var pow = this.m.add(new BN(1)).iushrn(2);
            return this.pow(a, pow);
          }
          var q = this.m.subn(1);
          var s = 0;
          while (!q.isZero() && q.andln(1) === 0) {
            s++;
            q.iushrn(1);
          }
          assert(!q.isZero());
          var one = new BN(1).toRed(this);
          var nOne = one.redNeg();
          var lpow = this.m.subn(1).iushrn(1);
          var z = this.m.bitLength();
          z = new BN(2 * z * z).toRed(this);
          while (this.pow(z, lpow).cmp(nOne) !== 0) {
            z.redIAdd(nOne);
          }
          var c = this.pow(z, q);
          var r = this.pow(a, q.addn(1).iushrn(1));
          var t = this.pow(a, q);
          var m = s;
          while (t.cmp(one) !== 0) {
            var tmp = t;
            for (var i = 0; tmp.cmp(one) !== 0; i++) {
              tmp = tmp.redSqr();
            }
            assert(i < m);
            var b = this.pow(c, new BN(1).iushln(m - i - 1));
            r = r.redMul(b);
            c = b.redSqr();
            t = t.redMul(c);
            m = i;
          }
          return r;
        };
        Red.prototype.invm = function invm(a) {
          var inv = a._invmp(this.m);
          if (inv.negative !== 0) {
            inv.negative = 0;
            return this.imod(inv).redNeg();
          } else {
            return this.imod(inv);
          }
        };
        Red.prototype.pow = function pow(a, num) {
          if (num.isZero()) return new BN(1).toRed(this);
          if (num.cmpn(1) === 0) return a.clone();
          var windowSize = 4;
          var wnd = new Array(1 << windowSize);
          wnd[0] = new BN(1).toRed(this);
          wnd[1] = a;
          for (var i = 2; i < wnd.length; i++) {
            wnd[i] = this.mul(wnd[i - 1], a);
          }
          var res = wnd[0];
          var current = 0;
          var currentLen = 0;
          var start = num.bitLength() % 26;
          if (start === 0) {
            start = 26;
          }
          for (i = num.length - 1; i >= 0; i--) {
            var word = num.words[i];
            for (var j = start - 1; j >= 0; j--) {
              var bit = word >> j & 1;
              if (res !== wnd[0]) {
                res = this.sqr(res);
              }
              if (bit === 0 && current === 0) {
                currentLen = 0;
                continue;
              }
              current <<= 1;
              current |= bit;
              currentLen++;
              if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue;
              res = this.mul(res, wnd[current]);
              currentLen = 0;
              current = 0;
            }
            start = 26;
          }
          return res;
        };
        Red.prototype.convertTo = function convertTo(num) {
          var r = num.umod(this.m);
          return r === num ? r.clone() : r;
        };
        Red.prototype.convertFrom = function convertFrom(num) {
          var res = num.clone();
          res.red = null;
          return res;
        };
        BN.mont = function mont(num) {
          return new Mont(num);
        };
        function Mont(m) {
          Red.call(this, m);
          this.shift = this.m.bitLength();
          if (this.shift % 26 !== 0) {
            this.shift += 26 - this.shift % 26;
          }
          this.r = new BN(1).iushln(this.shift);
          this.r2 = this.imod(this.r.sqr());
          this.rinv = this.r._invmp(this.m);
          this.minv = this.rinv.mul(this.r).isubn(1).div(this.m);
          this.minv = this.minv.umod(this.r);
          this.minv = this.r.sub(this.minv);
        }
        inherits(Mont, Red);
        Mont.prototype.convertTo = function convertTo(num) {
          return this.imod(num.ushln(this.shift));
        };
        Mont.prototype.convertFrom = function convertFrom(num) {
          var r = this.imod(num.mul(this.rinv));
          r.red = null;
          return r;
        };
        Mont.prototype.imul = function imul(a, b) {
          if (a.isZero() || b.isZero()) {
            a.words[0] = 0;
            a.length = 1;
            return a;
          }
          var t = a.imul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.mul = function mul(a, b) {
          if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this);
          var t = a.mul(b);
          var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);
          var u = t.isub(c).iushrn(this.shift);
          var res = u;
          if (u.cmp(this.m) >= 0) {
            res = u.isub(this.m);
          } else if (u.cmpn(0) < 0) {
            res = u.iadd(this.m);
          }
          return res._forceRed(this);
        };
        Mont.prototype.invm = function invm(a) {
          var res = this.imod(a._invmp(this.m).mul(this.r2));
          return res._forceRed(this);
        };
      })(false || module, this);
    },
    7362(module, __unused_webpack_exports, __webpack_require__) {
      var parseKeys = __webpack_require__(8170);
      var mgf = __webpack_require__(8206);
      var xor = __webpack_require__(2061);
      var BN = __webpack_require__(4890);
      var crt = __webpack_require__(7332);
      var createHash = __webpack_require__(7108);
      var withPublic = __webpack_require__(9247);
      var Buffer = __webpack_require__(2861).Buffer;
      module.exports = function privateDecrypt(privateKey, enc, reverse) {
        var padding;
        if (privateKey.padding) {
          padding = privateKey.padding;
        } else if (reverse) {
          padding = 1;
        } else {
          padding = 4;
        }
        var key = parseKeys(privateKey);
        var k = key.modulus.byteLength();
        if (enc.length > k || new BN(enc).cmp(key.modulus) >= 0) {
          throw new Error("decryption error");
        }
        var msg;
        if (reverse) {
          msg = withPublic(new BN(enc), key);
        } else {
          msg = crt(enc, key);
        }
        var zBuffer = Buffer.alloc(k - msg.length);
        msg = Buffer.concat([ zBuffer, msg ], k);
        if (padding === 4) {
          return oaep(key, msg);
        } else if (padding === 1) {
          return pkcs1(key, msg, reverse);
        } else if (padding === 3) {
          return msg;
        } else {
          throw new Error("unknown padding");
        }
      };
      function oaep(key, msg) {
        var k = key.modulus.byteLength();
        var iHash = createHash("sha1").update(Buffer.alloc(0)).digest();
        var hLen = iHash.length;
        if (msg[0] !== 0) {
          throw new Error("decryption error");
        }
        var maskedSeed = msg.slice(1, hLen + 1);
        var maskedDb = msg.slice(hLen + 1);
        var seed = xor(maskedSeed, mgf(maskedDb, hLen));
        var db = xor(maskedDb, mgf(seed, k - hLen - 1));
        if (compare(iHash, db.slice(0, hLen))) {
          throw new Error("decryption error");
        }
        var i = hLen;
        while (db[i] === 0) {
          i++;
        }
        if (db[i++] !== 1) {
          throw new Error("decryption error");
        }
        return db.slice(i);
      }
      function pkcs1(key, msg, reverse) {
        var p1 = msg.slice(0, 2);
        var i = 2;
        var status = 0;
        while (msg[i++] !== 0) {
          if (i >= msg.length) {
            status++;
            break;
          }
        }
        var ps = msg.slice(2, i - 1);
        if (p1.toString("hex") !== "0002" && !reverse || p1.toString("hex") !== "0001" && reverse) {
          status++;
        }
        if (ps.length < 8) {
          status++;
        }
        if (status) {
          throw new Error("decryption error");
        }
        return msg.slice(i);
      }
      function compare(a, b) {
        a = Buffer.from(a);
        b = Buffer.from(b);
        var dif = 0;
        var len = a.length;
        if (a.length !== b.length) {
          dif++;
          len = Math.min(a.length, b.length);
        }
        var i = -1;
        while (++i < len) {
          dif += a[i] ^ b[i];
        }
        return dif;
      }
    },
    8902(module, __unused_webpack_exports, __webpack_require__) {
      var parseKeys = __webpack_require__(8170);
      var randomBytes = __webpack_require__(3209);
      var createHash = __webpack_require__(7108);
      var mgf = __webpack_require__(8206);
      var xor = __webpack_require__(2061);
      var BN = __webpack_require__(4890);
      var withPublic = __webpack_require__(9247);
      var crt = __webpack_require__(7332);
      var Buffer = __webpack_require__(2861).Buffer;
      module.exports = function publicEncrypt(publicKey, msg, reverse) {
        var padding;
        if (publicKey.padding) {
          padding = publicKey.padding;
        } else if (reverse) {
          padding = 1;
        } else {
          padding = 4;
        }
        var key = parseKeys(publicKey);
        var paddedMsg;
        if (padding === 4) {
          paddedMsg = oaep(key, msg);
        } else if (padding === 1) {
          paddedMsg = pkcs1(key, msg, reverse);
        } else if (padding === 3) {
          paddedMsg = new BN(msg);
          if (paddedMsg.cmp(key.modulus) >= 0) {
            throw new Error("data too long for modulus");
          }
        } else {
          throw new Error("unknown padding");
        }
        if (reverse) {
          return crt(paddedMsg, key);
        } else {
          return withPublic(paddedMsg, key);
        }
      };
      function oaep(key, msg) {
        var k = key.modulus.byteLength();
        var mLen = msg.length;
        var iHash = createHash("sha1").update(Buffer.alloc(0)).digest();
        var hLen = iHash.length;
        var hLen2 = 2 * hLen;
        if (mLen > k - hLen2 - 2) {
          throw new Error("message too long");
        }
        var ps = Buffer.alloc(k - mLen - hLen2 - 2);
        var dblen = k - hLen - 1;
        var seed = randomBytes(hLen);
        var maskedDb = xor(Buffer.concat([ iHash, ps, Buffer.alloc(1, 1), msg ], dblen), mgf(seed, dblen));
        var maskedSeed = xor(seed, mgf(maskedDb, hLen));
        return new BN(Buffer.concat([ Buffer.alloc(1), maskedSeed, maskedDb ], k));
      }
      function pkcs1(key, msg, reverse) {
        var mLen = msg.length;
        var k = key.modulus.byteLength();
        if (mLen > k - 11) {
          throw new Error("message too long");
        }
        var ps;
        if (reverse) {
          ps = Buffer.alloc(k - mLen - 3, 255);
        } else {
          ps = nonZero(k - mLen - 3);
        }
        return new BN(Buffer.concat([ Buffer.from([ 0, reverse ? 1 : 2 ]), ps, Buffer.alloc(1), msg ], k));
      }
      function nonZero(len) {
        var out = Buffer.allocUnsafe(len);
        var i = 0;
        var cache = randomBytes(len * 2);
        var cur = 0;
        var num;
        while (i < len) {
          if (cur === cache.length) {
            cache = randomBytes(len * 2);
            cur = 0;
          }
          num = cache[cur++];
          if (num) {
            out[i++] = num;
          }
        }
        return out;
      }
    },
    9247(module, __unused_webpack_exports, __webpack_require__) {
      var BN = __webpack_require__(4890);
      var Buffer = __webpack_require__(2861).Buffer;
      function withPublic(paddedMsg, key) {
        return Buffer.from(paddedMsg.toRed(BN.mont(key.modulus)).redPow(new BN(key.publicExponent)).fromRed().toArray());
      }
      module.exports = withPublic;
    },
    2061(module) {
      module.exports = function xor(a, b) {
        var len = a.length;
        var i = -1;
        while (++i < len) {
          a[i] ^= b[i];
        }
        return a;
      };
    },
    3209(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var MAX_BYTES = 65536;
      var MAX_UINT32 = 4294967295;
      function oldBrowser() {
        throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11");
      }
      var Buffer = __webpack_require__(2861).Buffer;
      var crypto = __webpack_require__.g.crypto || __webpack_require__.g.msCrypto;
      if (crypto && crypto.getRandomValues) {
        module.exports = randomBytes;
      } else {
        module.exports = oldBrowser;
      }
      function randomBytes(size, cb) {
        if (size > MAX_UINT32) throw new RangeError("requested too many random bytes");
        var bytes = Buffer.allocUnsafe(size);
        if (size > 0) {
          if (size > MAX_BYTES) {
            for (var generated = 0; generated < size; generated += MAX_BYTES) {
              crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES));
            }
          } else {
            crypto.getRandomValues(bytes);
          }
        }
        if (typeof cb === "function") {
          return process.nextTick((function() {
            cb(null, bytes);
          }));
        }
        return bytes;
      }
    },
    6983(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      function oldBrowser() {
        throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11");
      }
      var safeBuffer = __webpack_require__(2861);
      var randombytes = __webpack_require__(3209);
      var Buffer = safeBuffer.Buffer;
      var kBufferMaxLength = safeBuffer.kMaxLength;
      var crypto = __webpack_require__.g.crypto || __webpack_require__.g.msCrypto;
      var kMaxUint32 = Math.pow(2, 32) - 1;
      function assertOffset(offset, length) {
        if (typeof offset !== "number" || offset !== offset) {
          throw new TypeError("offset must be a number");
        }
        if (offset > kMaxUint32 || offset < 0) {
          throw new TypeError("offset must be a uint32");
        }
        if (offset > kBufferMaxLength || offset > length) {
          throw new RangeError("offset out of range");
        }
      }
      function assertSize(size, offset, length) {
        if (typeof size !== "number" || size !== size) {
          throw new TypeError("size must be a number");
        }
        if (size > kMaxUint32 || size < 0) {
          throw new TypeError("size must be a uint32");
        }
        if (size + offset > length || size > kBufferMaxLength) {
          throw new RangeError("buffer too small");
        }
      }
      if (crypto && crypto.getRandomValues || !process.browser) {
        exports.randomFill = randomFill;
        exports.randomFillSync = randomFillSync;
      } else {
        exports.randomFill = oldBrowser;
        exports.randomFillSync = oldBrowser;
      }
      function randomFill(buf, offset, size, cb) {
        if (!Buffer.isBuffer(buf) && !(buf instanceof __webpack_require__.g.Uint8Array)) {
          throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
        }
        if (typeof offset === "function") {
          cb = offset;
          offset = 0;
          size = buf.length;
        } else if (typeof size === "function") {
          cb = size;
          size = buf.length - offset;
        } else if (typeof cb !== "function") {
          throw new TypeError('"cb" argument must be a function');
        }
        assertOffset(offset, buf.length);
        assertSize(size, offset, buf.length);
        return actualFill(buf, offset, size, cb);
      }
      function actualFill(buf, offset, size, cb) {
        if (process.browser) {
          var ourBuf = buf.buffer;
          var uint = new Uint8Array(ourBuf, offset, size);
          crypto.getRandomValues(uint);
          if (cb) {
            process.nextTick((function() {
              cb(null, buf);
            }));
            return;
          }
          return buf;
        }
        if (cb) {
          randombytes(size, (function(err, bytes) {
            if (err) {
              return cb(err);
            }
            bytes.copy(buf, offset);
            cb(null, buf);
          }));
          return;
        }
        var bytes = randombytes(size);
        bytes.copy(buf, offset);
        return buf;
      }
      function randomFillSync(buf, offset, size) {
        if (typeof offset === "undefined") {
          offset = 0;
        }
        if (!Buffer.isBuffer(buf) && !(buf instanceof __webpack_require__.g.Uint8Array)) {
          throw new TypeError('"buf" argument must be a Buffer or Uint8Array');
        }
        assertOffset(offset, buf.length);
        if (size === undefined) size = buf.length - offset;
        assertSize(size, offset, buf.length);
        return actualFill(buf, offset, size);
      }
    },
    6048(module) {
      "use strict";
      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 = function(_Base) {
          _inheritsLoose(NodeError, _Base);
          function NodeError(arg1, arg2, arg3) {
            return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
          }
          return NodeError;
        }(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(!pos || pos < 0 ? 0 : +pos, search.length) === search;
      }
      function endsWith(str, search, this_len) {
        if (this_len === undefined || 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 type = includes(name, ".") ? "property" : "argument";
          msg = 'The "'.concat(name, '" ').concat(type, " ").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");
      module.exports.F = codes;
    },
    5382(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var objectKeys = Object.keys || function(obj) {
        var keys = [];
        for (var key in obj) keys.push(key);
        return keys;
      };
      module.exports = Duplex;
      var Readable = __webpack_require__(5412);
      var Writable = __webpack_require__(6708);
      __webpack_require__(6698)(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", {
        enumerable: false,
        get: function get() {
          return this._writableState.highWaterMark;
        }
      });
      Object.defineProperty(Duplex.prototype, "writableBuffer", {
        enumerable: false,
        get: function get() {
          return this._writableState && this._writableState.getBuffer();
        }
      });
      Object.defineProperty(Duplex.prototype, "writableLength", {
        enumerable: false,
        get: function get() {
          return this._writableState.length;
        }
      });
      function onend() {
        if (this._writableState.ended) return;
        process.nextTick(onEndNT, this);
      }
      function onEndNT(self) {
        self.end();
      }
      Object.defineProperty(Duplex.prototype, "destroyed", {
        enumerable: false,
        get: function get() {
          if (this._readableState === undefined || this._writableState === undefined) {
            return false;
          }
          return this._readableState.destroyed && this._writableState.destroyed;
        },
        set: function set(value) {
          if (this._readableState === undefined || this._writableState === undefined) {
            return;
          }
          this._readableState.destroyed = value;
          this._writableState.destroyed = value;
        }
      });
    },
    3600(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = PassThrough;
      var Transform = __webpack_require__(4610);
      __webpack_require__(6698)(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);
      };
    },
    5412(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      module.exports = Readable;
      var Duplex;
      Readable.ReadableState = ReadableState;
      var EE = __webpack_require__(7007).EventEmitter;
      var EElistenerCount = function EElistenerCount(emitter, type) {
        return emitter.listeners(type).length;
      };
      var Stream = __webpack_require__(345);
      var Buffer = __webpack_require__(8287).Buffer;
      var OurUint8Array = (typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
      function _uint8ArrayToBuffer(chunk) {
        return Buffer.from(chunk);
      }
      function _isUint8Array(obj) {
        return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
      }
      var debugUtil = __webpack_require__(9838);
      var debug;
      if (debugUtil && debugUtil.debuglog) {
        debug = debugUtil.debuglog("stream");
      } else {
        debug = function debug() {};
      }
      var BufferList = __webpack_require__(2726);
      var destroyImpl = __webpack_require__(5896);
      var _require = __webpack_require__(5291), getHighWaterMark = _require.getHighWaterMark;
      var _require$codes = __webpack_require__(6048).F, 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;
      __webpack_require__(6698)(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 || __webpack_require__(5382);
        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 = __webpack_require__(3141).I;
          this.decoder = new StringDecoder(options.encoding);
          this.encoding = options.encoding;
        }
      }
      function Readable(options) {
        Duplex = Duplex || __webpack_require__(5382);
        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", {
        enumerable: false,
        get: function get() {
          if (this._readableState === undefined) {
            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 state = this._readableState;
        var skipChunkCheck;
        if (!state.objectMode) {
          if (typeof chunk === "string") {
            encoding = encoding || state.defaultEncoding;
            if (encoding !== state.encoding) {
              chunk = Buffer.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 state = stream._readableState;
        if (chunk === null) {
          state.reading = false;
          onEofChunk(stream, state);
        } else {
          var er;
          if (!skipChunkCheck) er = chunkInvalid(state, chunk);
          if (er) {
            errorOrDestroy(stream, er);
          } else if (state.objectMode || chunk && chunk.length > 0) {
            if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
              chunk = _uint8ArrayToBuffer(chunk);
            }
            if (addToFront) {
              if (state.endEmitted) errorOrDestroy(stream, new ERR_STREAM_UNSHIFT_AFTER_END_EVENT); else addChunk(stream, state, chunk, true);
            } else if (state.ended) {
              errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF);
            } else if (state.destroyed) {
              return false;
            } else {
              state.reading = false;
              if (state.decoder && !encoding) {
                chunk = state.decoder.write(chunk);
                if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); else maybeReadMore(stream, state);
              } else {
                addChunk(stream, state, chunk, false);
              }
            }
          } else if (!addToFront) {
            state.reading = false;
            maybeReadMore(stream, state);
          }
        }
        return !state.ended && (state.length < state.highWaterMark || state.length === 0);
      }
      function addChunk(stream, state, chunk, addToFront) {
        if (state.flowing && state.length === 0 && !state.sync) {
          state.awaitDrain = 0;
          stream.emit("data", chunk);
        } else {
          state.length += state.objectMode ? 1 : chunk.length;
          if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk);
          if (state.needReadable) emitReadable(stream);
        }
        maybeReadMore(stream, state);
      }
      function chunkInvalid(state, chunk) {
        var er;
        if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== undefined && !state.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 = __webpack_require__(3141).I;
        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, state) {
        if (n <= 0 || state.length === 0 && state.ended) return 0;
        if (state.objectMode) return 1;
        if (n !== n) {
          if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length;
        }
        if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
        if (n <= state.length) return n;
        if (!state.ended) {
          state.needReadable = true;
          return 0;
        }
        return state.length;
      }
      Readable.prototype.read = function(n) {
        debug("read", n);
        n = parseInt(n, 10);
        var state = this._readableState;
        var nOrig = n;
        if (n !== 0) state.emittedReadable = false;
        if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
          debug("read: emitReadable", state.length, state.ended);
          if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this);
          return null;
        }
        n = howMuchToRead(n, state);
        if (n === 0 && state.ended) {
          if (state.length === 0) endReadable(this);
          return null;
        }
        var doRead = state.needReadable;
        debug("need readable", doRead);
        if (state.length === 0 || state.length - n < state.highWaterMark) {
          doRead = true;
          debug("length less than watermark", doRead);
        }
        if (state.ended || state.reading) {
          doRead = false;
          debug("reading or ended", doRead);
        } else if (doRead) {
          debug("do read");
          state.reading = true;
          state.sync = true;
          if (state.length === 0) state.needReadable = true;
          this._read(state.highWaterMark);
          state.sync = false;
          if (!state.reading) n = howMuchToRead(nOrig, state);
        }
        var ret;
        if (n > 0) ret = fromList(n, state); else ret = null;
        if (ret === null) {
          state.needReadable = state.length <= state.highWaterMark;
          n = 0;
        } else {
          state.length -= n;
          state.awaitDrain = 0;
        }
        if (state.length === 0) {
          if (!state.ended) state.needReadable = true;
          if (nOrig !== n && state.ended) endReadable(this);
        }
        if (ret !== null) this.emit("data", ret);
        return ret;
      };
      function onEofChunk(stream, state) {
        debug("onEofChunk");
        if (state.ended) return;
        if (state.decoder) {
          var chunk = state.decoder.end();
          if (chunk && chunk.length) {
            state.buffer.push(chunk);
            state.length += state.objectMode ? 1 : chunk.length;
          }
        }
        state.ended = true;
        if (state.sync) {
          emitReadable(stream);
        } else {
          state.needReadable = false;
          if (!state.emittedReadable) {
            state.emittedReadable = true;
            emitReadable_(stream);
          }
        }
      }
      function emitReadable(stream) {
        var state = stream._readableState;
        debug("emitReadable", state.needReadable, state.emittedReadable);
        state.needReadable = false;
        if (!state.emittedReadable) {
          debug("emitReadable", state.flowing);
          state.emittedReadable = true;
          process.nextTick(emitReadable_, stream);
        }
      }
      function emitReadable_(stream) {
        var state = stream._readableState;
        debug("emitReadable_", state.destroyed, state.length, state.ended);
        if (!state.destroyed && (state.length || state.ended)) {
          stream.emit("readable");
          state.emittedReadable = false;
        }
        state.needReadable = !state.flowing && !state.ended && state.length <= state.highWaterMark;
        flow(stream);
      }
      function maybeReadMore(stream, state) {
        if (!state.readingMore) {
          state.readingMore = true;
          process.nextTick(maybeReadMore_, stream, state);
        }
      }
      function maybeReadMore_(stream, state) {
        while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
          var len = state.length;
          debug("maybeReadMore read 0");
          stream.read(0);
          if (len === state.length) break;
        }
        state.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 state = this._readableState;
        switch (state.pipesCount) {
         case 0:
          state.pipes = dest;
          break;

         case 1:
          state.pipes = [ state.pipes, dest ];
          break;

         default:
          state.pipes.push(dest);
          break;
        }
        state.pipesCount += 1;
        debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
        var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
        var endFn = doEnd ? onend : unpipe;
        if (state.endEmitted) process.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 (state.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 ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
              debug("false write response, pause", state.awaitDrain);
              state.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 (!state.flowing) {
          debug("pipe resume");
          src.resume();
        }
        return dest;
      };
      function pipeOnDrain(src) {
        return function pipeOnDrainFunctionResult() {
          var state = src._readableState;
          debug("pipeOnDrain", state.awaitDrain);
          if (state.awaitDrain) state.awaitDrain--;
          if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
            state.flowing = true;
            flow(src);
          }
        };
      }
      Readable.prototype.unpipe = function(dest) {
        var state = this._readableState;
        var unpipeInfo = {
          hasUnpiped: false
        };
        if (state.pipesCount === 0) return this;
        if (state.pipesCount === 1) {
          if (dest && dest !== state.pipes) return this;
          if (!dest) dest = state.pipes;
          state.pipes = null;
          state.pipesCount = 0;
          state.flowing = false;
          if (dest) dest.emit("unpipe", this, unpipeInfo);
          return this;
        }
        if (!dest) {
          var dests = state.pipes;
          var len = state.pipesCount;
          state.pipes = null;
          state.pipesCount = 0;
          state.flowing = false;
          for (var i = 0; i < len; i++) dests[i].emit("unpipe", this, {
            hasUnpiped: false
          });
          return this;
        }
        var index = indexOf(state.pipes, dest);
        if (index === -1) return this;
        state.pipes.splice(index, 1);
        state.pipesCount -= 1;
        if (state.pipesCount === 1) state.pipes = state.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 state = this._readableState;
        if (ev === "data") {
          state.readableListening = this.listenerCount("readable") > 0;
          if (state.flowing !== false) this.resume();
        } else if (ev === "readable") {
          if (!state.endEmitted && !state.readableListening) {
            state.readableListening = state.needReadable = true;
            state.flowing = false;
            state.emittedReadable = false;
            debug("on readable", state.length, state.reading);
            if (state.length) {
              emitReadable(this);
            } else if (!state.reading) {
              process.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.nextTick(updateReadableListening, this);
        }
        return res;
      };
      Readable.prototype.removeAllListeners = function(ev) {
        var res = Stream.prototype.removeAllListeners.apply(this, arguments);
        if (ev === "readable" || ev === undefined) {
          process.nextTick(updateReadableListening, this);
        }
        return res;
      };
      function updateReadableListening(self) {
        var state = self._readableState;
        state.readableListening = self.listenerCount("readable") > 0;
        if (state.resumeScheduled && !state.paused) {
          state.flowing = true;
        } else if (self.listenerCount("data") > 0) {
          self.resume();
        }
      }
      function nReadingNextTick(self) {
        debug("readable nexttick read 0");
        self.read(0);
      }
      Readable.prototype.resume = function() {
        var state = this._readableState;
        if (!state.flowing) {
          debug("resume");
          state.flowing = !state.readableListening;
          resume(this, state);
        }
        state.paused = false;
        return this;
      };
      function resume(stream, state) {
        if (!state.resumeScheduled) {
          state.resumeScheduled = true;
          process.nextTick(resume_, stream, state);
        }
      }
      function resume_(stream, state) {
        debug("resume", state.reading);
        if (!state.reading) {
          stream.read(0);
        }
        state.resumeScheduled = false;
        stream.emit("resume");
        flow(stream);
        if (state.flowing && !state.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 state = stream._readableState;
        debug("flow", state.flowing);
        while (state.flowing && stream.read() !== null) ;
      }
      Readable.prototype.wrap = function(stream) {
        var _this = this;
        var state = this._readableState;
        var paused = false;
        stream.on("end", (function() {
          debug("wrapped end");
          if (state.decoder && !state.ended) {
            var chunk = state.decoder.end();
            if (chunk && chunk.length) _this.push(chunk);
          }
          _this.push(null);
        }));
        stream.on("data", (function(chunk) {
          debug("wrapped data");
          if (state.decoder) chunk = state.decoder.write(chunk);
          if (state.objectMode && (chunk === null || chunk === undefined)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return;
          var ret = _this.push(chunk);
          if (!ret) {
            paused = true;
            stream.pause();
          }
        }));
        for (var i in stream) {
          if (this[i] === undefined && typeof stream[i] === "function") {
            this[i] = 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(n) {
          debug("wrapped _read", n);
          if (paused) {
            paused = false;
            stream.resume();
          }
        };
        return this;
      };
      if (typeof Symbol === "function") {
        Readable.prototype[Symbol.asyncIterator] = function() {
          if (createReadableStreamAsyncIterator === undefined) {
            createReadableStreamAsyncIterator = __webpack_require__(2955);
          }
          return createReadableStreamAsyncIterator(this);
        };
      }
      Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
        enumerable: false,
        get: function get() {
          return this._readableState.highWaterMark;
        }
      });
      Object.defineProperty(Readable.prototype, "readableBuffer", {
        enumerable: false,
        get: function get() {
          return this._readableState && this._readableState.buffer;
        }
      });
      Object.defineProperty(Readable.prototype, "readableFlowing", {
        enumerable: false,
        get: function get() {
          return this._readableState.flowing;
        },
        set: function set(state) {
          if (this._readableState) {
            this._readableState.flowing = state;
          }
        }
      });
      Readable._fromList = fromList;
      Object.defineProperty(Readable.prototype, "readableLength", {
        enumerable: false,
        get: function get() {
          return this._readableState.length;
        }
      });
      function fromList(n, state) {
        if (state.length === 0) return null;
        var ret;
        if (state.objectMode) ret = state.buffer.shift(); else if (!n || n >= state.length) {
          if (state.decoder) ret = state.buffer.join(""); else if (state.buffer.length === 1) ret = state.buffer.first(); else ret = state.buffer.concat(state.length);
          state.buffer.clear();
        } else {
          ret = state.buffer.consume(n, state.decoder);
        }
        return ret;
      }
      function endReadable(stream) {
        var state = stream._readableState;
        debug("endReadable", state.endEmitted);
        if (!state.endEmitted) {
          state.ended = true;
          process.nextTick(endReadableNT, state, stream);
        }
      }
      function endReadableNT(state, stream) {
        debug("endReadableNT", state.endEmitted, state.length);
        if (!state.endEmitted && state.length === 0) {
          state.endEmitted = true;
          stream.readable = false;
          stream.emit("end");
          if (state.autoDestroy) {
            var wState = stream._writableState;
            if (!wState || wState.autoDestroy && wState.finished) {
              stream.destroy();
            }
          }
        }
      }
      if (typeof Symbol === "function") {
        Readable.from = function(iterable, opts) {
          if (from === undefined) {
            from = __webpack_require__(5157);
          }
          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;
      }
    },
    4610(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = Transform;
      var _require$codes = __webpack_require__(6048).F, 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 = __webpack_require__(5382);
      __webpack_require__(6698)(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);
      }
    },
    6708(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      module.exports = Writable;
      function WriteReq(chunk, encoding, cb) {
        this.chunk = chunk;
        this.encoding = encoding;
        this.callback = cb;
        this.next = null;
      }
      function CorkedRequest(state) {
        var _this = this;
        this.next = null;
        this.entry = null;
        this.finish = function() {
          onCorkedFinish(_this, state);
        };
      }
      var Duplex;
      Writable.WritableState = WritableState;
      var internalUtil = {
        deprecate: __webpack_require__(4643)
      };
      var Stream = __webpack_require__(345);
      var Buffer = __webpack_require__(8287).Buffer;
      var OurUint8Array = (typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
      function _uint8ArrayToBuffer(chunk) {
        return Buffer.from(chunk);
      }
      function _isUint8Array(obj) {
        return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
      }
      var destroyImpl = __webpack_require__(5896);
      var _require = __webpack_require__(5291), getHighWaterMark = _require.getHighWaterMark;
      var _require$codes = __webpack_require__(6048).F, 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;
      __webpack_require__(6698)(Writable, Stream);
      function nop() {}
      function WritableState(options, stream, isDuplex) {
        Duplex = Duplex || __webpack_require__(5382);
        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 realHasInstance(object) {
          return object instanceof this;
        };
      }
      function Writable(options) {
        Duplex = Duplex || __webpack_require__(5382);
        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.nextTick(cb, er);
      }
      function validChunk(stream, state, chunk, cb) {
        var er;
        if (chunk === null) {
          er = new ERR_STREAM_NULL_VALUES;
        } else if (typeof chunk !== "string" && !state.objectMode) {
          er = new ERR_INVALID_ARG_TYPE("chunk", [ "string", "Buffer" ], chunk);
        }
        if (er) {
          errorOrDestroy(stream, er);
          process.nextTick(cb, er);
          return false;
        }
        return true;
      }
      Writable.prototype.write = function(chunk, encoding, cb) {
        var state = this._writableState;
        var ret = false;
        var isBuf = !state.objectMode && _isUint8Array(chunk);
        if (isBuf && !Buffer.isBuffer(chunk)) {
          chunk = _uint8ArrayToBuffer(chunk);
        }
        if (typeof encoding === "function") {
          cb = encoding;
          encoding = null;
        }
        if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state.defaultEncoding;
        if (typeof cb !== "function") cb = nop;
        if (state.ending) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state, chunk, cb)) {
          state.pendingcb++;
          ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
        }
        return ret;
      };
      Writable.prototype.cork = function() {
        this._writableState.corked++;
      };
      Writable.prototype.uncork = function() {
        var state = this._writableState;
        if (state.corked) {
          state.corked--;
          if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
        }
      };
      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", {
        enumerable: false,
        get: function get() {
          return this._writableState && this._writableState.getBuffer();
        }
      });
      function decodeChunk(state, chunk, encoding) {
        if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
          chunk = Buffer.from(chunk, encoding);
        }
        return chunk;
      }
      Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
        enumerable: false,
        get: function get() {
          return this._writableState.highWaterMark;
        }
      });
      function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
        if (!isBuf) {
          var newChunk = decodeChunk(state, chunk, encoding);
          if (chunk !== newChunk) {
            isBuf = true;
            encoding = "buffer";
            chunk = newChunk;
          }
        }
        var len = state.objectMode ? 1 : chunk.length;
        state.length += len;
        var ret = state.length < state.highWaterMark;
        if (!ret) state.needDrain = true;
        if (state.writing || state.corked) {
          var last = state.lastBufferedRequest;
          state.lastBufferedRequest = {
            chunk,
            encoding,
            isBuf,
            callback: cb,
            next: null
          };
          if (last) {
            last.next = state.lastBufferedRequest;
          } else {
            state.bufferedRequest = state.lastBufferedRequest;
          }
          state.bufferedRequestCount += 1;
        } else {
          doWrite(stream, state, false, len, chunk, encoding, cb);
        }
        return ret;
      }
      function doWrite(stream, state, writev, len, chunk, encoding, cb) {
        state.writelen = len;
        state.writecb = cb;
        state.writing = true;
        state.sync = true;
        if (state.destroyed) state.onwrite(new ERR_STREAM_DESTROYED("write")); else if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite);
        state.sync = false;
      }
      function onwriteError(stream, state, sync, er, cb) {
        --state.pendingcb;
        if (sync) {
          process.nextTick(cb, er);
          process.nextTick(finishMaybe, stream, state);
          stream._writableState.errorEmitted = true;
          errorOrDestroy(stream, er);
        } else {
          cb(er);
          stream._writableState.errorEmitted = true;
          errorOrDestroy(stream, er);
          finishMaybe(stream, state);
        }
      }
      function onwriteStateUpdate(state) {
        state.writing = false;
        state.writecb = null;
        state.length -= state.writelen;
        state.writelen = 0;
      }
      function onwrite(stream, er) {
        var state = stream._writableState;
        var sync = state.sync;
        var cb = state.writecb;
        if (typeof cb !== "function") throw new ERR_MULTIPLE_CALLBACK;
        onwriteStateUpdate(state);
        if (er) onwriteError(stream, state, sync, er, cb); else {
          var finished = needFinish(state) || stream.destroyed;
          if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
            clearBuffer(stream, state);
          }
          if (sync) {
            process.nextTick(afterWrite, stream, state, finished, cb);
          } else {
            afterWrite(stream, state, finished, cb);
          }
        }
      }
      function afterWrite(stream, state, finished, cb) {
        if (!finished) onwriteDrain(stream, state);
        state.pendingcb--;
        cb();
        finishMaybe(stream, state);
      }
      function onwriteDrain(stream, state) {
        if (state.length === 0 && state.needDrain) {
          state.needDrain = false;
          stream.emit("drain");
        }
      }
      function clearBuffer(stream, state) {
        state.bufferProcessing = true;
        var entry = state.bufferedRequest;
        if (stream._writev && entry && entry.next) {
          var l = state.bufferedRequestCount;
          var buffer = new Array(l);
          var holder = state.corkedRequestsFree;
          holder.entry = entry;
          var count = 0;
          var allBuffers = true;
          while (entry) {
            buffer[count] = entry;
            if (!entry.isBuf) allBuffers = false;
            entry = entry.next;
            count += 1;
          }
          buffer.allBuffers = allBuffers;
          doWrite(stream, state, true, state.length, buffer, "", holder.finish);
          state.pendingcb++;
          state.lastBufferedRequest = null;
          if (holder.next) {
            state.corkedRequestsFree = holder.next;
            holder.next = null;
          } else {
            state.corkedRequestsFree = new CorkedRequest(state);
          }
          state.bufferedRequestCount = 0;
        } else {
          while (entry) {
            var chunk = entry.chunk;
            var encoding = entry.encoding;
            var cb = entry.callback;
            var len = state.objectMode ? 1 : chunk.length;
            doWrite(stream, state, false, len, chunk, encoding, cb);
            entry = entry.next;
            state.bufferedRequestCount--;
            if (state.writing) {
              break;
            }
          }
          if (entry === null) state.lastBufferedRequest = null;
        }
        state.bufferedRequest = entry;
        state.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 state = 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 !== undefined) this.write(chunk, encoding);
        if (state.corked) {
          state.corked = 1;
          this.uncork();
        }
        if (!state.ending) endWritable(this, state, cb);
        return this;
      };
      Object.defineProperty(Writable.prototype, "writableLength", {
        enumerable: false,
        get: function get() {
          return this._writableState.length;
        }
      });
      function needFinish(state) {
        return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
      }
      function callFinal(stream, state) {
        stream._final((function(err) {
          state.pendingcb--;
          if (err) {
            errorOrDestroy(stream, err);
          }
          state.prefinished = true;
          stream.emit("prefinish");
          finishMaybe(stream, state);
        }));
      }
      function prefinish(stream, state) {
        if (!state.prefinished && !state.finalCalled) {
          if (typeof stream._final === "function" && !state.destroyed) {
            state.pendingcb++;
            state.finalCalled = true;
            process.nextTick(callFinal, stream, state);
          } else {
            state.prefinished = true;
            stream.emit("prefinish");
          }
        }
      }
      function finishMaybe(stream, state) {
        var need = needFinish(state);
        if (need) {
          prefinish(stream, state);
          if (state.pendingcb === 0) {
            state.finished = true;
            stream.emit("finish");
            if (state.autoDestroy) {
              var rState = stream._readableState;
              if (!rState || rState.autoDestroy && rState.endEmitted) {
                stream.destroy();
              }
            }
          }
        }
        return need;
      }
      function endWritable(stream, state, cb) {
        state.ending = true;
        finishMaybe(stream, state);
        if (cb) {
          if (state.finished) process.nextTick(cb); else stream.once("finish", cb);
        }
        state.ended = true;
        stream.writable = false;
      }
      function onCorkedFinish(corkReq, state, err) {
        var entry = corkReq.entry;
        corkReq.entry = null;
        while (entry) {
          var cb = entry.callback;
          state.pendingcb--;
          cb(err);
          entry = entry.next;
        }
        state.corkedRequestsFree.next = corkReq;
      }
      Object.defineProperty(Writable.prototype, "destroyed", {
        enumerable: false,
        get: function get() {
          if (this._writableState === undefined) {
            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);
      };
    },
    2955(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var _Object$setPrototypeO;
      function _defineProperty(obj, key, value) {
        key = _toPropertyKey(key);
        if (key in obj) {
          Object.defineProperty(obj, key, {
            value,
            enumerable: true,
            configurable: true,
            writable: true
          });
        } else {
          obj[key] = value;
        }
        return obj;
      }
      function _toPropertyKey(arg) {
        var key = _toPrimitive(arg, "string");
        return typeof key === "symbol" ? key : String(key);
      }
      function _toPrimitive(input, hint) {
        if (typeof input !== "object" || input === null) return input;
        var prim = input[Symbol.toPrimitive];
        if (prim !== undefined) {
          var res = prim.call(input, hint || "default");
          if (typeof res !== "object") return res;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return (hint === "string" ? String : Number)(input);
      }
      var finished = __webpack_require__(6238);
      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.nextTick(readAndResolve, iter);
      }
      function wrapForNext(lastPromise, iter) {
        return function(resolve, reject) {
          lastPromise.then((function() {
            if (iter[kEnded]) {
              resolve(createIterResult(undefined, 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(undefined, true));
          }
          if (this[kStream].destroyed) {
            return new Promise((function(resolve, reject) {
              process.nextTick((function() {
                if (_this[kError]) {
                  reject(_this[kError]);
                } else {
                  resolve(createIterResult(undefined, 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(undefined, true));
          }));
        }));
      })), _Object$setPrototypeO), AsyncIteratorPrototype);
      var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterator(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(undefined, true));
          }
          iterator[kEnded] = true;
        }));
        stream.on("readable", onReadable.bind(null, iterator));
        return iterator;
      };
      module.exports = createReadableStreamAsyncIterator;
    },
    2726(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      function ownKeys(object, enumerableOnly) {
        var keys = Object.keys(object);
        if (Object.getOwnPropertySymbols) {
          var symbols = Object.getOwnPropertySymbols(object);
          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 = null != arguments[i] ? arguments[i] : {};
          i % 2 ? ownKeys(Object(source), !0).forEach((function(key) {
            _defineProperty(target, key, source[key]);
          })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach((function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
          }));
        }
        return target;
      }
      function _defineProperty(obj, key, value) {
        key = _toPropertyKey(key);
        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, _toPropertyKey(descriptor.key), descriptor);
        }
      }
      function _createClass(Constructor, protoProps, staticProps) {
        if (protoProps) _defineProperties(Constructor.prototype, protoProps);
        if (staticProps) _defineProperties(Constructor, staticProps);
        Object.defineProperty(Constructor, "prototype", {
          writable: false
        });
        return Constructor;
      }
      function _toPropertyKey(arg) {
        var key = _toPrimitive(arg, "string");
        return typeof key === "symbol" ? key : String(key);
      }
      function _toPrimitive(input, hint) {
        if (typeof input !== "object" || input === null) return input;
        var prim = input[Symbol.toPrimitive];
        if (prim !== undefined) {
          var res = prim.call(input, hint || "default");
          if (typeof res !== "object") return res;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return (hint === "string" ? String : Number)(input);
      }
      var _require = __webpack_require__(8287), Buffer = _require.Buffer;
      var _require2 = __webpack_require__(5340), inspect = _require2.inspect;
      var custom = inspect && inspect.custom || "inspect";
      function copyBuffer(src, target, offset) {
        Buffer.prototype.copy.call(src, target, offset);
      }
      module.exports = 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 Buffer.alloc(0);
            var ret = Buffer.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;
          }
        }, {
          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;
          }
        }, {
          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;
          }
        }, {
          key: "_getBuffer",
          value: function _getBuffer(n) {
            var ret = Buffer.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;
          }
        }, {
          key: custom,
          value: function value(_, options) {
            return inspect(this, _objectSpread(_objectSpread({}, options), {}, {
              depth: 0,
              customInspect: false
            }));
          }
        } ]);
        return BufferList;
      }();
    },
    5896(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      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.nextTick(emitErrorNT, this, err);
            } else if (!this._writableState.errorEmitted) {
              this._writableState.errorEmitted = true;
              process.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(err) {
          if (!cb && err) {
            if (!_this._writableState) {
              process.nextTick(emitErrorAndCloseNT, _this, err);
            } else if (!_this._writableState.errorEmitted) {
              _this._writableState.errorEmitted = true;
              process.nextTick(emitErrorAndCloseNT, _this, err);
            } else {
              process.nextTick(emitCloseNT, _this);
            }
          } else if (cb) {
            process.nextTick(emitCloseNT, _this);
            cb(err);
          } else {
            process.nextTick(emitCloseNT, _this);
          }
        }));
        return this;
      }
      function emitErrorAndCloseNT(self, err) {
        emitErrorNT(self, err);
        emitCloseNT(self);
      }
      function emitCloseNT(self) {
        if (self._writableState && !self._writableState.emitClose) return;
        if (self._readableState && !self._readableState.emitClose) return;
        self.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(self, err) {
        self.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);
      }
      module.exports = {
        destroy,
        undestroy,
        errorOrDestroy
      };
    },
    6238(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var ERR_STREAM_PREMATURE_CLOSE = __webpack_require__(6048).F.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 noop() {}
      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 || noop);
        var readable = opts.readable || opts.readable !== false && stream.readable;
        var writable = opts.writable || opts.writable !== false && stream.writable;
        var onlegacyfinish = function onlegacyfinish() {
          if (!stream.writable) onfinish();
        };
        var writableEnded = stream._writableState && stream._writableState.finished;
        var onfinish = function onfinish() {
          writable = false;
          writableEnded = true;
          if (!readable) callback.call(stream);
        };
        var readableEnded = stream._readableState && stream._readableState.endEmitted;
        var onend = function onend() {
          readable = false;
          readableEnded = true;
          if (!writable) callback.call(stream);
        };
        var onerror = function onerror(err) {
          callback.call(stream, err);
        };
        var onclose = function onclose() {
          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 onrequest() {
          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);
        };
      }
      module.exports = eos;
    },
    5157(module) {
      module.exports = function() {
        throw new Error("Readable.from is not available in the browser");
      };
    },
    7758(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var eos;
      function once(callback) {
        var called = false;
        return function() {
          if (called) return;
          called = true;
          callback.apply(void 0, arguments);
        };
      }
      var _require$codes = __webpack_require__(6048).F, ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS, ERR_STREAM_DESTROYED = _require$codes.ERR_STREAM_DESTROYED;
      function noop(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 === undefined) eos = __webpack_require__(6238);
        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 noop;
        if (typeof streams[streams.length - 1] !== "function") return noop;
        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);
      }
      module.exports = pipeline;
    },
    5291(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var ERR_INVALID_OPT_VALUE = __webpack_require__(6048).F.ERR_INVALID_OPT_VALUE;
      function highWaterMarkFrom(options, isDuplex, duplexKey) {
        return options.highWaterMark != null ? options.highWaterMark : isDuplex ? options[duplexKey] : null;
      }
      function getHighWaterMark(state, 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 state.objectMode ? 16 : 16 * 1024;
      }
      module.exports = {
        getHighWaterMark
      };
    },
    345(module, __unused_webpack_exports, __webpack_require__) {
      module.exports = __webpack_require__(7007).EventEmitter;
    },
    6011(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(8287).Buffer;
      var inherits = __webpack_require__(6698);
      var HashBase = __webpack_require__(1147);
      var ARRAY16 = new Array(16);
      var zl = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 ];
      var zr = [ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 ];
      var sl = [ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ];
      var sr = [ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ];
      var hl = [ 0, 1518500249, 1859775393, 2400959708, 2840853838 ];
      var hr = [ 1352829926, 1548603684, 1836072691, 2053994217, 0 ];
      function rotl(x, n) {
        return x << n | x >>> 32 - n;
      }
      function fn1(a, b, c, d, e, m, k, s) {
        return rotl(a + (b ^ c ^ d) + m + k | 0, s) + e | 0;
      }
      function fn2(a, b, c, d, e, m, k, s) {
        return rotl(a + (b & c | ~b & d) + m + k | 0, s) + e | 0;
      }
      function fn3(a, b, c, d, e, m, k, s) {
        return rotl(a + ((b | ~c) ^ d) + m + k | 0, s) + e | 0;
      }
      function fn4(a, b, c, d, e, m, k, s) {
        return rotl(a + (b & d | c & ~d) + m + k | 0, s) + e | 0;
      }
      function fn5(a, b, c, d, e, m, k, s) {
        return rotl(a + (b ^ (c | ~d)) + m + k | 0, s) + e | 0;
      }
      function RIPEMD160() {
        HashBase.call(this, 64);
        this._a = 1732584193;
        this._b = 4023233417;
        this._c = 2562383102;
        this._d = 271733878;
        this._e = 3285377520;
      }
      inherits(RIPEMD160, HashBase);
      RIPEMD160.prototype._update = function() {
        var words = ARRAY16;
        for (var j = 0; j < 16; ++j) {
          words[j] = this._block.readInt32LE(j * 4);
        }
        var al = this._a | 0;
        var bl = this._b | 0;
        var cl = this._c | 0;
        var dl = this._d | 0;
        var el = this._e | 0;
        var ar = this._a | 0;
        var br = this._b | 0;
        var cr = this._c | 0;
        var dr = this._d | 0;
        var er = this._e | 0;
        for (var i = 0; i < 80; i += 1) {
          var tl;
          var tr;
          if (i < 16) {
            tl = fn1(al, bl, cl, dl, el, words[zl[i]], hl[0], sl[i]);
            tr = fn5(ar, br, cr, dr, er, words[zr[i]], hr[0], sr[i]);
          } else if (i < 32) {
            tl = fn2(al, bl, cl, dl, el, words[zl[i]], hl[1], sl[i]);
            tr = fn4(ar, br, cr, dr, er, words[zr[i]], hr[1], sr[i]);
          } else if (i < 48) {
            tl = fn3(al, bl, cl, dl, el, words[zl[i]], hl[2], sl[i]);
            tr = fn3(ar, br, cr, dr, er, words[zr[i]], hr[2], sr[i]);
          } else if (i < 64) {
            tl = fn4(al, bl, cl, dl, el, words[zl[i]], hl[3], sl[i]);
            tr = fn2(ar, br, cr, dr, er, words[zr[i]], hr[3], sr[i]);
          } else {
            tl = fn5(al, bl, cl, dl, el, words[zl[i]], hl[4], sl[i]);
            tr = fn1(ar, br, cr, dr, er, words[zr[i]], hr[4], sr[i]);
          }
          al = el;
          el = dl;
          dl = rotl(cl, 10);
          cl = bl;
          bl = tl;
          ar = er;
          er = dr;
          dr = rotl(cr, 10);
          cr = br;
          br = tr;
        }
        var t = this._b + cl + dr | 0;
        this._b = this._c + dl + er | 0;
        this._c = this._d + el + ar | 0;
        this._d = this._e + al + br | 0;
        this._e = this._a + bl + cr | 0;
        this._a = t;
      };
      RIPEMD160.prototype._digest = function() {
        this._block[this._blockOffset] = 128;
        this._blockOffset += 1;
        if (this._blockOffset > 56) {
          this._block.fill(0, this._blockOffset, 64);
          this._update();
          this._blockOffset = 0;
        }
        this._block.fill(0, this._blockOffset, 56);
        this._block.writeUInt32LE(this._length[0], 56);
        this._block.writeUInt32LE(this._length[1], 60);
        this._update();
        var buffer = Buffer.alloc ? Buffer.alloc(20) : new Buffer(20);
        buffer.writeInt32LE(this._a, 0);
        buffer.writeInt32LE(this._b, 4);
        buffer.writeInt32LE(this._c, 8);
        buffer.writeInt32LE(this._d, 12);
        buffer.writeInt32LE(this._e, 16);
        return buffer;
      };
      module.exports = RIPEMD160;
    },
    1147(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var toBuffer = __webpack_require__(8537);
      var Transform = __webpack_require__(1077).Transform;
      var inherits = __webpack_require__(6698);
      function HashBase(blockSize) {
        Transform.call(this);
        this._block = Buffer.allocUnsafe(blockSize);
        this._blockSize = blockSize;
        this._blockOffset = 0;
        this._length = [ 0, 0, 0, 0 ];
        this._finalized = false;
      }
      inherits(HashBase, Transform);
      HashBase.prototype._transform = function(chunk, encoding, callback) {
        var error = null;
        try {
          this.update(chunk, encoding);
        } catch (err) {
          error = err;
        }
        callback(error);
      };
      HashBase.prototype._flush = function(callback) {
        var error = null;
        try {
          this.push(this.digest());
        } catch (err) {
          error = err;
        }
        callback(error);
      };
      HashBase.prototype.update = function(data, encoding) {
        if (this._finalized) {
          throw new Error("Digest already called");
        }
        var dataBuffer = toBuffer(data, encoding);
        var block = this._block;
        var offset = 0;
        while (this._blockOffset + dataBuffer.length - offset >= this._blockSize) {
          for (var i = this._blockOffset; i < this._blockSize; ) {
            block[i] = dataBuffer[offset];
            i += 1;
            offset += 1;
          }
          this._update();
          this._blockOffset = 0;
        }
        while (offset < dataBuffer.length) {
          block[this._blockOffset] = dataBuffer[offset];
          this._blockOffset += 1;
          offset += 1;
        }
        for (var j = 0, carry = dataBuffer.length * 8; carry > 0; ++j) {
          this._length[j] += carry;
          carry = this._length[j] / 4294967296 | 0;
          if (carry > 0) {
            this._length[j] -= 4294967296 * carry;
          }
        }
        return this;
      };
      HashBase.prototype._update = function() {
        throw new Error("_update is not implemented");
      };
      HashBase.prototype.digest = function(encoding) {
        if (this._finalized) {
          throw new Error("Digest already called");
        }
        this._finalized = true;
        var digest = this._digest();
        if (encoding !== undefined) {
          digest = digest.toString(encoding);
        }
        this._block.fill(0);
        this._blockOffset = 0;
        for (var i = 0; i < 4; ++i) {
          this._length[i] = 0;
        }
        return digest;
      };
      HashBase.prototype._digest = function() {
        throw new Error("_digest is not implemented");
      };
      module.exports = HashBase;
    },
    8537(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var toBuffer = __webpack_require__(5377);
      var useUint8Array = typeof Uint8Array !== "undefined";
      var useArrayBuffer = useUint8Array && typeof ArrayBuffer !== "undefined";
      var isView = useArrayBuffer && ArrayBuffer.isView;
      module.exports = function(thing, encoding) {
        if (typeof thing === "string" || Buffer.isBuffer(thing) || useUint8Array && thing instanceof Uint8Array || isView && isView(thing)) {
          return toBuffer(thing, encoding);
        }
        throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView');
      };
    },
    9860(module) {
      var toString = {}.toString;
      module.exports = Array.isArray || function(arr) {
        return toString.call(arr) == "[object Array]";
      };
    },
    308(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var pna = __webpack_require__(3225);
      var objectKeys = Object.keys || function(obj) {
        var keys = [];
        for (var key in obj) {
          keys.push(key);
        }
        return keys;
      };
      module.exports = Duplex;
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      var Readable = __webpack_require__(1706);
      var Writable = __webpack_require__(2398);
      util.inherits(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);
        if (options && options.readable === false) this.readable = false;
        if (options && options.writable === false) this.writable = false;
        this.allowHalfOpen = true;
        if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
        this.once("end", onend);
      }
      Object.defineProperty(Duplex.prototype, "writableHighWaterMark", {
        enumerable: false,
        get: function() {
          return this._writableState.highWaterMark;
        }
      });
      function onend() {
        if (this.allowHalfOpen || this._writableState.ended) return;
        pna.nextTick(onEndNT, this);
      }
      function onEndNT(self) {
        self.end();
      }
      Object.defineProperty(Duplex.prototype, "destroyed", {
        get: function() {
          if (this._readableState === undefined || this._writableState === undefined) {
            return false;
          }
          return this._readableState.destroyed && this._writableState.destroyed;
        },
        set: function(value) {
          if (this._readableState === undefined || this._writableState === undefined) {
            return;
          }
          this._readableState.destroyed = value;
          this._writableState.destroyed = value;
        }
      });
      Duplex.prototype._destroy = function(err, cb) {
        this.push(null);
        this.end();
        pna.nextTick(cb, err);
      };
    },
    8158(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = PassThrough;
      var Transform = __webpack_require__(5972);
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      util.inherits(PassThrough, Transform);
      function PassThrough(options) {
        if (!(this instanceof PassThrough)) return new PassThrough(options);
        Transform.call(this, options);
      }
      PassThrough.prototype._transform = function(chunk, encoding, cb) {
        cb(null, chunk);
      };
    },
    1706(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var pna = __webpack_require__(3225);
      module.exports = Readable;
      var isArray = __webpack_require__(9860);
      var Duplex;
      Readable.ReadableState = ReadableState;
      var EE = __webpack_require__(7007).EventEmitter;
      var EElistenerCount = function(emitter, type) {
        return emitter.listeners(type).length;
      };
      var Stream = __webpack_require__(1667);
      var Buffer = __webpack_require__(3392).Buffer;
      var OurUint8Array = (typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
      function _uint8ArrayToBuffer(chunk) {
        return Buffer.from(chunk);
      }
      function _isUint8Array(obj) {
        return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
      }
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      var debugUtil = __webpack_require__(5248);
      var debug = void 0;
      if (debugUtil && debugUtil.debuglog) {
        debug = debugUtil.debuglog("stream");
      } else {
        debug = function() {};
      }
      var BufferList = __webpack_require__(6972);
      var destroyImpl = __webpack_require__(330);
      var StringDecoder;
      util.inherits(Readable, Stream);
      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 (isArray(emitter._events[event])) emitter._events[event].unshift(fn); else emitter._events[event] = [ fn, emitter._events[event] ];
      }
      function ReadableState(options, stream) {
        Duplex = Duplex || __webpack_require__(308);
        options = options || {};
        var isDuplex = stream instanceof Duplex;
        this.objectMode = !!options.objectMode;
        if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
        var hwm = options.highWaterMark;
        var readableHwm = options.readableHighWaterMark;
        var defaultHwm = this.objectMode ? 16 : 16 * 1024;
        if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm; else this.highWaterMark = defaultHwm;
        this.highWaterMark = Math.floor(this.highWaterMark);
        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.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 = __webpack_require__(7479).I;
          this.decoder = new StringDecoder(options.encoding);
          this.encoding = options.encoding;
        }
      }
      function Readable(options) {
        Duplex = Duplex || __webpack_require__(308);
        if (!(this instanceof Readable)) return new Readable(options);
        this._readableState = new ReadableState(options, this);
        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", {
        get: function() {
          if (this._readableState === undefined) {
            return false;
          }
          return this._readableState.destroyed;
        },
        set: function(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) {
        this.push(null);
        cb(err);
      };
      Readable.prototype.push = function(chunk, encoding) {
        var state = this._readableState;
        var skipChunkCheck;
        if (!state.objectMode) {
          if (typeof chunk === "string") {
            encoding = encoding || state.defaultEncoding;
            if (encoding !== state.encoding) {
              chunk = Buffer.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) {
        var state = stream._readableState;
        if (chunk === null) {
          state.reading = false;
          onEofChunk(stream, state);
        } else {
          var er;
          if (!skipChunkCheck) er = chunkInvalid(state, chunk);
          if (er) {
            stream.emit("error", er);
          } else if (state.objectMode || chunk && chunk.length > 0) {
            if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
              chunk = _uint8ArrayToBuffer(chunk);
            }
            if (addToFront) {
              if (state.endEmitted) stream.emit("error", new Error("stream.unshift() after end event")); else addChunk(stream, state, chunk, true);
            } else if (state.ended) {
              stream.emit("error", new Error("stream.push() after EOF"));
            } else {
              state.reading = false;
              if (state.decoder && !encoding) {
                chunk = state.decoder.write(chunk);
                if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false); else maybeReadMore(stream, state);
              } else {
                addChunk(stream, state, chunk, false);
              }
            }
          } else if (!addToFront) {
            state.reading = false;
          }
        }
        return needMoreData(state);
      }
      function addChunk(stream, state, chunk, addToFront) {
        if (state.flowing && state.length === 0 && !state.sync) {
          stream.emit("data", chunk);
          stream.read(0);
        } else {
          state.length += state.objectMode ? 1 : chunk.length;
          if (addToFront) state.buffer.unshift(chunk); else state.buffer.push(chunk);
          if (state.needReadable) emitReadable(stream);
        }
        maybeReadMore(stream, state);
      }
      function chunkInvalid(state, chunk) {
        var er;
        if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
          er = new TypeError("Invalid non-string/buffer chunk");
        }
        return er;
      }
      function needMoreData(state) {
        return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
      }
      Readable.prototype.isPaused = function() {
        return this._readableState.flowing === false;
      };
      Readable.prototype.setEncoding = function(enc) {
        if (!StringDecoder) StringDecoder = __webpack_require__(7479).I;
        this._readableState.decoder = new StringDecoder(enc);
        this._readableState.encoding = enc;
        return this;
      };
      var MAX_HWM = 8388608;
      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, state) {
        if (n <= 0 || state.length === 0 && state.ended) return 0;
        if (state.objectMode) return 1;
        if (n !== n) {
          if (state.flowing && state.length) return state.buffer.head.data.length; else return state.length;
        }
        if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
        if (n <= state.length) return n;
        if (!state.ended) {
          state.needReadable = true;
          return 0;
        }
        return state.length;
      }
      Readable.prototype.read = function(n) {
        debug("read", n);
        n = parseInt(n, 10);
        var state = this._readableState;
        var nOrig = n;
        if (n !== 0) state.emittedReadable = false;
        if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
          debug("read: emitReadable", state.length, state.ended);
          if (state.length === 0 && state.ended) endReadable(this); else emitReadable(this);
          return null;
        }
        n = howMuchToRead(n, state);
        if (n === 0 && state.ended) {
          if (state.length === 0) endReadable(this);
          return null;
        }
        var doRead = state.needReadable;
        debug("need readable", doRead);
        if (state.length === 0 || state.length - n < state.highWaterMark) {
          doRead = true;
          debug("length less than watermark", doRead);
        }
        if (state.ended || state.reading) {
          doRead = false;
          debug("reading or ended", doRead);
        } else if (doRead) {
          debug("do read");
          state.reading = true;
          state.sync = true;
          if (state.length === 0) state.needReadable = true;
          this._read(state.highWaterMark);
          state.sync = false;
          if (!state.reading) n = howMuchToRead(nOrig, state);
        }
        var ret;
        if (n > 0) ret = fromList(n, state); else ret = null;
        if (ret === null) {
          state.needReadable = true;
          n = 0;
        } else {
          state.length -= n;
        }
        if (state.length === 0) {
          if (!state.ended) state.needReadable = true;
          if (nOrig !== n && state.ended) endReadable(this);
        }
        if (ret !== null) this.emit("data", ret);
        return ret;
      };
      function onEofChunk(stream, state) {
        if (state.ended) return;
        if (state.decoder) {
          var chunk = state.decoder.end();
          if (chunk && chunk.length) {
            state.buffer.push(chunk);
            state.length += state.objectMode ? 1 : chunk.length;
          }
        }
        state.ended = true;
        emitReadable(stream);
      }
      function emitReadable(stream) {
        var state = stream._readableState;
        state.needReadable = false;
        if (!state.emittedReadable) {
          debug("emitReadable", state.flowing);
          state.emittedReadable = true;
          if (state.sync) pna.nextTick(emitReadable_, stream); else emitReadable_(stream);
        }
      }
      function emitReadable_(stream) {
        debug("emit readable");
        stream.emit("readable");
        flow(stream);
      }
      function maybeReadMore(stream, state) {
        if (!state.readingMore) {
          state.readingMore = true;
          pna.nextTick(maybeReadMore_, stream, state);
        }
      }
      function maybeReadMore_(stream, state) {
        var len = state.length;
        while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
          debug("maybeReadMore read 0");
          stream.read(0);
          if (len === state.length) break; else len = state.length;
        }
        state.readingMore = false;
      }
      Readable.prototype._read = function(n) {
        this.emit("error", new Error("_read() is not implemented"));
      };
      Readable.prototype.pipe = function(dest, pipeOpts) {
        var src = this;
        var state = this._readableState;
        switch (state.pipesCount) {
         case 0:
          state.pipes = dest;
          break;

         case 1:
          state.pipes = [ state.pipes, dest ];
          break;

         default:
          state.pipes.push(dest);
          break;
        }
        state.pipesCount += 1;
        debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
        var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
        var endFn = doEnd ? onend : unpipe;
        if (state.endEmitted) pna.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 (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
        }
        var increasedAwaitDrain = false;
        src.on("data", ondata);
        function ondata(chunk) {
          debug("ondata");
          increasedAwaitDrain = false;
          var ret = dest.write(chunk);
          if (false === ret && !increasedAwaitDrain) {
            if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
              debug("false write response, pause", state.awaitDrain);
              state.awaitDrain++;
              increasedAwaitDrain = true;
            }
            src.pause();
          }
        }
        function onerror(er) {
          debug("onerror", er);
          unpipe();
          dest.removeListener("error", onerror);
          if (EElistenerCount(dest, "error") === 0) dest.emit("error", 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 (!state.flowing) {
          debug("pipe resume");
          src.resume();
        }
        return dest;
      };
      function pipeOnDrain(src) {
        return function() {
          var state = src._readableState;
          debug("pipeOnDrain", state.awaitDrain);
          if (state.awaitDrain) state.awaitDrain--;
          if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
            state.flowing = true;
            flow(src);
          }
        };
      }
      Readable.prototype.unpipe = function(dest) {
        var state = this._readableState;
        var unpipeInfo = {
          hasUnpiped: false
        };
        if (state.pipesCount === 0) return this;
        if (state.pipesCount === 1) {
          if (dest && dest !== state.pipes) return this;
          if (!dest) dest = state.pipes;
          state.pipes = null;
          state.pipesCount = 0;
          state.flowing = false;
          if (dest) dest.emit("unpipe", this, unpipeInfo);
          return this;
        }
        if (!dest) {
          var dests = state.pipes;
          var len = state.pipesCount;
          state.pipes = null;
          state.pipesCount = 0;
          state.flowing = false;
          for (var i = 0; i < len; i++) {
            dests[i].emit("unpipe", this, {
              hasUnpiped: false
            });
          }
          return this;
        }
        var index = indexOf(state.pipes, dest);
        if (index === -1) return this;
        state.pipes.splice(index, 1);
        state.pipesCount -= 1;
        if (state.pipesCount === 1) state.pipes = state.pipes[0];
        dest.emit("unpipe", this, unpipeInfo);
        return this;
      };
      Readable.prototype.on = function(ev, fn) {
        var res = Stream.prototype.on.call(this, ev, fn);
        if (ev === "data") {
          if (this._readableState.flowing !== false) this.resume();
        } else if (ev === "readable") {
          var state = this._readableState;
          if (!state.endEmitted && !state.readableListening) {
            state.readableListening = state.needReadable = true;
            state.emittedReadable = false;
            if (!state.reading) {
              pna.nextTick(nReadingNextTick, this);
            } else if (state.length) {
              emitReadable(this);
            }
          }
        }
        return res;
      };
      Readable.prototype.addListener = Readable.prototype.on;
      function nReadingNextTick(self) {
        debug("readable nexttick read 0");
        self.read(0);
      }
      Readable.prototype.resume = function() {
        var state = this._readableState;
        if (!state.flowing) {
          debug("resume");
          state.flowing = true;
          resume(this, state);
        }
        return this;
      };
      function resume(stream, state) {
        if (!state.resumeScheduled) {
          state.resumeScheduled = true;
          pna.nextTick(resume_, stream, state);
        }
      }
      function resume_(stream, state) {
        if (!state.reading) {
          debug("resume read 0");
          stream.read(0);
        }
        state.resumeScheduled = false;
        state.awaitDrain = 0;
        stream.emit("resume");
        flow(stream);
        if (state.flowing && !state.reading) stream.read(0);
      }
      Readable.prototype.pause = function() {
        debug("call pause flowing=%j", this._readableState.flowing);
        if (false !== this._readableState.flowing) {
          debug("pause");
          this._readableState.flowing = false;
          this.emit("pause");
        }
        return this;
      };
      function flow(stream) {
        var state = stream._readableState;
        debug("flow", state.flowing);
        while (state.flowing && stream.read() !== null) {}
      }
      Readable.prototype.wrap = function(stream) {
        var _this = this;
        var state = this._readableState;
        var paused = false;
        stream.on("end", (function() {
          debug("wrapped end");
          if (state.decoder && !state.ended) {
            var chunk = state.decoder.end();
            if (chunk && chunk.length) _this.push(chunk);
          }
          _this.push(null);
        }));
        stream.on("data", (function(chunk) {
          debug("wrapped data");
          if (state.decoder) chunk = state.decoder.write(chunk);
          if (state.objectMode && (chunk === null || chunk === undefined)) return; else if (!state.objectMode && (!chunk || !chunk.length)) return;
          var ret = _this.push(chunk);
          if (!ret) {
            paused = true;
            stream.pause();
          }
        }));
        for (var i in stream) {
          if (this[i] === undefined && typeof stream[i] === "function") {
            this[i] = function(method) {
              return function() {
                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(n) {
          debug("wrapped _read", n);
          if (paused) {
            paused = false;
            stream.resume();
          }
        };
        return this;
      };
      Object.defineProperty(Readable.prototype, "readableHighWaterMark", {
        enumerable: false,
        get: function() {
          return this._readableState.highWaterMark;
        }
      });
      Readable._fromList = fromList;
      function fromList(n, state) {
        if (state.length === 0) return null;
        var ret;
        if (state.objectMode) ret = state.buffer.shift(); else if (!n || n >= state.length) {
          if (state.decoder) ret = state.buffer.join(""); else if (state.buffer.length === 1) ret = state.buffer.head.data; else ret = state.buffer.concat(state.length);
          state.buffer.clear();
        } else {
          ret = fromListPartial(n, state.buffer, state.decoder);
        }
        return ret;
      }
      function fromListPartial(n, list, hasStrings) {
        var ret;
        if (n < list.head.data.length) {
          ret = list.head.data.slice(0, n);
          list.head.data = list.head.data.slice(n);
        } else if (n === list.head.data.length) {
          ret = list.shift();
        } else {
          ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
        }
        return ret;
      }
      function copyFromBufferString(n, list) {
        var p = list.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) list.head = p.next; else list.head = list.tail = null;
            } else {
              list.head = p;
              p.data = str.slice(nb);
            }
            break;
          }
          ++c;
        }
        list.length -= c;
        return ret;
      }
      function copyFromBuffer(n, list) {
        var ret = Buffer.allocUnsafe(n);
        var p = list.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) list.head = p.next; else list.head = list.tail = null;
            } else {
              list.head = p;
              p.data = buf.slice(nb);
            }
            break;
          }
          ++c;
        }
        list.length -= c;
        return ret;
      }
      function endReadable(stream) {
        var state = stream._readableState;
        if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
        if (!state.endEmitted) {
          state.ended = true;
          pna.nextTick(endReadableNT, state, stream);
        }
      }
      function endReadableNT(state, stream) {
        if (!state.endEmitted && state.length === 0) {
          state.endEmitted = true;
          stream.readable = false;
          stream.emit("end");
        }
      }
      function indexOf(xs, x) {
        for (var i = 0, l = xs.length; i < l; i++) {
          if (xs[i] === x) return i;
        }
        return -1;
      }
    },
    5972(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = Transform;
      var Duplex = __webpack_require__(308);
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      util.inherits(Transform, Duplex);
      function afterTransform(er, data) {
        var ts = this._transformState;
        ts.transforming = false;
        var cb = ts.writecb;
        if (!cb) {
          return this.emit("error", new Error("write callback called multiple times"));
        }
        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._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) {
        throw new Error("_transform() is not implemented");
      };
      Transform.prototype._write = function(chunk, encoding, cb) {
        var ts = this._transformState;
        ts.writecb = cb;
        ts.writechunk = chunk;
        ts.writeencoding = encoding;
        if (!ts.transforming) {
          var rs = this._readableState;
          if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
        }
      };
      Transform.prototype._read = function(n) {
        var ts = this._transformState;
        if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
          ts.transforming = true;
          this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
        } else {
          ts.needTransform = true;
        }
      };
      Transform.prototype._destroy = function(err, cb) {
        var _this2 = this;
        Duplex.prototype._destroy.call(this, err, (function(err2) {
          cb(err2);
          _this2.emit("close");
        }));
      };
      function done(stream, er, data) {
        if (er) return stream.emit("error", er);
        if (data != null) stream.push(data);
        if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0");
        if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming");
        return stream.push(null);
      }
    },
    2398(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var process = __webpack_require__(5606);
      var pna = __webpack_require__(3225);
      module.exports = Writable;
      function WriteReq(chunk, encoding, cb) {
        this.chunk = chunk;
        this.encoding = encoding;
        this.callback = cb;
        this.next = null;
      }
      function CorkedRequest(state) {
        var _this = this;
        this.next = null;
        this.entry = null;
        this.finish = function() {
          onCorkedFinish(_this, state);
        };
      }
      var asyncWrite = !process.browser && [ "v0.10", "v0.9." ].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
      var Duplex;
      Writable.WritableState = WritableState;
      var util = Object.create(__webpack_require__(5622));
      util.inherits = __webpack_require__(6698);
      var internalUtil = {
        deprecate: __webpack_require__(4643)
      };
      var Stream = __webpack_require__(1667);
      var Buffer = __webpack_require__(3392).Buffer;
      var OurUint8Array = (typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : typeof window !== "undefined" ? window : typeof self !== "undefined" ? self : {}).Uint8Array || function() {};
      function _uint8ArrayToBuffer(chunk) {
        return Buffer.from(chunk);
      }
      function _isUint8Array(obj) {
        return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
      }
      var destroyImpl = __webpack_require__(330);
      util.inherits(Writable, Stream);
      function nop() {}
      function WritableState(options, stream) {
        Duplex = Duplex || __webpack_require__(308);
        options = options || {};
        var isDuplex = stream instanceof Duplex;
        this.objectMode = !!options.objectMode;
        if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
        var hwm = options.highWaterMark;
        var writableHwm = options.writableHighWaterMark;
        var defaultHwm = this.objectMode ? 16 : 16 * 1024;
        if (hwm || hwm === 0) this.highWaterMark = hwm; else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm; else this.highWaterMark = defaultHwm;
        this.highWaterMark = Math.floor(this.highWaterMark);
        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.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() {
              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(object) {
            if (realHasInstance.call(this, object)) return true;
            if (this !== Writable) return false;
            return object && object._writableState instanceof WritableState;
          }
        });
      } else {
        realHasInstance = function(object) {
          return object instanceof this;
        };
      }
      function Writable(options) {
        Duplex = Duplex || __webpack_require__(308);
        if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
          return new Writable(options);
        }
        this._writableState = new WritableState(options, this);
        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() {
        this.emit("error", new Error("Cannot pipe, not readable"));
      };
      function writeAfterEnd(stream, cb) {
        var er = new Error("write after end");
        stream.emit("error", er);
        pna.nextTick(cb, er);
      }
      function validChunk(stream, state, chunk, cb) {
        var valid = true;
        var er = false;
        if (chunk === null) {
          er = new TypeError("May not write null values to stream");
        } else if (typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
          er = new TypeError("Invalid non-string/buffer chunk");
        }
        if (er) {
          stream.emit("error", er);
          pna.nextTick(cb, er);
          valid = false;
        }
        return valid;
      }
      Writable.prototype.write = function(chunk, encoding, cb) {
        var state = this._writableState;
        var ret = false;
        var isBuf = !state.objectMode && _isUint8Array(chunk);
        if (isBuf && !Buffer.isBuffer(chunk)) {
          chunk = _uint8ArrayToBuffer(chunk);
        }
        if (typeof encoding === "function") {
          cb = encoding;
          encoding = null;
        }
        if (isBuf) encoding = "buffer"; else if (!encoding) encoding = state.defaultEncoding;
        if (typeof cb !== "function") cb = nop;
        if (state.ended) writeAfterEnd(this, cb); else if (isBuf || validChunk(this, state, chunk, cb)) {
          state.pendingcb++;
          ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
        }
        return ret;
      };
      Writable.prototype.cork = function() {
        var state = this._writableState;
        state.corked++;
      };
      Writable.prototype.uncork = function() {
        var state = this._writableState;
        if (state.corked) {
          state.corked--;
          if (!state.writing && !state.corked && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
        }
      };
      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 TypeError("Unknown encoding: " + encoding);
        this._writableState.defaultEncoding = encoding;
        return this;
      };
      function decodeChunk(state, chunk, encoding) {
        if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
          chunk = Buffer.from(chunk, encoding);
        }
        return chunk;
      }
      Object.defineProperty(Writable.prototype, "writableHighWaterMark", {
        enumerable: false,
        get: function() {
          return this._writableState.highWaterMark;
        }
      });
      function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
        if (!isBuf) {
          var newChunk = decodeChunk(state, chunk, encoding);
          if (chunk !== newChunk) {
            isBuf = true;
            encoding = "buffer";
            chunk = newChunk;
          }
        }
        var len = state.objectMode ? 1 : chunk.length;
        state.length += len;
        var ret = state.length < state.highWaterMark;
        if (!ret) state.needDrain = true;
        if (state.writing || state.corked) {
          var last = state.lastBufferedRequest;
          state.lastBufferedRequest = {
            chunk,
            encoding,
            isBuf,
            callback: cb,
            next: null
          };
          if (last) {
            last.next = state.lastBufferedRequest;
          } else {
            state.bufferedRequest = state.lastBufferedRequest;
          }
          state.bufferedRequestCount += 1;
        } else {
          doWrite(stream, state, false, len, chunk, encoding, cb);
        }
        return ret;
      }
      function doWrite(stream, state, writev, len, chunk, encoding, cb) {
        state.writelen = len;
        state.writecb = cb;
        state.writing = true;
        state.sync = true;
        if (writev) stream._writev(chunk, state.onwrite); else stream._write(chunk, encoding, state.onwrite);
        state.sync = false;
      }
      function onwriteError(stream, state, sync, er, cb) {
        --state.pendingcb;
        if (sync) {
          pna.nextTick(cb, er);
          pna.nextTick(finishMaybe, stream, state);
          stream._writableState.errorEmitted = true;
          stream.emit("error", er);
        } else {
          cb(er);
          stream._writableState.errorEmitted = true;
          stream.emit("error", er);
          finishMaybe(stream, state);
        }
      }
      function onwriteStateUpdate(state) {
        state.writing = false;
        state.writecb = null;
        state.length -= state.writelen;
        state.writelen = 0;
      }
      function onwrite(stream, er) {
        var state = stream._writableState;
        var sync = state.sync;
        var cb = state.writecb;
        onwriteStateUpdate(state);
        if (er) onwriteError(stream, state, sync, er, cb); else {
          var finished = needFinish(state);
          if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
            clearBuffer(stream, state);
          }
          if (sync) {
            asyncWrite(afterWrite, stream, state, finished, cb);
          } else {
            afterWrite(stream, state, finished, cb);
          }
        }
      }
      function afterWrite(stream, state, finished, cb) {
        if (!finished) onwriteDrain(stream, state);
        state.pendingcb--;
        cb();
        finishMaybe(stream, state);
      }
      function onwriteDrain(stream, state) {
        if (state.length === 0 && state.needDrain) {
          state.needDrain = false;
          stream.emit("drain");
        }
      }
      function clearBuffer(stream, state) {
        state.bufferProcessing = true;
        var entry = state.bufferedRequest;
        if (stream._writev && entry && entry.next) {
          var l = state.bufferedRequestCount;
          var buffer = new Array(l);
          var holder = state.corkedRequestsFree;
          holder.entry = entry;
          var count = 0;
          var allBuffers = true;
          while (entry) {
            buffer[count] = entry;
            if (!entry.isBuf) allBuffers = false;
            entry = entry.next;
            count += 1;
          }
          buffer.allBuffers = allBuffers;
          doWrite(stream, state, true, state.length, buffer, "", holder.finish);
          state.pendingcb++;
          state.lastBufferedRequest = null;
          if (holder.next) {
            state.corkedRequestsFree = holder.next;
            holder.next = null;
          } else {
            state.corkedRequestsFree = new CorkedRequest(state);
          }
          state.bufferedRequestCount = 0;
        } else {
          while (entry) {
            var chunk = entry.chunk;
            var encoding = entry.encoding;
            var cb = entry.callback;
            var len = state.objectMode ? 1 : chunk.length;
            doWrite(stream, state, false, len, chunk, encoding, cb);
            entry = entry.next;
            state.bufferedRequestCount--;
            if (state.writing) {
              break;
            }
          }
          if (entry === null) state.lastBufferedRequest = null;
        }
        state.bufferedRequest = entry;
        state.bufferProcessing = false;
      }
      Writable.prototype._write = function(chunk, encoding, cb) {
        cb(new Error("_write() is not implemented"));
      };
      Writable.prototype._writev = null;
      Writable.prototype.end = function(chunk, encoding, cb) {
        var state = this._writableState;
        if (typeof chunk === "function") {
          cb = chunk;
          chunk = null;
          encoding = null;
        } else if (typeof encoding === "function") {
          cb = encoding;
          encoding = null;
        }
        if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
        if (state.corked) {
          state.corked = 1;
          this.uncork();
        }
        if (!state.ending) endWritable(this, state, cb);
      };
      function needFinish(state) {
        return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
      }
      function callFinal(stream, state) {
        stream._final((function(err) {
          state.pendingcb--;
          if (err) {
            stream.emit("error", err);
          }
          state.prefinished = true;
          stream.emit("prefinish");
          finishMaybe(stream, state);
        }));
      }
      function prefinish(stream, state) {
        if (!state.prefinished && !state.finalCalled) {
          if (typeof stream._final === "function") {
            state.pendingcb++;
            state.finalCalled = true;
            pna.nextTick(callFinal, stream, state);
          } else {
            state.prefinished = true;
            stream.emit("prefinish");
          }
        }
      }
      function finishMaybe(stream, state) {
        var need = needFinish(state);
        if (need) {
          prefinish(stream, state);
          if (state.pendingcb === 0) {
            state.finished = true;
            stream.emit("finish");
          }
        }
        return need;
      }
      function endWritable(stream, state, cb) {
        state.ending = true;
        finishMaybe(stream, state);
        if (cb) {
          if (state.finished) pna.nextTick(cb); else stream.once("finish", cb);
        }
        state.ended = true;
        stream.writable = false;
      }
      function onCorkedFinish(corkReq, state, err) {
        var entry = corkReq.entry;
        corkReq.entry = null;
        while (entry) {
          var cb = entry.callback;
          state.pendingcb--;
          cb(err);
          entry = entry.next;
        }
        state.corkedRequestsFree.next = corkReq;
      }
      Object.defineProperty(Writable.prototype, "destroyed", {
        get: function() {
          if (this._writableState === undefined) {
            return false;
          }
          return this._writableState.destroyed;
        },
        set: function(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) {
        this.end();
        cb(err);
      };
    },
    6972(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      function _classCallCheck(instance, Constructor) {
        if (!(instance instanceof Constructor)) {
          throw new TypeError("Cannot call a class as a function");
        }
      }
      var Buffer = __webpack_require__(3392).Buffer;
      var util = __webpack_require__(5394);
      function copyBuffer(src, target, offset) {
        src.copy(target, offset);
      }
      module.exports = function() {
        function BufferList() {
          _classCallCheck(this, BufferList);
          this.head = null;
          this.tail = null;
          this.length = 0;
        }
        BufferList.prototype.push = 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;
        };
        BufferList.prototype.unshift = function unshift(v) {
          var entry = {
            data: v,
            next: this.head
          };
          if (this.length === 0) this.tail = entry;
          this.head = entry;
          ++this.length;
        };
        BufferList.prototype.shift = 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;
        };
        BufferList.prototype.clear = function clear() {
          this.head = this.tail = null;
          this.length = 0;
        };
        BufferList.prototype.join = 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;
        };
        BufferList.prototype.concat = function concat(n) {
          if (this.length === 0) return Buffer.alloc(0);
          var ret = Buffer.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;
        };
        return BufferList;
      }();
      if (util && util.inspect && util.inspect.custom) {
        module.exports.prototype[util.inspect.custom] = function() {
          var obj = util.inspect({
            length: this.length
          });
          return this.constructor.name + " " + obj;
        };
      }
    },
    330(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var pna = __webpack_require__(3225);
      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) {
              pna.nextTick(emitErrorNT, this, err);
            } else if (!this._writableState.errorEmitted) {
              this._writableState.errorEmitted = true;
              pna.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(err) {
          if (!cb && err) {
            if (!_this._writableState) {
              pna.nextTick(emitErrorNT, _this, err);
            } else if (!_this._writableState.errorEmitted) {
              _this._writableState.errorEmitted = true;
              pna.nextTick(emitErrorNT, _this, err);
            }
          } else if (cb) {
            cb(err);
          }
        }));
        return this;
      }
      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(self, err) {
        self.emit("error", err);
      }
      module.exports = {
        destroy,
        undestroy
      };
    },
    1667(module, __unused_webpack_exports, __webpack_require__) {
      module.exports = __webpack_require__(7007).EventEmitter;
    },
    3392(module, exports, __webpack_require__) {
      var buffer = __webpack_require__(8287);
      var Buffer = buffer.Buffer;
      function copyProps(src, dst) {
        for (var key in src) {
          dst[key] = src[key];
        }
      }
      if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
        module.exports = buffer;
      } else {
        copyProps(buffer, exports);
        exports.Buffer = SafeBuffer;
      }
      function SafeBuffer(arg, encodingOrOffset, length) {
        return Buffer(arg, encodingOrOffset, length);
      }
      copyProps(Buffer, SafeBuffer);
      SafeBuffer.from = function(arg, encodingOrOffset, length) {
        if (typeof arg === "number") {
          throw new TypeError("Argument must not be a number");
        }
        return Buffer(arg, encodingOrOffset, length);
      };
      SafeBuffer.alloc = function(size, fill, encoding) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        var buf = Buffer(size);
        if (fill !== undefined) {
          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 Buffer(size);
      };
      SafeBuffer.allocUnsafeSlow = function(size) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        return buffer.SlowBuffer(size);
      };
    },
    1077(module, exports, __webpack_require__) {
      exports = module.exports = __webpack_require__(1706);
      exports.Stream = exports;
      exports.Readable = exports;
      exports.Writable = __webpack_require__(2398);
      exports.Duplex = __webpack_require__(308);
      exports.Transform = __webpack_require__(5972);
      exports.PassThrough = __webpack_require__(8158);
    },
    7479(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(6229).Buffer;
      var isEncoding = Buffer.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" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
        return nenc || enc;
      }
      exports.I = 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 = Buffer.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 === undefined) 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(self, buf, i) {
        var j = buf.length - 1;
        if (j < i) return 0;
        var nb = utf8CheckByte(buf[j]);
        if (nb >= 0) {
          if (nb > 0) self.lastNeed = nb - 1;
          return nb;
        }
        if (--j < i || nb === -2) return 0;
        nb = utf8CheckByte(buf[j]);
        if (nb >= 0) {
          if (nb > 0) self.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 self.lastNeed = nb - 3;
          }
          return nb;
        }
        return 0;
      }
      function utf8CheckExtraBytes(self, buf, p) {
        if ((buf[0] & 192) !== 128) {
          self.lastNeed = 0;
          return "�";
        }
        if (self.lastNeed > 1 && buf.length > 1) {
          if ((buf[1] & 192) !== 128) {
            self.lastNeed = 1;
            return "�";
          }
          if (self.lastNeed > 2 && buf.length > 2) {
            if ((buf[2] & 192) !== 128) {
              self.lastNeed = 2;
              return "�";
            }
          }
        }
      }
      function utf8FillLast(buf) {
        var p = this.lastTotal - this.lastNeed;
        var r = utf8CheckExtraBytes(this, buf, p);
        if (r !== undefined) 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) : "";
      }
    },
    6229(module, exports, __webpack_require__) {
      var buffer = __webpack_require__(8287);
      var Buffer = buffer.Buffer;
      function copyProps(src, dst) {
        for (var key in src) {
          dst[key] = src[key];
        }
      }
      if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
        module.exports = buffer;
      } else {
        copyProps(buffer, exports);
        exports.Buffer = SafeBuffer;
      }
      function SafeBuffer(arg, encodingOrOffset, length) {
        return Buffer(arg, encodingOrOffset, length);
      }
      copyProps(Buffer, SafeBuffer);
      SafeBuffer.from = function(arg, encodingOrOffset, length) {
        if (typeof arg === "number") {
          throw new TypeError("Argument must not be a number");
        }
        return Buffer(arg, encodingOrOffset, length);
      };
      SafeBuffer.alloc = function(size, fill, encoding) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        var buf = Buffer(size);
        if (fill !== undefined) {
          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 Buffer(size);
      };
      SafeBuffer.allocUnsafeSlow = function(size) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        return buffer.SlowBuffer(size);
      };
    },
    2861(module, exports, __webpack_require__) {
      var buffer = __webpack_require__(8287);
      var Buffer = buffer.Buffer;
      function copyProps(src, dst) {
        for (var key in src) {
          dst[key] = src[key];
        }
      }
      if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
        module.exports = buffer;
      } else {
        copyProps(buffer, exports);
        exports.Buffer = SafeBuffer;
      }
      function SafeBuffer(arg, encodingOrOffset, length) {
        return Buffer(arg, encodingOrOffset, length);
      }
      SafeBuffer.prototype = Object.create(Buffer.prototype);
      copyProps(Buffer, SafeBuffer);
      SafeBuffer.from = function(arg, encodingOrOffset, length) {
        if (typeof arg === "number") {
          throw new TypeError("Argument must not be a number");
        }
        return Buffer(arg, encodingOrOffset, length);
      };
      SafeBuffer.alloc = function(size, fill, encoding) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        var buf = Buffer(size);
        if (fill !== undefined) {
          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 Buffer(size);
      };
      SafeBuffer.allocUnsafeSlow = function(size) {
        if (typeof size !== "number") {
          throw new TypeError("Argument must be a number");
        }
        return buffer.SlowBuffer(size);
      };
    },
    9983(module) {
      "use strict";
      (function(root) {
        const MAX_VALUE = 2147483647;
        function SHA256(m) {
          const K = new Uint32Array([ 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298 ]);
          let h0 = 1779033703, h1 = 3144134277, h2 = 1013904242, h3 = 2773480762;
          let h4 = 1359893119, h5 = 2600822924, h6 = 528734635, h7 = 1541459225;
          const w = new Uint32Array(64);
          function blocks(p) {
            let off = 0, len = p.length;
            while (len >= 64) {
              let a = h0, b = h1, c = h2, d = h3, e = h4, f = h5, g = h6, h = h7, u, i, j, t1, t2;
              for (i = 0; i < 16; i++) {
                j = off + i * 4;
                w[i] = (p[j] & 255) << 24 | (p[j + 1] & 255) << 16 | (p[j + 2] & 255) << 8 | p[j + 3] & 255;
              }
              for (i = 16; i < 64; i++) {
                u = w[i - 2];
                t1 = (u >>> 17 | u << 32 - 17) ^ (u >>> 19 | u << 32 - 19) ^ u >>> 10;
                u = w[i - 15];
                t2 = (u >>> 7 | u << 32 - 7) ^ (u >>> 18 | u << 32 - 18) ^ u >>> 3;
                w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0) | 0;
              }
              for (i = 0; i < 64; i++) {
                t1 = (((e >>> 6 | e << 32 - 6) ^ (e >>> 11 | e << 32 - 11) ^ (e >>> 25 | e << 32 - 25)) + (e & f ^ ~e & g) | 0) + (h + (K[i] + w[i] | 0) | 0) | 0;
                t2 = ((a >>> 2 | a << 32 - 2) ^ (a >>> 13 | a << 32 - 13) ^ (a >>> 22 | a << 32 - 22)) + (a & b ^ a & c ^ b & c) | 0;
                h = g;
                g = f;
                f = e;
                e = d + t1 | 0;
                d = c;
                c = b;
                b = a;
                a = t1 + t2 | 0;
              }
              h0 = h0 + a | 0;
              h1 = h1 + b | 0;
              h2 = h2 + c | 0;
              h3 = h3 + d | 0;
              h4 = h4 + e | 0;
              h5 = h5 + f | 0;
              h6 = h6 + g | 0;
              h7 = h7 + h | 0;
              off += 64;
              len -= 64;
            }
          }
          blocks(m);
          let i, bytesLeft = m.length % 64, bitLenHi = m.length / 536870912 | 0, bitLenLo = m.length << 3, numZeros = bytesLeft < 56 ? 56 : 120, p = m.slice(m.length - bytesLeft, m.length);
          p.push(128);
          for (i = bytesLeft + 1; i < numZeros; i++) {
            p.push(0);
          }
          p.push(bitLenHi >>> 24 & 255);
          p.push(bitLenHi >>> 16 & 255);
          p.push(bitLenHi >>> 8 & 255);
          p.push(bitLenHi >>> 0 & 255);
          p.push(bitLenLo >>> 24 & 255);
          p.push(bitLenLo >>> 16 & 255);
          p.push(bitLenLo >>> 8 & 255);
          p.push(bitLenLo >>> 0 & 255);
          blocks(p);
          return [ h0 >>> 24 & 255, h0 >>> 16 & 255, h0 >>> 8 & 255, h0 >>> 0 & 255, h1 >>> 24 & 255, h1 >>> 16 & 255, h1 >>> 8 & 255, h1 >>> 0 & 255, h2 >>> 24 & 255, h2 >>> 16 & 255, h2 >>> 8 & 255, h2 >>> 0 & 255, h3 >>> 24 & 255, h3 >>> 16 & 255, h3 >>> 8 & 255, h3 >>> 0 & 255, h4 >>> 24 & 255, h4 >>> 16 & 255, h4 >>> 8 & 255, h4 >>> 0 & 255, h5 >>> 24 & 255, h5 >>> 16 & 255, h5 >>> 8 & 255, h5 >>> 0 & 255, h6 >>> 24 & 255, h6 >>> 16 & 255, h6 >>> 8 & 255, h6 >>> 0 & 255, h7 >>> 24 & 255, h7 >>> 16 & 255, h7 >>> 8 & 255, h7 >>> 0 & 255 ];
        }
        function PBKDF2_HMAC_SHA256_OneIter(password, salt, dkLen) {
          password = password.length <= 64 ? password : SHA256(password);
          const innerLen = 64 + salt.length + 4;
          const inner = new Array(innerLen);
          const outerKey = new Array(64);
          let i;
          let dk = [];
          for (i = 0; i < 64; i++) {
            inner[i] = 54;
          }
          for (i = 0; i < password.length; i++) {
            inner[i] ^= password[i];
          }
          for (i = 0; i < salt.length; i++) {
            inner[64 + i] = salt[i];
          }
          for (i = innerLen - 4; i < innerLen; i++) {
            inner[i] = 0;
          }
          for (i = 0; i < 64; i++) outerKey[i] = 92;
          for (i = 0; i < password.length; i++) outerKey[i] ^= password[i];
          function incrementCounter() {
            for (let i = innerLen - 1; i >= innerLen - 4; i--) {
              inner[i]++;
              if (inner[i] <= 255) return;
              inner[i] = 0;
            }
          }
          while (dkLen >= 32) {
            incrementCounter();
            dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))));
            dkLen -= 32;
          }
          if (dkLen > 0) {
            incrementCounter();
            dk = dk.concat(SHA256(outerKey.concat(SHA256(inner))).slice(0, dkLen));
          }
          return dk;
        }
        function blockmix_salsa8(BY, Yi, r, x, _X) {
          let i;
          arraycopy(BY, (2 * r - 1) * 16, _X, 0, 16);
          for (i = 0; i < 2 * r; i++) {
            blockxor(BY, i * 16, _X, 16);
            salsa20_8(_X, x);
            arraycopy(_X, 0, BY, Yi + i * 16, 16);
          }
          for (i = 0; i < r; i++) {
            arraycopy(BY, Yi + i * 2 * 16, BY, i * 16, 16);
          }
          for (i = 0; i < r; i++) {
            arraycopy(BY, Yi + (i * 2 + 1) * 16, BY, (i + r) * 16, 16);
          }
        }
        function R(a, b) {
          return a << b | a >>> 32 - b;
        }
        function salsa20_8(B, x) {
          arraycopy(B, 0, x, 0, 16);
          for (let i = 8; i > 0; i -= 2) {
            x[4] ^= R(x[0] + x[12], 7);
            x[8] ^= R(x[4] + x[0], 9);
            x[12] ^= R(x[8] + x[4], 13);
            x[0] ^= R(x[12] + x[8], 18);
            x[9] ^= R(x[5] + x[1], 7);
            x[13] ^= R(x[9] + x[5], 9);
            x[1] ^= R(x[13] + x[9], 13);
            x[5] ^= R(x[1] + x[13], 18);
            x[14] ^= R(x[10] + x[6], 7);
            x[2] ^= R(x[14] + x[10], 9);
            x[6] ^= R(x[2] + x[14], 13);
            x[10] ^= R(x[6] + x[2], 18);
            x[3] ^= R(x[15] + x[11], 7);
            x[7] ^= R(x[3] + x[15], 9);
            x[11] ^= R(x[7] + x[3], 13);
            x[15] ^= R(x[11] + x[7], 18);
            x[1] ^= R(x[0] + x[3], 7);
            x[2] ^= R(x[1] + x[0], 9);
            x[3] ^= R(x[2] + x[1], 13);
            x[0] ^= R(x[3] + x[2], 18);
            x[6] ^= R(x[5] + x[4], 7);
            x[7] ^= R(x[6] + x[5], 9);
            x[4] ^= R(x[7] + x[6], 13);
            x[5] ^= R(x[4] + x[7], 18);
            x[11] ^= R(x[10] + x[9], 7);
            x[8] ^= R(x[11] + x[10], 9);
            x[9] ^= R(x[8] + x[11], 13);
            x[10] ^= R(x[9] + x[8], 18);
            x[12] ^= R(x[15] + x[14], 7);
            x[13] ^= R(x[12] + x[15], 9);
            x[14] ^= R(x[13] + x[12], 13);
            x[15] ^= R(x[14] + x[13], 18);
          }
          for (let i = 0; i < 16; ++i) {
            B[i] += x[i];
          }
        }
        function blockxor(S, Si, D, len) {
          for (let i = 0; i < len; i++) {
            D[i] ^= S[Si + i];
          }
        }
        function arraycopy(src, srcPos, dest, destPos, length) {
          while (length--) {
            dest[destPos++] = src[srcPos++];
          }
        }
        function checkBufferish(o) {
          if (!o || typeof o.length !== "number") {
            return false;
          }
          for (let i = 0; i < o.length; i++) {
            const v = o[i];
            if (typeof v !== "number" || v % 1 || v < 0 || v >= 256) {
              return false;
            }
          }
          return true;
        }
        function ensureInteger(value, name) {
          if (typeof value !== "number" || value % 1) {
            throw new Error("invalid " + name);
          }
          return value;
        }
        function _scrypt(password, salt, N, r, p, dkLen, callback) {
          N = ensureInteger(N, "N");
          r = ensureInteger(r, "r");
          p = ensureInteger(p, "p");
          dkLen = ensureInteger(dkLen, "dkLen");
          if (N === 0 || (N & N - 1) !== 0) {
            throw new Error("N must be power of 2");
          }
          if (N > MAX_VALUE / 128 / r) {
            throw new Error("N too large");
          }
          if (r > MAX_VALUE / 128 / p) {
            throw new Error("r too large");
          }
          if (!checkBufferish(password)) {
            throw new Error("password must be an array or buffer");
          }
          password = Array.prototype.slice.call(password);
          if (!checkBufferish(salt)) {
            throw new Error("salt must be an array or buffer");
          }
          salt = Array.prototype.slice.call(salt);
          let b = PBKDF2_HMAC_SHA256_OneIter(password, salt, p * 128 * r);
          const B = new Uint32Array(p * 32 * r);
          for (let i = 0; i < B.length; i++) {
            const j = i * 4;
            B[i] = (b[j + 3] & 255) << 24 | (b[j + 2] & 255) << 16 | (b[j + 1] & 255) << 8 | (b[j + 0] & 255) << 0;
          }
          const XY = new Uint32Array(64 * r);
          const V = new Uint32Array(32 * r * N);
          const Yi = 32 * r;
          const x = new Uint32Array(16);
          const _X = new Uint32Array(16);
          const totalOps = p * N * 2;
          let currentOp = 0;
          let lastPercent10 = null;
          let stop = false;
          let state = 0;
          let i0 = 0, i1;
          let Bi;
          const limit = callback ? parseInt(1e3 / r) : 4294967295;
          const nextTick = typeof setImmediate !== "undefined" ? setImmediate : setTimeout;
          const incrementalSMix = function() {
            if (stop) {
              return callback(new Error("cancelled"), currentOp / totalOps);
            }
            let steps;
            switch (state) {
             case 0:
              Bi = i0 * 32 * r;
              arraycopy(B, Bi, XY, 0, Yi);
              state = 1;
              i1 = 0;

             case 1:
              steps = N - i1;
              if (steps > limit) {
                steps = limit;
              }
              for (let i = 0; i < steps; i++) {
                arraycopy(XY, 0, V, (i1 + i) * Yi, Yi);
                blockmix_salsa8(XY, Yi, r, x, _X);
              }
              i1 += steps;
              currentOp += steps;
              if (callback) {
                const percent10 = parseInt(1e3 * currentOp / totalOps);
                if (percent10 !== lastPercent10) {
                  stop = callback(null, currentOp / totalOps);
                  if (stop) {
                    break;
                  }
                  lastPercent10 = percent10;
                }
              }
              if (i1 < N) {
                break;
              }
              i1 = 0;
              state = 2;

             case 2:
              steps = N - i1;
              if (steps > limit) {
                steps = limit;
              }
              for (let i = 0; i < steps; i++) {
                const offset = (2 * r - 1) * 16;
                const j = XY[offset] & N - 1;
                blockxor(V, j * Yi, XY, Yi);
                blockmix_salsa8(XY, Yi, r, x, _X);
              }
              i1 += steps;
              currentOp += steps;
              if (callback) {
                const percent10 = parseInt(1e3 * currentOp / totalOps);
                if (percent10 !== lastPercent10) {
                  stop = callback(null, currentOp / totalOps);
                  if (stop) {
                    break;
                  }
                  lastPercent10 = percent10;
                }
              }
              if (i1 < N) {
                break;
              }
              arraycopy(XY, 0, B, Bi, Yi);
              i0++;
              if (i0 < p) {
                state = 0;
                break;
              }
              b = [];
              for (let i = 0; i < B.length; i++) {
                b.push(B[i] >> 0 & 255);
                b.push(B[i] >> 8 & 255);
                b.push(B[i] >> 16 & 255);
                b.push(B[i] >> 24 & 255);
              }
              const derivedKey = PBKDF2_HMAC_SHA256_OneIter(password, b, dkLen);
              if (callback) {
                callback(null, 1, derivedKey);
              }
              return derivedKey;
            }
            if (callback) {
              nextTick(incrementalSMix);
            }
          };
          if (!callback) {
            while (true) {
              const derivedKey = incrementalSMix();
              if (derivedKey != undefined) {
                return derivedKey;
              }
            }
          }
          incrementalSMix();
        }
        const lib = {
          scrypt: function(password, salt, N, r, p, dkLen, progressCallback) {
            return new Promise((function(resolve, reject) {
              let lastProgress = 0;
              if (progressCallback) {
                progressCallback(0);
              }
              _scrypt(password, salt, N, r, p, dkLen, (function(error, progress, key) {
                if (error) {
                  reject(error);
                } else if (key) {
                  if (progressCallback && lastProgress !== 1) {
                    progressCallback(1);
                  }
                  resolve(new Uint8Array(key));
                } else if (progressCallback && progress !== lastProgress) {
                  lastProgress = progress;
                  return progressCallback(progress);
                }
              }));
            }));
          },
          syncScrypt: function(password, salt, N, r, p, dkLen) {
            return new Uint8Array(_scrypt(password, salt, N, r, p, dkLen));
          }
        };
        if (true) {
          module.exports = lib;
        } else {}
      })(this);
    },
    6897(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var GetIntrinsic = __webpack_require__(453);
      var define = __webpack_require__(41);
      var hasDescriptors = __webpack_require__(592)();
      var gOPD = __webpack_require__(5795);
      var $TypeError = __webpack_require__(9675);
      var $floor = GetIntrinsic("%Math.floor%");
      module.exports = function setFunctionLength(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) {
            define(fn, "length", length, true, true);
          } else {
            define(fn, "length", length);
          }
        }
        return fn;
      };
    },
    392(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var toBuffer = __webpack_require__(5377);
      function Hash(blockSize, finalSize) {
        this._block = Buffer.alloc(blockSize);
        this._finalSize = finalSize;
        this._blockSize = blockSize;
        this._len = 0;
      }
      Hash.prototype.update = function(data, enc) {
        data = toBuffer(data, enc || "utf8");
        var block = this._block;
        var blockSize = this._blockSize;
        var length = data.length;
        var accum = this._len;
        for (var offset = 0; offset < length; ) {
          var assigned = accum % blockSize;
          var remainder = Math.min(length - offset, blockSize - assigned);
          for (var i = 0; i < remainder; i++) {
            block[assigned + i] = data[offset + i];
          }
          accum += remainder;
          offset += remainder;
          if (accum % blockSize === 0) {
            this._update(block);
          }
        }
        this._len += length;
        return this;
      };
      Hash.prototype.digest = function(enc) {
        var rem = this._len % this._blockSize;
        this._block[rem] = 128;
        this._block.fill(0, rem + 1);
        if (rem >= this._finalSize) {
          this._update(this._block);
          this._block.fill(0);
        }
        var bits = this._len * 8;
        if (bits <= 4294967295) {
          this._block.writeUInt32BE(bits, this._blockSize - 4);
        } else {
          var lowBits = (bits & 4294967295) >>> 0;
          var highBits = (bits - lowBits) / 4294967296;
          this._block.writeUInt32BE(highBits, this._blockSize - 8);
          this._block.writeUInt32BE(lowBits, this._blockSize - 4);
        }
        this._update(this._block);
        var hash = this._hash();
        return enc ? hash.toString(enc) : hash;
      };
      Hash.prototype._update = function() {
        throw new Error("_update must be implemented by subclass");
      };
      module.exports = Hash;
    },
    2802(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      module.exports = function SHA(algorithm) {
        var alg = algorithm.toLowerCase();
        var Algorithm = module.exports[alg];
        if (!Algorithm) {
          throw new Error(alg + " is not supported (we accept pull requests)");
        }
        return new Algorithm;
      };
      module.exports.sha = __webpack_require__(7816);
      module.exports.sha1 = __webpack_require__(3737);
      module.exports.sha224 = __webpack_require__(6710);
      module.exports.sha256 = __webpack_require__(4107);
      module.exports.sha384 = __webpack_require__(2827);
      module.exports.sha512 = __webpack_require__(2890);
    },
    7816(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var Hash = __webpack_require__(392);
      var Buffer = __webpack_require__(2861).Buffer;
      var K = [ 1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0 ];
      var W = new Array(80);
      function Sha() {
        this.init();
        this._w = W;
        Hash.call(this, 64, 56);
      }
      inherits(Sha, Hash);
      Sha.prototype.init = function() {
        this._a = 1732584193;
        this._b = 4023233417;
        this._c = 2562383102;
        this._d = 271733878;
        this._e = 3285377520;
        return this;
      };
      function rotl5(num) {
        return num << 5 | num >>> 27;
      }
      function rotl30(num) {
        return num << 30 | num >>> 2;
      }
      function ft(s, b, c, d) {
        if (s === 0) {
          return b & c | ~b & d;
        }
        if (s === 2) {
          return b & c | b & d | c & d;
        }
        return b ^ c ^ d;
      }
      Sha.prototype._update = function(M) {
        var w = this._w;
        var a = this._a | 0;
        var b = this._b | 0;
        var c = this._c | 0;
        var d = this._d | 0;
        var e = this._e | 0;
        for (var i = 0; i < 16; ++i) {
          w[i] = M.readInt32BE(i * 4);
        }
        for (;i < 80; ++i) {
          w[i] = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16];
        }
        for (var j = 0; j < 80; ++j) {
          var s = ~~(j / 20);
          var t = rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s] | 0;
          e = d;
          d = c;
          c = rotl30(b);
          b = a;
          a = t;
        }
        this._a = a + this._a | 0;
        this._b = b + this._b | 0;
        this._c = c + this._c | 0;
        this._d = d + this._d | 0;
        this._e = e + this._e | 0;
      };
      Sha.prototype._hash = function() {
        var H = Buffer.allocUnsafe(20);
        H.writeInt32BE(this._a | 0, 0);
        H.writeInt32BE(this._b | 0, 4);
        H.writeInt32BE(this._c | 0, 8);
        H.writeInt32BE(this._d | 0, 12);
        H.writeInt32BE(this._e | 0, 16);
        return H;
      };
      module.exports = Sha;
    },
    3737(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var Hash = __webpack_require__(392);
      var Buffer = __webpack_require__(2861).Buffer;
      var K = [ 1518500249, 1859775393, 2400959708 | 0, 3395469782 | 0 ];
      var W = new Array(80);
      function Sha1() {
        this.init();
        this._w = W;
        Hash.call(this, 64, 56);
      }
      inherits(Sha1, Hash);
      Sha1.prototype.init = function() {
        this._a = 1732584193;
        this._b = 4023233417;
        this._c = 2562383102;
        this._d = 271733878;
        this._e = 3285377520;
        return this;
      };
      function rotl1(num) {
        return num << 1 | num >>> 31;
      }
      function rotl5(num) {
        return num << 5 | num >>> 27;
      }
      function rotl30(num) {
        return num << 30 | num >>> 2;
      }
      function ft(s, b, c, d) {
        if (s === 0) {
          return b & c | ~b & d;
        }
        if (s === 2) {
          return b & c | b & d | c & d;
        }
        return b ^ c ^ d;
      }
      Sha1.prototype._update = function(M) {
        var w = this._w;
        var a = this._a | 0;
        var b = this._b | 0;
        var c = this._c | 0;
        var d = this._d | 0;
        var e = this._e | 0;
        for (var i = 0; i < 16; ++i) {
          w[i] = M.readInt32BE(i * 4);
        }
        for (;i < 80; ++i) {
          w[i] = rotl1(w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]);
        }
        for (var j = 0; j < 80; ++j) {
          var s = ~~(j / 20);
          var t = rotl5(a) + ft(s, b, c, d) + e + w[j] + K[s] | 0;
          e = d;
          d = c;
          c = rotl30(b);
          b = a;
          a = t;
        }
        this._a = a + this._a | 0;
        this._b = b + this._b | 0;
        this._c = c + this._c | 0;
        this._d = d + this._d | 0;
        this._e = e + this._e | 0;
      };
      Sha1.prototype._hash = function() {
        var H = Buffer.allocUnsafe(20);
        H.writeInt32BE(this._a | 0, 0);
        H.writeInt32BE(this._b | 0, 4);
        H.writeInt32BE(this._c | 0, 8);
        H.writeInt32BE(this._d | 0, 12);
        H.writeInt32BE(this._e | 0, 16);
        return H;
      };
      module.exports = Sha1;
    },
    6710(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var Sha256 = __webpack_require__(4107);
      var Hash = __webpack_require__(392);
      var Buffer = __webpack_require__(2861).Buffer;
      var W = new Array(64);
      function Sha224() {
        this.init();
        this._w = W;
        Hash.call(this, 64, 56);
      }
      inherits(Sha224, Sha256);
      Sha224.prototype.init = function() {
        this._a = 3238371032;
        this._b = 914150663;
        this._c = 812702999;
        this._d = 4144912697;
        this._e = 4290775857;
        this._f = 1750603025;
        this._g = 1694076839;
        this._h = 3204075428;
        return this;
      };
      Sha224.prototype._hash = function() {
        var H = Buffer.allocUnsafe(28);
        H.writeInt32BE(this._a, 0);
        H.writeInt32BE(this._b, 4);
        H.writeInt32BE(this._c, 8);
        H.writeInt32BE(this._d, 12);
        H.writeInt32BE(this._e, 16);
        H.writeInt32BE(this._f, 20);
        H.writeInt32BE(this._g, 24);
        return H;
      };
      module.exports = Sha224;
    },
    4107(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var Hash = __webpack_require__(392);
      var Buffer = __webpack_require__(2861).Buffer;
      var K = [ 1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298 ];
      var W = new Array(64);
      function Sha256() {
        this.init();
        this._w = W;
        Hash.call(this, 64, 56);
      }
      inherits(Sha256, Hash);
      Sha256.prototype.init = function() {
        this._a = 1779033703;
        this._b = 3144134277;
        this._c = 1013904242;
        this._d = 2773480762;
        this._e = 1359893119;
        this._f = 2600822924;
        this._g = 528734635;
        this._h = 1541459225;
        return this;
      };
      function ch(x, y, z) {
        return z ^ x & (y ^ z);
      }
      function maj(x, y, z) {
        return x & y | z & (x | y);
      }
      function sigma0(x) {
        return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10);
      }
      function sigma1(x) {
        return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7);
      }
      function gamma0(x) {
        return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ x >>> 3;
      }
      function gamma1(x) {
        return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ x >>> 10;
      }
      Sha256.prototype._update = function(M) {
        var w = this._w;
        var a = this._a | 0;
        var b = this._b | 0;
        var c = this._c | 0;
        var d = this._d | 0;
        var e = this._e | 0;
        var f = this._f | 0;
        var g = this._g | 0;
        var h = this._h | 0;
        for (var i = 0; i < 16; ++i) {
          w[i] = M.readInt32BE(i * 4);
        }
        for (;i < 64; ++i) {
          w[i] = gamma1(w[i - 2]) + w[i - 7] + gamma0(w[i - 15]) + w[i - 16] | 0;
        }
        for (var j = 0; j < 64; ++j) {
          var T1 = h + sigma1(e) + ch(e, f, g) + K[j] + w[j] | 0;
          var T2 = sigma0(a) + maj(a, b, c) | 0;
          h = g;
          g = f;
          f = e;
          e = d + T1 | 0;
          d = c;
          c = b;
          b = a;
          a = T1 + T2 | 0;
        }
        this._a = a + this._a | 0;
        this._b = b + this._b | 0;
        this._c = c + this._c | 0;
        this._d = d + this._d | 0;
        this._e = e + this._e | 0;
        this._f = f + this._f | 0;
        this._g = g + this._g | 0;
        this._h = h + this._h | 0;
      };
      Sha256.prototype._hash = function() {
        var H = Buffer.allocUnsafe(32);
        H.writeInt32BE(this._a, 0);
        H.writeInt32BE(this._b, 4);
        H.writeInt32BE(this._c, 8);
        H.writeInt32BE(this._d, 12);
        H.writeInt32BE(this._e, 16);
        H.writeInt32BE(this._f, 20);
        H.writeInt32BE(this._g, 24);
        H.writeInt32BE(this._h, 28);
        return H;
      };
      module.exports = Sha256;
    },
    2827(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var SHA512 = __webpack_require__(2890);
      var Hash = __webpack_require__(392);
      var Buffer = __webpack_require__(2861).Buffer;
      var W = new Array(160);
      function Sha384() {
        this.init();
        this._w = W;
        Hash.call(this, 128, 112);
      }
      inherits(Sha384, SHA512);
      Sha384.prototype.init = function() {
        this._ah = 3418070365;
        this._bh = 1654270250;
        this._ch = 2438529370;
        this._dh = 355462360;
        this._eh = 1731405415;
        this._fh = 2394180231;
        this._gh = 3675008525;
        this._hh = 1203062813;
        this._al = 3238371032;
        this._bl = 914150663;
        this._cl = 812702999;
        this._dl = 4144912697;
        this._el = 4290775857;
        this._fl = 1750603025;
        this._gl = 1694076839;
        this._hl = 3204075428;
        return this;
      };
      Sha384.prototype._hash = function() {
        var H = Buffer.allocUnsafe(48);
        function writeInt64BE(h, l, offset) {
          H.writeInt32BE(h, offset);
          H.writeInt32BE(l, offset + 4);
        }
        writeInt64BE(this._ah, this._al, 0);
        writeInt64BE(this._bh, this._bl, 8);
        writeInt64BE(this._ch, this._cl, 16);
        writeInt64BE(this._dh, this._dl, 24);
        writeInt64BE(this._eh, this._el, 32);
        writeInt64BE(this._fh, this._fl, 40);
        return H;
      };
      module.exports = Sha384;
    },
    2890(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var inherits = __webpack_require__(6698);
      var Hash = __webpack_require__(392);
      var Buffer = __webpack_require__(2861).Buffer;
      var K = [ 1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591 ];
      var W = new Array(160);
      function Sha512() {
        this.init();
        this._w = W;
        Hash.call(this, 128, 112);
      }
      inherits(Sha512, Hash);
      Sha512.prototype.init = function() {
        this._ah = 1779033703;
        this._bh = 3144134277;
        this._ch = 1013904242;
        this._dh = 2773480762;
        this._eh = 1359893119;
        this._fh = 2600822924;
        this._gh = 528734635;
        this._hh = 1541459225;
        this._al = 4089235720;
        this._bl = 2227873595;
        this._cl = 4271175723;
        this._dl = 1595750129;
        this._el = 2917565137;
        this._fl = 725511199;
        this._gl = 4215389547;
        this._hl = 327033209;
        return this;
      };
      function Ch(x, y, z) {
        return z ^ x & (y ^ z);
      }
      function maj(x, y, z) {
        return x & y | z & (x | y);
      }
      function sigma0(x, xl) {
        return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25);
      }
      function sigma1(x, xl) {
        return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23);
      }
      function Gamma0(x, xl) {
        return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ x >>> 7;
      }
      function Gamma0l(x, xl) {
        return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25);
      }
      function Gamma1(x, xl) {
        return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ x >>> 6;
      }
      function Gamma1l(x, xl) {
        return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26);
      }
      function getCarry(a, b) {
        return a >>> 0 < b >>> 0 ? 1 : 0;
      }
      Sha512.prototype._update = function(M) {
        var w = this._w;
        var ah = this._ah | 0;
        var bh = this._bh | 0;
        var ch = this._ch | 0;
        var dh = this._dh | 0;
        var eh = this._eh | 0;
        var fh = this._fh | 0;
        var gh = this._gh | 0;
        var hh = this._hh | 0;
        var al = this._al | 0;
        var bl = this._bl | 0;
        var cl = this._cl | 0;
        var dl = this._dl | 0;
        var el = this._el | 0;
        var fl = this._fl | 0;
        var gl = this._gl | 0;
        var hl = this._hl | 0;
        for (var i = 0; i < 32; i += 2) {
          w[i] = M.readInt32BE(i * 4);
          w[i + 1] = M.readInt32BE(i * 4 + 4);
        }
        for (;i < 160; i += 2) {
          var xh = w[i - 15 * 2];
          var xl = w[i - 15 * 2 + 1];
          var gamma0 = Gamma0(xh, xl);
          var gamma0l = Gamma0l(xl, xh);
          xh = w[i - 2 * 2];
          xl = w[i - 2 * 2 + 1];
          var gamma1 = Gamma1(xh, xl);
          var gamma1l = Gamma1l(xl, xh);
          var Wi7h = w[i - 7 * 2];
          var Wi7l = w[i - 7 * 2 + 1];
          var Wi16h = w[i - 16 * 2];
          var Wi16l = w[i - 16 * 2 + 1];
          var Wil = gamma0l + Wi7l | 0;
          var Wih = gamma0 + Wi7h + getCarry(Wil, gamma0l) | 0;
          Wil = Wil + gamma1l | 0;
          Wih = Wih + gamma1 + getCarry(Wil, gamma1l) | 0;
          Wil = Wil + Wi16l | 0;
          Wih = Wih + Wi16h + getCarry(Wil, Wi16l) | 0;
          w[i] = Wih;
          w[i + 1] = Wil;
        }
        for (var j = 0; j < 160; j += 2) {
          Wih = w[j];
          Wil = w[j + 1];
          var majh = maj(ah, bh, ch);
          var majl = maj(al, bl, cl);
          var sigma0h = sigma0(ah, al);
          var sigma0l = sigma0(al, ah);
          var sigma1h = sigma1(eh, el);
          var sigma1l = sigma1(el, eh);
          var Kih = K[j];
          var Kil = K[j + 1];
          var chh = Ch(eh, fh, gh);
          var chl = Ch(el, fl, gl);
          var t1l = hl + sigma1l | 0;
          var t1h = hh + sigma1h + getCarry(t1l, hl) | 0;
          t1l = t1l + chl | 0;
          t1h = t1h + chh + getCarry(t1l, chl) | 0;
          t1l = t1l + Kil | 0;
          t1h = t1h + Kih + getCarry(t1l, Kil) | 0;
          t1l = t1l + Wil | 0;
          t1h = t1h + Wih + getCarry(t1l, Wil) | 0;
          var t2l = sigma0l + majl | 0;
          var t2h = sigma0h + majh + getCarry(t2l, sigma0l) | 0;
          hh = gh;
          hl = gl;
          gh = fh;
          gl = fl;
          fh = eh;
          fl = el;
          el = dl + t1l | 0;
          eh = dh + t1h + getCarry(el, dl) | 0;
          dh = ch;
          dl = cl;
          ch = bh;
          cl = bl;
          bh = ah;
          bl = al;
          al = t1l + t2l | 0;
          ah = t1h + t2h + getCarry(al, t1l) | 0;
        }
        this._al = this._al + al | 0;
        this._bl = this._bl + bl | 0;
        this._cl = this._cl + cl | 0;
        this._dl = this._dl + dl | 0;
        this._el = this._el + el | 0;
        this._fl = this._fl + fl | 0;
        this._gl = this._gl + gl | 0;
        this._hl = this._hl + hl | 0;
        this._ah = this._ah + ah + getCarry(this._al, al) | 0;
        this._bh = this._bh + bh + getCarry(this._bl, bl) | 0;
        this._ch = this._ch + ch + getCarry(this._cl, cl) | 0;
        this._dh = this._dh + dh + getCarry(this._dl, dl) | 0;
        this._eh = this._eh + eh + getCarry(this._el, el) | 0;
        this._fh = this._fh + fh + getCarry(this._fl, fl) | 0;
        this._gh = this._gh + gh + getCarry(this._gl, gl) | 0;
        this._hh = this._hh + hh + getCarry(this._hl, hl) | 0;
      };
      Sha512.prototype._hash = function() {
        var H = Buffer.allocUnsafe(64);
        function writeInt64BE(h, l, offset) {
          H.writeInt32BE(h, offset);
          H.writeInt32BE(l, offset + 4);
        }
        writeInt64BE(this._ah, this._al, 0);
        writeInt64BE(this._bh, this._bl, 8);
        writeInt64BE(this._ch, this._cl, 16);
        writeInt64BE(this._dh, this._dl, 24);
        writeInt64BE(this._eh, this._el, 32);
        writeInt64BE(this._fh, this._fl, 40);
        writeInt64BE(this._gh, this._gl, 48);
        writeInt64BE(this._hh, this._hl, 56);
        return H;
      };
      module.exports = Sha512;
    },
    8310(module, __unused_webpack_exports, __webpack_require__) {
      module.exports = Stream;
      var EE = __webpack_require__(7007).EventEmitter;
      var inherits = __webpack_require__(6698);
      inherits(Stream, EE);
      Stream.Readable = __webpack_require__(5412);
      Stream.Writable = __webpack_require__(6708);
      Stream.Duplex = __webpack_require__(5382);
      Stream.Transform = __webpack_require__(4610);
      Stream.PassThrough = __webpack_require__(3600);
      Stream.finished = __webpack_require__(6238);
      Stream.pipeline = __webpack_require__(7758);
      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;
      };
    },
    3141(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var isEncoding = Buffer.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" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
        return nenc || enc;
      }
      exports.I = 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 = Buffer.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 === undefined) 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(self, buf, i) {
        var j = buf.length - 1;
        if (j < i) return 0;
        var nb = utf8CheckByte(buf[j]);
        if (nb >= 0) {
          if (nb > 0) self.lastNeed = nb - 1;
          return nb;
        }
        if (--j < i || nb === -2) return 0;
        nb = utf8CheckByte(buf[j]);
        if (nb >= 0) {
          if (nb > 0) self.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 self.lastNeed = nb - 3;
          }
          return nb;
        }
        return 0;
      }
      function utf8CheckExtraBytes(self, buf, p) {
        if ((buf[0] & 192) !== 128) {
          self.lastNeed = 0;
          return "�";
        }
        if (self.lastNeed > 1 && buf.length > 1) {
          if ((buf[1] & 192) !== 128) {
            self.lastNeed = 1;
            return "�";
          }
          if (self.lastNeed > 2 && buf.length > 2) {
            if ((buf[2] & 192) !== 128) {
              self.lastNeed = 2;
              return "�";
            }
          }
        }
      }
      function utf8FillLast(buf) {
        var p = this.lastTotal - this.lastNeed;
        var r = utf8CheckExtraBytes(this, buf, p);
        if (r !== undefined) 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) : "";
      }
    },
    5377(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var Buffer = __webpack_require__(2861).Buffer;
      var isArray = __webpack_require__(4634);
      var typedArrayBuffer = __webpack_require__(4372);
      var isView = ArrayBuffer.isView || function isView(obj) {
        try {
          typedArrayBuffer(obj);
          return true;
        } catch (e) {
          return false;
        }
      };
      var useUint8Array = typeof Uint8Array !== "undefined";
      var useArrayBuffer = typeof ArrayBuffer !== "undefined" && typeof Uint8Array !== "undefined";
      var useFromArrayBuffer = useArrayBuffer && (Buffer.prototype instanceof Uint8Array || Buffer.TYPED_ARRAY_SUPPORT);
      module.exports = function toBuffer(data, encoding) {
        if (Buffer.isBuffer(data)) {
          if (data.constructor && !("isBuffer" in data)) {
            return Buffer.from(data);
          }
          return data;
        }
        if (typeof data === "string") {
          return Buffer.from(data, encoding);
        }
        if (useArrayBuffer && isView(data)) {
          if (data.byteLength === 0) {
            return Buffer.alloc(0);
          }
          if (useFromArrayBuffer) {
            var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength);
            if (res.byteLength === data.byteLength) {
              return res;
            }
          }
          var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
          var result = Buffer.from(uint8);
          if (result.length === data.byteLength) {
            return result;
          }
        }
        if (useUint8Array && data instanceof Uint8Array) {
          return Buffer.from(data);
        }
        var isArr = isArray(data);
        if (isArr) {
          for (var i = 0; i < data.length; i += 1) {
            var x = data[i];
            if (typeof x !== "number" || x < 0 || x > 255 || ~~x !== x) {
              throw new RangeError("Array items must be numbers in the range 0-255.");
            }
          }
        }
        if (isArr || Buffer.isBuffer(data) && data.constructor && typeof data.constructor.isBuffer === "function" && data.constructor.isBuffer(data)) {
          return Buffer.from(data);
        }
        throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.');
      };
    },
    4372(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var $TypeError = __webpack_require__(9675);
      var callBound = __webpack_require__(6556);
      var $typedArrayBuffer = callBound("TypedArray.prototype.buffer", true);
      var isTypedArray = __webpack_require__(5680);
      module.exports = $typedArrayBuffer || function typedArrayBuffer(x) {
        if (!isTypedArray(x)) {
          throw new $TypeError("Not a Typed Array");
        }
        return x.buffer;
      };
    },
    4643(module, __unused_webpack_exports, __webpack_require__) {
      module.exports = 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 (!__webpack_require__.g.localStorage) return false;
        } catch (_) {
          return false;
        }
        var val = __webpack_require__.g.localStorage[name];
        if (null == val) return false;
        return String(val).toLowerCase() === "true";
      }
    },
    3988(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports["default"] = void 0;
      var _default = exports["default"] = function _default(aliases) {
        return function() {
          return function(next) {
            return function(action) {
              var alias = aliases[action.type];
              if (alias) {
                return next(alias(action));
              }
              return next(action);
            };
          };
        };
      };
    },
    9529(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.STATE_TYPE = exports.PATCH_STATE_TYPE = exports.FETCH_STATE_TYPE = exports.DISPATCH_TYPE = exports.DEFAULT_CHANNEL_NAME = void 0;
      var DISPATCH_TYPE = exports.DISPATCH_TYPE = "webext.dispatch";
      var FETCH_STATE_TYPE = exports.FETCH_STATE_TYPE = "webext.fetch_state";
      var STATE_TYPE = exports.STATE_TYPE = "webext.state";
      var PATCH_STATE_TYPE = exports.PATCH_STATE_TYPE = "webext.patch_state";
      var DEFAULT_CHANNEL_NAME = exports.DEFAULT_CHANNEL_NAME = "webext.channel";
    },
    3207(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      var __webpack_unused_export__;
      __webpack_unused_export__ = {
        value: true
      };
      __webpack_unused_export__ = {
        enumerable: true,
        get: function get() {
          return _Store["default"];
        }
      };
      Object.defineProperty(exports, "nK", {
        enumerable: true,
        get: function get() {
          return _alias["default"];
        }
      });
      __webpack_unused_export__ = {
        enumerable: true,
        get: function get() {
          return _applyMiddleware["default"];
        }
      };
      Object.defineProperty(exports, "Iq", {
        enumerable: true,
        get: function get() {
          return _wrapStore["default"];
        }
      });
      var _Store = _interopRequireDefault(__webpack_require__(1732));
      var _applyMiddleware = _interopRequireDefault(__webpack_require__(9449));
      var _wrapStore = _interopRequireDefault(__webpack_require__(6745));
      var _alias = _interopRequireDefault(__webpack_require__(3988));
      function _interopRequireDefault(e) {
        return e && e.__esModule ? e : {
          default: e
        };
      }
    },
    8571(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.createDeferredListener = void 0;
      var createDeferredListener = exports.createDeferredListener = function createDeferredListener(filter) {
        var resolve = function resolve() {};
        var fnPromise = new Promise((function(resolve_) {
          return resolve = resolve_;
        }));
        var listener = function listener(message, sender, sendResponse) {
          if (!filter(message, sender, sendResponse)) {
            return;
          }
          fnPromise.then((function(fn) {
            fn(message, sender, sendResponse);
          }));
          return true;
        };
        return {
          setListener: resolve,
          listener
        };
      };
    },
    7575(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.withSerializer = exports.withDeserializer = exports.noop = void 0;
      function _typeof(o) {
        "@babel/helpers - typeof";
        return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
          return typeof o;
        } : function(o) {
          return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
        }, _typeof(o);
      }
      function ownKeys(e, r) {
        var t = Object.keys(e);
        if (Object.getOwnPropertySymbols) {
          var o = Object.getOwnPropertySymbols(e);
          r && (o = o.filter((function(r) {
            return Object.getOwnPropertyDescriptor(e, r).enumerable;
          }))), t.push.apply(t, o);
        }
        return t;
      }
      function _objectSpread(e) {
        for (var r = 1; r < arguments.length; r++) {
          var t = null != arguments[r] ? arguments[r] : {};
          r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
            _defineProperty(e, r, t[r]);
          })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
            Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
          }));
        }
        return e;
      }
      function _defineProperty(e, r, t) {
        return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
          value: t,
          enumerable: !0,
          configurable: !0,
          writable: !0
        }) : e[r] = t, e;
      }
      function _toPropertyKey(t) {
        var i = _toPrimitive(t, "string");
        return "symbol" == _typeof(i) ? i : i + "";
      }
      function _toPrimitive(t, r) {
        if ("object" != _typeof(t) || !t) return t;
        var e = t[Symbol.toPrimitive];
        if (void 0 !== e) {
          var i = e.call(t, r || "default");
          if ("object" != _typeof(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === r ? String : Number)(t);
      }
      var noop = exports.noop = function noop(payload) {
        return payload;
      };
      var transformPayload = function transformPayload(message) {
        var transformer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
        return _objectSpread(_objectSpread({}, message), message.payload ? {
          payload: transformer(message.payload)
        } : {});
      };
      var deserializeListener = function deserializeListener(listener) {
        var deserializer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
        var shouldDeserialize = arguments.length > 2 ? arguments[2] : undefined;
        if (shouldDeserialize) {
          return function(message) {
            for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
              args[_key - 1] = arguments[_key];
            }
            if (shouldDeserialize.apply(void 0, [ message ].concat(args))) {
              return listener.apply(void 0, [ transformPayload(message, deserializer) ].concat(args));
            }
            return listener.apply(void 0, [ message ].concat(args));
          };
        }
        return function(message) {
          for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
            args[_key2 - 1] = arguments[_key2];
          }
          return listener.apply(void 0, [ transformPayload(message, deserializer) ].concat(args));
        };
      };
      var withDeserializer = exports.withDeserializer = function withDeserializer() {
        var deserializer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;
        return function(addListenerFn) {
          return function(listener, shouldDeserialize) {
            return addListenerFn(deserializeListener(listener, deserializer, shouldDeserialize));
          };
        };
      };
      var withSerializer = exports.withSerializer = function withSerializer() {
        var serializer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;
        return function(sendMessageFn) {
          var messageArgIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
          return function() {
            for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
              args[_key3] = arguments[_key3];
            }
            if (args.length <= messageArgIndex) {
              throw new Error("Message in request could not be serialized. " + "Expected message in position ".concat(messageArgIndex, " but only received ").concat(args.length, " args."));
            }
            args[messageArgIndex] = transformPayload(args[messageArgIndex], serializer);
            return sendMessageFn.apply(void 0, args);
          };
        };
      };
    },
    1732(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports["default"] = void 0;
      var _lodash = _interopRequireDefault(__webpack_require__(368));
      var _constants = __webpack_require__(9529);
      var _serialization = __webpack_require__(7575);
      var _patch = _interopRequireDefault(__webpack_require__(3807));
      var _util = __webpack_require__(6183);
      function _interopRequireDefault(e) {
        return e && e.__esModule ? e : {
          default: e
        };
      }
      function _typeof(o) {
        "@babel/helpers - typeof";
        return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
          return typeof o;
        } : function(o) {
          return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
        }, _typeof(o);
      }
      function _classCallCheck(a, n) {
        if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
      }
      function _defineProperties(e, r) {
        for (var t = 0; t < r.length; t++) {
          var o = r[t];
          o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), 
          Object.defineProperty(e, _toPropertyKey(o.key), o);
        }
      }
      function _createClass(e, r, t) {
        return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
          writable: !1
        }), e;
      }
      function _toPropertyKey(t) {
        var i = _toPrimitive(t, "string");
        return "symbol" == _typeof(i) ? i : i + "";
      }
      function _toPrimitive(t, r) {
        if ("object" != _typeof(t) || !t) return t;
        var e = t[Symbol.toPrimitive];
        if (void 0 !== e) {
          var i = e.call(t, r || "default");
          if ("object" != _typeof(i)) return i;
          throw new TypeError("@@toPrimitive must return a primitive value.");
        }
        return ("string" === r ? String : Number)(t);
      }
      var backgroundErrPrefix = "\nLooks like there is an error in the background page. " + "You might want to inspect your background page for more details.\n";
      var defaultOpts = {
        channelName: _constants.DEFAULT_CHANNEL_NAME,
        state: {},
        serializer: _serialization.noop,
        deserializer: _serialization.noop,
        patchStrategy: _patch["default"]
      };
      var Store = function() {
        function Store() {
          var _this = this;
          var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultOpts, _ref$channelName = _ref.channelName, channelName = _ref$channelName === void 0 ? defaultOpts.channelName : _ref$channelName, _ref$state = _ref.state, state = _ref$state === void 0 ? defaultOpts.state : _ref$state, _ref$serializer = _ref.serializer, serializer = _ref$serializer === void 0 ? defaultOpts.serializer : _ref$serializer, _ref$deserializer = _ref.deserializer, deserializer = _ref$deserializer === void 0 ? defaultOpts.deserializer : _ref$deserializer, _ref$patchStrategy = _ref.patchStrategy, patchStrategy = _ref$patchStrategy === void 0 ? defaultOpts.patchStrategy : _ref$patchStrategy;
          _classCallCheck(this, Store);
          if (!channelName) {
            throw new Error("channelName is required in options");
          }
          if (typeof serializer !== "function") {
            throw new Error("serializer must be a function");
          }
          if (typeof deserializer !== "function") {
            throw new Error("deserializer must be a function");
          }
          if (typeof patchStrategy !== "function") {
            throw new Error("patchStrategy must be one of the included patching strategies or a custom patching function");
          }
          this.channelName = channelName;
          this.readyResolved = false;
          this.readyPromise = new Promise((function(resolve) {
            return _this.readyResolve = resolve;
          }));
          this.browserAPI = (0, _util.getBrowserAPI)();
          this.initializeStore = this.initializeStore.bind(this);
          this.browserAPI.runtime.sendMessage({
            type: _constants.FETCH_STATE_TYPE,
            channelName
          }, undefined, this.initializeStore);
          this.deserializer = deserializer;
          this.serializedPortListener = (0, _serialization.withDeserializer)(deserializer)((function() {
            var _this$browserAPI$runt;
            return (_this$browserAPI$runt = _this.browserAPI.runtime.onMessage).addListener.apply(_this$browserAPI$runt, arguments);
          }));
          this.serializedMessageSender = (0, _serialization.withSerializer)(serializer)((function() {
            var _this$browserAPI$runt2;
            return (_this$browserAPI$runt2 = _this.browserAPI.runtime).sendMessage.apply(_this$browserAPI$runt2, arguments);
          }));
          this.listeners = [];
          this.state = state;
          this.patchStrategy = patchStrategy;
          var shouldDeserialize = function shouldDeserialize(message) {
            return Boolean(message) && typeof message.type === "string" && message.channelName === _this.channelName;
          };
          this.serializedPortListener((function(message) {
            if (!message || message.channelName !== _this.channelName) {
              return;
            }
            switch (message.type) {
             case _constants.STATE_TYPE:
              _this.replaceState(message.payload);
              if (!_this.readyResolved) {
                _this.readyResolved = true;
                _this.readyResolve();
              }
              break;

             case _constants.PATCH_STATE_TYPE:
              _this.patchState(message.payload);
              break;

             default:
            }
          }), shouldDeserialize);
          this.dispatch = this.dispatch.bind(this);
          this.getState = this.getState.bind(this);
          this.subscribe = this.subscribe.bind(this);
        }
        return _createClass(Store, [ {
          key: "ready",
          value: function ready() {
            var cb = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
            if (cb !== null) {
              return this.readyPromise.then(cb);
            }
            return this.readyPromise;
          }
        }, {
          key: "subscribe",
          value: function subscribe(listener) {
            var _this2 = this;
            this.listeners.push(listener);
            return function() {
              _this2.listeners = _this2.listeners.filter((function(l) {
                return l !== listener;
              }));
            };
          }
        }, {
          key: "patchState",
          value: function patchState(difference) {
            if (!this.readyResolved) {
              return;
            }
            this.state = this.patchStrategy(this.state, difference);
            this.listeners.forEach((function(l) {
              return l();
            }));
          }
        }, {
          key: "replaceState",
          value: function replaceState(state) {
            this.state = state;
            this.listeners.forEach((function(l) {
              return l();
            }));
          }
        }, {
          key: "getState",
          value: function getState() {
            return this.state;
          }
        }, {
          key: "replaceReducer",
          value: function replaceReducer() {
            return;
          }
        }, {
          key: "dispatch",
          value: function dispatch(data) {
            var _this3 = this;
            return new Promise((function(resolve, reject) {
              _this3.serializedMessageSender({
                type: _constants.DISPATCH_TYPE,
                channelName: _this3.channelName,
                payload: data
              }, null, (function(resp) {
                if (!resp) {
                  var _error = _this3.browserAPI.runtime.lastError;
                  var bgErr = new Error("".concat(backgroundErrPrefix).concat(_error));
                  reject((0, _lodash["default"])(bgErr, _error));
                  return;
                }
                var error = resp.error;
                var value = resp.value;
                if (typeof _this3.deserializer !== "undefined") {
                  try {
                    value = _this3.deserializer(value);
                  } catch (error) {}
                }
                if (error) {
                  var _bgErr = new Error("".concat(backgroundErrPrefix).concat(error));
                  reject((0, _lodash["default"])(_bgErr, error));
                } else {
                  resolve(value && value.payload);
                }
              }));
            }));
          }
        }, {
          key: "initializeStore",
          value: function initializeStore(message) {
            if (message && message.type === _constants.FETCH_STATE_TYPE) {
              this.replaceState(this.deserializer(message.payload));
              if (!this.readyResolved) {
                this.readyResolved = true;
                this.readyResolve();
              }
            }
          }
        } ]);
      }();
      var _default = exports["default"] = Store;
    },
    9449(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports["default"] = applyMiddleware;
      function _toConsumableArray(r) {
        return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
      }
      function _nonIterableSpread() {
        throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
      }
      function _unsupportedIterableToArray(r, a) {
        if (r) {
          if ("string" == typeof r) return _arrayLikeToArray(r, a);
          var t = {}.toString.call(r).slice(8, -1);
          return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
        }
      }
      function _iterableToArray(r) {
        if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
      }
      function _arrayWithoutHoles(r) {
        if (Array.isArray(r)) return _arrayLikeToArray(r);
      }
      function _arrayLikeToArray(r, a) {
        (null == a || a > r.length) && (a = r.length);
        for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
        return n;
      }
      function compose() {
        for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
          funcs[_key] = arguments[_key];
        }
        if (funcs.length === 0) {
          return function(arg) {
            return arg;
          };
        }
        if (funcs.length === 1) {
          return funcs[0];
        }
        return funcs.reduce((function(a, b) {
          return function() {
            return a(b.apply(void 0, arguments));
          };
        }));
      }
      function applyMiddleware(store) {
        for (var _len2 = arguments.length, middlewares = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
          middlewares[_key2 - 1] = arguments[_key2];
        }
        var _dispatch = function dispatch() {
          throw new Error("Dispatching while constructing your middleware is not allowed. " + "Other middleware would not be applied to this dispatch.");
        };
        var middlewareAPI = {
          getState: store.getState.bind(store),
          dispatch: function dispatch() {
            return _dispatch.apply(void 0, arguments);
          }
        };
        middlewares = (middlewares || []).map((function(middleware) {
          return middleware(middlewareAPI);
        }));
        _dispatch = compose.apply(void 0, _toConsumableArray(middlewares))(store.dispatch);
        store.dispatch = _dispatch;
        return store;
      }
    },
    140(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.DIFF_STATUS_UPDATED = exports.DIFF_STATUS_REMOVED = exports.DIFF_STATUS_KEYS_UPDATED = exports.DIFF_STATUS_ARRAY_UPDATED = void 0;
      var DIFF_STATUS_UPDATED = exports.DIFF_STATUS_UPDATED = "updated";
      var DIFF_STATUS_REMOVED = exports.DIFF_STATUS_REMOVED = "removed";
      var DIFF_STATUS_KEYS_UPDATED = exports.DIFF_STATUS_KEYS_UPDATED = "updated_keys";
      var DIFF_STATUS_ARRAY_UPDATED = exports.DIFF_STATUS_ARRAY_UPDATED = "updated_array";
    },
    8642(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports["default"] = shallowDiff;
      var _constants = __webpack_require__(140);
      function shallowDiff(oldObj, newObj) {
        var difference = [];
        Object.keys(newObj).forEach((function(key) {
          if (oldObj[key] !== newObj[key]) {
            difference.push({
              key,
              value: newObj[key],
              change: _constants.DIFF_STATUS_UPDATED
            });
          }
        }));
        Object.keys(oldObj).forEach((function(key) {
          if (!newObj.hasOwnProperty(key)) {
            difference.push({
              key,
              change: _constants.DIFF_STATUS_REMOVED
            });
          }
        }));
        return difference;
      }
    },
    3807(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports["default"] = _default;
      var _constants = __webpack_require__(140);
      function _default(obj, difference) {
        var newObj = Object.assign({}, obj);
        difference.forEach((function(_ref) {
          var change = _ref.change, key = _ref.key, value = _ref.value;
          switch (change) {
           case _constants.DIFF_STATUS_UPDATED:
            newObj[key] = value;
            break;

           case _constants.DIFF_STATUS_REMOVED:
            Reflect.deleteProperty(newObj, key);
            break;

           default:
          }
        }));
        return newObj;
      }
    },
    6183(__unused_webpack_module, exports) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports.getBrowserAPI = getBrowserAPI;
      function getBrowserAPI() {
        var api;
        try {
          api = self.chrome || self.browser || browser;
        } catch (error) {
          api = browser;
        }
        if (!api) {
          throw new Error("Browser API is not present");
        }
        return api;
      }
    },
    6745(__unused_webpack_module, exports, __webpack_require__) {
      "use strict";
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
      exports["default"] = void 0;
      var _constants = __webpack_require__(9529);
      var _serialization = __webpack_require__(7575);
      var _util = __webpack_require__(6183);
      var _diff = _interopRequireDefault(__webpack_require__(8642));
      var _listener = __webpack_require__(8571);
      function _interopRequireDefault(e) {
        return e && e.__esModule ? e : {
          default: e
        };
      }
      function _createForOfIteratorHelper(r, e) {
        var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
        if (!t) {
          if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
            t && (r = t);
            var _n = 0, F = function F() {};
            return {
              s: F,
              n: function n() {
                return _n >= r.length ? {
                  done: !0
                } : {
                  done: !1,
                  value: r[_n++]
                };
              },
              e: function e(r) {
                throw r;
              },
              f: F
            };
          }
          throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }
        var o, a = !0, u = !1;
        return {
          s: function s() {
            t = t.call(r);
          },
          n: function n() {
            var r = t.next();
            return a = r.done, r;
          },
          e: function e(r) {
            u = !0, o = r;
          },
          f: function f() {
            try {
              a || null == t["return"] || t["return"]();
            } finally {
              if (u) throw o;
            }
          }
        };
      }
      function _unsupportedIterableToArray(r, a) {
        if (r) {
          if ("string" == typeof r) return _arrayLikeToArray(r, a);
          var t = {}.toString.call(r).slice(8, -1);
          return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
        }
      }
      function _arrayLikeToArray(r, a) {
        (null == a || a > r.length) && (a = r.length);
        for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
        return n;
      }
      var promiseResponder = function promiseResponder(dispatchResult, send) {
        Promise.resolve(dispatchResult).then((function(res) {
          send({
            error: null,
            value: res
          });
        }))["catch"]((function(err) {
          console.error("error dispatching result:", err);
          send({
            error: err.message,
            value: null
          });
        }));
      };
      var defaultOpts = {
        channelName: _constants.DEFAULT_CHANNEL_NAME,
        dispatchResponder: promiseResponder,
        serializer: _serialization.noop,
        deserializer: _serialization.noop,
        diffStrategy: _diff["default"]
      };
      var _default = exports["default"] = function _default() {
        var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultOpts, _ref$channelName = _ref.channelName, channelName = _ref$channelName === void 0 ? defaultOpts.channelName : _ref$channelName;
        var browserAPI = (0, _util.getBrowserAPI)();
        var filterStateMessages = function filterStateMessages(message) {
          return message.type === _constants.FETCH_STATE_TYPE && message.channelName === channelName;
        };
        var filterActionMessages = function filterActionMessages(message) {
          return message.type === _constants.DISPATCH_TYPE && message.channelName === channelName;
        };
        var stateProviderListener = (0, _listener.createDeferredListener)(filterStateMessages);
        var actionListener = (0, _listener.createDeferredListener)(filterActionMessages);
        browserAPI.runtime.onMessage.addListener(stateProviderListener.listener);
        browserAPI.runtime.onMessage.addListener(actionListener.listener);
        return function(store) {
          var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultOpts, _ref2$dispatchRespond = _ref2.dispatchResponder, dispatchResponder = _ref2$dispatchRespond === void 0 ? defaultOpts.dispatchResponder : _ref2$dispatchRespond, _ref2$serializer = _ref2.serializer, serializer = _ref2$serializer === void 0 ? defaultOpts.serializer : _ref2$serializer, _ref2$deserializer = _ref2.deserializer, deserializer = _ref2$deserializer === void 0 ? defaultOpts.deserializer : _ref2$deserializer, _ref2$diffStrategy = _ref2.diffStrategy, diffStrategy = _ref2$diffStrategy === void 0 ? defaultOpts.diffStrategy : _ref2$diffStrategy;
          if (typeof serializer !== "function") {
            throw new Error("serializer must be a function");
          }
          if (typeof deserializer !== "function") {
            throw new Error("deserializer must be a function");
          }
          if (typeof diffStrategy !== "function") {
            throw new Error("diffStrategy must be one of the included diffing strategies or a custom diff function");
          }
          var dispatchResponse = function dispatchResponse(request, sender, sendResponse) {
            var action = Object.assign({}, request.payload, {
              _sender: sender
            });
            var dispatchResult = null;
            try {
              dispatchResult = store.dispatch(action);
            } catch (e) {
              dispatchResult = Promise.reject(e.message);
              console.error(e);
            }
            dispatchResponder(dispatchResult, sendResponse);
          };
          var serializedMessagePoster = (0, _serialization.withSerializer)(serializer)((function() {
            var _browserAPI$runtime;
            for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
              args[_key] = arguments[_key];
            }
            var onErrorCallback = function onErrorCallback() {
              if (browserAPI.runtime.lastError) {}
            };
            (_browserAPI$runtime = browserAPI.runtime).sendMessage.apply(_browserAPI$runtime, args.concat([ onErrorCallback ]));
            return browserAPI.tabs.query({}, (function(tabs) {
              var _iterator = _createForOfIteratorHelper(tabs), _step;
              try {
                for (_iterator.s(); !(_step = _iterator.n()).done; ) {
                  var _browserAPI$tabs;
                  var tab = _step.value;
                  (_browserAPI$tabs = browserAPI.tabs).sendMessage.apply(_browserAPI$tabs, [ tab.id ].concat(args, [ onErrorCallback ]));
                }
              } catch (err) {
                _iterator.e(err);
              } finally {
                _iterator.f();
              }
            }));
          }));
          var currentState = store.getState();
          var forceUpdate = function forceUpdate(newState, diff) {
            currentState = newState;
            serializedMessagePoster({
              type: _constants.PATCH_STATE_TYPE,
              payload: diff,
              channelName
            });
          };
          var patchState = function patchState() {
            var newState = store.getState();
            var diff = diffStrategy(currentState, newState, forceUpdate);
            if (diff.length) {
              currentState = newState;
              serializedMessagePoster({
                type: _constants.PATCH_STATE_TYPE,
                payload: diff,
                channelName
              });
            }
          };
          store.subscribe(patchState);
          serializedMessagePoster({
            type: _constants.STATE_TYPE,
            payload: currentState,
            channelName
          });
          stateProviderListener.setListener((function(request, sender, sendResponse) {
            var state = store.getState();
            sendResponse({
              type: _constants.FETCH_STATE_TYPE,
              payload: serializer(state)
            });
          }));
          var withPayloadDeserializer = (0, _serialization.withDeserializer)(deserializer);
          withPayloadDeserializer(actionListener.setListener)(dispatchResponse, filterActionMessages);
        };
      };
    },
    6815(module, exports) {
      var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;
      (function(global, factory) {
        if (true) {
          !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ module ], __WEBPACK_AMD_DEFINE_FACTORY__ = factory, 
          __WEBPACK_AMD_DEFINE_RESULT__ = typeof __WEBPACK_AMD_DEFINE_FACTORY__ === "function" ? __WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__) : __WEBPACK_AMD_DEFINE_FACTORY__, 
          __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
        } else {
          var mod;
        }
      })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, (function(module) {
        "use strict";
        if (!(globalThis.chrome && globalThis.chrome.runtime && globalThis.chrome.runtime.id)) {
          throw new Error("This script should only be loaded in a browser extension.");
        }
        if (!(globalThis.browser && globalThis.browser.runtime && globalThis.browser.runtime.id)) {
          const CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE = "The message port closed before a response was received.";
          const wrapAPIs = extensionAPIs => {
            const apiMetadata = {
              alarms: {
                clear: {
                  minArgs: 0,
                  maxArgs: 1
                },
                clearAll: {
                  minArgs: 0,
                  maxArgs: 0
                },
                get: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getAll: {
                  minArgs: 0,
                  maxArgs: 0
                }
              },
              bookmarks: {
                create: {
                  minArgs: 1,
                  maxArgs: 1
                },
                get: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getChildren: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getRecent: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getSubTree: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getTree: {
                  minArgs: 0,
                  maxArgs: 0
                },
                move: {
                  minArgs: 2,
                  maxArgs: 2
                },
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeTree: {
                  minArgs: 1,
                  maxArgs: 1
                },
                search: {
                  minArgs: 1,
                  maxArgs: 1
                },
                update: {
                  minArgs: 2,
                  maxArgs: 2
                }
              },
              browserAction: {
                disable: {
                  minArgs: 0,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                enable: {
                  minArgs: 0,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                getBadgeBackgroundColor: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getBadgeText: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getPopup: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getTitle: {
                  minArgs: 1,
                  maxArgs: 1
                },
                openPopup: {
                  minArgs: 0,
                  maxArgs: 0
                },
                setBadgeBackgroundColor: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                setBadgeText: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                setIcon: {
                  minArgs: 1,
                  maxArgs: 1
                },
                setPopup: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                setTitle: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                }
              },
              browsingData: {
                remove: {
                  minArgs: 2,
                  maxArgs: 2
                },
                removeCache: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeCookies: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeDownloads: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeFormData: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeHistory: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeLocalStorage: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removePasswords: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removePluginData: {
                  minArgs: 1,
                  maxArgs: 1
                },
                settings: {
                  minArgs: 0,
                  maxArgs: 0
                }
              },
              commands: {
                getAll: {
                  minArgs: 0,
                  maxArgs: 0
                }
              },
              contextMenus: {
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeAll: {
                  minArgs: 0,
                  maxArgs: 0
                },
                update: {
                  minArgs: 2,
                  maxArgs: 2
                }
              },
              cookies: {
                get: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getAll: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getAllCookieStores: {
                  minArgs: 0,
                  maxArgs: 0
                },
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                set: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              devtools: {
                inspectedWindow: {
                  eval: {
                    minArgs: 1,
                    maxArgs: 2,
                    singleCallbackArg: false
                  }
                },
                panels: {
                  create: {
                    minArgs: 3,
                    maxArgs: 3,
                    singleCallbackArg: true
                  },
                  elements: {
                    createSidebarPane: {
                      minArgs: 1,
                      maxArgs: 1
                    }
                  }
                }
              },
              downloads: {
                cancel: {
                  minArgs: 1,
                  maxArgs: 1
                },
                download: {
                  minArgs: 1,
                  maxArgs: 1
                },
                erase: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getFileIcon: {
                  minArgs: 1,
                  maxArgs: 2
                },
                open: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                pause: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeFile: {
                  minArgs: 1,
                  maxArgs: 1
                },
                resume: {
                  minArgs: 1,
                  maxArgs: 1
                },
                search: {
                  minArgs: 1,
                  maxArgs: 1
                },
                show: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                }
              },
              extension: {
                isAllowedFileSchemeAccess: {
                  minArgs: 0,
                  maxArgs: 0
                },
                isAllowedIncognitoAccess: {
                  minArgs: 0,
                  maxArgs: 0
                }
              },
              history: {
                addUrl: {
                  minArgs: 1,
                  maxArgs: 1
                },
                deleteAll: {
                  minArgs: 0,
                  maxArgs: 0
                },
                deleteRange: {
                  minArgs: 1,
                  maxArgs: 1
                },
                deleteUrl: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getVisits: {
                  minArgs: 1,
                  maxArgs: 1
                },
                search: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              i18n: {
                detectLanguage: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getAcceptLanguages: {
                  minArgs: 0,
                  maxArgs: 0
                }
              },
              identity: {
                launchWebAuthFlow: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              idle: {
                queryState: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              management: {
                get: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getAll: {
                  minArgs: 0,
                  maxArgs: 0
                },
                getSelf: {
                  minArgs: 0,
                  maxArgs: 0
                },
                setEnabled: {
                  minArgs: 2,
                  maxArgs: 2
                },
                uninstallSelf: {
                  minArgs: 0,
                  maxArgs: 1
                }
              },
              notifications: {
                clear: {
                  minArgs: 1,
                  maxArgs: 1
                },
                create: {
                  minArgs: 1,
                  maxArgs: 2
                },
                getAll: {
                  minArgs: 0,
                  maxArgs: 0
                },
                getPermissionLevel: {
                  minArgs: 0,
                  maxArgs: 0
                },
                update: {
                  minArgs: 2,
                  maxArgs: 2
                }
              },
              pageAction: {
                getPopup: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getTitle: {
                  minArgs: 1,
                  maxArgs: 1
                },
                hide: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                setIcon: {
                  minArgs: 1,
                  maxArgs: 1
                },
                setPopup: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                setTitle: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                },
                show: {
                  minArgs: 1,
                  maxArgs: 1,
                  fallbackToNoCallback: true
                }
              },
              permissions: {
                contains: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getAll: {
                  minArgs: 0,
                  maxArgs: 0
                },
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                request: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              runtime: {
                getBackgroundPage: {
                  minArgs: 0,
                  maxArgs: 0
                },
                getPlatformInfo: {
                  minArgs: 0,
                  maxArgs: 0
                },
                openOptionsPage: {
                  minArgs: 0,
                  maxArgs: 0
                },
                requestUpdateCheck: {
                  minArgs: 0,
                  maxArgs: 0
                },
                sendMessage: {
                  minArgs: 1,
                  maxArgs: 3
                },
                sendNativeMessage: {
                  minArgs: 2,
                  maxArgs: 2
                },
                setUninstallURL: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              sessions: {
                getDevices: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getRecentlyClosed: {
                  minArgs: 0,
                  maxArgs: 1
                },
                restore: {
                  minArgs: 0,
                  maxArgs: 1
                }
              },
              storage: {
                local: {
                  clear: {
                    minArgs: 0,
                    maxArgs: 0
                  },
                  get: {
                    minArgs: 0,
                    maxArgs: 1
                  },
                  getBytesInUse: {
                    minArgs: 0,
                    maxArgs: 1
                  },
                  remove: {
                    minArgs: 1,
                    maxArgs: 1
                  },
                  set: {
                    minArgs: 1,
                    maxArgs: 1
                  }
                },
                managed: {
                  get: {
                    minArgs: 0,
                    maxArgs: 1
                  },
                  getBytesInUse: {
                    minArgs: 0,
                    maxArgs: 1
                  }
                },
                sync: {
                  clear: {
                    minArgs: 0,
                    maxArgs: 0
                  },
                  get: {
                    minArgs: 0,
                    maxArgs: 1
                  },
                  getBytesInUse: {
                    minArgs: 0,
                    maxArgs: 1
                  },
                  remove: {
                    minArgs: 1,
                    maxArgs: 1
                  },
                  set: {
                    minArgs: 1,
                    maxArgs: 1
                  }
                }
              },
              tabs: {
                captureVisibleTab: {
                  minArgs: 0,
                  maxArgs: 2
                },
                create: {
                  minArgs: 1,
                  maxArgs: 1
                },
                detectLanguage: {
                  minArgs: 0,
                  maxArgs: 1
                },
                discard: {
                  minArgs: 0,
                  maxArgs: 1
                },
                duplicate: {
                  minArgs: 1,
                  maxArgs: 1
                },
                executeScript: {
                  minArgs: 1,
                  maxArgs: 2
                },
                get: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getCurrent: {
                  minArgs: 0,
                  maxArgs: 0
                },
                getZoom: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getZoomSettings: {
                  minArgs: 0,
                  maxArgs: 1
                },
                goBack: {
                  minArgs: 0,
                  maxArgs: 1
                },
                goForward: {
                  minArgs: 0,
                  maxArgs: 1
                },
                highlight: {
                  minArgs: 1,
                  maxArgs: 1
                },
                insertCSS: {
                  minArgs: 1,
                  maxArgs: 2
                },
                move: {
                  minArgs: 2,
                  maxArgs: 2
                },
                query: {
                  minArgs: 1,
                  maxArgs: 1
                },
                reload: {
                  minArgs: 0,
                  maxArgs: 2
                },
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                removeCSS: {
                  minArgs: 1,
                  maxArgs: 2
                },
                sendMessage: {
                  minArgs: 2,
                  maxArgs: 3
                },
                setZoom: {
                  minArgs: 1,
                  maxArgs: 2
                },
                setZoomSettings: {
                  minArgs: 1,
                  maxArgs: 2
                },
                update: {
                  minArgs: 1,
                  maxArgs: 2
                }
              },
              topSites: {
                get: {
                  minArgs: 0,
                  maxArgs: 0
                }
              },
              webNavigation: {
                getAllFrames: {
                  minArgs: 1,
                  maxArgs: 1
                },
                getFrame: {
                  minArgs: 1,
                  maxArgs: 1
                }
              },
              webRequest: {
                handlerBehaviorChanged: {
                  minArgs: 0,
                  maxArgs: 0
                }
              },
              windows: {
                create: {
                  minArgs: 0,
                  maxArgs: 1
                },
                get: {
                  minArgs: 1,
                  maxArgs: 2
                },
                getAll: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getCurrent: {
                  minArgs: 0,
                  maxArgs: 1
                },
                getLastFocused: {
                  minArgs: 0,
                  maxArgs: 1
                },
                remove: {
                  minArgs: 1,
                  maxArgs: 1
                },
                update: {
                  minArgs: 2,
                  maxArgs: 2
                }
              }
            };
            if (Object.keys(apiMetadata).length === 0) {
              throw new Error("api-metadata.json has not been included in browser-polyfill");
            }
            class DefaultWeakMap extends WeakMap {
              constructor(createItem, items = undefined) {
                super(items);
                this.createItem = createItem;
              }
              get(key) {
                if (!this.has(key)) {
                  this.set(key, this.createItem(key));
                }
                return super.get(key);
              }
            }
            const isThenable = value => value && typeof value === "object" && typeof value.then === "function";
            const makeCallback = (promise, metadata) => (...callbackArgs) => {
              if (extensionAPIs.runtime.lastError) {
                promise.reject(new Error(extensionAPIs.runtime.lastError.message));
              } else if (metadata.singleCallbackArg || callbackArgs.length <= 1 && metadata.singleCallbackArg !== false) {
                promise.resolve(callbackArgs[0]);
              } else {
                promise.resolve(callbackArgs);
              }
            };
            const pluralizeArguments = numArgs => numArgs == 1 ? "argument" : "arguments";
            const wrapAsyncFunction = (name, metadata) => function asyncFunctionWrapper(target, ...args) {
              if (args.length < metadata.minArgs) {
                throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
              }
              if (args.length > metadata.maxArgs) {
                throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
              }
              return new Promise(((resolve, reject) => {
                if (metadata.fallbackToNoCallback) {
                  try {
                    target[name](...args, makeCallback({
                      resolve,
                      reject
                    }, metadata));
                  } catch (cbError) {
                    console.warn(`${name} API method doesn't seem to support the callback parameter, ` + "falling back to call it without a callback: ", cbError);
                    target[name](...args);
                    metadata.fallbackToNoCallback = false;
                    metadata.noCallback = true;
                    resolve();
                  }
                } else if (metadata.noCallback) {
                  target[name](...args);
                  resolve();
                } else {
                  target[name](...args, makeCallback({
                    resolve,
                    reject
                  }, metadata));
                }
              }));
            };
            const wrapMethod = (target, method, wrapper) => new Proxy(method, {
              apply(targetMethod, thisObj, args) {
                return wrapper.call(thisObj, target, ...args);
              }
            });
            let hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
            const wrapObject = (target, wrappers = {}, metadata = {}) => {
              let cache = Object.create(null);
              let handlers = {
                has(proxyTarget, prop) {
                  return prop in target || prop in cache;
                },
                get(proxyTarget, prop, receiver) {
                  if (prop in cache) {
                    return cache[prop];
                  }
                  if (!(prop in target)) {
                    return undefined;
                  }
                  let value = target[prop];
                  if (typeof value === "function") {
                    if (typeof wrappers[prop] === "function") {
                      value = wrapMethod(target, target[prop], wrappers[prop]);
                    } else if (hasOwnProperty(metadata, prop)) {
                      let wrapper = wrapAsyncFunction(prop, metadata[prop]);
                      value = wrapMethod(target, target[prop], wrapper);
                    } else {
                      value = value.bind(target);
                    }
                  } else if (typeof value === "object" && value !== null && (hasOwnProperty(wrappers, prop) || hasOwnProperty(metadata, prop))) {
                    value = wrapObject(value, wrappers[prop], metadata[prop]);
                  } else if (hasOwnProperty(metadata, "*")) {
                    value = wrapObject(value, wrappers[prop], metadata["*"]);
                  } else {
                    Object.defineProperty(cache, prop, {
                      configurable: true,
                      enumerable: true,
                      get() {
                        return target[prop];
                      },
                      set(value) {
                        target[prop] = value;
                      }
                    });
                    return value;
                  }
                  cache[prop] = value;
                  return value;
                },
                set(proxyTarget, prop, value, receiver) {
                  if (prop in cache) {
                    cache[prop] = value;
                  } else {
                    target[prop] = value;
                  }
                  return true;
                },
                defineProperty(proxyTarget, prop, desc) {
                  return Reflect.defineProperty(cache, prop, desc);
                },
                deleteProperty(proxyTarget, prop) {
                  return Reflect.deleteProperty(cache, prop);
                }
              };
              let proxyTarget = Object.create(target);
              return new Proxy(proxyTarget, handlers);
            };
            const wrapEvent = wrapperMap => ({
              addListener(target, listener, ...args) {
                target.addListener(wrapperMap.get(listener), ...args);
              },
              hasListener(target, listener) {
                return target.hasListener(wrapperMap.get(listener));
              },
              removeListener(target, listener) {
                target.removeListener(wrapperMap.get(listener));
              }
            });
            const onRequestFinishedWrappers = new DefaultWeakMap((listener => {
              if (typeof listener !== "function") {
                return listener;
              }
              return function onRequestFinished(req) {
                const wrappedReq = wrapObject(req, {}, {
                  getContent: {
                    minArgs: 0,
                    maxArgs: 0
                  }
                });
                listener(wrappedReq);
              };
            }));
            const onMessageWrappers = new DefaultWeakMap((listener => {
              if (typeof listener !== "function") {
                return listener;
              }
              return function onMessage(message, sender, sendResponse) {
                let didCallSendResponse = false;
                let wrappedSendResponse;
                let sendResponsePromise = new Promise((resolve => {
                  wrappedSendResponse = function(response) {
                    didCallSendResponse = true;
                    resolve(response);
                  };
                }));
                let result;
                try {
                  result = listener(message, sender, wrappedSendResponse);
                } catch (err) {
                  result = Promise.reject(err);
                }
                const isResultThenable = result !== true && isThenable(result);
                if (result !== true && !isResultThenable && !didCallSendResponse) {
                  return false;
                }
                const sendPromisedResult = promise => {
                  promise.then((msg => {
                    sendResponse(msg);
                  }), (error => {
                    let message;
                    if (error && (error instanceof Error || typeof error.message === "string")) {
                      message = error.message;
                    } else {
                      message = "An unexpected error occurred";
                    }
                    sendResponse({
                      __mozWebExtensionPolyfillReject__: true,
                      message
                    });
                  })).catch((err => {
                    console.error("Failed to send onMessage rejected reply", err);
                  }));
                };
                if (isResultThenable) {
                  sendPromisedResult(result);
                } else {
                  sendPromisedResult(sendResponsePromise);
                }
                return true;
              };
            }));
            const wrappedSendMessageCallback = ({reject, resolve}, reply) => {
              if (extensionAPIs.runtime.lastError) {
                if (extensionAPIs.runtime.lastError.message === CHROME_SEND_MESSAGE_CALLBACK_NO_RESPONSE_MESSAGE) {
                  resolve();
                } else {
                  reject(new Error(extensionAPIs.runtime.lastError.message));
                }
              } else if (reply && reply.__mozWebExtensionPolyfillReject__) {
                reject(new Error(reply.message));
              } else {
                resolve(reply);
              }
            };
            const wrappedSendMessage = (name, metadata, apiNamespaceObj, ...args) => {
              if (args.length < metadata.minArgs) {
                throw new Error(`Expected at least ${metadata.minArgs} ${pluralizeArguments(metadata.minArgs)} for ${name}(), got ${args.length}`);
              }
              if (args.length > metadata.maxArgs) {
                throw new Error(`Expected at most ${metadata.maxArgs} ${pluralizeArguments(metadata.maxArgs)} for ${name}(), got ${args.length}`);
              }
              return new Promise(((resolve, reject) => {
                const wrappedCb = wrappedSendMessageCallback.bind(null, {
                  resolve,
                  reject
                });
                args.push(wrappedCb);
                apiNamespaceObj.sendMessage(...args);
              }));
            };
            const staticWrappers = {
              devtools: {
                network: {
                  onRequestFinished: wrapEvent(onRequestFinishedWrappers)
                }
              },
              runtime: {
                onMessage: wrapEvent(onMessageWrappers),
                onMessageExternal: wrapEvent(onMessageWrappers),
                sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
                  minArgs: 1,
                  maxArgs: 3
                })
              },
              tabs: {
                sendMessage: wrappedSendMessage.bind(null, "sendMessage", {
                  minArgs: 2,
                  maxArgs: 3
                })
              }
            };
            const settingMetadata = {
              clear: {
                minArgs: 1,
                maxArgs: 1
              },
              get: {
                minArgs: 1,
                maxArgs: 1
              },
              set: {
                minArgs: 1,
                maxArgs: 1
              }
            };
            apiMetadata.privacy = {
              network: {
                "*": settingMetadata
              },
              services: {
                "*": settingMetadata
              },
              websites: {
                "*": settingMetadata
              }
            };
            return wrapObject(extensionAPIs, staticWrappers, apiMetadata);
          };
          module.exports = wrapAPIs(chrome);
        } else {
          module.exports = globalThis.browser;
        }
      }));
    },
    5767(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var forEach = __webpack_require__(2682);
      var availableTypedArrays = __webpack_require__(9209);
      var callBind = __webpack_require__(487);
      var callBound = __webpack_require__(6556);
      var gOPD = __webpack_require__(5795);
      var getProto = __webpack_require__(3628);
      var $toString = callBound("Object.prototype.toString");
      var hasToStringTag = __webpack_require__(9092)();
      var g = typeof globalThis === "undefined" ? __webpack_require__.g : globalThis;
      var typedArrays = availableTypedArrays();
      var $slice = callBound("String.prototype.slice");
      var $indexOf = callBound("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 && getProto) {
        forEach(typedArrays, (function(typedArray) {
          var arr = new g[typedArray];
          if (Symbol.toStringTag in arr && getProto) {
            var proto = getProto(arr);
            var descriptor = gOPD(proto, Symbol.toStringTag);
            if (!descriptor && proto) {
              var superProto = getProto(proto);
              descriptor = gOPD(superProto, Symbol.toStringTag);
            }
            cache["$" + typedArray] = callBind(descriptor.get);
          }
        }));
      } else {
        forEach(typedArrays, (function(typedArray) {
          var arr = new g[typedArray];
          var fn = arr.slice || arr.set;
          if (fn) {
            cache["$" + typedArray] = callBind(fn);
          }
        }));
      }
      var tryTypedArrays = function tryAllTypedArrays(value) {
        var found = false;
        forEach(cache, (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(cache, (function(getter, name) {
          if (!found) {
            try {
              getter(value);
              found = $slice(name, 1);
            } catch (e) {}
          }
        }));
        return found;
      };
      module.exports = function whichTypedArray(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);
      };
    },
    2789() {},
    4049() {},
    8982() {},
    7790() {},
    1395() {},
    1638() {},
    2668() {},
    7965() {},
    6089() {},
    9368() {},
    4688() {},
    1069() {},
    5340() {},
    9838() {},
    5394() {},
    5248() {},
    9209(module, __unused_webpack_exports, __webpack_require__) {
      "use strict";
      var possibleNames = __webpack_require__(6578);
      var g = typeof globalThis === "undefined" ? __webpack_require__.g : globalThis;
      module.exports = function availableTypedArrays() {
        var out = [];
        for (var i = 0; i < possibleNames.length; i++) {
          if (typeof g[possibleNames[i]] === "function") {
            out[out.length] = possibleNames[i];
          }
        }
        return out;
      };
    },
    3219(module) {
      "use strict";
      module.exports = JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}');
    },
    2951(module) {
      "use strict";
      module.exports = JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}');
    },
    4589(module) {
      "use strict";
      module.exports = JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}');
    },
    3241(module) {
      "use strict";
      module.exports = JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}');
    },
    1636(module) {
      "use strict";
      module.exports = {
        rE: "6.6.1"
      };
    },
    5579(module) {
      "use strict";
      module.exports = JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}');
    }
  };
  var __webpack_module_cache__ = {};
  function __webpack_require__(moduleId) {
    var cachedModule = __webpack_module_cache__[moduleId];
    if (cachedModule !== undefined) {
      return cachedModule.exports;
    }
    var module = __webpack_module_cache__[moduleId] = {
      id: moduleId,
      loaded: false,
      exports: {}
    };
    __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
    module.loaded = true;
    return module.exports;
  }
  (() => {
    __webpack_require__.amdO = {};
  })();
  (() => {
    __webpack_require__.n = module => {
      var getter = module && module.__esModule ? () => module["default"] : () => module;
      __webpack_require__.d(getter, {
        a: getter
      });
      return getter;
    };
  })();
  (() => {
    __webpack_require__.d = (exports, definition) => {
      for (var key in definition) {
        if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
          Object.defineProperty(exports, key, {
            enumerable: true,
            get: definition[key]
          });
        }
      }
    };
  })();
  (() => {
    __webpack_require__.g = function() {
      if (typeof globalThis === "object") return globalThis;
      try {
        return this || new Function("return this")();
      } catch (e) {
        if (typeof window === "object") return window;
      }
    }();
  })();
  (() => {
    __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  })();
  (() => {
    __webpack_require__.r = exports => {
      if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
        Object.defineProperty(exports, Symbol.toStringTag, {
          value: "Module"
        });
      }
      Object.defineProperty(exports, "__esModule", {
        value: true
      });
    };
  })();
  (() => {
    __webpack_require__.nmd = module => {
      module.paths = [];
      if (!module.children) module.children = [];
      return module;
    };
  })();
  var __webpack_exports__ = {};
  (() => {
    "use strict";
    var browser_polyfill = __webpack_require__(6815);
    var browser_polyfill_default = __webpack_require__.n(browser_polyfill);
    var lib = __webpack_require__(3207);
    var jsondiffpatch_umd = __webpack_require__(1562);
    const differ = (0, jsondiffpatch_umd.create)();
    const bigintDiffFilter = context => {
      if (typeof context.left === "bigint" && typeof context.right === "bigint") {
        if (context.left !== context.right) {
          context.setResult([ context.left, context.right ]);
        }
      }
    };
    bigintDiffFilter.filterName = "bigint";
    differ.processor.pipes.diff.before("objects", bigintDiffFilter);
    const differ_diff = differ.diff.bind(differ);
    const patch = differ.patch.bind(differ);
    var qethers_lib = __webpack_require__(7785);
    var address_lib = __webpack_require__(171);
    const QEVM = {
      chainID: "256",
      name: "QEVM",
      symbol: "QEVM",
      decimals: 18,
      metadata: {
        tokenLists: []
      }
    };
    const POSEIDON_QEVM = {
      ...QEVM,
      chainID: "257",
      name: "Poseidon QEVM",
      symbol: "pQEVM"
    };
    const BASE_ASSETS_BY_CUSTOM_NAME = {
      QEVM,
      POSEIDON_QEVM
    };
    const BASE_ASSETS = Object.values(BASE_ASSETS_BY_CUSTOM_NAME);
    const coinTypesByAssetSymbol = {
      QEVM: 10101
    };
    const USD = {
      name: "United States Dollar",
      symbol: "USD",
      decimals: 10
    };
    const FIAT_CURRENCIES = [ USD ];
    const FIAT_CURRENCIES_SYMBOL = FIAT_CURRENCIES.map((currency => currency.symbol));
    const QEVM_DATA = {
      coinType: coinTypesByAssetSymbol.QEVM,
      metadata: {
        tokenLists: [],
        websiteURL: "https://quantumevm.com"
      }
    };
    const currencies_QEVM = {
      ...BASE_ASSETS_BY_CUSTOM_NAME.QEVM,
      ...QEVM_DATA
    };
    const currencies_POSEIDON_QEVM = {
      ...BASE_ASSETS_BY_CUSTOM_NAME.POSEIDON_QEVM,
      ...QEVM_DATA
    };
    const BUILT_IN_NETWORK_BASE_ASSETS = [ currencies_QEVM, currencies_POSEIDON_QEVM ];
    const ZEUS = {
      name: "Zeus",
      baseAsset: currencies_QEVM,
      chainID: "256",
      family: "QEVM"
    };
    const POSEIDON = {
      name: "Poseidon",
      baseAsset: currencies_POSEIDON_QEVM,
      chainID: "257",
      family: "QEVM"
    };
    const DEFAULT_NETWORKS = [ ZEUS, POSEIDON ];
    function isBuiltInNetwork(network) {
      return DEFAULT_NETWORKS.some((builtInNetwork => builtInNetwork.chainID === network.chainID));
    }
    const DEFAULT_NETWORKS_BY_CHAIN_ID = new Set(DEFAULT_NETWORKS.map((network => network.chainID)));
    const EIP_1559_COMPLIANT_CHAIN_IDS = new Set([ ZEUS, POSEIDON ].map((network => network.chainID)));
    const CHAINS_WITH_MEMPOOL = new Set([ ZEUS, POSEIDON ].map((network => network.chainID)));
    const NETWORK_BY_CHAIN_ID = {
      [ZEUS.chainID]: ZEUS,
      [POSEIDON.chainID]: POSEIDON
    };
    const TEST_NETWORK_BY_CHAIN_ID = new Set([ POSEIDON ].map((network => network.chainID)));
    const CHAIN_ID_TO_RPC_URLS = {
      [ZEUS.chainID]: [ "https://zeus.rpc.quantumevm.com/" ],
      [POSEIDON.chainID]: [ "https://poseidon.rpc.quantumevm.com/" ]
    };
    const NETWORKS_WITH_FEE_SETTINGS = new Set([]);
    const STATE_KEY = "qwallet";
    const POPUP_MONITOR_PORT_NAME = "popup-monitor";
    const NETWORK_TYPES = {
      qevm: "qevm"
    };
    const TRANSPORT_TYPES = {
      ws: "ws",
      http: "http"
    };
    const ALARMS = {
      block: "block",
      minute: "minute",
      times: {
        block: .13,
        minute: .1
      }
    };
    const SECOND = 1e3;
    const MINUTE = 60 * SECOND;
    const HOUR = 60 * MINUTE;
    const DAY = 24 * HOUR;
    const DEFAULT_COMMUNITY_MULTISIG_ADDRESS = "0x99b36fDbC582D113aF36A21EBa06BFEAb7b9bE12";
    const COMMUNITY_MULTISIG_ADDRESS_BY_CHAINID = {};
    var isAddress;
    var utils;
    var utils_ZEUS;
    var utils_POSEIDON;
    function isValidChecksumAddress(address) {
      return isAddress(address);
    }
    function isMixedCaseAddress(address) {
      let addressValue = address;
      if (address.slice(0, 2) === "0X") {
        addressValue = `0x${address.slice(2)}`;
      }
      return !(addressValue.match(/^(0x)?[0-9A-F]{64}$/) || addressValue.match(/^(0x)?[0-9a-f]{64}$/));
    }
    function normalizeQEVMAddress(address) {
      return (0, address_lib.getAddress)(address);
    }
    function normalizeAddressOnNetwork({address, network}) {
      return {
        address: normalizeQEVMAddress(address),
        network
      };
    }
    function truncateDecimalAmount(value, decimalLength, maxDecimalLength = decimalLength) {
      const valueString = value.toString();
      if (!valueString.includes(".")) {
        return valueString;
      }
      const [integer, decimals] = valueString.split(".");
      const firstSignificantDecimalDigit = [ ...decimals ].findIndex((digit => digit !== "0")) + 1;
      const decimalTruncationLength = integer.length > 1 || integer[0] !== "0" ? decimalLength : Math.min(Math.max(decimalLength, firstSignificantDecimalDigit), maxDecimalLength);
      if (decimalTruncationLength < firstSignificantDecimalDigit) {
        return integer;
      }
      const decimalsTruncated = decimals.substring(0, decimalTruncationLength);
      return `${integer}.${decimalsTruncated}`;
    }
    function sameQEVMAddress(address1, address2) {
      if (typeof address1 === "undefined" || typeof address2 === "undefined" || address1 === null || address2 === null) {
        return false;
      }
      return (0, address_lib.getAddress)(address1) === (0, address_lib.getAddress)(address2);
    }
    function gweiToWei(value) {
      return BigInt(utils.parseUnits(value.toString(), "gwei").toString());
    }
    function convertToEth(value) {
      if (value && value >= 1) {
        return qethers_lib.utils.formatUnits(BigInt(value));
      }
      return "";
    }
    function weiToGwei(value) {
      if (value && value >= 1) {
        return truncateDecimalAmount(qethers_lib.utils.formatUnits(BigInt(value), "gwei"), 2);
      }
      return "";
    }
    function encodeJSON(input) {
      return JSON.stringify(input, ((_, value) => {
        if (typeof value === "bigint") {
          return {
            B_I_G_I_N_T: value.toString()
          };
        }
        return value;
      }));
    }
    function decodeJSON(input) {
      return JSON.parse(input, ((_, value) => value !== null && typeof value === "object" && "B_I_G_I_N_T" in value ? BigInt(value.B_I_G_I_N_T) : value));
    }
    function getQEVMNetwork() {
      const quantumevmNetwork = "MISSING_ENV_VAR".QEVM_NETWORK?.toUpperCase();
      if (quantumevmNetwork === "ZEUS") {
        return utils_ZEUS;
      }
      if (quantumevmNetwork === "POSEIDON") {
        return utils_POSEIDON;
      }
      return utils_ZEUS;
    }
    function isProbablyQEVMAddress(str) {
      if ((0, address_lib.isAddress)(str) && str.length === 66) {
        return true;
      }
      return false;
    }
    function truncateAddress(address) {
      return `${address.slice(0, 6)}…${address.slice(-5)}`;
    }
    const getNumericStringValueFromBigNumber = (value, tokenDecimals) => Number(value.toBigInt() / 10n ** BigInt(tokenDecimals)).toString();
    const numberTo32BytesHex = (value, decimals) => {
      const withDecimals = BigInt(value) * 10n ** BigInt(decimals);
      const hex = utils.hexlify(withDecimals);
      return hex;
    };
    const isMaxUint256 = amount => qethers_lib.qethers.BigNumber.from(amount).eq(qethers_lib.qethers.constants.MaxUint256);
    const hexToAscii = hex_ => {
      const hex = hex_.toString();
      let str = "";
      for (let i = 0; i < hex.length; i += 2) str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
      return str.replace("\0", "");
    };
    const wait = ms => new Promise((r => {
      setTimeout(r, ms);
    }));
    const getUNIXTimestamp = (time = Date.now()) => Math.floor(time / 1e3);
    var emittery = __webpack_require__(6827);
    var emittery_default = __webpack_require__.n(emittery);
    class BaseService {
      emitter=new (emittery_default());
      boundAlarmHandler=this.handleAlarm.bind(this);
      constructor(alarmSchedules = {}) {
        this.alarmSchedules = alarmSchedules;
      }
      async internalStartService() {
        const scheduleEntries = Object.entries(this.alarmSchedules);
        scheduleEntries.forEach((([name, {schedule, runAtStart, handler}]) => {
          browser_polyfill_default().alarms.create(name, schedule);
          if (runAtStart) {
            handler();
          }
        }));
        if (scheduleEntries.length > 0) {
          browser_polyfill_default().alarms.onAlarm.addListener(this.boundAlarmHandler);
        }
      }
      async internalStopService() {
        const scheduleNames = Object.keys(this.alarmSchedules);
        scheduleNames.forEach((alarmName => browser_polyfill_default().alarms.clear(alarmName)));
        if (scheduleNames.length > 0) {
          browser_polyfill_default().alarms.onAlarm.removeListener(this.boundAlarmHandler);
        }
      }
      handleAlarm(alarm) {
        this.alarmSchedules[alarm.name]?.handler(alarm);
      }
      serviceState="unstarted";
      async started() {
        switch (this.serviceState) {
         case "started":
          return this;

         case "stopped":
          throw new Error("Service is already stopped and cannot be restarted.");

         case "unstarted":
         case "starting":
          return this.emitter.once("serviceStarted").then((() => this));

         default:
          {
            const exhaustiveCheck = this.serviceState;
            throw new Error(`Unreachable code: ${exhaustiveCheck}`);
          }
        }
      }
      startService=async () => {
        switch (this.serviceState) {
         case "started":
         case "starting":
          return;

         case "stopped":
          throw new Error("Service is already stopped and cannot be restarted.");

         case "unstarted":
          this.serviceState = "starting";
          await this.internalStartService();
          this.serviceState = "started";
          this.emitter.emit("serviceStarted", undefined);
          break;

         default:
          {
            const exhaustiveCheck = this.serviceState;
            throw new Error(`Unreachable code: ${exhaustiveCheck}`);
          }
        }
      };
      stopService=async () => {
        switch (this.serviceState) {
         case "unstarted":
          throw new Error("Attempted to stop a service that was never started.");

         case "stopped":
          return;

         case "starting":
          await this.started();
          await this.stopService();
          break;

         case "started":
          await this.internalStopService();
          this.serviceState = "stopped";
          this.emitter.emit("serviceStopped", undefined);
          break;

         default:
          {
            const exhaustiveCheck = this.serviceState;
            throw new Error(`Unreachable code: ${exhaustiveCheck}`);
          }
        }
      };
    }
    var lib_utils = __webpack_require__(6884);
    const logger_HOUR = 1e3 * 60 * 60;
    const store = {
      async get(key) {
        const realKey = `logs-${key}`;
        return String((await browser_polyfill_default().storage.local.get(realKey))[realKey]) ?? "";
      },
      async getAll(...keys) {
        const keyResults = await browser_polyfill_default().storage.local.get(keys.map((key => `logs-${key}`)));
        return Object.fromEntries(keys.map((key => [ key, String(keyResults[`logs-${key}`]) ?? "" ])));
      },
      async set(key, value) {
        browser_polyfill_default().storage.local.set({
          [`logs-${key}`]: value
        });
      }
    };
    let LogLevel = function(LogLevel) {
      LogLevel["debug"] = "debug";
      LogLevel["info"] = "info";
      LogLevel["warn"] = "warn";
      LogLevel["error"] = "error";
      LogLevel["off"] = "off";
      return LogLevel;
    }({});
    const logLevels = {
      [LogLevel.debug]: 0,
      [LogLevel.info]: 1,
      [LogLevel.warn]: 2,
      [LogLevel.error]: 3,
      [LogLevel.off]: 4
    };
    const styles = {
      debug: {
        icon: "🐛",
        css: [],
        dateCss: [ "float: right" ]
      },
      log: {
        icon: "🪵",
        css: []
      },
      info: {
        icon: "💡",
        css: [ "color: blue" ]
      },
      warn: {
        icon: "⚠️",
        css: [ "color: #63450b", "background-color: #fffbe5", "border: 1px solid #fff5c2", "padding: 0.5em" ]
      },
      error: {
        icon: "❌",
        css: [ "color: #ff1a1a", "background-color: #fff0f0", "border: 1px solid #ffd6d6", "padding: 0.5em" ]
      }
    };
    function purgeSensitiveFailSafe(log) {
      return log.replaceAll(/0x[0-9a-fA-F]+|(\b[a-zA-Z0-9]{64}\b)|(?:[a-z]+(?:\s|$)){12}/g, "[REDACTED]");
    }
    const BLINK_PREFIX = "    at ";
    const WEBKIT_GECKO_DELIMITER = "@";
    const WEBKIT_MARKER = "@";
    const GECKO_MARKER = "/";
    function logLabelFromStackEntry(stackEntry) {
      if (stackEntry?.startsWith(BLINK_PREFIX)) {
        return stackEntry.substring(BLINK_PREFIX.length).split(" ")[0];
      }
      if (stackEntry?.includes(GECKO_MARKER) && stackEntry.includes(WEBKIT_GECKO_DELIMITER)) {
        return stackEntry.split(WEBKIT_GECKO_DELIMITER)[0].split(GECKO_MARKER).filter((item => item.replace(/(?:promise)?</, "").trim() !== "")).slice(-2).join(".");
      }
      if (stackEntry?.includes(WEBKIT_MARKER)) {
        return stackEntry.split(WEBKIT_MARKER)[0];
      }
      return undefined;
    }
    const iso8601Length = 24;
    const iso8601DateRegExpString = "\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+(?:[+-][0-2]\\d:[0-5]\\d|Z)";
    const logDateRegExp = new RegExp(`(?=^\\[${iso8601DateRegExpString}\\] \\[)`, "m");
    class Logger {
      #level=logLevels[LogLevel.debug];
      set logLevel(value) {
        this.#level = logLevels[value];
      }
      store=store;
      constructor(contextId = "BG") {
        this.contextId = contextId;
      }
      debug(...input) {
        this.logEvent(LogLevel.debug, input);
      }
      info(...input) {
        this.logEvent(LogLevel.info, input);
      }
      warn(...input) {
        this.logEvent(LogLevel.warn, input);
      }
      error(...input) {
        this.logEvent(LogLevel.error, input);
      }
      errorLogRejectedPromises(logPrefix, settledPromises, perResultData = []) {
        const rejectedLogData = settledPromises.reduce(((logData, settledPromise, i) => settledPromise.status === "rejected" ? [ ...logData, settledPromise, ...perResultData.slice(i, i + 1) ] : logData), []);
        if (rejectedLogData.length > 0) {
          this.error(logPrefix, rejectedLogData);
        }
      }
      buildError(...input) {
        this.error(...input);
        return new Error(input.join(" "));
      }
      logEvent(level, input) {
        if (logLevels[level] < this.#level) return;
        const stackTrace = (new Error).stack?.split("\n")?.filter((line => {
          if (line.trim() === "" || line.trim() === "Error") {
            return false;
          }
          return true;
        }))?.slice(2);
        const logLabel = logLabelFromStackEntry(stackTrace?.[0]) ?? "(unknown function)";
        const isoDateString = (new Date).toISOString();
        const [logDate, logTime] = isoDateString.replace(/Z$/, "").split(/T/);
        console.group(`%c ${styles[level].icon} [${logTime}] ${logLabel} %c [${logDate}]`, styles[level].css.join(";"), styles[level].dateCss ?? styles.debug.dateCss.join(";"));
        console[level](...input);
        if (typeof stackTrace !== "undefined" && level !== "error") {
          console[level](stackTrace.join("\n"));
        }
        console.groupEnd();
        this.saveLog(level, isoDateString, logLabel, input, stackTrace);
      }
      async saveLog(level, isoDateString, logLabel, input, stackTrace) {
        const formattedInput = input.map((loggedValue => {
          if (typeof loggedValue === "object") {
            try {
              return JSON.stringify(loggedValue);
            } catch (_) {
              return String(loggedValue);
            }
          } else {
            return String(loggedValue);
          }
        })).join(" ");
        const formattedStackTrace = stackTrace === undefined ? "" : `\n${stackTrace.join("\n")}`;
        const logData = `    ${formattedInput}${formattedStackTrace}`.split("\n").join("\n    ");
        const existingLogs = await this.store.get(level);
        const fullPrefix = `[${isoDateString}] [${level.toUpperCase()}:${this.contextId}]`;
        const purgedData = purgeSensitiveFailSafe(logData);
        const updatedLogs = `${existingLogs}${fullPrefix} ${logLabel}\n${purgedData}\n\n`.slice(-5e4);
        await this.store.set(level, updatedLogs);
      }
      async serializeLogs() {
        const logs = await this.store.getAll("debug", "info", "warn", "error");
        if (Object.values(logs).every((entry => entry === ""))) {
          return "[NO LOGS FOUND]";
        }
        const logEntries = Object.values(logs).flatMap((levelLogs => {
          const splitLogs = levelLogs?.split(logDateRegExp) ?? [];
          if (splitLogs.length > 0 && splitLogs[0] !== "" && !splitLogs[0].match(logDateRegExp)) {
            splitLogs[0] = `[${new Date(0).toISOString()}] ${splitLogs[0]}`;
          }
          return splitLogs;
        }));
        if (logEntries.length < 1) {
          return "";
        }
        const dateFromLogEntry = dateStr => new Date(dateStr.substring(1, iso8601Length));
        const entriesByDateAsc = logEntries.sort(((a, b) => a.substr(1, iso8601Length).localeCompare(b.substr(1, iso8601Length))));
        const lastEntry = entriesByDateAsc[entriesByDateAsc.length - 1];
        const lastEntryDate = dateFromLogEntry(lastEntry);
        return entriesByDateAsc.filter((logLine => dateFromLogEntry(logLine).getTime() >= lastEntryDate.getTime() - logger_HOUR)).join("\n");
      }
    }
    const logger = new Logger;
    function logRejectedAndReturnFulfilledResults(logPrefix, settledPromises, perResultData = []) {
      logger.errorLogRejectedPromises(logPrefix, settledPromises, perResultData);
      return settledPromises.reduce(((fulfilledResults, settledPromise) => settledPromise.status === "fulfilled" ? [ ...fulfilledResults, settledPromise.value ] : fulfilledResults), []);
    }
    const serializeLogs = logger.serializeLogs.bind(logger);
    const lib_logger = logger;
    async function getBlockPrices(network, provider) {
      const [currentBlock, feeData] = await Promise.all([ provider.getBlock("latest"), provider.getFeeData() ]);
      const baseFeePerGas = currentBlock?.baseFeePerGas?.toBigInt();
      if (feeData.gasPrice === null) {
        lib_logger.warn("Not receiving accurate gas prices from provider", feeData);
      }
      const gasPrice = feeData?.gasPrice?.toBigInt() || 0n;
      if (baseFeePerGas) {
        return {
          network,
          blockNumber: currentBlock.number,
          baseFeePerGas,
          estimatedPrices: [ {
            confidence: 99,
            maxPriorityFeePerGas: 2500000000n,
            maxFeePerGas: baseFeePerGas * 2n + 2500000000n,
            price: gasPrice
          }, {
            confidence: 95,
            maxPriorityFeePerGas: 1500000000n,
            maxFeePerGas: baseFeePerGas * 15n / 10n + 1500000000n,
            price: gasPrice * 9n / 10n
          }, {
            confidence: 70,
            maxPriorityFeePerGas: 1100000000n,
            maxFeePerGas: baseFeePerGas * 13n / 10n + 1100000000n,
            price: gasPrice * 8n / 10n
          } ],
          dataSource: "local"
        };
      }
      if (EIP_1559_COMPLIANT_CHAIN_IDS.has(network.chainID) && (feeData.maxPriorityFeePerGas === null || feeData.maxFeePerGas === null)) {
        lib_logger.warn("Not receiving accurate EIP-1559 gas prices from provider", feeData, network.name);
      }
      const maxFeePerGas = feeData?.maxFeePerGas?.toBigInt() || 0n;
      const maxPriorityFeePerGas = feeData?.maxPriorityFeePerGas?.toBigInt() || 0n;
      return {
        network,
        blockNumber: currentBlock.number,
        baseFeePerGas: (maxFeePerGas - maxPriorityFeePerGas) / 2n,
        estimatedPrices: [ {
          confidence: 99,
          maxPriorityFeePerGas,
          maxFeePerGas,
          price: gasPrice
        } ],
        dataSource: "local"
      };
    }
    const KNOWN_TX_TYPES = [ 0, 1, 2 ];
    function isKnownTxType(arg) {
      return arg !== undefined && arg !== null && KNOWN_TX_TYPES.includes(Number(arg));
    }
    function sameNetwork(network1, network2) {
      return network1.family === network2.family && network1.chainID === network2.chainID;
    }
    function toHexChainID(chainID) {
      if (typeof chainID === "string" && chainID.startsWith("0x")) {
        return chainID.toLowerCase();
      }
      return `0x${BigInt(chainID).toString(16)}`;
    }
    const sameChainID = (chainID, other) => toHexChainID(chainID) === toHexChainID(other);
    const isEIP1559TransactionRequest = transactionRequest => "maxFeePerGas" in transactionRequest && transactionRequest.maxFeePerGas !== null && "maxPriorityFeePerGas" in transactionRequest && transactionRequest.maxPriorityFeePerGas !== null;
    const isEIP1559SignedTransaction = signedTransaction => "maxFeePerGas" in signedTransaction && "maxPriorityFeePerGas" in signedTransaction && signedTransaction.maxFeePerGas !== null && signedTransaction.maxPriorityFeePerGas !== null;
    const isEIP1559EnrichedTransactionSignatureRequest = transactionSignatureRequest => "maxFeePerGas" in transactionSignatureRequest && "maxPriorityFeePerGas" in transactionSignatureRequest;
    const isEIP1559EnrichedTransactionRequest = enrichedTransactionRequest => "maxFeePerGas" in enrichedTransactionRequest && "maxPriorityFeePerGas" in enrichedTransactionRequest;
    const isEnrichedQEVMTransactionRequest = transactionRequest => "annotation" in transactionRequest;
    const e = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : "undefined" != typeof window ? window : __webpack_require__.g, t = Object.keys, n = Array.isArray;
    function r(e, n) {
      return "object" != typeof n || t(n).forEach((function(t) {
        e[t] = n[t];
      })), e;
    }
    "undefined" == typeof Promise || e.Promise || (e.Promise = Promise);
    const s = Object.getPrototypeOf, i = {}.hasOwnProperty;
    function o(e, t) {
      return i.call(e, t);
    }
    function a(e, n) {
      "function" == typeof n && (n = n(s(e))), ("undefined" == typeof Reflect ? t : Reflect.ownKeys)(n).forEach((t => {
        l(e, t, n[t]);
      }));
    }
    const u = Object.defineProperty;
    function l(e, t, n, s) {
      u(e, t, r(n && o(n, "get") && "function" == typeof n.get ? {
        get: n.get,
        set: n.set,
        configurable: !0
      } : {
        value: n,
        configurable: !0,
        writable: !0
      }, s));
    }
    function c(e) {
      return {
        from: function(t) {
          return e.prototype = Object.create(t.prototype), l(e.prototype, "constructor", e), 
          {
            extend: a.bind(null, e.prototype)
          };
        }
      };
    }
    const h = Object.getOwnPropertyDescriptor;
    function d(e, t) {
      let n;
      return h(e, t) || (n = s(e)) && d(n, t);
    }
    const f = [].slice;
    function p(e, t, n) {
      return f.call(e, t, n);
    }
    function y(e, t) {
      return t(e);
    }
    function m(e) {
      if (!e) throw new Error("Assertion Failed");
    }
    function v(t) {
      e.setImmediate ? setImmediate(t) : setTimeout(t, 0);
    }
    function g(e, t) {
      return e.reduce(((e, n, r) => {
        var s = t(n, r);
        return s && (e[s[0]] = s[1]), e;
      }), {});
    }
    function b(e, t) {
      if ("string" == typeof t && o(e, t)) return e[t];
      if (!t) return e;
      if ("string" != typeof t) {
        for (var n = [], r = 0, s = t.length; r < s; ++r) {
          var i = b(e, t[r]);
          n.push(i);
        }
        return n;
      }
      var a = t.indexOf(".");
      if (-1 !== a) {
        var u = e[t.substr(0, a)];
        return null == u ? void 0 : b(u, t.substr(a + 1));
      }
    }
    function _(e, t, r) {
      if (e && void 0 !== t && (!("isFrozen" in Object) || !Object.isFrozen(e))) if ("string" != typeof t && "length" in t) {
        m("string" != typeof r && "length" in r);
        for (var s = 0, i = t.length; s < i; ++s) _(e, t[s], r[s]);
      } else {
        var a = t.indexOf(".");
        if (-1 !== a) {
          var u = t.substr(0, a), l = t.substr(a + 1);
          if ("" === l) void 0 === r ? n(e) && !isNaN(parseInt(u)) ? e.splice(u, 1) : delete e[u] : e[u] = r; else {
            var c = e[u];
            c && o(e, u) || (c = e[u] = {}), _(c, l, r);
          }
        } else void 0 === r ? n(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = r;
      }
    }
    function w(e) {
      var t = {};
      for (var n in e) o(e, n) && (t[n] = e[n]);
      return t;
    }
    const x = [].concat;
    function k(e) {
      return x.apply([], e);
    }
    const E = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(k([ 8, 16, 32, 64 ].map((e => [ "Int", "Uint", "Float" ].map((t => t + e + "Array")))))).filter((t => e[t])), P = E.map((t => e[t]));
    g(E, (e => [ e, !0 ]));
    let K = null;
    function O(e) {
      K = "undefined" != typeof WeakMap && new WeakMap;
      const t = S(e);
      return K = null, t;
    }
    function S(e) {
      if (!e || "object" != typeof e) return e;
      let t = K && K.get(e);
      if (t) return t;
      if (n(e)) {
        t = [], K && K.set(e, t);
        for (var r = 0, i = e.length; r < i; ++r) t.push(S(e[r]));
      } else if (P.indexOf(e.constructor) >= 0) t = e; else {
        const n = s(e);
        for (var a in t = n === Object.prototype ? {} : Object.create(n), K && K.set(e, t), 
        e) o(e, a) && (t[a] = S(e[a]));
      }
      return t;
    }
    const {toString: A} = {};
    function C(e) {
      return A.call(e).slice(8, -1);
    }
    const j = "undefined" != typeof Symbol ? Symbol.iterator : "@@iterator", D = "symbol" == typeof j ? function(e) {
      var t;
      return null != e && (t = e[j]) && t.apply(e);
    } : function() {
      return null;
    }, I = {};
    function B(e) {
      var t, r, s, i;
      if (1 === arguments.length) {
        if (n(e)) return e.slice();
        if (this === I && "string" == typeof e) return [ e ];
        if (i = D(e)) {
          for (r = []; !(s = i.next()).done; ) r.push(s.value);
          return r;
        }
        if (null == e) return [ e ];
        if ("number" == typeof (t = e.length)) {
          for (r = new Array(t); t--; ) r[t] = e[t];
          return r;
        }
        return [ e ];
      }
      for (t = arguments.length, r = new Array(t); t--; ) r[t] = arguments[t];
      return r;
    }
    const T = "undefined" != typeof Symbol ? e => "AsyncFunction" === e[Symbol.toStringTag] : () => !1;
    var R = "undefined" != typeof location && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
    function F(e, t) {
      R = e, M = t;
    }
    var M = () => !0;
    const N = !new Error("").stack;
    function q() {
      if (N) try {
        throw q.arguments, new Error;
      } catch (e) {
        return e;
      }
      return new Error;
    }
    function $(e, t) {
      var n = e.stack;
      return n ? (t = t || 0, 0 === n.indexOf(e.name) && (t += (e.name + e.message).split("\n").length), 
      n.split("\n").slice(t).filter(M).map((e => "\n" + e)).join("")) : "";
    }
    var U = [ "Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone" ], L = [ "Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait" ].concat(U), V = {
      VersionChanged: "Database version changed by other database connection",
      DatabaseClosed: "Database has been closed",
      Abort: "Transaction aborted",
      TransactionInactive: "Transaction has already completed or failed",
      MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"
    };
    function W(e, t) {
      this._e = q(), this.name = e, this.message = t;
    }
    function Y(e, t) {
      return e + ". Errors: " + Object.keys(t).map((e => t[e].toString())).filter(((e, t, n) => n.indexOf(e) === t)).join("\n");
    }
    function z(e, t, n, r) {
      this._e = q(), this.failures = t, this.failedKeys = r, this.successCount = n, this.message = Y(e, t);
    }
    function G(e, t) {
      this._e = q(), this.name = "BulkError", this.failures = Object.keys(t).map((e => t[e])), 
      this.failuresByPos = t, this.message = Y(e, t);
    }
    c(W).from(Error).extend({
      stack: {
        get: function() {
          return this._stack || (this._stack = this.name + ": " + this.message + $(this._e, 2));
        }
      },
      toString: function() {
        return this.name + ": " + this.message;
      }
    }), c(z).from(W), c(G).from(W);
    var H = L.reduce(((e, t) => (e[t] = t + "Error", e)), {});
    const Q = W;
    var X = L.reduce(((e, t) => {
      var n = t + "Error";
      function r(e, r) {
        this._e = q(), this.name = n, e ? "string" == typeof e ? (this.message = `${e}${r ? "\n " + r : ""}`, 
        this.inner = r || null) : "object" == typeof e && (this.message = `${e.name} ${e.message}`, 
        this.inner = e) : (this.message = V[t] || n, this.inner = null);
      }
      return c(r).from(Q), e[t] = r, e;
    }), {});
    X.Syntax = SyntaxError, X.Type = TypeError, X.Range = RangeError;
    var J = U.reduce(((e, t) => (e[t + "Error"] = X[t], e)), {});
    var Z = L.reduce(((e, t) => (-1 === [ "Syntax", "Type", "Range" ].indexOf(t) && (e[t + "Error"] = X[t]), 
    e)), {});
    function ee() {}
    function te(e) {
      return e;
    }
    function ne(e, t) {
      return null == e || e === te ? t : function(n) {
        return t(e(n));
      };
    }
    function re(e, t) {
      return function() {
        e.apply(this, arguments), t.apply(this, arguments);
      };
    }
    function se(e, t) {
      return e === ee ? t : function() {
        var n = e.apply(this, arguments);
        void 0 !== n && (arguments[0] = n);
        var r = this.onsuccess, s = this.onerror;
        this.onsuccess = null, this.onerror = null;
        var i = t.apply(this, arguments);
        return r && (this.onsuccess = this.onsuccess ? re(r, this.onsuccess) : r), s && (this.onerror = this.onerror ? re(s, this.onerror) : s), 
        void 0 !== i ? i : n;
      };
    }
    function ie(e, t) {
      return e === ee ? t : function() {
        e.apply(this, arguments);
        var n = this.onsuccess, r = this.onerror;
        this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? re(n, this.onsuccess) : n), 
        r && (this.onerror = this.onerror ? re(r, this.onerror) : r);
      };
    }
    function oe(e, t) {
      return e === ee ? t : function(n) {
        var s = e.apply(this, arguments);
        r(n, s);
        var i = this.onsuccess, o = this.onerror;
        this.onsuccess = null, this.onerror = null;
        var a = t.apply(this, arguments);
        return i && (this.onsuccess = this.onsuccess ? re(i, this.onsuccess) : i), o && (this.onerror = this.onerror ? re(o, this.onerror) : o), 
        void 0 === s ? void 0 === a ? void 0 : a : r(s, a);
      };
    }
    function ae(e, t) {
      return e === ee ? t : function() {
        return !1 !== t.apply(this, arguments) && e.apply(this, arguments);
      };
    }
    function ue(e, t) {
      return e === ee ? t : function() {
        var n = e.apply(this, arguments);
        if (n && "function" == typeof n.then) {
          for (var r = this, s = arguments.length, i = new Array(s); s--; ) i[s] = arguments[s];
          return n.then((function() {
            return t.apply(r, i);
          }));
        }
        return t.apply(this, arguments);
      };
    }
    Z.ModifyError = z, Z.DexieError = W, Z.BulkError = G;
    var le = {};
    const ce = 100, [he, de, fe] = "undefined" == typeof Promise ? [] : (() => {
      let e = Promise.resolve();
      if ("undefined" == typeof crypto || !crypto.subtle) return [ e, s(e), e ];
      const t = crypto.subtle.digest("SHA-512", new Uint8Array([ 0 ]));
      return [ t, s(t), e ];
    })(), pe = de && de.then, ye = he && he.constructor, me = !!fe;
    var ve = !1, ge = fe ? () => {
      fe.then($e);
    } : e.setImmediate ? setImmediate.bind(null, $e) : e.MutationObserver ? () => {
      var e = document.createElement("div");
      new MutationObserver((() => {
        $e(), e = null;
      })).observe(e, {
        attributes: !0
      }), e.setAttribute("i", "1");
    } : () => {
      setTimeout($e, 0);
    }, be = function(e, t) {
      Se.push([ e, t ]), we && (ge(), we = !1);
    }, _e = !0, we = !0, xe = [], ke = [], Ee = null, Pe = te, Ke = {
      id: "global",
      global: !0,
      ref: 0,
      unhandleds: [],
      onunhandled: dt,
      pgp: !1,
      env: {},
      finalize: function() {
        this.unhandleds.forEach((e => {
          try {
            dt(e[0], e[1]);
          } catch (e) {}
        }));
      }
    }, Oe = Ke, Se = [], Ae = 0, Ce = [];
    function je(e) {
      if ("object" != typeof this) throw new TypeError("Promises must be constructed via new");
      this._listeners = [], this.onuncatched = ee, this._lib = !1;
      var t = this._PSD = Oe;
      if (R && (this._stackHolder = q(), this._prev = null, this._numPrev = 0), "function" != typeof e) {
        if (e !== le) throw new TypeError("Not a function");
        return this._state = arguments[1], this._value = arguments[2], void (!1 === this._state && Te(this, this._value));
      }
      this._state = null, this._value = null, ++t.ref, Be(this, e);
    }
    const De = {
      get: function() {
        var e = Oe, t = Xe;
        function n(n, r) {
          var s = !e.global && (e !== Oe || t !== Xe);
          const i = s && !tt();
          var o = new je(((t, o) => {
            Fe(this, new Ie(lt(n, e, s, i), lt(r, e, s, i), t, o, e));
          }));
          return R && qe(o, this), o;
        }
        return n.prototype = le, n;
      },
      set: function(e) {
        l(this, "then", e && e.prototype === le ? De : {
          get: function() {
            return e;
          },
          set: De.set
        });
      }
    };
    function Ie(e, t, n, r, s) {
      this.onFulfilled = "function" == typeof e ? e : null, this.onRejected = "function" == typeof t ? t : null, 
      this.resolve = n, this.reject = r, this.psd = s;
    }
    function Be(e, t) {
      try {
        t((t => {
          if (null === e._state) {
            if (t === e) throw new TypeError("A promise cannot be resolved with itself.");
            var n = e._lib && Ue();
            t && "function" == typeof t.then ? Be(e, ((e, n) => {
              t instanceof je ? t._then(e, n) : t.then(e, n);
            })) : (e._state = !0, e._value = t, Re(e)), n && Le();
          }
        }), Te.bind(null, e));
      } catch (t) {
        Te(e, t);
      }
    }
    function Te(e, t) {
      if (ke.push(t), null === e._state) {
        var n = e._lib && Ue();
        t = Pe(t), e._state = !1, e._value = t, R && null !== t && "object" == typeof t && !t._promise && function(e, t, n) {
          try {
            e.apply(null, n);
          } catch (e) {
            t && t(e);
          }
        }((() => {
          var n = d(t, "stack");
          t._promise = e, l(t, "stack", {
            get: () => ve ? n && (n.get ? n.get.apply(t) : n.value) : e.stack
          });
        })), function(e) {
          xe.some((t => t._value === e._value)) || xe.push(e);
        }(e), Re(e), n && Le();
      }
    }
    function Re(e) {
      var t = e._listeners;
      e._listeners = [];
      for (var n = 0, r = t.length; n < r; ++n) Fe(e, t[n]);
      var s = e._PSD;
      --s.ref || s.finalize(), 0 === Ae && (++Ae, be((() => {
        0 == --Ae && Ve();
      }), []));
    }
    function Fe(e, t) {
      if (null !== e._state) {
        var n = e._state ? t.onFulfilled : t.onRejected;
        if (null === n) return (e._state ? t.resolve : t.reject)(e._value);
        ++t.psd.ref, ++Ae, be(Me, [ n, e, t ]);
      } else e._listeners.push(t);
    }
    function Me(e, t, n) {
      try {
        Ee = t;
        var r, s = t._value;
        t._state ? r = e(s) : (ke.length && (ke = []), r = e(s), -1 === ke.indexOf(s) && function(e) {
          var t = xe.length;
          for (;t; ) if (xe[--t]._value === e._value) return void xe.splice(t, 1);
        }(t)), n.resolve(r);
      } catch (e) {
        n.reject(e);
      } finally {
        Ee = null, 0 == --Ae && Ve(), --n.psd.ref || n.psd.finalize();
      }
    }
    function Ne(e, t, n) {
      if (t.length === n) return t;
      var r = "";
      if (!1 === e._state) {
        var s, i, o = e._value;
        null != o ? (s = o.name || "Error", i = o.message || o, r = $(o, 0)) : (s = o, i = ""), 
        t.push(s + (i ? ": " + i : "") + r);
      }
      return R && ((r = $(e._stackHolder, 2)) && -1 === t.indexOf(r) && t.push(r), e._prev && Ne(e._prev, t, n)), 
      t;
    }
    function qe(e, t) {
      var n = t ? t._numPrev + 1 : 0;
      n < 100 && (e._prev = t, e._numPrev = n);
    }
    function $e() {
      Ue() && Le();
    }
    function Ue() {
      var e = _e;
      return _e = !1, we = !1, e;
    }
    function Le() {
      var e, t, n;
      do {
        for (;Se.length > 0; ) for (e = Se, Se = [], n = e.length, t = 0; t < n; ++t) {
          var r = e[t];
          r[0].apply(null, r[1]);
        }
      } while (Se.length > 0);
      _e = !0, we = !0;
    }
    function Ve() {
      var e = xe;
      xe = [], e.forEach((e => {
        e._PSD.onunhandled.call(null, e._value, e);
      }));
      for (var t = Ce.slice(0), n = t.length; n; ) t[--n]();
    }
    function We(e) {
      return new je(le, !1, e);
    }
    function Ye(e, t) {
      var n = Oe;
      return function() {
        var r = Ue(), s = Oe;
        try {
          return it(n, !0), e.apply(this, arguments);
        } catch (e) {
          t && t(e);
        } finally {
          it(s, !1), r && Le();
        }
      };
    }
    a(je.prototype, {
      then: De,
      _then: function(e, t) {
        Fe(this, new Ie(null, null, e, t, Oe));
      },
      catch: function(e) {
        if (1 === arguments.length) return this.then(null, e);
        var t = arguments[0], n = arguments[1];
        return "function" == typeof t ? this.then(null, (e => e instanceof t ? n(e) : We(e))) : this.then(null, (e => e && e.name === t ? n(e) : We(e)));
      },
      finally: function(e) {
        return this.then((t => (e(), t)), (t => (e(), We(t))));
      },
      stack: {
        get: function() {
          if (this._stack) return this._stack;
          try {
            ve = !0;
            var e = Ne(this, [], 20).join("\nFrom previous: ");
            return null !== this._state && (this._stack = e), e;
          } finally {
            ve = !1;
          }
        }
      },
      timeout: function(e, t) {
        return e < 1 / 0 ? new je(((n, r) => {
          var s = setTimeout((() => r(new X.Timeout(t))), e);
          this.then(n, r).finally(clearTimeout.bind(null, s));
        })) : this;
      }
    }), "undefined" != typeof Symbol && Symbol.toStringTag && l(je.prototype, Symbol.toStringTag, "Dexie.Promise"), 
    Ke.env = ot(), a(je, {
      all: function() {
        var e = B.apply(null, arguments).map(nt);
        return new je((function(t, n) {
          0 === e.length && t([]);
          var r = e.length;
          e.forEach(((s, i) => je.resolve(s).then((n => {
            e[i] = n, --r || t(e);
          }), n)));
        }));
      },
      resolve: e => {
        if (e instanceof je) return e;
        if (e && "function" == typeof e.then) return new je(((t, n) => {
          e.then(t, n);
        }));
        var t = new je(le, !0, e);
        return qe(t, Ee), t;
      },
      reject: We,
      race: function() {
        var e = B.apply(null, arguments).map(nt);
        return new je(((t, n) => {
          e.map((e => je.resolve(e).then(t, n)));
        }));
      },
      PSD: {
        get: () => Oe,
        set: e => Oe = e
      },
      totalEchoes: {
        get: () => Xe
      },
      newPSD: Ze,
      usePSD: at,
      scheduler: {
        get: () => be,
        set: e => {
          be = e;
        }
      },
      rejectionMapper: {
        get: () => Pe,
        set: e => {
          Pe = e;
        }
      },
      follow: (e, t) => new je(((n, r) => Ze(((t, n) => {
        var r = Oe;
        r.unhandleds = [], r.onunhandled = n, r.finalize = re((function() {
          !function(e) {
            function t() {
              e(), Ce.splice(Ce.indexOf(t), 1);
            }
            Ce.push(t), ++Ae, be((() => {
              0 == --Ae && Ve();
            }), []);
          }((() => {
            0 === this.unhandleds.length ? t() : n(this.unhandleds[0]);
          }));
        }), r.finalize), e();
      }), t, n, r)))
    }), ye && (ye.allSettled && l(je, "allSettled", (function() {
      const e = B.apply(null, arguments).map(nt);
      return new je((t => {
        0 === e.length && t([]);
        let n = e.length;
        const r = new Array(n);
        e.forEach(((e, s) => je.resolve(e).then((e => r[s] = {
          status: "fulfilled",
          value: e
        }), (e => r[s] = {
          status: "rejected",
          reason: e
        })).then((() => --n || t(r)))));
      }));
    })), ye.any && "undefined" != typeof AggregateError && l(je, "any", (function() {
      const e = B.apply(null, arguments).map(nt);
      return new je(((t, n) => {
        0 === e.length && n(new AggregateError([]));
        let r = e.length;
        const s = new Array(r);
        e.forEach(((e, i) => je.resolve(e).then((e => t(e)), (e => {
          s[i] = e, --r || n(new AggregateError(s));
        }))));
      }));
    })));
    const ze = {
      awaits: 0,
      echoes: 0,
      id: 0
    };
    var Ge = 0, He = [], Qe = 0, Xe = 0, Je = 0;
    function Ze(e, t, n, s) {
      var i = Oe, o = Object.create(i);
      o.parent = i, o.ref = 0, o.global = !1, o.id = ++Je;
      var a = Ke.env;
      o.env = me ? {
        Promise: je,
        PromiseProp: {
          value: je,
          configurable: !0,
          writable: !0
        },
        all: je.all,
        race: je.race,
        allSettled: je.allSettled,
        any: je.any,
        resolve: je.resolve,
        reject: je.reject,
        nthen: ct(a.nthen, o),
        gthen: ct(a.gthen, o)
      } : {}, t && r(o, t), ++i.ref, o.finalize = function() {
        --this.parent.ref || this.parent.finalize();
      };
      var u = at(o, e, n, s);
      return 0 === o.ref && o.finalize(), u;
    }
    function et() {
      return ze.id || (ze.id = ++Ge), ++ze.awaits, ze.echoes += ce, ze.id;
    }
    function tt() {
      return !!ze.awaits && (0 == --ze.awaits && (ze.id = 0), ze.echoes = ze.awaits * ce, 
      !0);
    }
    function nt(e) {
      return ze.echoes && e && e.constructor === ye ? (et(), e.then((e => (tt(), e)), (e => (tt(), 
      ft(e))))) : e;
    }
    function rt(e) {
      ++Xe, ze.echoes && 0 != --ze.echoes || (ze.echoes = ze.id = 0), He.push(Oe), it(e, !0);
    }
    function st() {
      var e = He[He.length - 1];
      He.pop(), it(e, !1);
    }
    function it(t, n) {
      var r = Oe;
      if ((n ? !ze.echoes || Qe++ && t === Oe : !Qe || --Qe && t === Oe) || ut(n ? rt.bind(null, t) : st), 
      t !== Oe && (Oe = t, r === Ke && (Ke.env = ot()), me)) {
        var s = Ke.env.Promise, i = t.env;
        de.then = i.nthen, s.prototype.then = i.gthen, (r.global || t.global) && (Object.defineProperty(e, "Promise", i.PromiseProp), 
        s.all = i.all, s.race = i.race, s.resolve = i.resolve, s.reject = i.reject, i.allSettled && (s.allSettled = i.allSettled), 
        i.any && (s.any = i.any));
      }
    }
    function ot() {
      var t = e.Promise;
      return me ? {
        Promise: t,
        PromiseProp: Object.getOwnPropertyDescriptor(e, "Promise"),
        all: t.all,
        race: t.race,
        allSettled: t.allSettled,
        any: t.any,
        resolve: t.resolve,
        reject: t.reject,
        nthen: de.then,
        gthen: t.prototype.then
      } : {};
    }
    function at(e, t, n, r, s) {
      var i = Oe;
      try {
        return it(e, !0), t(n, r, s);
      } finally {
        it(i, !1);
      }
    }
    function ut(e) {
      pe.call(he, e);
    }
    function lt(e, t, n, r) {
      return "function" != typeof e ? e : function() {
        var s = Oe;
        n && et(), it(t, !0);
        try {
          return e.apply(this, arguments);
        } finally {
          it(s, !1), r && ut(tt);
        }
      };
    }
    function ct(e, t) {
      return function(n, r) {
        return e.call(this, lt(n, t), lt(r, t));
      };
    }
    -1 === ("" + pe).indexOf("[native code]") && (et = tt = ee);
    const ht = "unhandledrejection";
    function dt(t, n) {
      var s;
      try {
        s = n.onuncatched(t);
      } catch (e) {}
      if (!1 !== s) try {
        var i, o = {
          promise: n,
          reason: t
        };
        if (e.document && document.createEvent ? ((i = document.createEvent("Event")).initEvent(ht, !0, !0), 
        r(i, o)) : e.CustomEvent && r(i = new CustomEvent(ht, {
          detail: o
        }), o), i && e.dispatchEvent && (dispatchEvent(i), !e.PromiseRejectionEvent && e.onunhandledrejection)) try {
          e.onunhandledrejection(i);
        } catch (e) {}
        R && i && !i.defaultPrevented && console.warn(`Unhandled rejection: ${t.stack || t}`);
      } catch (e) {}
    }
    var ft = je.reject;
    function pt(e, t, n, r) {
      if (e.idbdb && (e._state.openComplete || Oe.letThrough || e._vip)) {
        var s = e._createTransaction(t, n, e._dbSchema);
        try {
          s.create(), e._state.PR1398_maxLoop = 3;
        } catch (s) {
          return s.name === H.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), 
          e._close(), e.open().then((() => pt(e, t, n, r)))) : ft(s);
        }
        return s._promise(t, ((e, t) => Ze((() => (Oe.trans = s, r(e, t, s)))))).then((e => s._completion.then((() => e))));
      }
      if (e._state.openComplete) return ft(new X.DatabaseClosed(e._state.dbOpenError));
      if (!e._state.isBeingOpened) {
        if (!e._options.autoOpen) return ft(new X.DatabaseClosed);
        e.open().catch(ee);
      }
      return e._state.dbReadyPromise.then((() => pt(e, t, n, r)));
    }
    const yt = "3.2.7", mt = String.fromCharCode(65535), vt = -1 / 0, gt = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", bt = "String expected.", _t = [], wt = "undefined" != typeof navigator && /(MSIE|Trident|Edge)/.test(navigator.userAgent), xt = wt, kt = wt, Et = e => !/(dexie\.js|dexie\.min\.js)/.test(e), Pt = "__dbnames", Kt = "readonly", Ot = "readwrite";
    function St(e, t) {
      return e ? t ? function() {
        return e.apply(this, arguments) && t.apply(this, arguments);
      } : e : t;
    }
    const At = {
      type: 3,
      lower: -1 / 0,
      lowerOpen: !1,
      upper: [ [] ],
      upperOpen: !1
    };
    function Ct(e) {
      return "string" != typeof e || /\./.test(e) ? e => e : t => (void 0 === t[e] && e in t && delete (t = O(t))[e], 
      t);
    }
    class jt {
      _trans(e, t, n) {
        const r = this._tx || Oe.trans, s = this.name;
        function i(e, n, r) {
          if (!r.schema[s]) throw new X.NotFound("Table " + s + " not part of transaction");
          return t(r.idbtrans, r);
        }
        const o = Ue();
        try {
          return r && r.db === this.db ? r === Oe.trans ? r._promise(e, i, n) : Ze((() => r._promise(e, i, n)), {
            trans: r,
            transless: Oe.transless || Oe
          }) : pt(this.db, e, [ this.name ], i);
        } finally {
          o && Le();
        }
      }
      get(e, t) {
        return e && e.constructor === Object ? this.where(e).first(t) : this._trans("readonly", (t => this.core.get({
          trans: t,
          key: e
        }).then((e => this.hook.reading.fire(e))))).then(t);
      }
      where(e) {
        if ("string" == typeof e) return new this.db.WhereClause(this, e);
        if (n(e)) return new this.db.WhereClause(this, `[${e.join("+")}]`);
        const r = t(e);
        if (1 === r.length) return this.where(r[0]).equals(e[r[0]]);
        const s = this.schema.indexes.concat(this.schema.primKey).filter((e => {
          if (e.compound && r.every((t => e.keyPath.indexOf(t) >= 0))) {
            for (let t = 0; t < r.length; ++t) if (-1 === r.indexOf(e.keyPath[t])) return !1;
            return !0;
          }
          return !1;
        })).sort(((e, t) => e.keyPath.length - t.keyPath.length))[0];
        if (s && this.db._maxKey !== mt) {
          const t = s.keyPath.slice(0, r.length);
          return this.where(t).equals(t.map((t => e[t])));
        }
        !s && R && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${r.join("+")}]`);
        const {idxByName: i} = this.schema, o = this.db._deps.indexedDB;
        function a(e, t) {
          try {
            return 0 === o.cmp(e, t);
          } catch (e) {
            return !1;
          }
        }
        const [u, l] = r.reduce((([t, r], s) => {
          const o = i[s], u = e[s];
          return [ t || o, t || !o ? St(r, o && o.multi ? e => {
            const t = b(e, s);
            return n(t) && t.some((e => a(u, e)));
          } : e => a(u, b(e, s))) : r ];
        }), [ null, null ]);
        return u ? this.where(u.name).equals(e[u.keyPath]).filter(l) : s ? this.filter(l) : this.where(r).equals("");
      }
      filter(e) {
        return this.toCollection().and(e);
      }
      count(e) {
        return this.toCollection().count(e);
      }
      offset(e) {
        return this.toCollection().offset(e);
      }
      limit(e) {
        return this.toCollection().limit(e);
      }
      each(e) {
        return this.toCollection().each(e);
      }
      toArray(e) {
        return this.toCollection().toArray(e);
      }
      toCollection() {
        return new this.db.Collection(new this.db.WhereClause(this));
      }
      orderBy(e) {
        return new this.db.Collection(new this.db.WhereClause(this, n(e) ? `[${e.join("+")}]` : e));
      }
      reverse() {
        return this.toCollection().reverse();
      }
      mapToClass(e) {
        this.schema.mappedClass = e;
        const t = t => {
          if (!t) return t;
          const n = Object.create(e.prototype);
          for (var r in t) if (o(t, r)) try {
            n[r] = t[r];
          } catch (e) {}
          return n;
        };
        return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), 
        this.schema.readHook = t, this.hook("reading", t), e;
      }
      defineClass() {
        return this.mapToClass((function(e) {
          r(this, e);
        }));
      }
      add(e, t) {
        const {auto: n, keyPath: r} = this.schema.primKey;
        let s = e;
        return r && n && (s = Ct(r)(e)), this._trans("readwrite", (e => this.core.mutate({
          trans: e,
          type: "add",
          keys: null != t ? [ t ] : null,
          values: [ s ]
        }))).then((e => e.numFailures ? je.reject(e.failures[0]) : e.lastResult)).then((t => {
          if (r) try {
            _(e, r, t);
          } catch (e) {}
          return t;
        }));
      }
      update(e, r) {
        if ("object" != typeof e || n(e)) return this.where(":id").equals(e).modify(r);
        {
          const n = b(e, this.schema.primKey.keyPath);
          if (void 0 === n) return ft(new X.InvalidArgument("Given object does not contain its primary key"));
          try {
            "function" != typeof r ? t(r).forEach((t => {
              _(e, t, r[t]);
            })) : r(e, {
              value: e,
              primKey: n
            });
          } catch (e) {}
          return this.where(":id").equals(n).modify(r);
        }
      }
      put(e, t) {
        const {auto: n, keyPath: r} = this.schema.primKey;
        let s = e;
        return r && n && (s = Ct(r)(e)), this._trans("readwrite", (e => this.core.mutate({
          trans: e,
          type: "put",
          values: [ s ],
          keys: null != t ? [ t ] : null
        }))).then((e => e.numFailures ? je.reject(e.failures[0]) : e.lastResult)).then((t => {
          if (r) try {
            _(e, r, t);
          } catch (e) {}
          return t;
        }));
      }
      delete(e) {
        return this._trans("readwrite", (t => this.core.mutate({
          trans: t,
          type: "delete",
          keys: [ e ]
        }))).then((e => e.numFailures ? je.reject(e.failures[0]) : void 0));
      }
      clear() {
        return this._trans("readwrite", (e => this.core.mutate({
          trans: e,
          type: "deleteRange",
          range: At
        }))).then((e => e.numFailures ? je.reject(e.failures[0]) : void 0));
      }
      bulkGet(e) {
        return this._trans("readonly", (t => this.core.getMany({
          keys: e,
          trans: t
        }).then((e => e.map((e => this.hook.reading.fire(e)))))));
      }
      bulkAdd(e, t, n) {
        const r = Array.isArray(t) ? t : void 0, s = (n = n || (r ? void 0 : t)) ? n.allKeys : void 0;
        return this._trans("readwrite", (t => {
          const {auto: n, keyPath: i} = this.schema.primKey;
          if (i && r) throw new X.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
          if (r && r.length !== e.length) throw new X.InvalidArgument("Arguments objects and keys must have the same length");
          const o = e.length;
          let a = i && n ? e.map(Ct(i)) : e;
          return this.core.mutate({
            trans: t,
            type: "add",
            keys: r,
            values: a,
            wantResults: s
          }).then((({numFailures: e, results: t, lastResult: n, failures: r}) => {
            if (0 === e) return s ? t : n;
            throw new G(`${this.name}.bulkAdd(): ${e} of ${o} operations failed`, r);
          }));
        }));
      }
      bulkPut(e, t, n) {
        const r = Array.isArray(t) ? t : void 0, s = (n = n || (r ? void 0 : t)) ? n.allKeys : void 0;
        return this._trans("readwrite", (t => {
          const {auto: n, keyPath: i} = this.schema.primKey;
          if (i && r) throw new X.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
          if (r && r.length !== e.length) throw new X.InvalidArgument("Arguments objects and keys must have the same length");
          const o = e.length;
          let a = i && n ? e.map(Ct(i)) : e;
          return this.core.mutate({
            trans: t,
            type: "put",
            keys: r,
            values: a,
            wantResults: s
          }).then((({numFailures: e, results: t, lastResult: n, failures: r}) => {
            if (0 === e) return s ? t : n;
            throw new G(`${this.name}.bulkPut(): ${e} of ${o} operations failed`, r);
          }));
        }));
      }
      bulkDelete(e) {
        const t = e.length;
        return this._trans("readwrite", (t => this.core.mutate({
          trans: t,
          type: "delete",
          keys: e
        }))).then((({numFailures: e, lastResult: n, failures: r}) => {
          if (0 === e) return n;
          throw new G(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`, r);
        }));
      }
    }
    function Dt(e) {
      var r = {}, s = function(t, n) {
        if (n) {
          for (var s = arguments.length, i = new Array(s - 1); --s; ) i[s - 1] = arguments[s];
          return r[t].subscribe.apply(null, i), e;
        }
        if ("string" == typeof t) return r[t];
      };
      s.addEventType = a;
      for (var i = 1, o = arguments.length; i < o; ++i) a(arguments[i]);
      return s;
      function a(e, i, o) {
        if ("object" != typeof e) {
          var u;
          i || (i = ae), o || (o = ee);
          var l = {
            subscribers: [],
            fire: o,
            subscribe: function(e) {
              -1 === l.subscribers.indexOf(e) && (l.subscribers.push(e), l.fire = i(l.fire, e));
            },
            unsubscribe: function(e) {
              l.subscribers = l.subscribers.filter((function(t) {
                return t !== e;
              })), l.fire = l.subscribers.reduce(i, o);
            }
          };
          return r[e] = s[e] = l, l;
        }
        t(u = e).forEach((function(e) {
          var t = u[e];
          if (n(t)) a(e, u[e][0], u[e][1]); else {
            if ("asap" !== t) throw new X.InvalidArgument("Invalid event config");
            var r = a(e, te, (function() {
              for (var e = arguments.length, t = new Array(e); e--; ) t[e] = arguments[e];
              r.subscribers.forEach((function(e) {
                v((function() {
                  e.apply(null, t);
                }));
              }));
            }));
          }
        }));
      }
    }
    function It(e, t) {
      return c(t).from({
        prototype: e
      }), t;
    }
    function Bt(e, t) {
      return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
    }
    function Tt(e, t) {
      e.filter = St(e.filter, t);
    }
    function Rt(e, t, n) {
      var r = e.replayFilter;
      e.replayFilter = r ? () => St(r(), t()) : t, e.justLimit = n && !r;
    }
    function Ft(e, t) {
      if (e.isPrimKey) return t.primaryKey;
      const n = t.getIndexByKeyPath(e.index);
      if (!n) throw new X.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
      return n;
    }
    function Mt(e, t, n) {
      const r = Ft(e, t.schema);
      return t.openCursor({
        trans: n,
        values: !e.keysOnly,
        reverse: "prev" === e.dir,
        unique: !!e.unique,
        query: {
          index: r,
          range: e.range
        }
      });
    }
    function Nt(e, t, n, r) {
      const s = e.replayFilter ? St(e.filter, e.replayFilter()) : e.filter;
      if (e.or) {
        const i = {}, a = (e, n, r) => {
          if (!s || s(n, r, (e => n.stop(e)), (e => n.fail(e)))) {
            var a = n.primaryKey, u = "" + a;
            "[object ArrayBuffer]" === u && (u = "" + new Uint8Array(a)), o(i, u) || (i[u] = !0, 
            t(e, n, r));
          }
        };
        return Promise.all([ e.or._iterate(a, n), qt(Mt(e, r, n), e.algorithm, a, !e.keysOnly && e.valueMapper) ]);
      }
      return qt(Mt(e, r, n), St(e.algorithm, s), t, !e.keysOnly && e.valueMapper);
    }
    function qt(e, t, n, r) {
      var s = Ye(r ? (e, t, s) => n(r(e), t, s) : n);
      return e.then((e => {
        if (e) return e.start((() => {
          var n = () => e.continue();
          t && !t(e, (e => n = e), (t => {
            e.stop(t), n = ee;
          }), (t => {
            e.fail(t), n = ee;
          })) || s(e.value, e, (e => n = e)), n();
        }));
      }));
    }
    function $t(e, t) {
      try {
        const n = Ut(e), r = Ut(t);
        if (n !== r) return "Array" === n ? 1 : "Array" === r ? -1 : "binary" === n ? 1 : "binary" === r ? -1 : "string" === n ? 1 : "string" === r ? -1 : "Date" === n ? 1 : "Date" !== r ? NaN : -1;
        switch (n) {
         case "number":
         case "Date":
         case "string":
          return e > t ? 1 : e < t ? -1 : 0;

         case "binary":
          return function(e, t) {
            const n = e.length, r = t.length, s = n < r ? n : r;
            for (let n = 0; n < s; ++n) if (e[n] !== t[n]) return e[n] < t[n] ? -1 : 1;
            return n === r ? 0 : n < r ? -1 : 1;
          }(Lt(e), Lt(t));

         case "Array":
          return function(e, t) {
            const n = e.length, r = t.length, s = n < r ? n : r;
            for (let n = 0; n < s; ++n) {
              const r = $t(e[n], t[n]);
              if (0 !== r) return r;
            }
            return n === r ? 0 : n < r ? -1 : 1;
          }(e, t);
        }
      } catch (e) {}
      return NaN;
    }
    function Ut(e) {
      const t = typeof e;
      if ("object" !== t) return t;
      if (ArrayBuffer.isView(e)) return "binary";
      const n = C(e);
      return "ArrayBuffer" === n ? "binary" : n;
    }
    function Lt(e) {
      return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
    }
    class Vt {
      _read(e, t) {
        var n = this._ctx;
        return n.error ? n.table._trans(null, ft.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
      }
      _write(e) {
        var t = this._ctx;
        return t.error ? t.table._trans(null, ft.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
      }
      _addAlgorithm(e) {
        var t = this._ctx;
        t.algorithm = St(t.algorithm, e);
      }
      _iterate(e, t) {
        return Nt(this._ctx, e, t, this._ctx.table.core);
      }
      clone(e) {
        var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
        return e && r(n, e), t._ctx = n, t;
      }
      raw() {
        return this._ctx.valueMapper = null, this;
      }
      each(e) {
        var t = this._ctx;
        return this._read((n => Nt(t, e, n, t.table.core)));
      }
      count(e) {
        return this._read((e => {
          const t = this._ctx, n = t.table.core;
          if (Bt(t, !0)) return n.count({
            trans: e,
            query: {
              index: Ft(t, n.schema),
              range: t.range
            }
          }).then((e => Math.min(e, t.limit)));
          var r = 0;
          return Nt(t, (() => (++r, !1)), e, n).then((() => r));
        })).then(e);
      }
      sortBy(e, t) {
        const n = e.split(".").reverse(), r = n[0], s = n.length - 1;
        function i(e, t) {
          return t ? i(e[n[t]], t - 1) : e[r];
        }
        var o = "next" === this._ctx.dir ? 1 : -1;
        function a(e, t) {
          var n = i(e, s), r = i(t, s);
          return n < r ? -o : n > r ? o : 0;
        }
        return this.toArray((function(e) {
          return e.sort(a);
        })).then(t);
      }
      toArray(e) {
        return this._read((e => {
          var t = this._ctx;
          if ("next" === t.dir && Bt(t, !0) && t.limit > 0) {
            const {valueMapper: n} = t, r = Ft(t, t.table.core.schema);
            return t.table.core.query({
              trans: e,
              limit: t.limit,
              values: !0,
              query: {
                index: r,
                range: t.range
              }
            }).then((({result: e}) => n ? e.map(n) : e));
          }
          {
            const n = [];
            return Nt(t, (e => n.push(e)), e, t.table.core).then((() => n));
          }
        }), e);
      }
      offset(e) {
        var t = this._ctx;
        return e <= 0 || (t.offset += e, Bt(t) ? Rt(t, (() => {
          var t = e;
          return (e, n) => 0 === t || (1 === t ? (--t, !1) : (n((() => {
            e.advance(t), t = 0;
          })), !1));
        })) : Rt(t, (() => {
          var t = e;
          return () => --t < 0;
        }))), this;
      }
      limit(e) {
        return this._ctx.limit = Math.min(this._ctx.limit, e), Rt(this._ctx, (() => {
          var t = e;
          return function(e, n, r) {
            return --t <= 0 && n(r), t >= 0;
          };
        }), !0), this;
      }
      until(e, t) {
        return Tt(this._ctx, (function(n, r, s) {
          return !e(n.value) || (r(s), t);
        })), this;
      }
      first(e) {
        return this.limit(1).toArray((function(e) {
          return e[0];
        })).then(e);
      }
      last(e) {
        return this.reverse().first(e);
      }
      filter(e) {
        var t, n;
        return Tt(this._ctx, (function(t) {
          return e(t.value);
        })), t = this._ctx, n = e, t.isMatch = St(t.isMatch, n), this;
      }
      and(e) {
        return this.filter(e);
      }
      or(e) {
        return new this.db.WhereClause(this._ctx.table, e, this);
      }
      reverse() {
        return this._ctx.dir = "prev" === this._ctx.dir ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), 
        this;
      }
      desc() {
        return this.reverse();
      }
      eachKey(e) {
        var t = this._ctx;
        return t.keysOnly = !t.isMatch, this.each((function(t, n) {
          e(n.key, n);
        }));
      }
      eachUniqueKey(e) {
        return this._ctx.unique = "unique", this.eachKey(e);
      }
      eachPrimaryKey(e) {
        var t = this._ctx;
        return t.keysOnly = !t.isMatch, this.each((function(t, n) {
          e(n.primaryKey, n);
        }));
      }
      keys(e) {
        var t = this._ctx;
        t.keysOnly = !t.isMatch;
        var n = [];
        return this.each((function(e, t) {
          n.push(t.key);
        })).then((function() {
          return n;
        })).then(e);
      }
      primaryKeys(e) {
        var t = this._ctx;
        if ("next" === t.dir && Bt(t, !0) && t.limit > 0) return this._read((e => {
          var n = Ft(t, t.table.core.schema);
          return t.table.core.query({
            trans: e,
            values: !1,
            limit: t.limit,
            query: {
              index: n,
              range: t.range
            }
          });
        })).then((({result: e}) => e)).then(e);
        t.keysOnly = !t.isMatch;
        var n = [];
        return this.each((function(e, t) {
          n.push(t.primaryKey);
        })).then((function() {
          return n;
        })).then(e);
      }
      uniqueKeys(e) {
        return this._ctx.unique = "unique", this.keys(e);
      }
      firstKey(e) {
        return this.limit(1).keys((function(e) {
          return e[0];
        })).then(e);
      }
      lastKey(e) {
        return this.reverse().firstKey(e);
      }
      distinct() {
        var e = this._ctx, t = e.index && e.table.schema.idxByName[e.index];
        if (!t || !t.multi) return this;
        var n = {};
        return Tt(this._ctx, (function(e) {
          var t = e.primaryKey.toString(), r = o(n, t);
          return n[t] = !0, !r;
        })), this;
      }
      modify(e) {
        var n = this._ctx;
        return this._write((r => {
          var s;
          if ("function" == typeof e) s = e; else {
            var i = t(e), o = i.length;
            s = function(t) {
              for (var n = !1, r = 0; r < o; ++r) {
                var s = i[r], a = e[s];
                b(t, s) !== a && (_(t, s, a), n = !0);
              }
              return n;
            };
          }
          const a = n.table.core, {outbound: u, extractKey: l} = a.schema.primaryKey, c = this.db._options.modifyChunkSize || 200, h = [];
          let d = 0;
          const f = [], p = (e, n) => {
            const {failures: r, numFailures: s} = n;
            d += e - s;
            for (let e of t(r)) h.push(r[e]);
          };
          return this.clone().primaryKeys().then((t => {
            const i = o => {
              const h = Math.min(c, t.length - o);
              return a.getMany({
                trans: r,
                keys: t.slice(o, o + h),
                cache: "immutable"
              }).then((d => {
                const f = [], y = [], m = u ? [] : null, v = [];
                for (let e = 0; e < h; ++e) {
                  const n = d[e], r = {
                    value: O(n),
                    primKey: t[o + e]
                  };
                  !1 !== s.call(r, r.value, r) && (null == r.value ? v.push(t[o + e]) : u || 0 === $t(l(n), l(r.value)) ? (y.push(r.value), 
                  u && m.push(t[o + e])) : (v.push(t[o + e]), f.push(r.value)));
                }
                const g = Bt(n) && n.limit === 1 / 0 && ("function" != typeof e || e === Wt) && {
                  index: n.index,
                  range: n.range
                };
                return Promise.resolve(f.length > 0 && a.mutate({
                  trans: r,
                  type: "add",
                  values: f
                }).then((e => {
                  for (let t in e.failures) v.splice(parseInt(t), 1);
                  p(f.length, e);
                }))).then((() => (y.length > 0 || g && "object" == typeof e) && a.mutate({
                  trans: r,
                  type: "put",
                  keys: m,
                  values: y,
                  criteria: g,
                  changeSpec: "function" != typeof e && e
                }).then((e => p(y.length, e))))).then((() => (v.length > 0 || g && e === Wt) && a.mutate({
                  trans: r,
                  type: "delete",
                  keys: v,
                  criteria: g
                }).then((e => p(v.length, e))))).then((() => t.length > o + h && i(o + c)));
              }));
            };
            return i(0).then((() => {
              if (h.length > 0) throw new z("Error modifying one or more objects", h, d, f);
              return t.length;
            }));
          }));
        }));
      }
      delete() {
        var e = this._ctx, t = e.range;
        return Bt(e) && (e.isPrimKey && !kt || 3 === t.type) ? this._write((n => {
          const {primaryKey: r} = e.table.core.schema, s = t;
          return e.table.core.count({
            trans: n,
            query: {
              index: r,
              range: s
            }
          }).then((t => e.table.core.mutate({
            trans: n,
            type: "deleteRange",
            range: s
          }).then((({failures: e, lastResult: n, results: r, numFailures: s}) => {
            if (s) throw new z("Could not delete some values", Object.keys(e).map((t => e[t])), t - s);
            return t - s;
          }))));
        })) : this.modify(Wt);
      }
    }
    const Wt = (e, t) => t.value = null;
    function Yt(e, t) {
      return e < t ? -1 : e === t ? 0 : 1;
    }
    function zt(e, t) {
      return e > t ? -1 : e === t ? 0 : 1;
    }
    function Gt(e, t, n) {
      var r = e instanceof en ? new e.Collection(e) : e;
      return r._ctx.error = n ? new n(t) : new TypeError(t), r;
    }
    function Ht(e) {
      return new e.Collection(e, (() => Zt(""))).limit(0);
    }
    function Qt(e, t, n, r, s, i) {
      for (var o = Math.min(e.length, r.length), a = -1, u = 0; u < o; ++u) {
        var l = t[u];
        if (l !== r[u]) return s(e[u], n[u]) < 0 ? e.substr(0, u) + n[u] + n.substr(u + 1) : s(e[u], r[u]) < 0 ? e.substr(0, u) + r[u] + n.substr(u + 1) : a >= 0 ? e.substr(0, a) + t[a] + n.substr(a + 1) : null;
        s(e[u], l) < 0 && (a = u);
      }
      return o < r.length && "next" === i ? e + n.substr(e.length) : o < e.length && "prev" === i ? e.substr(0, n.length) : a < 0 ? null : e.substr(0, a) + r[a] + n.substr(a + 1);
    }
    function Xt(e, t, n, r) {
      var s, i, o, a, u, l, c, h = n.length;
      if (!n.every((e => "string" == typeof e))) return Gt(e, bt);
      function d(e) {
        s = function(e) {
          return "next" === e ? e => e.toUpperCase() : e => e.toLowerCase();
        }(e), i = function(e) {
          return "next" === e ? e => e.toLowerCase() : e => e.toUpperCase();
        }(e), o = "next" === e ? Yt : zt;
        var t = n.map((function(e) {
          return {
            lower: i(e),
            upper: s(e)
          };
        })).sort((function(e, t) {
          return o(e.lower, t.lower);
        }));
        a = t.map((function(e) {
          return e.upper;
        })), u = t.map((function(e) {
          return e.lower;
        })), l = e, c = "next" === e ? "" : r;
      }
      d("next");
      var f = new e.Collection(e, (() => Jt(a[0], u[h - 1] + r)));
      f._ondirectionchange = function(e) {
        d(e);
      };
      var p = 0;
      return f._addAlgorithm((function(e, n, r) {
        var s = e.key;
        if ("string" != typeof s) return !1;
        var d = i(s);
        if (t(d, u, p)) return !0;
        for (var f = null, y = p; y < h; ++y) {
          var m = Qt(s, d, a[y], u[y], o, l);
          null === m && null === f ? p = y + 1 : (null === f || o(f, m) > 0) && (f = m);
        }
        return n(null !== f ? function() {
          e.continue(f + c);
        } : r), !1;
      })), f;
    }
    function Jt(e, t, n, r) {
      return {
        type: 2,
        lower: e,
        upper: t,
        lowerOpen: n,
        upperOpen: r
      };
    }
    function Zt(e) {
      return {
        type: 1,
        lower: e,
        upper: e
      };
    }
    class en {
      get Collection() {
        return this._ctx.table.db.Collection;
      }
      between(e, t, n, r) {
        n = !1 !== n, r = !0 === r;
        try {
          return this._cmp(e, t) > 0 || 0 === this._cmp(e, t) && (n || r) && (!n || !r) ? Ht(this) : new this.Collection(this, (() => Jt(e, t, !n, !r)));
        } catch (e) {
          return Gt(this, gt);
        }
      }
      equals(e) {
        return null == e ? Gt(this, gt) : new this.Collection(this, (() => Zt(e)));
      }
      above(e) {
        return null == e ? Gt(this, gt) : new this.Collection(this, (() => Jt(e, void 0, !0)));
      }
      aboveOrEqual(e) {
        return null == e ? Gt(this, gt) : new this.Collection(this, (() => Jt(e, void 0, !1)));
      }
      below(e) {
        return null == e ? Gt(this, gt) : new this.Collection(this, (() => Jt(void 0, e, !1, !0)));
      }
      belowOrEqual(e) {
        return null == e ? Gt(this, gt) : new this.Collection(this, (() => Jt(void 0, e)));
      }
      startsWith(e) {
        return "string" != typeof e ? Gt(this, bt) : this.between(e, e + mt, !0, !0);
      }
      startsWithIgnoreCase(e) {
        return "" === e ? this.startsWith(e) : Xt(this, ((e, t) => 0 === e.indexOf(t[0])), [ e ], mt);
      }
      equalsIgnoreCase(e) {
        return Xt(this, ((e, t) => e === t[0]), [ e ], "");
      }
      anyOfIgnoreCase() {
        var e = B.apply(I, arguments);
        return 0 === e.length ? Ht(this) : Xt(this, ((e, t) => -1 !== t.indexOf(e)), e, "");
      }
      startsWithAnyOfIgnoreCase() {
        var e = B.apply(I, arguments);
        return 0 === e.length ? Ht(this) : Xt(this, ((e, t) => t.some((t => 0 === e.indexOf(t)))), e, mt);
      }
      anyOf() {
        const e = B.apply(I, arguments);
        let t = this._cmp;
        try {
          e.sort(t);
        } catch (e) {
          return Gt(this, gt);
        }
        if (0 === e.length) return Ht(this);
        const n = new this.Collection(this, (() => Jt(e[0], e[e.length - 1])));
        n._ondirectionchange = n => {
          t = "next" === n ? this._ascending : this._descending, e.sort(t);
        };
        let r = 0;
        return n._addAlgorithm(((n, s, i) => {
          const o = n.key;
          for (;t(o, e[r]) > 0; ) if (++r, r === e.length) return s(i), !1;
          return 0 === t(o, e[r]) || (s((() => {
            n.continue(e[r]);
          })), !1);
        })), n;
      }
      notEqual(e) {
        return this.inAnyRange([ [ vt, e ], [ e, this.db._maxKey ] ], {
          includeLowers: !1,
          includeUppers: !1
        });
      }
      noneOf() {
        const e = B.apply(I, arguments);
        if (0 === e.length) return new this.Collection(this);
        try {
          e.sort(this._ascending);
        } catch (e) {
          return Gt(this, gt);
        }
        const t = e.reduce(((e, t) => e ? e.concat([ [ e[e.length - 1][1], t ] ]) : [ [ vt, t ] ]), null);
        return t.push([ e[e.length - 1], this.db._maxKey ]), this.inAnyRange(t, {
          includeLowers: !1,
          includeUppers: !1
        });
      }
      inAnyRange(e, t) {
        const n = this._cmp, r = this._ascending, s = this._descending, i = this._min, o = this._max;
        if (0 === e.length) return Ht(this);
        if (!e.every((e => void 0 !== e[0] && void 0 !== e[1] && r(e[0], e[1]) <= 0))) return Gt(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", X.InvalidArgument);
        const a = !t || !1 !== t.includeLowers, u = t && !0 === t.includeUppers;
        let l, c = r;
        function h(e, t) {
          return c(e[0], t[0]);
        }
        try {
          l = e.reduce((function(e, t) {
            let r = 0, s = e.length;
            for (;r < s; ++r) {
              const s = e[r];
              if (n(t[0], s[1]) < 0 && n(t[1], s[0]) > 0) {
                s[0] = i(s[0], t[0]), s[1] = o(s[1], t[1]);
                break;
              }
            }
            return r === s && e.push(t), e;
          }), []), l.sort(h);
        } catch (e) {
          return Gt(this, gt);
        }
        let d = 0;
        const f = u ? e => r(e, l[d][1]) > 0 : e => r(e, l[d][1]) >= 0, p = a ? e => s(e, l[d][0]) > 0 : e => s(e, l[d][0]) >= 0;
        let y = f;
        const m = new this.Collection(this, (() => Jt(l[0][0], l[l.length - 1][1], !a, !u)));
        return m._ondirectionchange = e => {
          "next" === e ? (y = f, c = r) : (y = p, c = s), l.sort(h);
        }, m._addAlgorithm(((e, t, n) => {
          for (var s = e.key; y(s); ) if (++d, d === l.length) return t(n), !1;
          return !!function(e) {
            return !f(e) && !p(e);
          }(s) || (0 === this._cmp(s, l[d][1]) || 0 === this._cmp(s, l[d][0]) || t((() => {
            c === r ? e.continue(l[d][0]) : e.continue(l[d][1]);
          })), !1);
        })), m;
      }
      startsWithAnyOf() {
        const e = B.apply(I, arguments);
        return e.every((e => "string" == typeof e)) ? 0 === e.length ? Ht(this) : this.inAnyRange(e.map((e => [ e, e + mt ]))) : Gt(this, "startsWithAnyOf() only works with strings");
      }
    }
    function tn(e) {
      return Ye((function(t) {
        return nn(t), e(t.target.error), !1;
      }));
    }
    function nn(e) {
      e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
    }
    const rn = "storagemutated", sn = "x-storagemutated-1", on = Dt(null, rn);
    class an {
      _lock() {
        return m(!Oe.global), ++this._reculock, 1 !== this._reculock || Oe.global || (Oe.lockOwnerFor = this), 
        this;
      }
      _unlock() {
        if (m(!Oe.global), 0 == --this._reculock) for (Oe.global || (Oe.lockOwnerFor = null); this._blockedFuncs.length > 0 && !this._locked(); ) {
          var e = this._blockedFuncs.shift();
          try {
            at(e[1], e[0]);
          } catch (e) {}
        }
        return this;
      }
      _locked() {
        return this._reculock && Oe.lockOwnerFor !== this;
      }
      create(e) {
        if (!this.mode) return this;
        const t = this.db.idbdb, n = this.db._state.dbOpenError;
        if (m(!this.idbtrans), !e && !t) switch (n && n.name) {
         case "DatabaseClosedError":
          throw new X.DatabaseClosed(n);

         case "MissingAPIError":
          throw new X.MissingAPI(n.message, n);

         default:
          throw new X.OpenFailed(n);
        }
        if (!this.active) throw new X.TransactionInactive;
        return m(null === this._completion._state), (e = this.idbtrans = e || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, {
          durability: this.chromeTransactionDurability
        }) : t.transaction(this.storeNames, this.mode, {
          durability: this.chromeTransactionDurability
        }))).onerror = Ye((t => {
          nn(t), this._reject(e.error);
        })), e.onabort = Ye((t => {
          nn(t), this.active && this._reject(new X.Abort(e.error)), this.active = !1, this.on("abort").fire(t);
        })), e.oncomplete = Ye((() => {
          this.active = !1, this._resolve(), "mutatedParts" in e && on.storagemutated.fire(e.mutatedParts);
        })), this;
      }
      _promise(e, t, n) {
        if ("readwrite" === e && "readwrite" !== this.mode) return ft(new X.ReadOnly("Transaction is readonly"));
        if (!this.active) return ft(new X.TransactionInactive);
        if (this._locked()) return new je(((r, s) => {
          this._blockedFuncs.push([ () => {
            this._promise(e, t, n).then(r, s);
          }, Oe ]);
        }));
        if (n) return Ze((() => {
          var e = new je(((e, n) => {
            this._lock();
            const r = t(e, n, this);
            r && r.then && r.then(e, n);
          }));
          return e.finally((() => this._unlock())), e._lib = !0, e;
        }));
        var r = new je(((e, n) => {
          var r = t(e, n, this);
          r && r.then && r.then(e, n);
        }));
        return r._lib = !0, r;
      }
      _root() {
        return this.parent ? this.parent._root() : this;
      }
      waitFor(e) {
        var t = this._root();
        const n = je.resolve(e);
        if (t._waitingFor) t._waitingFor = t._waitingFor.then((() => n)); else {
          t._waitingFor = n, t._waitingQueue = [];
          var r = t.idbtrans.objectStore(t.storeNames[0]);
          !function e() {
            for (++t._spinCount; t._waitingQueue.length; ) t._waitingQueue.shift()();
            t._waitingFor && (r.get(-1 / 0).onsuccess = e);
          }();
        }
        var s = t._waitingFor;
        return new je(((e, r) => {
          n.then((n => t._waitingQueue.push(Ye(e.bind(null, n)))), (e => t._waitingQueue.push(Ye(r.bind(null, e))))).finally((() => {
            t._waitingFor === s && (t._waitingFor = null);
          }));
        }));
      }
      abort() {
        this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new X.Abort));
      }
      table(e) {
        const t = this._memoizedTables || (this._memoizedTables = {});
        if (o(t, e)) return t[e];
        const n = this.schema[e];
        if (!n) throw new X.NotFound("Table " + e + " not part of transaction");
        const r = new this.db.Table(e, n, this);
        return r.core = this.db.core.table(e), t[e] = r, r;
      }
    }
    function un(e, t, n, r, s, i, o) {
      return {
        name: e,
        keyPath: t,
        unique: n,
        multi: r,
        auto: s,
        compound: i,
        src: (n && !o ? "&" : "") + (r ? "*" : "") + (s ? "++" : "") + ln(t)
      };
    }
    function ln(e) {
      return "string" == typeof e ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
    }
    function cn(e, t, n) {
      return {
        name: e,
        primKey: t,
        indexes: n,
        mappedClass: null,
        idxByName: g(n, (e => [ e.name, e ]))
      };
    }
    let hn = e => {
      try {
        return e.only([ [] ]), hn = () => [ [] ], [ [] ];
      } catch (e) {
        return hn = () => mt, mt;
      }
    };
    function dn(e) {
      return null == e ? () => {} : "string" == typeof e ? function(e) {
        const t = e.split(".");
        return 1 === t.length ? t => t[e] : t => b(t, e);
      }(e) : t => b(t, e);
    }
    function fn(e) {
      return [].slice.call(e);
    }
    let pn = 0;
    function yn(e) {
      return null == e ? ":id" : "string" == typeof e ? e : `[${e.join("+")}]`;
    }
    function mn(e, t, r) {
      function s(e) {
        if (3 === e.type) return null;
        if (4 === e.type) throw new Error("Cannot convert never type to IDBKeyRange");
        const {lower: n, upper: r, lowerOpen: s, upperOpen: i} = e;
        return void 0 === n ? void 0 === r ? null : t.upperBound(r, !!i) : void 0 === r ? t.lowerBound(n, !!s) : t.bound(n, r, !!s, !!i);
      }
      const {schema: i, hasGetAll: o} = function(e, t) {
        const r = fn(e.objectStoreNames);
        return {
          schema: {
            name: e.name,
            tables: r.map((e => t.objectStore(e))).map((e => {
              const {keyPath: t, autoIncrement: r} = e, s = n(t), i = null == t, o = {}, a = {
                name: e.name,
                primaryKey: {
                  name: null,
                  isPrimaryKey: !0,
                  outbound: i,
                  compound: s,
                  keyPath: t,
                  autoIncrement: r,
                  unique: !0,
                  extractKey: dn(t)
                },
                indexes: fn(e.indexNames).map((t => e.index(t))).map((e => {
                  const {name: t, unique: r, multiEntry: s, keyPath: i} = e, a = {
                    name: t,
                    compound: n(i),
                    keyPath: i,
                    unique: r,
                    multiEntry: s,
                    extractKey: dn(i)
                  };
                  return o[yn(i)] = a, a;
                })),
                getIndexByKeyPath: e => o[yn(e)]
              };
              return o[":id"] = a.primaryKey, null != t && (o[yn(t)] = a.primaryKey), a;
            }))
          },
          hasGetAll: r.length > 0 && "getAll" in t.objectStore(r[0]) && !("undefined" != typeof navigator && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604)
        };
      }(e, r), a = i.tables.map((e => function(e) {
        const t = e.name;
        return {
          name: t,
          schema: e,
          mutate: function({trans: e, type: n, keys: r, values: i, range: o}) {
            return new Promise(((a, u) => {
              a = Ye(a);
              const l = e.objectStore(t), c = null == l.keyPath, h = "put" === n || "add" === n;
              if (!h && "delete" !== n && "deleteRange" !== n) throw new Error("Invalid operation type: " + n);
              const {length: d} = r || i || {
                length: 1
              };
              if (r && i && r.length !== i.length) throw new Error("Given keys array must have same length as given values array.");
              if (0 === d) return a({
                numFailures: 0,
                failures: {},
                results: [],
                lastResult: void 0
              });
              let f;
              const p = [], y = [];
              let m = 0;
              const v = e => {
                ++m, nn(e);
              };
              if ("deleteRange" === n) {
                if (4 === o.type) return a({
                  numFailures: m,
                  failures: y,
                  results: [],
                  lastResult: void 0
                });
                3 === o.type ? p.push(f = l.clear()) : p.push(f = l.delete(s(o)));
              } else {
                const [e, t] = h ? c ? [ i, r ] : [ i, null ] : [ r, null ];
                if (h) for (let r = 0; r < d; ++r) p.push(f = t && void 0 !== t[r] ? l[n](e[r], t[r]) : l[n](e[r])), 
                f.onerror = v; else for (let t = 0; t < d; ++t) p.push(f = l[n](e[t])), f.onerror = v;
              }
              const g = e => {
                const t = e.target.result;
                p.forEach(((e, t) => null != e.error && (y[t] = e.error))), a({
                  numFailures: m,
                  failures: y,
                  results: "delete" === n ? r : p.map((e => e.result)),
                  lastResult: t
                });
              };
              f.onerror = e => {
                v(e), g(e);
              }, f.onsuccess = g;
            }));
          },
          getMany: ({trans: e, keys: n}) => new Promise(((r, s) => {
            r = Ye(r);
            const i = e.objectStore(t), o = n.length, a = new Array(o);
            let u, l = 0, c = 0;
            const h = e => {
              const t = e.target;
              a[t._pos] = t.result, ++c === l && r(a);
            }, d = tn(s);
            for (let e = 0; e < o; ++e) null != n[e] && (u = i.get(n[e]), u._pos = e, u.onsuccess = h, 
            u.onerror = d, ++l);
            0 === l && r(a);
          })),
          get: ({trans: e, key: n}) => new Promise(((r, s) => {
            r = Ye(r);
            const i = e.objectStore(t).get(n);
            i.onsuccess = e => r(e.target.result), i.onerror = tn(s);
          })),
          query: function(e) {
            return n => new Promise(((r, i) => {
              r = Ye(r);
              const {trans: o, values: a, limit: u, query: l} = n, c = u === 1 / 0 ? void 0 : u, {index: h, range: d} = l, f = o.objectStore(t), p = h.isPrimaryKey ? f : f.index(h.name), y = s(d);
              if (0 === u) return r({
                result: []
              });
              if (e) {
                const e = a ? p.getAll(y, c) : p.getAllKeys(y, c);
                e.onsuccess = e => r({
                  result: e.target.result
                }), e.onerror = tn(i);
              } else {
                let e = 0;
                const t = a || !("openKeyCursor" in p) ? p.openCursor(y) : p.openKeyCursor(y), n = [];
                t.onsuccess = s => {
                  const i = t.result;
                  return i ? (n.push(a ? i.value : i.primaryKey), ++e === u ? r({
                    result: n
                  }) : void i.continue()) : r({
                    result: n
                  });
                }, t.onerror = tn(i);
              }
            }));
          }(o),
          openCursor: function({trans: e, values: n, query: r, reverse: i, unique: o}) {
            return new Promise(((a, u) => {
              a = Ye(a);
              const {index: l, range: c} = r, h = e.objectStore(t), d = l.isPrimaryKey ? h : h.index(l.name), f = i ? o ? "prevunique" : "prev" : o ? "nextunique" : "next", p = n || !("openKeyCursor" in d) ? d.openCursor(s(c), f) : d.openKeyCursor(s(c), f);
              p.onerror = tn(u), p.onsuccess = Ye((t => {
                const n = p.result;
                if (!n) return void a(null);
                n.___id = ++pn, n.done = !1;
                const r = n.continue.bind(n);
                let s = n.continuePrimaryKey;
                s && (s = s.bind(n));
                const i = n.advance.bind(n), o = () => {
                  throw new Error("Cursor not stopped");
                };
                n.trans = e, n.stop = n.continue = n.continuePrimaryKey = n.advance = () => {
                  throw new Error("Cursor not started");
                }, n.fail = Ye(u), n.next = function() {
                  let e = 1;
                  return this.start((() => e-- ? this.continue() : this.stop())).then((() => this));
                }, n.start = e => {
                  const t = new Promise(((e, t) => {
                    e = Ye(e), p.onerror = tn(t), n.fail = t, n.stop = t => {
                      n.stop = n.continue = n.continuePrimaryKey = n.advance = o, e(t);
                    };
                  })), a = () => {
                    if (p.result) try {
                      e();
                    } catch (e) {
                      n.fail(e);
                    } else n.done = !0, n.start = () => {
                      throw new Error("Cursor behind last entry");
                    }, n.stop();
                  };
                  return p.onsuccess = Ye((e => {
                    p.onsuccess = a, a();
                  })), n.continue = r, n.continuePrimaryKey = s, n.advance = i, a(), t;
                }, a(n);
              }), u);
            }));
          },
          count({query: e, trans: n}) {
            const {index: r, range: i} = e;
            return new Promise(((e, o) => {
              const a = n.objectStore(t), u = r.isPrimaryKey ? a : a.index(r.name), l = s(i), c = l ? u.count(l) : u.count();
              c.onsuccess = Ye((t => e(t.target.result))), c.onerror = tn(o);
            }));
          }
        };
      }(e))), u = {};
      return a.forEach((e => u[e.name] = e)), {
        stack: "dbcore",
        transaction: e.transaction.bind(e),
        table(e) {
          if (!u[e]) throw new Error(`Table '${e}' not found`);
          return u[e];
        },
        MIN_KEY: -1 / 0,
        MAX_KEY: hn(t),
        schema: i
      };
    }
    function vn({_novip: e}, t) {
      const n = t.db, r = function(e, t, {IDBKeyRange: n, indexedDB: r}, s) {
        const i = function(e, t) {
          return t.reduce(((e, {create: t}) => ({
            ...e,
            ...t(e)
          })), e);
        }(mn(t, n, s), e.dbcore);
        return {
          dbcore: i
        };
      }(e._middlewares, n, e._deps, t);
      e.core = r.dbcore, e.tables.forEach((t => {
        const n = t.name;
        e.core.schema.tables.some((e => e.name === n)) && (t.core = e.core.table(n), e[n] instanceof e.Table && (e[n].core = t.core));
      }));
    }
    function gn({_novip: e}, t, n, r) {
      n.forEach((n => {
        const s = r[n];
        t.forEach((t => {
          const r = d(t, n);
          (!r || "value" in r && void 0 === r.value) && (t === e.Transaction.prototype || t instanceof e.Transaction ? l(t, n, {
            get() {
              return this.table(n);
            },
            set(e) {
              u(this, n, {
                value: e,
                writable: !0,
                configurable: !0,
                enumerable: !0
              });
            }
          }) : t[n] = new e.Table(n, s));
        }));
      }));
    }
    function bn({_novip: e}, t) {
      t.forEach((t => {
        for (let n in t) t[n] instanceof e.Table && delete t[n];
      }));
    }
    function _n(e, t) {
      return e._cfg.version - t._cfg.version;
    }
    function wn(e, n, r, s) {
      const i = e._dbSchema, o = e._createTransaction("readwrite", e._storeNames, i);
      o.create(r), o._completion.catch(s);
      const a = o._reject.bind(o), u = Oe.transless || Oe;
      Ze((() => {
        Oe.trans = o, Oe.transless = u, 0 === n ? (t(i).forEach((e => {
          kn(r, e, i[e].primKey, i[e].indexes);
        })), vn(e, r), je.follow((() => e.on.populate.fire(o))).catch(a)) : function({_novip: e}, n, r, s) {
          const i = [], o = e._versions;
          let a = e._dbSchema = Pn(e, e.idbdb, s), u = !1;
          const l = o.filter((e => e._cfg.version >= n));
          function c() {
            return i.length ? je.resolve(i.shift()(r.idbtrans)).then(c) : je.resolve();
          }
          return l.forEach((o => {
            i.push((() => {
              const i = a, l = o._cfg.dbschema;
              Kn(e, i, s), Kn(e, l, s), a = e._dbSchema = l;
              const c = xn(i, l);
              c.add.forEach((e => {
                kn(s, e[0], e[1].primKey, e[1].indexes);
              })), c.change.forEach((e => {
                if (e.recreate) throw new X.Upgrade("Not yet support for changing primary key");
                {
                  const t = s.objectStore(e.name);
                  e.add.forEach((e => En(t, e))), e.change.forEach((e => {
                    t.deleteIndex(e.name), En(t, e);
                  })), e.del.forEach((e => t.deleteIndex(e)));
                }
              }));
              const h = o._cfg.contentUpgrade;
              if (h && o._cfg.version > n) {
                vn(e, s), r._memoizedTables = {}, u = !0;
                let n = w(l);
                c.del.forEach((e => {
                  n[e] = i[e];
                })), bn(e, [ e.Transaction.prototype ]), gn(e, [ e.Transaction.prototype ], t(n), n), 
                r.schema = n;
                const o = T(h);
                let a;
                o && et();
                const d = je.follow((() => {
                  if (a = h(r), a && o) {
                    var e = tt.bind(null, null);
                    a.then(e, e);
                  }
                }));
                return a && "function" == typeof a.then ? je.resolve(a) : d.then((() => a));
              }
            })), i.push((t => {
              if (!u || !xt) {
                !function(e, t) {
                  [].slice.call(t.db.objectStoreNames).forEach((n => null == e[n] && t.db.deleteObjectStore(n)));
                }(o._cfg.dbschema, t);
              }
              bn(e, [ e.Transaction.prototype ]), gn(e, [ e.Transaction.prototype ], e._storeNames, e._dbSchema), 
              r.schema = e._dbSchema;
            }));
          })), c().then((() => {
            var e, n;
            n = s, t(e = a).forEach((t => {
              n.db.objectStoreNames.contains(t) || kn(n, t, e[t].primKey, e[t].indexes);
            }));
          }));
        }(e, n, o, r).catch(a);
      }));
    }
    function xn(e, t) {
      const n = {
        del: [],
        add: [],
        change: []
      };
      let r;
      for (r in e) t[r] || n.del.push(r);
      for (r in t) {
        const s = e[r], i = t[r];
        if (s) {
          const e = {
            name: r,
            def: i,
            recreate: !1,
            del: [],
            add: [],
            change: []
          };
          if ("" + (s.primKey.keyPath || "") != "" + (i.primKey.keyPath || "") || s.primKey.auto !== i.primKey.auto && !wt) e.recreate = !0, 
          n.change.push(e); else {
            const t = s.idxByName, r = i.idxByName;
            let o;
            for (o in t) r[o] || e.del.push(o);
            for (o in r) {
              const n = t[o], s = r[o];
              n ? n.src !== s.src && e.change.push(s) : e.add.push(s);
            }
            (e.del.length > 0 || e.add.length > 0 || e.change.length > 0) && n.change.push(e);
          }
        } else n.add.push([ r, i ]);
      }
      return n;
    }
    function kn(e, t, n, r) {
      const s = e.db.createObjectStore(t, n.keyPath ? {
        keyPath: n.keyPath,
        autoIncrement: n.auto
      } : {
        autoIncrement: n.auto
      });
      return r.forEach((e => En(s, e))), s;
    }
    function En(e, t) {
      e.createIndex(t.name, t.keyPath, {
        unique: t.unique,
        multiEntry: t.multi
      });
    }
    function Pn(e, t, n) {
      const r = {};
      return p(t.objectStoreNames, 0).forEach((e => {
        const t = n.objectStore(e);
        let s = t.keyPath;
        const i = un(ln(s), s || "", !1, !1, !!t.autoIncrement, s && "string" != typeof s, !0), o = [];
        for (let e = 0; e < t.indexNames.length; ++e) {
          const n = t.index(t.indexNames[e]);
          s = n.keyPath;
          var a = un(n.name, s, !!n.unique, !!n.multiEntry, !1, s && "string" != typeof s, !1);
          o.push(a);
        }
        r[e] = cn(e, i, o);
      })), r;
    }
    function Kn({_novip: t}, n, r) {
      const s = r.db.objectStoreNames;
      for (let e = 0; e < s.length; ++e) {
        const i = s[e], o = r.objectStore(i);
        t._hasGetAll = "getAll" in o;
        for (let e = 0; e < o.indexNames.length; ++e) {
          const t = o.indexNames[e], r = o.index(t).keyPath, s = "string" == typeof r ? r : "[" + p(r).join("+") + "]";
          if (n[i]) {
            const e = n[i].idxByName[s];
            e && (e.name = t, delete n[i].idxByName[s], n[i].idxByName[t] = e);
          }
        }
      }
      "undefined" != typeof navigator && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && e.WorkerGlobalScope && e instanceof e.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (t._hasGetAll = !1);
    }
    class On {
      _parseStoresSpec(e, r) {
        t(e).forEach((t => {
          if (null !== e[t]) {
            var s = e[t].split(",").map(((e, t) => {
              const r = (e = e.trim()).replace(/([&*]|\+\+)/g, ""), s = /^\[/.test(r) ? r.match(/^\[(.*)\]$/)[1].split("+") : r;
              return un(r, s || null, /\&/.test(e), /\*/.test(e), /\+\+/.test(e), n(s), 0 === t);
            })), i = s.shift();
            if (i.multi) throw new X.Schema("Primary key cannot be multi-valued");
            s.forEach((e => {
              if (e.auto) throw new X.Schema("Only primary key can be marked as autoIncrement (++)");
              if (!e.keyPath) throw new X.Schema("Index must have a name and cannot be an empty string");
            })), r[t] = cn(t, i, s);
          }
        }));
      }
      stores(e) {
        const n = this.db;
        this._cfg.storesSource = this._cfg.storesSource ? r(this._cfg.storesSource, e) : e;
        const s = n._versions, i = {};
        let o = {};
        return s.forEach((e => {
          r(i, e._cfg.storesSource), o = e._cfg.dbschema = {}, e._parseStoresSpec(i, o);
        })), n._dbSchema = o, bn(n, [ n._allTables, n, n.Transaction.prototype ]), gn(n, [ n._allTables, n, n.Transaction.prototype, this._cfg.tables ], t(o), o), 
        n._storeNames = t(o), this;
      }
      upgrade(e) {
        return this._cfg.contentUpgrade = ue(this._cfg.contentUpgrade || ee, e), this;
      }
    }
    function Sn(e, t) {
      let n = e._dbNamesDB;
      return n || (n = e._dbNamesDB = new Xn(Pt, {
        addons: [],
        indexedDB: e,
        IDBKeyRange: t
      }), n.version(1).stores({
        dbnames: "name"
      })), n.table("dbnames");
    }
    function An(e) {
      return e && "function" == typeof e.databases;
    }
    function Cn(e) {
      return Ze((function() {
        return Oe.letThrough = !0, e();
      }));
    }
    function jn() {
      var e;
      return !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise((function(t) {
        var n = function() {
          return indexedDB.databases().finally(t);
        };
        e = setInterval(n, 100), n();
      })).finally((function() {
        return clearInterval(e);
      })) : Promise.resolve();
    }
    function Dn(e) {
      const n = e._state, {indexedDB: r} = e._deps;
      if (n.isBeingOpened || e.idbdb) return n.dbReadyPromise.then((() => n.dbOpenError ? ft(n.dbOpenError) : e));
      R && (n.openCanceller._stackHolder = q()), n.isBeingOpened = !0, n.dbOpenError = null, 
      n.openComplete = !1;
      const s = n.openCanceller;
      function i() {
        if (n.openCanceller !== s) throw new X.DatabaseClosed("db.open() was cancelled");
      }
      let o = n.dbReadyResolve, a = null, u = !1;
      const l = () => new je(((s, o) => {
        if (i(), !r) throw new X.MissingAPI;
        const l = e.name, c = n.autoSchema ? r.open(l) : r.open(l, Math.round(10 * e.verno));
        if (!c) throw new X.MissingAPI;
        c.onerror = tn(o), c.onblocked = Ye(e._fireOnBlocked), c.onupgradeneeded = Ye((t => {
          if (a = c.transaction, n.autoSchema && !e._options.allowEmptyDB) {
            c.onerror = nn, a.abort(), c.result.close();
            const e = r.deleteDatabase(l);
            e.onsuccess = e.onerror = Ye((() => {
              o(new X.NoSuchDatabase(`Database ${l} doesnt exist`));
            }));
          } else {
            a.onerror = tn(o);
            var s = t.oldVersion > Math.pow(2, 62) ? 0 : t.oldVersion;
            u = s < 1, e._novip.idbdb = c.result, wn(e, s / 10, a, o);
          }
        }), o), c.onsuccess = Ye((() => {
          a = null;
          const r = e._novip.idbdb = c.result, i = p(r.objectStoreNames);
          if (i.length > 0) try {
            const s = r.transaction(1 === (o = i).length ? o[0] : o, "readonly");
            n.autoSchema ? function({_novip: e}, n, r) {
              e.verno = n.version / 10;
              const s = e._dbSchema = Pn(0, n, r);
              e._storeNames = p(n.objectStoreNames, 0), gn(e, [ e._allTables ], t(s), s);
            }(e, r, s) : (Kn(e, e._dbSchema, s), function(e, t) {
              const n = xn(Pn(0, e.idbdb, t), e._dbSchema);
              return !(n.add.length || n.change.some((e => e.add.length || e.change.length)));
            }(e, s) || console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")), 
            vn(e, s);
          } catch (e) {}
          var o;
          _t.push(e), r.onversionchange = Ye((t => {
            n.vcFired = !0, e.on("versionchange").fire(t);
          })), r.onclose = Ye((t => {
            e.on("close").fire(t);
          })), u && function({indexedDB: e, IDBKeyRange: t}, n) {
            !An(e) && n !== Pt && Sn(e, t).put({
              name: n
            }).catch(ee);
          }(e._deps, l), s();
        }), o);
      })).catch((e => e && "UnknownError" === e.name && n.PR1398_maxLoop > 0 ? (n.PR1398_maxLoop--, 
      console.warn("Dexie: Workaround for Chrome UnknownError on open()"), l()) : je.reject(e)));
      return je.race([ s, ("undefined" == typeof navigator ? je.resolve() : jn()).then(l) ]).then((() => (i(), 
      n.onReadyBeingFired = [], je.resolve(Cn((() => e.on.ready.fire(e.vip)))).then((function t() {
        if (n.onReadyBeingFired.length > 0) {
          let r = n.onReadyBeingFired.reduce(ue, ee);
          return n.onReadyBeingFired = [], je.resolve(Cn((() => r(e.vip)))).then(t);
        }
      }))))).finally((() => {
        n.onReadyBeingFired = null, n.isBeingOpened = !1;
      })).then((() => e)).catch((t => {
        n.dbOpenError = t;
        try {
          a && a.abort();
        } catch (e) {}
        return s === n.openCanceller && e._close(), ft(t);
      })).finally((() => {
        n.openComplete = !0, o();
      }));
    }
    function In(e) {
      var t = t => e.next(t), r = i(t), s = i((t => e.throw(t)));
      function i(e) {
        return t => {
          var i = e(t), o = i.value;
          return i.done ? o : o && "function" == typeof o.then ? o.then(r, s) : n(o) ? Promise.all(o).then(r, s) : r(o);
        };
      }
      return i(t)();
    }
    function Bn(e, t, n) {
      var r = arguments.length;
      if (r < 2) throw new X.InvalidArgument("Too few arguments");
      for (var s = new Array(r - 1); --r; ) s[r - 1] = arguments[r];
      return n = s.pop(), [ e, k(s), n ];
    }
    function Tn(e, t, n, r, s) {
      return je.resolve().then((() => {
        const i = Oe.transless || Oe, o = e._createTransaction(t, n, e._dbSchema, r), a = {
          trans: o,
          transless: i
        };
        if (r) o.idbtrans = r.idbtrans; else try {
          o.create(), e._state.PR1398_maxLoop = 3;
        } catch (r) {
          return r.name === H.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), 
          e._close(), e.open().then((() => Tn(e, t, n, null, s)))) : ft(r);
        }
        const u = T(s);
        let l;
        u && et();
        const c = je.follow((() => {
          if (l = s.call(o, o), l) if (u) {
            var e = tt.bind(null, null);
            l.then(e, e);
          } else "function" == typeof l.next && "function" == typeof l.throw && (l = In(l));
        }), a);
        return (l && "function" == typeof l.then ? je.resolve(l).then((e => o.active ? e : ft(new X.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))) : c.then((() => l))).then((e => (r && o._resolve(), 
        o._completion.then((() => e))))).catch((e => (o._reject(e), ft(e))));
      }));
    }
    function Rn(e, t, r) {
      const s = n(e) ? e.slice() : [ e ];
      for (let e = 0; e < r; ++e) s.push(t);
      return s;
    }
    const Fn = {
      stack: "dbcore",
      name: "VirtualIndexMiddleware",
      level: 1,
      create: function(e) {
        return {
          ...e,
          table(t) {
            const n = e.table(t), {schema: r} = n, s = {}, i = [];
            function o(e, t, n) {
              const r = yn(e), a = s[r] = s[r] || [], u = null == e ? 0 : "string" == typeof e ? 1 : e.length, l = t > 0, c = {
                ...n,
                isVirtual: l,
                keyTail: t,
                keyLength: u,
                extractKey: dn(e),
                unique: !l && n.unique
              };
              if (a.push(c), c.isPrimaryKey || i.push(c), u > 1) {
                o(2 === u ? e[0] : e.slice(0, u - 1), t + 1, n);
              }
              return a.sort(((e, t) => e.keyTail - t.keyTail)), c;
            }
            const a = o(r.primaryKey.keyPath, 0, r.primaryKey);
            s[":id"] = [ a ];
            for (const e of r.indexes) o(e.keyPath, 0, e);
            function u(t) {
              const n = t.query.index;
              return n.isVirtual ? {
                ...t,
                query: {
                  index: n,
                  range: (r = t.query.range, s = n.keyTail, {
                    type: 1 === r.type ? 2 : r.type,
                    lower: Rn(r.lower, r.lowerOpen ? e.MAX_KEY : e.MIN_KEY, s),
                    lowerOpen: !0,
                    upper: Rn(r.upper, r.upperOpen ? e.MIN_KEY : e.MAX_KEY, s),
                    upperOpen: !0
                  })
                }
              } : t;
              var r, s;
            }
            const l = {
              ...n,
              schema: {
                ...r,
                primaryKey: a,
                indexes: i,
                getIndexByKeyPath: function(e) {
                  const t = s[yn(e)];
                  return t && t[0];
                }
              },
              count: e => n.count(u(e)),
              query: e => n.query(u(e)),
              openCursor(t) {
                const {keyTail: r, isVirtual: s, keyLength: i} = t.query.index;
                if (!s) return n.openCursor(t);
                return n.openCursor(u(t)).then((n => n && function(n) {
                  const s = Object.create(n, {
                    continue: {
                      value: function(s) {
                        null != s ? n.continue(Rn(s, t.reverse ? e.MAX_KEY : e.MIN_KEY, r)) : t.unique ? n.continue(n.key.slice(0, i).concat(t.reverse ? e.MIN_KEY : e.MAX_KEY, r)) : n.continue();
                      }
                    },
                    continuePrimaryKey: {
                      value(t, s) {
                        n.continuePrimaryKey(Rn(t, e.MAX_KEY, r), s);
                      }
                    },
                    primaryKey: {
                      get: () => n.primaryKey
                    },
                    key: {
                      get() {
                        const e = n.key;
                        return 1 === i ? e[0] : e.slice(0, i);
                      }
                    },
                    value: {
                      get: () => n.value
                    }
                  });
                  return s;
                }(n)));
              }
            };
            return l;
          }
        };
      }
    };
    function Mn(e, n, r, s) {
      return r = r || {}, s = s || "", t(e).forEach((t => {
        if (o(n, t)) {
          var i = e[t], a = n[t];
          if ("object" == typeof i && "object" == typeof a && i && a) {
            const e = C(i);
            e !== C(a) ? r[s + t] = n[t] : "Object" === e ? Mn(i, a, r, s + t + ".") : i !== a && (r[s + t] = n[t]);
          } else i !== a && (r[s + t] = n[t]);
        } else r[s + t] = void 0;
      })), t(n).forEach((t => {
        o(e, t) || (r[s + t] = n[t]);
      })), r;
    }
    const Nn = {
      stack: "dbcore",
      name: "HooksMiddleware",
      level: 2,
      create: e => ({
        ...e,
        table(t) {
          const n = e.table(t), {primaryKey: r} = n.schema, s = {
            ...n,
            mutate(e) {
              const s = Oe.trans, {deleting: i, creating: a, updating: u} = s.table(t).hook;
              switch (e.type) {
               case "add":
                if (a.fire === ee) break;
                return s._promise("readwrite", (() => l(e)), !0);

               case "put":
                if (a.fire === ee && u.fire === ee) break;
                return s._promise("readwrite", (() => l(e)), !0);

               case "delete":
                if (i.fire === ee) break;
                return s._promise("readwrite", (() => l(e)), !0);

               case "deleteRange":
                if (i.fire === ee) break;
                return s._promise("readwrite", (() => function(e) {
                  return c(e.trans, e.range, 1e4);
                }(e)), !0);
              }
              return n.mutate(e);
              function l(e) {
                const t = Oe.trans, s = e.keys || function(e, t) {
                  return "delete" === t.type ? t.keys : t.keys || t.values.map(e.extractKey);
                }(r, e);
                if (!s) throw new Error("Keys missing");
                return "delete" !== (e = "add" === e.type || "put" === e.type ? {
                  ...e,
                  keys: s
                } : {
                  ...e
                }).type && (e.values = [ ...e.values ]), e.keys && (e.keys = [ ...e.keys ]), function(e, t, n) {
                  return "add" === t.type ? Promise.resolve([]) : e.getMany({
                    trans: t.trans,
                    keys: n,
                    cache: "immutable"
                  });
                }(n, e, s).then((l => {
                  const c = s.map(((n, s) => {
                    const c = l[s], h = {
                      onerror: null,
                      onsuccess: null
                    };
                    if ("delete" === e.type) i.fire.call(h, n, c, t); else if ("add" === e.type || void 0 === c) {
                      const i = a.fire.call(h, n, e.values[s], t);
                      null == n && null != i && (n = i, e.keys[s] = n, r.outbound || _(e.values[s], r.keyPath, n));
                    } else {
                      const r = Mn(c, e.values[s]), i = u.fire.call(h, r, n, c, t);
                      if (i) {
                        const t = e.values[s];
                        Object.keys(i).forEach((e => {
                          o(t, e) ? t[e] = i[e] : _(t, e, i[e]);
                        }));
                      }
                    }
                    return h;
                  }));
                  return n.mutate(e).then((({failures: t, results: n, numFailures: r, lastResult: i}) => {
                    for (let r = 0; r < s.length; ++r) {
                      const i = n ? n[r] : s[r], o = c[r];
                      null == i ? o.onerror && o.onerror(t[r]) : o.onsuccess && o.onsuccess("put" === e.type && l[r] ? e.values[r] : i);
                    }
                    return {
                      failures: t,
                      results: n,
                      numFailures: r,
                      lastResult: i
                    };
                  })).catch((e => (c.forEach((t => t.onerror && t.onerror(e))), Promise.reject(e))));
                }));
              }
              function c(e, t, s) {
                return n.query({
                  trans: e,
                  values: !1,
                  query: {
                    index: r,
                    range: t
                  },
                  limit: s
                }).then((({result: n}) => l({
                  type: "delete",
                  keys: n,
                  trans: e
                }).then((r => r.numFailures > 0 ? Promise.reject(r.failures[0]) : n.length < s ? {
                  failures: [],
                  numFailures: 0,
                  lastResult: void 0
                } : c(e, {
                  ...t,
                  lower: n[n.length - 1],
                  lowerOpen: !0
                }, s)))));
              }
            }
          };
          return s;
        }
      })
    };
    function qn(e, t, n) {
      try {
        if (!t) return null;
        if (t.keys.length < e.length) return null;
        const r = [];
        for (let s = 0, i = 0; s < t.keys.length && i < e.length; ++s) 0 === $t(t.keys[s], e[i]) && (r.push(n ? O(t.values[s]) : t.values[s]), 
        ++i);
        return r.length === e.length ? r : null;
      } catch (e) {
        return null;
      }
    }
    const $n = {
      stack: "dbcore",
      level: -1,
      create: e => ({
        table: t => {
          const n = e.table(t);
          return {
            ...n,
            getMany: e => {
              if (!e.cache) return n.getMany(e);
              const t = qn(e.keys, e.trans._cache, "clone" === e.cache);
              return t ? je.resolve(t) : n.getMany(e).then((t => (e.trans._cache = {
                keys: e.keys,
                values: "clone" === e.cache ? O(t) : t
              }, t)));
            },
            mutate: e => ("add" !== e.type && (e.trans._cache = null), n.mutate(e))
          };
        }
      })
    };
    function Un(e) {
      return !("from" in e);
    }
    const Ln = function(e, t) {
      if (!this) {
        const t = new Ln;
        return e && "d" in e && r(t, e), t;
      }
      r(this, arguments.length ? {
        d: 1,
        from: e,
        to: arguments.length > 1 ? t : e
      } : {
        d: 0
      });
    };
    function Vn(e, t, n) {
      const s = $t(t, n);
      if (isNaN(s)) return;
      if (s > 0) throw RangeError();
      if (Un(e)) return r(e, {
        from: t,
        to: n,
        d: 1
      });
      const i = e.l, o = e.r;
      if ($t(n, e.from) < 0) return i ? Vn(i, t, n) : e.l = {
        from: t,
        to: n,
        d: 1,
        l: null,
        r: null
      }, Gn(e);
      if ($t(t, e.to) > 0) return o ? Vn(o, t, n) : e.r = {
        from: t,
        to: n,
        d: 1,
        l: null,
        r: null
      }, Gn(e);
      $t(t, e.from) < 0 && (e.from = t, e.l = null, e.d = o ? o.d + 1 : 1), $t(n, e.to) > 0 && (e.to = n, 
      e.r = null, e.d = e.l ? e.l.d + 1 : 1);
      const a = !e.r;
      i && !e.l && Wn(e, i), o && a && Wn(e, o);
    }
    function Wn(e, t) {
      Un(t) || function e(t, {from: n, to: r, l: s, r: i}) {
        Vn(t, n, r), s && e(t, s), i && e(t, i);
      }(e, t);
    }
    function Yn(e, t) {
      const n = zn(t);
      let r = n.next();
      if (r.done) return !1;
      let s = r.value;
      const i = zn(e);
      let o = i.next(s.from), a = o.value;
      for (;!r.done && !o.done; ) {
        if ($t(a.from, s.to) <= 0 && $t(a.to, s.from) >= 0) return !0;
        $t(s.from, a.from) < 0 ? s = (r = n.next(a.from)).value : a = (o = i.next(s.from)).value;
      }
      return !1;
    }
    function zn(e) {
      let t = Un(e) ? null : {
        s: 0,
        n: e
      };
      return {
        next(e) {
          const n = arguments.length > 0;
          for (;t; ) switch (t.s) {
           case 0:
            if (t.s = 1, n) for (;t.n.l && $t(e, t.n.from) < 0; ) t = {
              up: t,
              n: t.n.l,
              s: 1
            }; else for (;t.n.l; ) t = {
              up: t,
              n: t.n.l,
              s: 1
            };

           case 1:
            if (t.s = 2, !n || $t(e, t.n.to) <= 0) return {
              value: t.n,
              done: !1
            };

           case 2:
            if (t.n.r) {
              t.s = 3, t = {
                up: t,
                n: t.n.r,
                s: 0
              };
              continue;
            }

           case 3:
            t = t.up;
          }
          return {
            done: !0
          };
        }
      };
    }
    function Gn(e) {
      var t, n;
      const r = ((null === (t = e.r) || void 0 === t ? void 0 : t.d) || 0) - ((null === (n = e.l) || void 0 === n ? void 0 : n.d) || 0), s = r > 1 ? "r" : r < -1 ? "l" : "";
      if (s) {
        const t = "r" === s ? "l" : "r", n = {
          ...e
        }, r = e[s];
        e.from = r.from, e.to = r.to, e[s] = r[s], n[s] = r[t], e[t] = n, n.d = Hn(n);
      }
      e.d = Hn(e);
    }
    function Hn({r: e, l: t}) {
      return (e ? t ? Math.max(e.d, t.d) : e.d : t ? t.d : 0) + 1;
    }
    a(Ln.prototype, {
      add(e) {
        return Wn(this, e), this;
      },
      addKey(e) {
        return Vn(this, e, e), this;
      },
      addKeys(e) {
        return e.forEach((e => Vn(this, e, e))), this;
      },
      [j]() {
        return zn(this);
      }
    });
    const Qn = {
      stack: "dbcore",
      level: 0,
      create: e => {
        const r = e.schema.name, s = new Ln(e.MIN_KEY, e.MAX_KEY);
        return {
          ...e,
          table: i => {
            const o = e.table(i), {schema: a} = o, {primaryKey: u} = a, {extractKey: l, outbound: c} = u, h = {
              ...o,
              mutate: e => {
                const t = e.trans, u = t.mutatedParts || (t.mutatedParts = {}), l = e => {
                  const t = `idb://${r}/${i}/${e}`;
                  return u[t] || (u[t] = new Ln);
                }, c = l(""), h = l(":dels"), {type: d} = e;
                let [f, p] = "deleteRange" === e.type ? [ e.range ] : "delete" === e.type ? [ e.keys ] : e.values.length < 50 ? [ [], e.values ] : [];
                const y = e.trans._cache;
                return o.mutate(e).then((e => {
                  if (n(f)) {
                    "delete" !== d && (f = e.results), c.addKeys(f);
                    const t = qn(f, y);
                    t || "add" === d || h.addKeys(f), (t || p) && function(e, t, r, s) {
                      function i(t) {
                        const i = e(t.name || "");
                        function o(e) {
                          return null != e ? t.extractKey(e) : null;
                        }
                        const a = e => t.multiEntry && n(e) ? e.forEach((e => i.addKey(e))) : i.addKey(e);
                        (r || s).forEach(((e, t) => {
                          const n = r && o(r[t]), i = s && o(s[t]);
                          0 !== $t(n, i) && (null != n && a(n), null != i && a(i));
                        }));
                      }
                      t.indexes.forEach(i);
                    }(l, a, t, p);
                  } else if (f) {
                    const e = {
                      from: f.lower,
                      to: f.upper
                    };
                    h.add(e), c.add(e);
                  } else c.add(s), h.add(s), a.indexes.forEach((e => l(e.name).add(s)));
                  return e;
                }));
              }
            }, d = ({query: {index: t, range: n}}) => {
              var r, s;
              return [ t, new Ln(null !== (r = n.lower) && void 0 !== r ? r : e.MIN_KEY, null !== (s = n.upper) && void 0 !== s ? s : e.MAX_KEY) ];
            }, f = {
              get: e => [ u, new Ln(e.key) ],
              getMany: e => [ u, (new Ln).addKeys(e.keys) ],
              count: d,
              query: d,
              openCursor: d
            };
            return t(f).forEach((e => {
              h[e] = function(t) {
                const {subscr: n} = Oe;
                if (n) {
                  const a = e => {
                    const t = `idb://${r}/${i}/${e}`;
                    return n[t] || (n[t] = new Ln);
                  }, u = a(""), h = a(":dels"), [d, p] = f[e](t);
                  if (a(d.name || "").add(p), !d.isPrimaryKey) {
                    if ("count" !== e) {
                      const n = "query" === e && c && t.values && o.query({
                        ...t,
                        values: !1
                      });
                      return o[e].apply(this, arguments).then((r => {
                        if ("query" === e) {
                          if (c && t.values) return n.then((({result: e}) => (u.addKeys(e), r)));
                          const e = t.values ? r.result.map(l) : r.result;
                          t.values ? u.addKeys(e) : h.addKeys(e);
                        } else if ("openCursor" === e) {
                          const e = r, n = t.values;
                          return e && Object.create(e, {
                            key: {
                              get: () => (h.addKey(e.primaryKey), e.key)
                            },
                            primaryKey: {
                              get() {
                                const t = e.primaryKey;
                                return h.addKey(t), t;
                              }
                            },
                            value: {
                              get: () => (n && u.addKey(e.primaryKey), e.value)
                            }
                          });
                        }
                        return r;
                      }));
                    }
                    h.add(s);
                  }
                }
                return o[e].apply(this, arguments);
              };
            })), h;
          }
        };
      }
    };
    class Xn {
      constructor(e, t) {
        this._middlewares = {}, this.verno = 0;
        const n = Xn.dependencies;
        this._options = t = {
          addons: Xn.addons,
          autoOpen: !0,
          indexedDB: n.indexedDB,
          IDBKeyRange: n.IDBKeyRange,
          ...t
        }, this._deps = {
          indexedDB: t.indexedDB,
          IDBKeyRange: t.IDBKeyRange
        };
        const {addons: r} = t;
        this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, 
        this.idbdb = null, this._novip = this;
        const s = {
          dbOpenError: null,
          isBeingOpened: !1,
          onReadyBeingFired: null,
          openComplete: !1,
          dbReadyResolve: ee,
          dbReadyPromise: null,
          cancelOpen: ee,
          openCanceller: null,
          autoSchema: !0,
          PR1398_maxLoop: 3
        };
        var i;
        s.dbReadyPromise = new je((e => {
          s.dbReadyResolve = e;
        })), s.openCanceller = new je(((e, t) => {
          s.cancelOpen = t;
        })), this._state = s, this.name = e, this.on = Dt(this, "populate", "blocked", "versionchange", "close", {
          ready: [ ue, ee ]
        }), this.on.ready.subscribe = y(this.on.ready.subscribe, (e => (t, n) => {
          Xn.vip((() => {
            const r = this._state;
            if (r.openComplete) r.dbOpenError || je.resolve().then(t), n && e(t); else if (r.onReadyBeingFired) r.onReadyBeingFired.push(t), 
            n && e(t); else {
              e(t);
              const r = this;
              n || e((function e() {
                r.on.ready.unsubscribe(t), r.on.ready.unsubscribe(e);
              }));
            }
          }));
        })), this.Collection = (i = this, It(Vt.prototype, (function(e, t) {
          this.db = i;
          let n = At, r = null;
          if (t) try {
            n = t();
          } catch (e) {
            r = e;
          }
          const s = e._ctx, o = s.table, a = o.hook.reading.fire;
          this._ctx = {
            table: o,
            index: s.index,
            isPrimKey: !s.index || o.schema.primKey.keyPath && s.index === o.schema.primKey.name,
            range: n,
            keysOnly: !1,
            dir: "next",
            unique: "",
            algorithm: null,
            filter: null,
            replayFilter: null,
            justLimit: !0,
            isMatch: null,
            offset: 0,
            limit: 1 / 0,
            error: r,
            or: s.or,
            valueMapper: a !== te ? a : null
          };
        }))), this.Table = function(e) {
          return It(jt.prototype, (function(t, n, r) {
            this.db = e, this._tx = r, this.name = t, this.schema = n, this.hook = e._allTables[t] ? e._allTables[t].hook : Dt(null, {
              creating: [ se, ee ],
              reading: [ ne, te ],
              updating: [ oe, ee ],
              deleting: [ ie, ee ]
            });
          }));
        }(this), this.Transaction = function(e) {
          return It(an.prototype, (function(t, n, r, s, i) {
            this.db = e, this.mode = t, this.storeNames = n, this.schema = r, this.chromeTransactionDurability = s, 
            this.idbtrans = null, this.on = Dt(this, "complete", "error", "abort"), this.parent = i || null, 
            this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, 
            this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, 
            this._completion = new je(((e, t) => {
              this._resolve = e, this._reject = t;
            })), this._completion.then((() => {
              this.active = !1, this.on.complete.fire();
            }), (e => {
              var t = this.active;
              return this.active = !1, this.on.error.fire(e), this.parent ? this.parent._reject(e) : t && this.idbtrans && this.idbtrans.abort(), 
              ft(e);
            }));
          }));
        }(this), this.Version = function(e) {
          return It(On.prototype, (function(t) {
            this.db = e, this._cfg = {
              version: t,
              storesSource: null,
              dbschema: {},
              tables: {},
              contentUpgrade: null
            };
          }));
        }(this), this.WhereClause = function(e) {
          return It(en.prototype, (function(t, n, r) {
            this.db = e, this._ctx = {
              table: t,
              index: ":id" === n ? null : n,
              or: r
            };
            const s = e._deps.indexedDB;
            if (!s) throw new X.MissingAPI;
            this._cmp = this._ascending = s.cmp.bind(s), this._descending = (e, t) => s.cmp(t, e), 
            this._max = (e, t) => s.cmp(e, t) > 0 ? e : t, this._min = (e, t) => s.cmp(e, t) < 0 ? e : t, 
            this._IDBKeyRange = e._deps.IDBKeyRange;
          }));
        }(this), this.on("versionchange", (e => {
          e.newVersion > 0 ? console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`), 
          this.close();
        })), this.on("blocked", (e => {
          !e.newVersion || e.newVersion < e.oldVersion ? console.warn(`Dexie.delete('${this.name}') was blocked`) : console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion / 10}`);
        })), this._maxKey = hn(t.IDBKeyRange), this._createTransaction = (e, t, n, r) => new this.Transaction(e, t, n, this._options.chromeTransactionDurability, r), 
        this._fireOnBlocked = e => {
          this.on("blocked").fire(e), _t.filter((e => e.name === this.name && e !== this && !e._state.vcFired)).map((t => t.on("versionchange").fire(e)));
        }, this.use(Fn), this.use(Nn), this.use(Qn), this.use($n), this.vip = Object.create(this, {
          _vip: {
            value: !0
          }
        }), r.forEach((e => e(this)));
      }
      version(e) {
        if (isNaN(e) || e < .1) throw new X.Type("Given version is not a positive number");
        if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened) throw new X.Schema("Cannot add version when database is open");
        this.verno = Math.max(this.verno, e);
        const t = this._versions;
        var n = t.filter((t => t._cfg.version === e))[0];
        return n || (n = new this.Version(e), t.push(n), t.sort(_n), n.stores({}), this._state.autoSchema = !1, 
        n);
      }
      _whenReady(e) {
        return this.idbdb && (this._state.openComplete || Oe.letThrough || this._vip) ? e() : new je(((e, t) => {
          if (this._state.openComplete) return t(new X.DatabaseClosed(this._state.dbOpenError));
          if (!this._state.isBeingOpened) {
            if (!this._options.autoOpen) return void t(new X.DatabaseClosed);
            this.open().catch(ee);
          }
          this._state.dbReadyPromise.then(e, t);
        })).then(e);
      }
      use({stack: e, create: t, level: n, name: r}) {
        r && this.unuse({
          stack: e,
          name: r
        });
        const s = this._middlewares[e] || (this._middlewares[e] = []);
        return s.push({
          stack: e,
          create: t,
          level: null == n ? 10 : n,
          name: r
        }), s.sort(((e, t) => e.level - t.level)), this;
      }
      unuse({stack: e, name: t, create: n}) {
        return e && this._middlewares[e] && (this._middlewares[e] = this._middlewares[e].filter((e => n ? e.create !== n : !!t && e.name !== t))), 
        this;
      }
      open() {
        return Dn(this);
      }
      _close() {
        const e = this._state, t = _t.indexOf(this);
        if (t >= 0 && _t.splice(t, 1), this.idbdb) {
          try {
            this.idbdb.close();
          } catch (e) {}
          this._novip.idbdb = null;
        }
        e.dbReadyPromise = new je((t => {
          e.dbReadyResolve = t;
        })), e.openCanceller = new je(((t, n) => {
          e.cancelOpen = n;
        }));
      }
      close() {
        this._close();
        const e = this._state;
        this._options.autoOpen = !1, e.dbOpenError = new X.DatabaseClosed, e.isBeingOpened && e.cancelOpen(e.dbOpenError);
      }
      delete() {
        const e = arguments.length > 0, t = this._state;
        return new je(((n, r) => {
          const s = () => {
            this.close();
            var e = this._deps.indexedDB.deleteDatabase(this.name);
            e.onsuccess = Ye((() => {
              !function({indexedDB: e, IDBKeyRange: t}, n) {
                !An(e) && n !== Pt && Sn(e, t).delete(n).catch(ee);
              }(this._deps, this.name), n();
            })), e.onerror = tn(r), e.onblocked = this._fireOnBlocked;
          };
          if (e) throw new X.InvalidArgument("Arguments not allowed in db.delete()");
          t.isBeingOpened ? t.dbReadyPromise.then(s) : s();
        }));
      }
      backendDB() {
        return this.idbdb;
      }
      isOpen() {
        return null !== this.idbdb;
      }
      hasBeenClosed() {
        const e = this._state.dbOpenError;
        return e && "DatabaseClosed" === e.name;
      }
      hasFailed() {
        return null !== this._state.dbOpenError;
      }
      dynamicallyOpened() {
        return this._state.autoSchema;
      }
      get tables() {
        return t(this._allTables).map((e => this._allTables[e]));
      }
      transaction() {
        const e = Bn.apply(this, arguments);
        return this._transaction.apply(this, e);
      }
      _transaction(e, t, n) {
        let r = Oe.trans;
        r && r.db === this && -1 === e.indexOf("!") || (r = null);
        const s = -1 !== e.indexOf("?");
        let i, o;
        e = e.replace("!", "").replace("?", "");
        try {
          if (o = t.map((e => {
            var t = e instanceof this.Table ? e.name : e;
            if ("string" != typeof t) throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
            return t;
          })), "r" == e || e === Kt) i = Kt; else {
            if ("rw" != e && e != Ot) throw new X.InvalidArgument("Invalid transaction mode: " + e);
            i = Ot;
          }
          if (r) {
            if (r.mode === Kt && i === Ot) {
              if (!s) throw new X.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
              r = null;
            }
            r && o.forEach((e => {
              if (r && -1 === r.storeNames.indexOf(e)) {
                if (!s) throw new X.SubTransaction("Table " + e + " not included in parent transaction.");
                r = null;
              }
            })), s && r && !r.active && (r = null);
          }
        } catch (e) {
          return r ? r._promise(null, ((t, n) => {
            n(e);
          })) : ft(e);
        }
        const a = Tn.bind(null, this, i, o, r, n);
        return r ? r._promise(i, a, "lock") : Oe.trans ? at(Oe.transless, (() => this._whenReady(a))) : this._whenReady(a);
      }
      table(e) {
        if (!o(this._allTables, e)) throw new X.InvalidTable(`Table ${e} does not exist`);
        return this._allTables[e];
      }
    }
    const Jn = "undefined" != typeof Symbol && "observable" in Symbol ? Symbol.observable : "@@observable";
    class Zn {
      constructor(e) {
        this._subscribe = e;
      }
      subscribe(e, t, n) {
        return this._subscribe(e && "function" != typeof e ? e : {
          next: e,
          error: t,
          complete: n
        });
      }
      [Jn]() {
        return this;
      }
    }
    function er(e, n) {
      return t(n).forEach((t => {
        Wn(e[t] || (e[t] = new Ln), n[t]);
      })), e;
    }
    function tr(e) {
      let n, r = !1;
      const s = new Zn((s => {
        const i = T(e);
        let o = !1, a = {}, u = {};
        const l = {
          get closed() {
            return o;
          },
          unsubscribe: () => {
            o = !0, on.storagemutated.unsubscribe(f);
          }
        };
        s.start && s.start(l);
        let c = !1, h = !1;
        function d() {
          return t(u).some((e => a[e] && Yn(a[e], u[e])));
        }
        const f = e => {
          er(a, e), d() && p();
        }, p = () => {
          if (c || o) return;
          a = {};
          const t = {}, y = function(t) {
            i && et();
            const n = () => Ze(e, {
              subscr: t,
              trans: null
            }), r = Oe.trans ? at(Oe.transless, n) : n();
            return i && r.then(tt, tt), r;
          }(t);
          h || (on(rn, f), h = !0), c = !0, Promise.resolve(y).then((e => {
            r = !0, n = e, c = !1, o || (d() ? p() : (a = {}, u = t, s.next && s.next(e)));
          }), (e => {
            c = !1, r = !1, s.error && s.error(e), l.unsubscribe();
          }));
        };
        return p(), l;
      }));
      return s.hasValue = () => r, s.getValue = () => n, s;
    }
    let nr;
    try {
      nr = {
        indexedDB: e.indexedDB || e.mozIndexedDB || e.webkitIndexedDB || e.msIndexedDB,
        IDBKeyRange: e.IDBKeyRange || e.webkitIDBKeyRange
      };
    } catch (e) {
      nr = {
        indexedDB: null,
        IDBKeyRange: null
      };
    }
    const rr = Xn;
    function sr(e) {
      let t = ir;
      try {
        ir = !0, on.storagemutated.fire(e);
      } finally {
        ir = t;
      }
    }
    a(rr, {
      ...Z,
      delete: e => new rr(e, {
        addons: []
      }).delete(),
      exists: e => new rr(e, {
        addons: []
      }).open().then((e => (e.close(), !0))).catch("NoSuchDatabaseError", (() => !1)),
      getDatabaseNames(e) {
        try {
          return function({indexedDB: e, IDBKeyRange: t}) {
            return An(e) ? Promise.resolve(e.databases()).then((e => e.map((e => e.name)).filter((e => e !== Pt)))) : Sn(e, t).toCollection().primaryKeys();
          }(rr.dependencies).then(e);
        } catch (e) {
          return ft(new X.MissingAPI);
        }
      },
      defineClass: () => function(e) {
        r(this, e);
      },
      ignoreTransaction: e => Oe.trans ? at(Oe.transless, e) : e(),
      vip: Cn,
      async: function(e) {
        return function() {
          try {
            var t = In(e.apply(this, arguments));
            return t && "function" == typeof t.then ? t : je.resolve(t);
          } catch (e) {
            return ft(e);
          }
        };
      },
      spawn: function(e, t, n) {
        try {
          var r = In(e.apply(n, t || []));
          return r && "function" == typeof r.then ? r : je.resolve(r);
        } catch (e) {
          return ft(e);
        }
      },
      currentTransaction: {
        get: () => Oe.trans || null
      },
      waitFor: function(e, t) {
        const n = je.resolve("function" == typeof e ? rr.ignoreTransaction(e) : e).timeout(t || 6e4);
        return Oe.trans ? Oe.trans.waitFor(n) : n;
      },
      Promise: je,
      debug: {
        get: () => R,
        set: e => {
          F(e, "dexie" === e ? () => !0 : Et);
        }
      },
      derive: c,
      extend: r,
      props: a,
      override: y,
      Events: Dt,
      on,
      liveQuery: tr,
      extendObservabilitySet: er,
      getByKeyPath: b,
      setByKeyPath: _,
      delByKeyPath: function(e, t) {
        "string" == typeof t ? _(e, t, void 0) : "length" in t && [].map.call(t, (function(t) {
          _(e, t, void 0);
        }));
      },
      shallowClone: w,
      deepClone: O,
      getObjectDiff: Mn,
      cmp: $t,
      asap: v,
      minKey: vt,
      addons: [],
      connections: _t,
      errnames: H,
      dependencies: nr,
      semVer: yt,
      version: yt.split(".").map((e => parseInt(e))).reduce(((e, t, n) => e + t / Math.pow(10, 2 * n)))
    }), rr.maxKey = hn(rr.dependencies.IDBKeyRange), "undefined" != typeof dispatchEvent && "undefined" != typeof addEventListener && (on(rn, (e => {
      if (!ir) {
        let t;
        wt ? (t = document.createEvent("CustomEvent"), t.initCustomEvent(sn, !0, !0, e)) : t = new CustomEvent(sn, {
          detail: e
        }), ir = !0, dispatchEvent(t), ir = !1;
      }
    })), addEventListener(sn, (({detail: e}) => {
      ir || sr(e);
    })));
    let ir = !1;
    if ("undefined" != typeof BroadcastChannel) {
      const e = new BroadcastChannel(sn);
      "function" == typeof e.unref && e.unref(), on(rn, (t => {
        ir || e.postMessage(t);
      })), e.onmessage = e => {
        e.data && sr(e.data);
      };
    } else if ("undefined" != typeof self && "undefined" != typeof navigator) {
      on(rn, (e => {
        try {
          ir || ("undefined" != typeof localStorage && localStorage.setItem(sn, JSON.stringify({
            trig: Math.random(),
            changedParts: e
          })), "object" == typeof self.clients && [ ...self.clients.matchAll({
            includeUncontrolled: !0
          }) ].forEach((t => t.postMessage({
            type: sn,
            changedParts: e
          }))));
        } catch (e) {}
      })), "undefined" != typeof addEventListener && addEventListener("storage", (e => {
        if (e.key === sn) {
          const t = JSON.parse(e.newValue);
          t && sr(t.changedParts);
        }
      }));
      const e = self.document && navigator.serviceWorker;
      e && e.addEventListener("message", (function({data: e}) {
        e && e.type === sn && sr(e.changedParts);
      }));
    }
    je.rejectionMapper = function(e, t) {
      if (!e || e instanceof W || e instanceof TypeError || e instanceof SyntaxError || !e.name || !J[e.name]) return e;
      var n = new J[e.name](t || e.message, e);
      return "stack" in e && l(n, "stack", {
        get: function() {
          return this.inner.stack;
        }
      }), n;
    }, F(R, Et);
    class ChainDatabase extends Xn {
      static defaultSettings={
        CHAIN_ID_TO_RPC_URLS,
        BASE_ASSETS,
        DEFAULT_NETWORKS
      };
      constructor(options) {
        super("qwal/chain", options);
        this.version(1).stores({
          accountsToTrack: "&[address+network.name+network.chainID],address,network.family,network.chainID,network.name",
          accountAssetTransferLookups: "++id,[addressNetwork.address+addressNetwork.network.name+addressNetwork.network.chainID],[addressNetwork.address+addressNetwork.network.name+addressNetwork.network.chainID+startBlock],[addressNetwork.address+addressNetwork.network.name+addressNetwork.network.chainID+endBlock],addressNetwork.address,addressNetwork.network.chainID,addressNetwork.network.name,startBlock,endBlock",
          balances: "++id,address,assetAmount.amount,assetAmount.asset.symbol,network.name,blockHeight,retrievedAt",
          chainTransactions: "&[hash+network.name],hash,from,[from+network.name],to,[to+network.name],nonce,[nonce+from+network.name],blockHash,blockNumber,network.name,firstSeen,dataSource",
          blocks: "&[hash+network.name],[network.name+timestamp],hash,network.name,timestamp,parentHash,blockHeight,[blockHeight+network.name]",
          networks: "&chainID,name,family",
          baseAssets: "&chainID,symbol,name",
          rpcConfig: "&chainID, rpcUrls",
          customRpcConfig: "&chainID, rpcUrls, supportedMethods"
        });
        this.chainTransactions.hook("updating", ((modifications, _, chainTransaction) => {
          const allowedVariants = [ "blockHeight", "blockHash", "firstSeen" ];
          const filteredModifications = Object.fromEntries(Object.entries(modifications).filter((([k]) => allowedVariants.includes(k))));
          if ("firstSeen" in filteredModifications) {
            return {
              ...filteredModifications,
              firstSeen: Math.min(chainTransaction.firstSeen, filteredModifications.firstSeen)
            };
          }
          return filteredModifications;
        }));
      }
      async initialize() {
        await this.initializeBaseAssets();
        await this.initializeRPCs();
        await this.initializeEVMNetworks();
      }
      async getLatestBlock(network) {
        return (await this.blocks.where("[network.name+timestamp]").aboveOrEqual([ network.name, Date.now() - 60 * 60 * 24 ]).and((block => block.network.name === network.name)).reverse().sortBy("timestamp"))[0] || null;
      }
      async getTransaction(network, txHash) {
        return (await this.chainTransactions.where("[hash+network.name]").equals([ txHash, network.name ]).toArray())[0] || null;
      }
      async addQEVMNetwork({chainName, chainID, decimals, symbol, assetName, rpcUrls, blockExplorerURL}) {
        const network = {
          name: chainName,
          chainID,
          family: "QEVM",
          blockExplorerURL,
          baseAsset: {
            decimals,
            symbol,
            name: assetName,
            chainID
          }
        };
        await this.networks.put(network);
        await this.addBaseAsset(assetName, symbol, chainID, decimals);
        await this.addRpcUrls(chainID, rpcUrls);
        return network;
      }
      async removeQEVMNetwork(chainID) {
        await this.transaction("rw", this.networks, this.baseAssets, this.rpcConfig, this.accountsToTrack, this.customRpcConfig, (async () => {
          await Promise.all([ this.networks.where({
            chainID
          }).delete(), this.baseAssets.where({
            chainID
          }).delete(), this.rpcConfig.where({
            chainID
          }).delete(), this.customRpcConfig.where({
            chainID
          }).delete() ]);
          const accountsToTrack = this.accountsToTrack.toCollection().filter((account => account.network.chainID === chainID));
          return accountsToTrack.delete();
        }));
      }
      async getAllQEVMNetworks() {
        return this.networks.where("family").equals("QEVM").toArray();
      }
      async getQEVMNetworkByChainID(chainID) {
        return (await this.networks.where("family").equals("QEVM").toArray()).find((network => network.chainID === chainID));
      }
      async addBaseAsset(name, symbol, chainID, decimals) {
        await this.baseAssets.put({
          decimals,
          name,
          symbol,
          chainID
        });
      }
      async getBaseAssetForNetwork(chainID) {
        const baseAsset = await this.baseAssets.get(chainID);
        if (!baseAsset) {
          throw new Error(`No Base Asset Found For Network ${chainID}`);
        }
        return baseAsset;
      }
      async getAllBaseAssets() {
        return this.baseAssets.toArray();
      }
      async initializeRPCs() {
        await Promise.all(Object.entries(ChainDatabase.defaultSettings.CHAIN_ID_TO_RPC_URLS).map((async ([chainId, rpcUrls]) => {
          if (rpcUrls) {
            await this.addRpcUrls(chainId, rpcUrls);
          }
        })));
      }
      async initializeBaseAssets() {
        await this.updateBaseAssets(ChainDatabase.defaultSettings.BASE_ASSETS);
      }
      async initializeEVMNetworks() {
        const existingNetworks = await this.getAllQEVMNetworks();
        await Promise.all(ChainDatabase.defaultSettings.DEFAULT_NETWORKS.map((async defaultNetwork => {
          if (!existingNetworks.some((network => sameNetwork(network, defaultNetwork)))) {
            await this.networks.put(defaultNetwork);
          }
        })));
      }
      async getRpcUrlsByChainId(chainId) {
        const rpcUrls = await this.rpcConfig.where({
          chainId
        }).first();
        if (rpcUrls) {
          return rpcUrls.rpcUrls;
        }
        throw new Error(`No RPC Found for ${chainId}`);
      }
      async addRpcUrls(chainID, rpcUrls) {
        const existingRpcUrlsForChain = await this.rpcConfig.get(chainID);
        if (existingRpcUrlsForChain) {
          existingRpcUrlsForChain.rpcUrls.push(...rpcUrls);
          existingRpcUrlsForChain.rpcUrls = [ ...new Set(existingRpcUrlsForChain.rpcUrls) ];
          await this.rpcConfig.put(existingRpcUrlsForChain);
        } else {
          await this.rpcConfig.put({
            chainID,
            rpcUrls
          });
        }
      }
      async addCustomRpcUrl(chainID, rpcUrl, supportedMethods = []) {
        return this.customRpcConfig.put({
          chainID,
          rpcUrls: [ rpcUrl ],
          supportedMethods
        });
      }
      async removeCustomRpcUrl(chainID) {
        return this.customRpcConfig.where({
          chainID
        }).delete();
      }
      async getAllRpcUrls() {
        return this.rpcConfig.toArray();
      }
      async getAllCustomRpcUrls() {
        return this.customRpcConfig.toArray();
      }
      async getAllSavedTransactionHashes() {
        return this.chainTransactions.orderBy("hash").keys();
      }
      async getAllTransactions() {
        return this.chainTransactions.toArray();
      }
      async getTransactionsForNetworkQuery(network) {
        return this.chainTransactions.where("network.name").equals(network.name);
      }
      async getTransactionsForNetwork(network) {
        return (await this.getTransactionsForNetworkQuery(network)).toArray();
      }
      async getNetworkPendingTransactions(network) {
        const transactions = await this.getTransactionsForNetworkQuery(network);
        return transactions.filter((transaction => !("status" in transaction) && (transaction.blockHash === null || transaction.blockHeight === null))).toArray();
      }
      async getBlock(network, blockHash) {
        return (await this.blocks.where("[hash+network.name]").equals([ blockHash, network.name ]).toArray())[0] || null;
      }
      async addOrUpdateTransaction(tx, dataSource) {
        await this.transaction("rw", this.chainTransactions, (() => this.chainTransactions.put({
          ...tx,
          firstSeen: Date.now(),
          dataSource
        })));
      }
      async getLatestAccountBalance(address, network, asset) {
        const balanceCandidates = await this.balances.where("retrievedAt").above(Date.now() - 7 * 24 * 60 * 60 * 1e3).filter((balance => balance.address === address && balance.assetAmount.asset.symbol === asset.symbol && balance.network.name === network.name)).reverse().sortBy("retrievedAt");
        return balanceCandidates.length > 0 ? balanceCandidates[0] : null;
      }
      async addAccountToTrack(addressNetwork) {
        await this.accountsToTrack.put(addressNetwork);
      }
      async removeAccountToTrack(address) {
        await this.accountsToTrack.where("address").equals(address).delete();
      }
      async getOldestAccountAssetTransferLookup(addressNetwork) {
        const lookups = await this.accountAssetTransferLookups.where("[addressNetwork.address+addressNetwork.network.name]").equals([ addressNetwork.address, addressNetwork.network.name ]).toArray();
        return lookups.reduce(((oldestBlock, lookup) => oldestBlock === null || lookup.startBlock < oldestBlock ? lookup.startBlock : oldestBlock), null);
      }
      async getNewestAccountAssetTransferLookup(addressNetwork) {
        const lookups = await this.accountAssetTransferLookups.where("[addressNetwork.address+addressNetwork.network.name]").equals([ addressNetwork.address, addressNetwork.network.name ]).toArray();
        return lookups.reduce(((newestBlock, lookup) => newestBlock === null || lookup.endBlock > newestBlock ? lookup.endBlock : newestBlock), null);
      }
      async recordAccountAssetTransferLookup(addressNetwork, startBlock, endBlock) {
        await this.accountAssetTransferLookups.add({
          addressNetwork,
          startBlock,
          endBlock,
          retrievedAt: Date.now()
        });
      }
      async addBlock(block) {
        await this.blocks.put(block);
      }
      async addBalance(accountBalance) {
        await this.balances.add(accountBalance);
      }
      async updateBaseAssets(baseAssets) {
        await this.baseAssets.bulkPut(baseAssets);
      }
      async getAccountsToTrack() {
        return this.accountsToTrack.toArray();
      }
      async getTrackedAddressesOnNetwork(network) {
        return this.accountsToTrack.where("network.name").equals(network.name).toArray();
      }
      async getTrackedAccountOnNetwork({address, network}) {
        return (await this.accountsToTrack.where("[address+network.name+network.chainID]").equals([ address, network.name, network.chainID ]).toArray())[0] ?? null;
      }
      async getChainIDsToTrack() {
        const chainIDs = await this.accountsToTrack.orderBy("network.chainID").keys();
        return new Set(chainIDs.filter((chainID => typeof chainID === "string")));
      }
    }
    function createDB(options) {
      return new ChainDatabase(options);
    }
    var BigNumber;
    var utils_isEIP1559TransactionRequest;
    function blockFromEthersBlock(network, gethResult) {
      return {
        hash: gethResult.hash,
        blockHeight: gethResult.number,
        parentHash: gethResult.parentHash,
        difficulty: 0n,
        timestamp: gethResult.timestamp,
        baseFeePerGas: gethResult.baseFeePerGas?.toBigInt(),
        network
      };
    }
    function blockFromProviderBlock(network, incomingGethResult) {
      const gethResult = incomingGethResult;
      return {
        hash: gethResult.hash,
        blockHeight: qethers_lib.BigNumber.from(gethResult.number).toNumber(),
        parentHash: gethResult.parentHash,
        difficulty: gethResult.difficulty ? BigInt(gethResult.difficulty) : 0n,
        timestamp: qethers_lib.BigNumber.from(gethResult.timestamp).toNumber(),
        baseFeePerGas: gethResult.baseFeePerGas ? BigInt(gethResult.baseFeePerGas) : undefined,
        network
      };
    }
    function ethersTransactionRequestFromEIP1559TransactionRequest(transaction) {
      return {
        to: transaction.to,
        data: transaction.input ?? undefined,
        from: transaction.from,
        type: transaction.type,
        nonce: transaction.nonce,
        value: transaction.value,
        chainId: parseInt(transaction.chainID, 10),
        gasLimit: transaction.gasLimit,
        maxFeePerGas: transaction.maxFeePerGas,
        maxPriorityFeePerGas: transaction.maxPriorityFeePerGas
      };
    }
    function ethersTransactionRequestFromLegacyTransactionRequest(transaction) {
      const {to, input, type, nonce, gasPrice, value, chainID, gasLimit, from} = transaction;
      return {
        from,
        to,
        data: input ?? undefined,
        type: type ?? undefined,
        nonce,
        gasPrice,
        value,
        chainId: parseInt(chainID, 10),
        gasLimit
      };
    }
    function ethersTransactionFromTransactionRequest(transactionRequest) {
      if (isEIP1559TransactionRequest(transactionRequest)) {
        return ethersTransactionRequestFromEIP1559TransactionRequest(transactionRequest);
      }
      return ethersTransactionRequestFromLegacyTransactionRequest(transactionRequest);
    }
    function eip1559TransactionRequestFromEthersTransactionRequest(transaction) {
      return {
        to: transaction.to,
        input: transaction.data?.toString() ?? null,
        from: transaction.from,
        type: transaction.type,
        nonce: typeof transaction.nonce !== "undefined" ? parseInt(transaction.nonce.toString(), 16) : undefined,
        value: typeof transaction.value !== "undefined" ? BigInt(transaction.value.toString()) : undefined,
        chainID: transaction.chainId?.toString(16),
        gasLimit: typeof transaction.gasLimit !== "undefined" ? BigInt(transaction.gasLimit.toString()) : undefined,
        maxFeePerGas: typeof transaction.maxFeePerGas !== "undefined" ? BigInt(transaction.maxFeePerGas.toString()) : undefined,
        maxPriorityFeePerGas: typeof transaction.maxPriorityFeePerGas !== "undefined" ? BigInt(transaction.maxPriorityFeePerGas.toString()) : undefined
      };
    }
    function legacyEVMTransactionRequestFromEthersTransactionRequest(transaction) {
      return {
        to: transaction.to,
        input: transaction.data?.toString() ?? null,
        from: transaction.from,
        type: transaction.type,
        nonce: typeof transaction.nonce !== "undefined" ? parseInt(transaction.nonce.toString(), 16) : undefined,
        value: transaction.value ? BigInt(transaction.value.toString()) : undefined,
        chainID: transaction.chainId?.toString(16),
        gasLimit: typeof transaction.gasLimit !== "undefined" ? BigInt(transaction.gasLimit.toString()) : undefined,
        gasPrice: typeof transaction.gasPrice !== "undefined" ? BigInt(transaction.gasPrice.toString()) : undefined
      };
    }
    function transactionRequestFromEthersTransactionRequest(ethersTransactionRequest) {
      if (isEIP1559TransactionRequest(ethersTransactionRequest)) {
        return eip1559TransactionRequestFromEthersTransactionRequest(ethersTransactionRequest);
      }
      return legacyEVMTransactionRequestFromEthersTransactionRequest(ethersTransactionRequest);
    }
    function unsignedTransactionFromEVMTransaction(tx) {
      const unsignedTransaction = {
        to: tx.to,
        nonce: tx.nonce,
        gasLimit: BigNumber.from(tx.gasLimit),
        data: tx.input || "",
        value: BigNumber.from(tx.value),
        chainId: parseInt(tx.network.chainID, 10),
        type: tx.type
      };
      if (utils_isEIP1559TransactionRequest(tx)) {
        unsignedTransaction.maxFeePerGas = BigNumber.from(tx.maxFeePerGas);
        unsignedTransaction.maxPriorityFeePerGas = BigNumber.from(tx.maxPriorityFeePerGas);
      } else if ("gasPrice" in tx) {
        unsignedTransaction.gasPrice = BigNumber.from(tx?.gasPrice ?? 0);
      }
      return unsignedTransaction;
    }
    function ethersTransactionFromSignedTransaction(tx) {
      const baseTx = {
        nonce: Number(tx.nonce),
        to: tx.to,
        data: tx.input || "",
        gasPrice: tx.gasPrice ? qethers_lib.BigNumber.from(tx.gasPrice) : undefined,
        type: tx.type,
        chainId: parseInt(tx.network.chainID, 10),
        value: qethers_lib.BigNumber.from(tx.value),
        gasLimit: qethers_lib.BigNumber.from(tx.gasLimit)
      };
      if (isEIP1559SignedTransaction(tx)) {
        return {
          ...baseTx,
          maxFeePerGas: qethers_lib.BigNumber.from(tx.maxFeePerGas),
          maxPriorityFeePerGas: qethers_lib.BigNumber.from(tx.maxPriorityFeePerGas),
          signature: tx.signature || undefined
        };
      }
      return baseTx;
    }
    function enrichTransactionWithReceipt(transaction, receipt) {
      const gasUsed = receipt.gasUsed.toBigInt();
      return {
        ...transaction,
        gasUsed,
        gasPrice: receipt.effectiveGasPrice?.toBigInt() ?? transaction.gasPrice,
        logs: receipt.logs.map((({address, data, topics}) => ({
          contractAddress: address,
          data,
          topics
        }))),
        status: receipt.status ?? (gasUsed === transaction.gasLimit ? 0 : 1),
        blockHash: receipt.blockHash,
        blockHeight: receipt.blockNumber
      };
    }
    function transactionFromEthersTransaction(tx, network) {
      if (!tx || tx.hash === undefined) {
        throw new Error("Malformed transaction");
      }
      if (!isKnownTxType(tx.type)) {
        throw new Error(`Unknown transaction type ${tx.type}`);
      }
      const newTx = {
        hash: tx.hash,
        from: tx.from,
        to: tx.to ?? undefined,
        nonce: parseInt(tx.nonce.toString(), 10),
        gasLimit: tx.gasLimit.toBigInt(),
        gasPrice: tx.gasPrice ? tx.gasPrice.toBigInt() : null,
        maxFeePerGas: tx.maxFeePerGas ? tx.maxFeePerGas.toBigInt() : null,
        maxPriorityFeePerGas: tx.maxPriorityFeePerGas ? tx.maxPriorityFeePerGas.toBigInt() : null,
        value: tx.value.toBigInt(),
        input: tx.data,
        type: tx.type,
        blockHash: tx.blockHash || null,
        blockHeight: tx.blockNumber || null,
        network,
        asset: network.baseAsset
      };
      if (tx.signature) {
        const signedTx = {
          ...newTx,
          signature: tx.signature
        };
        return signedTx;
      }
      return newTx;
    }
    var providers_lib = __webpack_require__(7649);
    const BASE_BACKOFF_MS = 400;
    const MAX_RETRIES_PER_PROVIDER = 3;
    const PRIMARY_PROVIDER_RECONNECT_INTERVAL = 10 * SECOND;
    const WAIT_BEFORE_SUBSCRIBING = 2 * SECOND;
    const WAIT_BEFORE_SEND_AGAIN = 100;
    const BALANCE_TTL = 1 * SECOND;
    const CACHE_CLEANUP_INTERVAL = 10 * SECOND;
    const PROVIDER_REQUEST_TIMEOUT = 5 * SECOND;
    function waitAnd(waitMs, fn) {
      return new Promise((resolve => {
        setTimeout((() => {
          resolve(fn());
        }), waitMs);
      }));
    }
    function backedOffMs() {
      return BASE_BACKOFF_MS + 400 * Math.random();
    }
    function isClosedOrClosingWebSocketProvider(provider) {
      if (provider instanceof providers_lib.WebSocketProvider) {
        const webSocket = provider._websocket;
        return webSocket.readyState === WebSocket.CLOSING || webSocket.readyState === WebSocket.CLOSED;
      }
      return false;
    }
    function isConnectingWebSocketProvider(provider) {
      if (provider instanceof providers_lib.WebSocketProvider) {
        const webSocket = provider._websocket;
        return webSocket.readyState === WebSocket.CONNECTING;
      }
      return false;
    }
    function customOrDefaultProvider(method, supportedMethods = []) {
      if (!supportedMethods.length) {
        return true;
      }
      return supportedMethods.some((m => method.startsWith(m)));
    }
    class SerialFallbackProvider extends providers_lib.JsonRpcProvider {
      customProviderSupportedMethods=[];
      cachedProvidersByIndex={};
      messagesToSend={};
      currentProviderIndex=0;
      forcedBatchMaxSize=0;
      forcedBatchMaxPromise=undefined;
      forcedBatchMaxPreviousSize=0;
      latestBalanceCache={};
      latestHasCodeCache={};
      subscriptions=[];
      eventSubscriptions=[];
      constructor(chainID, providerCreators) {
        const customProviderCreator = providerCreators.find((creator => creator.type === "custom"));
        const [firstProviderCreator, ...remainingProviderCreators] = providerCreators.flatMap((pc => pc.type === "custom" ? [] : pc.creator));
        const firstProvider = firstProviderCreator();
        super(firstProvider.connection, firstProvider.network);
        this.chainID = chainID;
        this.currentProvider = firstProvider;
        this.cachedProvidersByIndex[0] = firstProvider;
        if (customProviderCreator) {
          this.addCustomProvider(customProviderCreator);
        }
        setInterval((() => {
          this.attemptToReconnectToPrimaryProvider();
        }), PRIMARY_PROVIDER_RECONNECT_INTERVAL);
        setInterval((() => {
          this.cleanupStaleCacheEntries();
        }), CACHE_CLEANUP_INTERVAL);
        this.cachedChainId = qethers_lib.utils.hexlify(Number(chainID));
        this.providerCreators = [ firstProviderCreator, ...remainingProviderCreators ];
      }
      async routeRpcCall(messageId) {
        const {method, params} = this.messagesToSend[messageId];
        const cachedResult = this.checkForCachedResult(method, params);
        if (typeof cachedResult !== "undefined") {
          delete this.messagesToSend[messageId];
          return cachedResult;
        }
        if (this.forcedBatchMaxPromise) {
          await this.forcedBatchMaxPromise;
        }
        const pendingBatch = "_pendingBatch" in this.currentProvider ? this.currentProvider._pendingBatch : undefined;
        const pendingBatchSize = pendingBatch?.length;
        const existingProviderIndex = this.currentProviderIndex;
        if (pendingBatch && this.forcedBatchMaxSize && pendingBatch.length >= this.forcedBatchMaxSize) {
          this.forcedBatchMaxPromise = new Promise((resolve => {
            const checkInterval = setInterval((() => {
              const latestPendingBatch = "_pendingBatch" in this.currentProvider ? this.currentProvider._pendingBatch : undefined;
              if ((latestPendingBatch?.length ?? 0) < this.forcedBatchMaxSize) {
                resolve();
                clearInterval(checkInterval);
              }
            }), 5);
          }));
        }
        try {
          if (isClosedOrClosingWebSocketProvider(this.currentProvider)) {
            throw new Error("WebSocket is already in CLOSING");
          }
          if (isConnectingWebSocketProvider(this.currentProvider)) {
            return await waitAnd(WAIT_BEFORE_SEND_AGAIN, (async () => this.routeRpcCall(messageId)));
          }
          if (this.customProvider && customOrDefaultProvider(method, this.customProviderSupportedMethods)) {
            const result = await this.customProvider.send(method, params);
            delete this.messagesToSend[messageId];
            return result;
          }
          const result = await this.currentProvider.send(method, params);
          delete this.messagesToSend[messageId];
          return result;
        } catch (error) {
          const stringifiedError = String(error);
          if (stringifiedError.match(/Batch size too large/) && (pendingBatchSize === undefined || pendingBatchSize === 0)) {
            this.forcedBatchMaxPreviousSize = pendingBatch?.length ?? pendingBatchSize ?? 1;
            this.forcedBatchMaxSize = (pendingBatch?.length ?? pendingBatchSize ?? 2) / 2;
            lib_logger.debug("Setting a max batch size of", this.forcedBatchMaxSize, "on chain", this.chainID, "and retrying: ", method, params);
            return this.routeRpcCall(messageId);
          }
          if (stringifiedError.match(/Batch size too large/)) {
            lib_logger.debug("Using max batch size of", this.forcedBatchMaxSize, "on chain", this.chainID, "and retrying: ", method, params);
            return this.routeRpcCall(messageId);
          }
          if (stringifiedError.match(/WebSocket is already in CLOSING|bad response|missing response|we can't execute this request|failed response|TIMEOUT|NETWORK_ERROR|call rate limit exhausted/)) {
            if (this.currentProviderIndex !== existingProviderIndex) {
              lib_logger.debug("Retrying on newly connected provider on chain", this.chainID, ": ", method, params);
              return await this.routeRpcCall(messageId);
            }
            if (this.currentProviderIndex + 1 < this.providerCreators.length) {
              return await this.attemptToSendMessageOnNewProvider(messageId);
            }
            this.currentProviderIndex = 0;
            this.reconnectProvider();
            delete this.messagesToSend[messageId];
            throw error;
          } else if (stringifiedError.match(/bad result from backend/)) {
            if (this.currentProviderIndex === existingProviderIndex && this.currentProviderIndex + 1 < this.providerCreators.length && this.shouldSendMessageOnNextProvider(messageId)) {
              return await this.attemptToSendMessageOnNewProvider(messageId);
            }
            const backoff = this.backoffFor(messageId);
            lib_logger.debug("Backing off for", backoff, "on chain", this.chainID, "and retrying: ", method, params);
            return await waitAnd(backoff, (async () => {
              if (isClosedOrClosingWebSocketProvider(this.currentProvider)) {
                await this.reconnectProvider();
              }
              lib_logger.debug("Retrying", "on chain", this.chainID, method, params);
              return this.routeRpcCall(messageId);
            }));
          }
          lib_logger.debug("Skipping fallback for unidentified error", error, "for provider", this.currentProvider, "on chain", this.chainID);
          delete this.messagesToSend[messageId];
          throw error;
        }
      }
      addCustomProvider(customProviderCreator) {
        this.customProviderSupportedMethods = customProviderCreator.supportedMethods ?? [];
        this.customProviderCreator = customProviderCreator.creator;
        this.customProvider = this.customProviderCreator();
      }
      removeCustomProvider() {
        this.customProviderSupportedMethods = [];
        this.customProviderCreator = undefined;
        this.customProvider = undefined;
      }
      conditionallyCacheResult(result, {method, params}) {
        if (method === "eth_getBalance" && params[1] === "latest") {
          const address = params[0];
          this.latestBalanceCache[address] = {
            balance: result,
            updatedAt: Date.now()
          };
        }
        if (method === "eth_getCode" && params[1] === "latest") {
          const address = params[0];
          this.latestHasCodeCache[address] = {
            hasCode: result
          };
        }
      }
      checkForCachedResult(method, params) {
        if (method === "eth_getBalance" && params[1] === "latest") {
          const address = params[0];
          const now = Date.now();
          const lastUpdate = this.latestBalanceCache[address]?.updatedAt;
          if (lastUpdate && now < lastUpdate + BALANCE_TTL) {
            return this.latestBalanceCache[address].balance;
          }
        }
        if (method === "eth_getCode" && params[1] === "latest") {
          const address = params[0];
          if (typeof this.latestHasCodeCache[address] !== "undefined") {
            return this.latestHasCodeCache[address].hasCode;
          }
        }
        return undefined;
      }
      cleanupStaleCacheEntries() {
        const balanceCache = Object.entries(this.latestBalanceCache);
        const hasCodeCache = Object.keys(this.latestHasCodeCache);
        if (balanceCache.length > 0) {
          lib_logger.debug(`Cleaning up ${this.network.chainId} balance cache, ${balanceCache.length} entries`);
          const now = Date.now();
          balanceCache.forEach((([address, balance]) => {
            if (balance.updatedAt < now - BALANCE_TTL) {
              delete this.latestBalanceCache[address];
            }
          }));
        }
        if (hasCodeCache.length > 0) {
          lib_logger.debug(`Cleaning up ${this.network.chainId} hasCode cache, ${hasCodeCache.length} entries`);
          this.latestHasCodeCache = {};
        }
      }
      async attemptToSendMessageOnNewProvider(messageId) {
        this.disconnectCurrentProvider();
        this.currentProviderIndex += 1;
        await this.reconnectProvider();
        return this.routeRpcCall(messageId);
      }
      async send(method, params) {
        if (method === "eth_chainId") {
          return this.cachedChainId;
        }
        const id = Symbol(method);
        this.messagesToSend[id] = {
          method,
          params,
          backoffCount: 0,
          providerIndex: this.currentProviderIndex
        };
        const result = await this.routeRpcCall(id);
        this.conditionallyCacheResult(result, {
          method,
          params
        });
        return result;
      }
      async subscribe(tag, param, processFunc) {
        const subscription = {
          tag,
          param,
          processFunc
        };
        if (this.currentProvider instanceof providers_lib.WebSocketProvider) {
          await this.currentProvider._subscribe(tag, param, processFunc);
          this.subscriptions.push(subscription);
        } else {
          lib_logger.warn("Current provider ", this.currentProvider, " for ", this.network, "is not a WebSocket provider; subscription " + "will not work until a WebSocket provider connects.");
        }
      }
      on(eventName, listener) {
        this.eventSubscriptions.push({
          eventName,
          listener,
          once: false
        });
        this.currentProvider.on(eventName, listener);
        return this;
      }
      once(eventName, listener) {
        const adjustedListener = this.listenerWithCleanup(eventName, listener);
        this.eventSubscriptions.push({
          eventName,
          listener: adjustedListener,
          once: true
        });
        this.currentProvider.once(eventName, listener);
        return this;
      }
      off(eventName, listenerToRemove) {
        this.eventSubscriptions = this.eventSubscriptions.filter((({eventName: savedEventName, listener: savedListener}) => {
          if (savedEventName === eventName) {
            if (typeof listenerToRemove === "undefined" || listenerToRemove === null) {
              return true;
            }
            if ("wrappedListener" in savedListener) {
              return savedListener.wrappedListener === listenerToRemove;
            }
            return savedListener === listenerToRemove;
          }
          return false;
        }));
        this.currentProvider.off(eventName, listenerToRemove);
        return this;
      }
      disconnectCurrentProvider() {
        lib_logger.debug("Disconnecting current provider; websocket: ", this.currentProvider instanceof providers_lib.WebSocketProvider, "on chain", this.chainID, ".");
        if (this.currentProvider instanceof providers_lib.WebSocketProvider) {
          this.currentProvider.destroy();
        } else {
          this.eventSubscriptions.forEach((({eventName}) => this.removeAllListeners(eventName)));
        }
      }
      listenerWithCleanup(eventName, listenerToWrap) {
        const wrappedListener = (...params) => {
          try {
            listenerToWrap(...params);
          } finally {
            this.eventSubscriptions = this.eventSubscriptions.filter((({eventName: storedEventName, listener, once}) => eventName !== storedEventName || listener !== wrappedListener || once !== true));
          }
        };
        wrappedListener.wrappedListener = listenerToWrap;
        return wrappedListener;
      }
      async reconnectProvider() {
        this.disconnectCurrentProvider();
        if (this.currentProviderIndex >= this.providerCreators.length) {
          this.currentProviderIndex = 0;
        }
        lib_logger.debug("Reconnecting provider at index", this.currentProviderIndex, "on chain", this.chainID, "...");
        const cachedProvider = this.cachedProvidersByIndex[this.currentProviderIndex] ?? this.providerCreators[this.currentProviderIndex]();
        this.cachedProvidersByIndex[this.currentProviderIndex] = cachedProvider;
        this.currentProvider = cachedProvider;
        await this.resubscribe(this.currentProvider);
      }
      async resubscribe(provider) {
        lib_logger.debug("Resubscribing subscriptions", "on chain", this.chainID, "...");
        if (isClosedOrClosingWebSocketProvider(provider) || isConnectingWebSocketProvider(provider)) {
          return false;
        }
        if (!provider.network) {
          return false;
        }
        if (provider instanceof providers_lib.WebSocketProvider) {
          const websocketProvider = provider;
          await this.subscriptions.reduce(((previousPromise, {tag, param, processFunc}) => previousPromise.then((() => waitAnd(backedOffMs(), (() => websocketProvider._subscribe(tag, param, processFunc)))))), Promise.resolve());
        }
        this.eventSubscriptions.forEach((({eventName, listener, once}) => {
          if (once) {
            provider.once(eventName, listener);
          } else {
            provider.on(eventName, listener);
          }
        }));
        lib_logger.debug("Subscriptions resubscribed", "on chain", this.chainID, "...");
        return true;
      }
      async attemptToReconnectToPrimaryProvider() {
        if (this.currentProviderIndex === 0) {
          return null;
        }
        const primaryProvider = this.providerCreators[0]();
        return waitAnd(WAIT_BEFORE_SUBSCRIBING, (async () => {
          const subscriptionsSuccessful = await this.resubscribe(primaryProvider);
          if (!subscriptionsSuccessful) {
            return;
          }
          await this.disconnectCurrentProvider();
          this.currentProvider = primaryProvider;
          this.currentProviderIndex = 0;
        }));
      }
      backoffFor(messageId) {
        this.messagesToSend[messageId].backoffCount += 1;
        this.conditionallyIncrementCurrentProviderIndex(messageId);
        return backedOffMs();
      }
      conditionallyIncrementCurrentProviderIndex(messageId) {
        const {providerIndex} = this.messagesToSend[messageId];
        if (providerIndex !== this.currentProviderIndex) {
          this.messagesToSend[messageId].backoffCount = 0;
          this.messagesToSend[messageId].providerIndex = this.currentProviderIndex;
        }
      }
      shouldSendMessageOnNextProvider(messageId) {
        const {backoffCount} = this.messagesToSend[messageId];
        if (backoffCount && backoffCount >= MAX_RETRIES_PER_PROVIDER) {
          return true;
        }
        return false;
      }
    }
    function getProviderCreator(rpcUrl) {
      const url = new URL(rpcUrl);
      if (/^wss?/.test(url.protocol)) {
        return new providers_lib.WebSocketProvider(rpcUrl);
      }
      if (/rpc\.ankr\.com|1rpc\.io/.test(url.href)) {
        return new providers_lib.JsonRpcBatchProvider({
          url: rpcUrl,
          throttleLimit: 1,
          timeout: PROVIDER_REQUEST_TIMEOUT
        });
      }
      return new providers_lib.JsonRpcProvider({
        url: rpcUrl,
        throttleLimit: 1,
        timeout: PROVIDER_REQUEST_TIMEOUT
      });
    }
    function makeSerialFallbackProvider(chainID, rpcUrls, customRpc) {
      const customProviderCreator = customRpc ? [ {
        type: "custom",
        supportedMethods: customRpc.supportedMethods ?? [],
        creator: () => getProviderCreator(customRpc.rpcUrls[0])
      } ] : [];
      const genericProviders = rpcUrls.map((rpcUrl => ({
        type: "generic",
        creator: () => getProviderCreator(rpcUrl)
      })));
      return new SerialFallbackProvider(chainID, [ ...genericProviders, ...customProviderCreator ]);
    }
    const MULTICALL_CONTRACT_ADDRESS = "0xEedcF72f3445928c074e7C1C3d72481E2Ee21822F731390b9FFfF8553b19EAa6";
    const CHAIN_SPECIFIC_MULTICALL_CONTRACT_ADDRESSES = {
      256: "0xEedcF72f3445928c074e7C1C3d72481E2Ee21822F731390b9FFfF8553b19EAa6",
      257: "0xEedcF72f3445928c074e7C1C3d72481E2Ee21822F731390b9FFfF8553b19EAa6"
    };
    const MULTICALL_ABI = [ "function aggregate(tuple(address target, bytes callData)[] calls) payable returns (uint256 blockNumber, bytes[] returnData)", "function aggregate3(tuple(address target, bool allowFailure, bytes callData)[] calls) payable returns (tuple(bool success, bytes returnData)[] returnData)", "function aggregate3Value(tuple(address target, bool allowFailure, uint256 value, bytes callData)[] calls) payable returns (tuple(bool success, bytes returnData)[] returnData)", "function blockAndAggregate(tuple(address target, bytes callData)[] calls) payable returns (uint256 blockNumber, bytes32 blockHash, tuple(bool success, bytes returnData)[] returnData)", "function getBasefee() view returns (uint256 basefee)", "function getBlockHash(uint256 blockNumber) view returns (bytes32 blockHash)", "function getBlockNumber() view returns (uint256 blockNumber)", "function getChainId() view returns (uint256 chainid)", "function getCurrentBlockCoinbase() view returns (address coinbase)", "function getCurrentBlockDifficulty() view returns (uint256 difficulty)", "function getCurrentBlockGasLimit() view returns (uint256 gaslimit)", "function getCurrentBlockTimestamp() view returns (uint256 timestamp)", "function getEthBalance(address addr) view returns (uint256 balance)", "function getLastBlockHash() view returns (bytes32 blockHash)", "function tryAggregate(bool requireSuccess, tuple(address target, bytes callData)[] calls) payable returns (tuple(bool success, bytes returnData)[] returnData)", "function tryBlockAndAggregate(bool requireSuccess, tuple(address target, bytes callData)[] calls) payable returns (uint256 blockNumber, bytes32 blockHash, tuple(bool success, bytes returnData)[] returnData)" ];
    var qethers;
    const QERC20_FUNCTIONS = {
      allowance: lib_utils.FunctionFragment.from("allowance(address owner, address spender) view returns (uint256)"),
      approve: lib_utils.FunctionFragment.from("approve(address spender, uint256 value) returns (bool)"),
      balanceOf: lib_utils.FunctionFragment.from("balanceOf(address owner) view returns (uint256)"),
      decimals: lib_utils.FunctionFragment.from("decimals() view returns (uint8)"),
      name: lib_utils.FunctionFragment.from("name() view returns (string)"),
      symbol: lib_utils.FunctionFragment.from("symbol() view returns (string)"),
      totalSupply: lib_utils.FunctionFragment.from("totalSupply() view returns (uint256)"),
      transfer: lib_utils.FunctionFragment.from("transfer(address to, uint amount) returns (bool)"),
      transferFrom: lib_utils.FunctionFragment.from("transferFrom(address from, address to, uint amount) returns (bool)")
    };
    const QERC20_EVENTS = {
      Transfer: lib_utils.EventFragment.from("Transfer(address indexed from, address indexed to, uint amount)"),
      Approval: lib_utils.EventFragment.from("Approval(address indexed owner, address indexed spender, uint amount)")
    };
    const QERC20_ABI = Object.values(QERC20_FUNCTIONS).concat(Object.values(QERC20_EVENTS));
    const QERC20_INTERFACE = new qethers_lib.qethers.utils.Interface(QERC20_ABI);
    const QERC2612_FUNCTIONS = {
      permit: lib_utils.FunctionFragment.from("permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s)"),
      nonces: lib_utils.FunctionFragment.from("nonces(address owner) view returns (uint256)"),
      DOMAIN: lib_utils.FunctionFragment.from("DOMAIN_SEPARATOR() view returns (bytes32)")
    };
    const QERC2612_ABI = QERC20_ABI.concat(Object.values(QERC2612_FUNCTIONS));
    const QERC2612_INTERFACE = new qethers_lib.qethers.utils.Interface(QERC2612_ABI);
    async function getBalance(provider, tokenAddress, account) {
      const token = new qethers.Contract(tokenAddress, QERC20_ABI, provider);
      return BigInt((await token.balanceOf(account)).toString());
    }
    async function getMetadata(provider, tokenSmartContract) {
      const token = new qethers_lib.qethers.Contract(tokenSmartContract.contractAddress, QERC20_ABI, provider);
      try {
        const [symbol, name, decimals] = await Promise.all([ QERC20_FUNCTIONS.symbol, QERC20_FUNCTIONS.name, QERC20_FUNCTIONS.decimals ].map((({name: functionName}) => token.callStatic[functionName]())));
        return {
          ...tokenSmartContract,
          symbol,
          name,
          decimals
        };
      } catch (error) {
        lib_logger.warn("Invalid metadata for token", tokenSmartContract);
        throw new Error("Could not retrieve erc20 token metadata");
      }
    }
    function parseQERC20Tx(input) {
      try {
        return QERC20_INTERFACE.parseTransaction({
          data: input
        });
      } catch (err) {
        return undefined;
      }
    }
    function parseLogsForQERC20Transfers(logs) {
      return logs.map((({contractAddress, data, topics}) => {
        try {
          const decoded = QERC20_INTERFACE.decodeEventLog(QERC20_EVENTS.Transfer, data, topics);
          if (typeof decoded.to === "undefined" || typeof decoded.from === "undefined" || typeof decoded.amount === "undefined") {
            return undefined;
          }
          return {
            contractAddress,
            amount: decoded.amount.toBigInt(),
            senderAddress: decoded.from,
            recipientAddress: decoded.to
          };
        } catch (_) {
          return undefined;
        }
      })).filter((info => typeof info !== "undefined"));
    }
    const getTokenBalances = async ({address, network}, tokenAddresses, provider) => {
      const multicallAddress = CHAIN_SPECIFIC_MULTICALL_CONTRACT_ADDRESSES[network.chainID] || MULTICALL_CONTRACT_ADDRESS;
      const contract = new qethers_lib.qethers.Contract(multicallAddress, MULTICALL_ABI, provider);
      const balanceOfCallData = QERC20_INTERFACE.encodeFunctionData("balanceOf", [ address ]);
      const response = await contract.callStatic.tryBlockAndAggregate(false, tokenAddresses.map((tokenAddress => [ tokenAddress, balanceOfCallData ])));
      return response.returnData.flatMap(((data, i) => {
        if (data.success !== true) {
          return [];
        }
        if (data.returnData === "0x00" || data.returnData === "0x") {
          return [];
        }
        return {
          amount: BigInt(qethers_lib.BigNumber.from(data.returnData).toString()),
          smartContract: {
            contractAddress: tokenAddresses[i],
            homeNetwork: network
          }
        };
      }));
    };
    let warnedAssetTransfers = false;
    class AssetDataHelper {
      constructor(providerTracker) {
        this.providerTracker = providerTracker;
      }
      async getTokenBalance(addressOnNetwork, smartContractAddress) {
        const provider = this.providerTracker.providerForNetwork(addressOnNetwork.network);
        if (!provider) {
          throw lib_logger.buildError("Could not find a provider for network", addressOnNetwork.network);
        }
        const balances = await getTokenBalances(addressOnNetwork, [ smartContractAddress ], provider);
        if (balances.length < 1) {
          throw lib_logger.buildError("Unable to retrieve balances for contract", smartContractAddress);
        }
        return balances[0];
      }
      async getTokenBalances(addressOnNetwork, smartContractAddresses) {
        const provider = this.providerTracker.providerForNetwork(addressOnNetwork.network);
        if (typeof provider === "undefined") {
          return [];
        }
        try {
          return await getTokenBalances(addressOnNetwork, smartContractAddresses || [], provider);
        } catch (error) {
          lib_logger.warn("Problem resolving asset balances; network may not support it", addressOnNetwork.network, error);
          return [];
        }
      }
      async getTokenMetadata(tokenSmartContract) {
        const provider = this.providerTracker.providerForNetwork(tokenSmartContract.homeNetwork);
        if (typeof provider === "undefined") {
          return undefined;
        }
        return getMetadata(provider, tokenSmartContract);
      }
      async getAssetTransfers(addressOnNetwork) {
        const provider = this.providerTracker.providerForNetwork(addressOnNetwork.network);
        if (typeof provider === "undefined") {
          return [];
        }
        if (!warnedAssetTransfers) {
          lib_logger.warn("Asset transfer lookup not yet supported");
          warnedAssetTransfers = true;
        }
        return [];
      }
    }
    const BLOCKS_FOR_TRANSACTION_HISTORY = 128e3;
    const BLOCKS_TO_SKIP_FOR_TRANSACTION_HISTORY = 20;
    const NETWORK_POLLING_TIMEOUT = MINUTE * 2.05;
    const TRANSACTION_CHECK_LIFETIME_MS = 10 * HOUR;
    const GAS_POLLS_PER_PERIOD = 4;
    const GAS_POLLING_PERIOD = 1;
    const TRANSACTIONS_WITH_PRIORITY_MAX_COUNT = 25;
    class ChainService extends BaseService {
      providers={
        evm: {}
      };
      lastUserActivityOnNetwork={};
      lastUserActivityOnAddress={};
      evmChainLastSeenNoncesByNormalizedAddress={};
      static create=async (preferenceService, internalSignerService) => new this(createDB(), await preferenceService, await internalSignerService);
      supportedNetworks=[ ZEUS, POSEIDON ];
      constructor(db, preferenceService, internalSignerService) {
        super({
          queuedTransactions: {
            schedule: {
              delayInMinutes: 1,
              periodInMinutes: 1
            },
            handler: () => {
              this.handleQueuedTransactionAlarm();
            }
          },
          historicAssetTransfers: {
            schedule: {
              periodInMinutes: 60
            },
            handler: () => {
              this.handleHistoricAssetTransferAlarm();
            },
            runAtStart: false
          },
          recentIncomingAssetTransfers: {
            schedule: {
              periodInMinutes: 1.5
            },
            handler: () => {
              this.handleRecentIncomingAssetTransferAlarm(true);
            }
          },
          forceRecentAssetTransfers: {
            schedule: {
              periodInMinutes: 12 * HOUR / MINUTE
            },
            handler: () => {
              this.handleRecentAssetTransferAlarm();
            }
          },
          recentAssetTransfers: {
            schedule: {
              periodInMinutes: 15
            },
            handler: () => {
              this.handleRecentAssetTransferAlarm(true);
            }
          },
          blockPrices: {
            runAtStart: false,
            schedule: {
              periodInMinutes: GAS_POLLING_PERIOD
            },
            handler: () => {
              this.pollBlockPrices();
            }
          }
        });
        this.db = db;
        this.preferenceService = preferenceService;
        this.internalSignerService = internalSignerService;
        this.trackedNetworks = [];
        this.subscribedAccounts = [];
        this.subscribedNetworks = [];
        this.transactionsToRetrieve = [];
        this.assetData = new AssetDataHelper(this);
      }
      async internalStartService() {
        await super.internalStartService();
        await this.db.initialize();
        await this.cleanupUnsupportedNetworks();
        await this.initializeNetworks();
        const allAccounts = await this.getAccountsToTrack();
        const accounts = allAccounts.filter((({address}) => isProbablyQEVMAddress(address)));
        const invalidAddresses = accounts.filter((({address}) => !isProbablyQEVMAddress(address)));
        invalidAddresses.forEach((({address}) => this.removeAccountToTrack(address)));
        const trackedNetworks = await this.getTrackedNetworks();
        const transactions = await this.db.getAllTransactions();
        this.emitter.emit("initializeActivities", {
          transactions,
          accounts
        });
        Promise.allSettled(accounts.flatMap((an => [ this.subscribeToAccountTransactions(an).catch((e => {
          lib_logger.error(e);
        })) ])).concat(trackedNetworks.map((network => this.db.getNetworkPendingTransactions(network).then((pendingTransactions => {
          pendingTransactions.forEach((({hash, firstSeen}) => {
            lib_logger.debug(`Queuing pending transaction ${hash} for status lookup.`);
            this.queueTransactionHashToRetrieve(network, hash, firstSeen);
          }));
        })).catch((e => {
          lib_logger.error(e);
        }))))));
      }
      async cleanupUnsupportedNetworks() {
        try {
          const supportedChainIds = new Set(DEFAULT_NETWORKS.map((n => n.chainID)));
          const allNetworks = await this.db.getAllQEVMNetworks();
          const unsupportedNetworks = allNetworks.filter((network => !supportedChainIds.has(network.chainID)));
          await Promise.all(unsupportedNetworks.map((network => {
            lib_logger.info(`Removing unsupported network from database: ${network.name} (${network.chainID})`);
            return this.db.removeQEVMNetwork(network.chainID);
          })));
          lib_logger.info("Database cleanup completed - only DEFAULT_NETWORKS remain");
        } catch (error) {
          lib_logger.error("Failed to cleanup unsupported networks:", error);
        }
      }
      async initializeNetworks() {
        const rpcUrls = await this.db.getAllRpcUrls();
        const customRpcUrls = await this.db.getAllCustomRpcUrls();
        await this.updateSupportedNetworks();
        this.lastUserActivityOnNetwork = Object.fromEntries(DEFAULT_NETWORKS.map((network => [ network.chainID, 0 ]))) || {};
        this.providers = {
          evm: Object.fromEntries(DEFAULT_NETWORKS.map((network => [ network.chainID, makeSerialFallbackProvider(network.chainID, rpcUrls.find((v => v.chainID === network.chainID))?.rpcUrls || [], customRpcUrls.find((v => v.chainID === network.chainID))) ])))
        };
      }
      providerForNetwork(network) {
        return this.providers.evm[network.chainID];
      }
      async addCustomProvider(chainID, rpcUrl, customProviderCreator) {
        await this.db.addCustomRpcUrl(chainID, rpcUrl, customProviderCreator.supportedMethods);
        this.providers.evm[chainID]?.addCustomProvider(customProviderCreator);
      }
      async removeCustomProvider(chainID) {
        await this.db.removeCustomRpcUrl(chainID);
        this.providers.evm[chainID]?.removeCustomProvider();
      }
      async getTrackedNetworks() {
        if (this.trackedNetworks.length > 0) {
          return this.trackedNetworks;
        }
        await Promise.allSettled(DEFAULT_NETWORKS.map((async network => this.startTrackingNetworkOrThrow(network.chainID))));
        return this.trackedNetworks;
      }
      async subscribeToNetworkEvents(network) {
        const provider = this.providerForNetwork(network);
        if (provider) {
          await Promise.allSettled([ this.fetchLatestBlockForNetwork(network), this.subscribeToNewHeads(network) ]);
        } else {
          lib_logger.error(`Couldn't find provider for network ${network.name}`);
        }
        this.emitter.emit("networkSubscribed", network);
      }
      async startTrackingNetworkOrThrow(chainID) {
        const trackedNetwork = this.trackedNetworks.find((network => sameChainID(network.chainID, chainID)));
        if (trackedNetwork) {
          lib_logger.warn(`${trackedNetwork.name} already being tracked - no need to activate it`);
          return trackedNetwork;
        }
        const networkToTrack = this.supportedNetworks.find((ntwrk => sameChainID(ntwrk.chainID, chainID)));
        if (!networkToTrack) {
          throw new Error(`Network with chainID ${chainID} is not supported`);
        }
        this.trackedNetworks.push(networkToTrack);
        const existingSubscription = this.subscribedNetworks.find((networkSubscription => networkSubscription.network.chainID === networkToTrack.chainID));
        if (!existingSubscription) {
          this.subscribeToNetworkEvents(networkToTrack);
          const addressesToTrack = new Set((await this.getAccountsToTrack()).map((account => account.address)));
          addressesToTrack.forEach((address => {
            this.addAccountToTrack({
              address,
              network: networkToTrack
            });
          }));
        }
        return networkToTrack;
      }
      providerForNetworkOrThrow(network) {
        const provider = this.providerForNetwork(network);
        if (!provider) {
          const isDefaultNetwork = DEFAULT_NETWORKS.some((n => n.chainID === network.chainID));
          if (!isDefaultNetwork) {
            const supportedNames = DEFAULT_NETWORKS.map((n => `${n.name} (${n.chainID})`)).join(", ");
            lib_logger.warn(`Network ${network.name} (${network.chainID}) is not supported. Supported networks: ${supportedNames}`);
            throw new Error(`Network ${network.name} is not supported in QEVM mode`);
          }
          lib_logger.error("Request received for operation on an inactive network", network, "expected", this.trackedNetworks);
          throw new Error(`No provider available for network ${network.name}, id: ${network.chainID}`);
        }
        return provider;
      }
      async populatePartialLegacyEVMTransactionRequest(network, partialRequest) {
        const {from, to, value, gasLimit, input, gasPrice, nonce, annotation, broadcastOnSign} = partialRequest;
        const transactionRequest = {
          from,
          to,
          value: value ?? 0n,
          gasLimit: gasLimit ?? 0n,
          input: input ?? null,
          gasPrice: gasPrice || await this.estimateGasPrice(network),
          type: 0,
          network,
          chainID: network.chainID,
          nonce,
          annotation,
          estimatedRollupGwei: 0n,
          estimatedRollupFee: 0n,
          broadcastOnSign
        };
        let estimatedGasLimit;
        let gasEstimationError;
        try {
          estimatedGasLimit = await this.estimateGasLimit(network, transactionRequest);
        } catch (error) {
          lib_logger.error("Error estimating gas limit: ", error);
          if (error instanceof Error) {
            const anyError = error;
            if ("code" in anyError && anyError.code === lib_utils.Logger.errors.UNPREDICTABLE_GAS_LIMIT) {
              gasEstimationError = anyError.error ?? "Unknown transaction error.";
            }
          }
        }
        if (typeof estimatedGasLimit !== "undefined" && (typeof gasLimit === "undefined" || gasLimit < 21000n)) {
          transactionRequest.gasLimit = estimatedGasLimit;
        }
        return {
          transactionRequest,
          gasEstimationError
        };
      }
      async populatePartialEIP1559TransactionRequest(network, partialRequest) {
        const {from, to, value, gasLimit, input, maxFeePerGas, maxPriorityFeePerGas, nonce, annotation, broadcastOnSign} = partialRequest;
        const transactionRequest = {
          from,
          to,
          value: value ?? 0n,
          gasLimit: gasLimit ?? 0n,
          maxFeePerGas: maxFeePerGas ?? 0n,
          maxPriorityFeePerGas: maxPriorityFeePerGas ?? 0n,
          input: input ?? null,
          type: 2,
          network,
          chainID: network.chainID,
          nonce,
          annotation,
          broadcastOnSign
        };
        let estimatedGasLimit;
        let gasEstimationError;
        try {
          estimatedGasLimit = await this.estimateGasLimit(network, transactionRequest);
        } catch (error) {
          if (error instanceof Error) {
            const anyError = error;
            if ("code" in anyError && anyError.code === lib_utils.Logger.errors.UNPREDICTABLE_GAS_LIMIT) {
              gasEstimationError = anyError.error ?? "Unknown transaction error.";
            }
          }
        }
        if (typeof estimatedGasLimit !== "undefined" && (typeof partialRequest.gasLimit === "undefined" || partialRequest.gasLimit < 21000n)) {
          transactionRequest.gasLimit = estimatedGasLimit;
        }
        return {
          transactionRequest,
          gasEstimationError
        };
      }
      async populatePartialTransactionRequest(network, partialRequest, defaults) {
        if (EIP_1559_COMPLIANT_CHAIN_IDS.has(network.chainID)) {
          const {maxFeePerGas = defaults.maxFeePerGas, maxPriorityFeePerGas = defaults.maxPriorityFeePerGas} = partialRequest;
          const populated = await this.populatePartialEIP1559TransactionRequest(network, {
            ...partialRequest,
            maxFeePerGas,
            maxPriorityFeePerGas
          });
          return populated;
        }
        const populated = await this.populatePartialLegacyEVMTransactionRequest(network, {
          ...partialRequest
        });
        return populated;
      }
      async populateEVMTransactionNonce(transactionRequest) {
        if (typeof transactionRequest.nonce !== "undefined") {
          return transactionRequest;
        }
        const {network, chainID} = transactionRequest;
        const normalizedAddress = normalizeQEVMAddress(transactionRequest.from);
        const provider = this.providerForNetworkOrThrow(network);
        const chainTransactionCount = await provider.getTransactionCount(transactionRequest.from, "latest");
        let knownNextNonce;
        if (CHAINS_WITH_MEMPOOL.has(chainID)) {
          const chainNonce = chainTransactionCount - 1;
          const existingNonce = this.evmChainLastSeenNoncesByNormalizedAddress[chainID]?.[normalizedAddress] ?? chainNonce;
          this.evmChainLastSeenNoncesByNormalizedAddress[chainID] ??= {};
          this.evmChainLastSeenNoncesByNormalizedAddress[chainID][normalizedAddress] = Math.max(existingNonce, chainNonce);
          this.evmChainLastSeenNoncesByNormalizedAddress[chainID][normalizedAddress] += 1;
          knownNextNonce = this.evmChainLastSeenNoncesByNormalizedAddress[chainID][normalizedAddress];
          lib_logger.debug("Got chain nonce", chainNonce, "existing nonce", existingNonce, "using", knownNextNonce);
        }
        return {
          ...transactionRequest,
          nonce: knownNextNonce ?? chainTransactionCount
        };
      }
      releaseEVMTransactionNonce(transactionRequest) {
        const chainID = "chainID" in transactionRequest ? transactionRequest.chainID : transactionRequest.network.chainID;
        if (CHAINS_WITH_MEMPOOL.has(chainID)) {
          const {nonce} = transactionRequest;
          const normalizedAddress = normalizeQEVMAddress(transactionRequest.from);
          if (!this.evmChainLastSeenNoncesByNormalizedAddress[chainID]?.[normalizedAddress]) {
            return;
          }
          const lastSeenNonce = this.evmChainLastSeenNoncesByNormalizedAddress[chainID][normalizedAddress];
          if (nonce === lastSeenNonce) {
            this.evmChainLastSeenNoncesByNormalizedAddress[chainID][normalizedAddress] -= 1;
          } else if (nonce < lastSeenNonce) {
            this.evmChainLastSeenNoncesByNormalizedAddress[chainID][normalizedAddress] = nonce - 1;
          }
        }
      }
      async getAccountsToTrack(onlyActiveAccounts = false) {
        const accounts = await this.db.getAccountsToTrack();
        if (onlyActiveAccounts) {
          return accounts.filter((({address, network}) => this.isCurrentlyActiveAddress(address) && this.isCurrentlyActiveChainID(network.chainID)));
        }
        return accounts;
      }
      async getTrackedAddressesOnNetwork(network) {
        return this.db.getTrackedAddressesOnNetwork(network);
      }
      async getNetworksToTrack() {
        const chainIDs = await this.db.getChainIDsToTrack();
        const networks = await Promise.all([ ...chainIDs ].map((async chainID => {
          const network = NETWORK_BY_CHAIN_ID[chainID];
          if (!network) {
            return this.db.getQEVMNetworkByChainID(chainID);
          }
          return network;
        })));
        return networks.filter((network => !!network));
      }
      async removeAccountToTrack(address) {
        await this.db.removeAccountToTrack(address);
      }
      async getLatestBaseAccountBalance({address, network}) {
        const balance = await this.providerForNetworkOrThrow(network).getBalance(address);
        const trackedAccounts = await this.getAccountsToTrack();
        const allTrackedAddresses = new Set(trackedAccounts.map((account => account.address)));
        const accountBalance = {
          address,
          network,
          assetAmount: {
            asset: await this.db.getBaseAssetForNetwork(network.chainID),
            amount: balance.toBigInt()
          },
          dataSource: "global",
          retrievedAt: Date.now()
        };
        if (allTrackedAddresses.has(address)) {
          this.emitter.emit("accountsWithBalances", {
            balances: [ accountBalance ],
            addressOnNetwork: {
              address,
              network
            }
          });
          await this.db.addBalance(accountBalance);
        }
        return accountBalance;
      }
      async addAccountToTrack(addressNetwork) {
        const isDefaultNetwork = DEFAULT_NETWORKS.some((n => n.chainID === addressNetwork.network.chainID));
        if (!isDefaultNetwork) {
          lib_logger.warn("Refusing to track account on unsupported network", addressNetwork);
          return;
        }
        const isAccountOnNetworkAlreadyTracked = await this.db.getTrackedAccountOnNetwork(addressNetwork);
        if (!isAccountOnNetworkAlreadyTracked) {
          await this.db.addAccountToTrack(addressNetwork);
          this.emitter.emit("newAccountToTrack", addressNetwork);
          await Promise.allSettled([ this.emitSavedTransactions(addressNetwork), this.subscribeToAccountTransactions(addressNetwork).catch((e => {
            lib_logger.error("chainService/addAccountToTrack: Error subscribing to account transactions for", {
              address: addressNetwork.address,
              chainID: addressNetwork.network.chainID
            }, e);
          })) ]);
        }
      }
      async getBlockHeight(network) {
        const cachedBlock = await this.db.getLatestBlock(network);
        if (cachedBlock) {
          return cachedBlock.blockHeight;
        }
        return this.providerForNetworkOrThrow(network).getBlockNumber();
      }
      async getBlockData(network, blockHash) {
        const cachedBlock = await this.db.getBlock(network, blockHash);
        if (cachedBlock) {
          return cachedBlock;
        }
        const resultBlock = await this.providerForNetworkOrThrow(network).getBlock(blockHash);
        const block = blockFromEthersBlock(network, resultBlock);
        await this.db.addBlock(block);
        this.emitter.emit("block", block);
        return block;
      }
      async getTransaction(network, txHash) {
        const cachedTx = await this.db.getTransaction(network, txHash);
        if (cachedTx) {
          return cachedTx;
        }
        const gethResult = await this.providerForNetworkOrThrow(network).getTransaction(txHash);
        const newTransaction = transactionFromEthersTransaction(gethResult, network);
        if (!newTransaction.blockHash && !newTransaction.blockHeight) {
          this.subscribeToTransactionConfirmation(network, newTransaction);
        }
        this.saveTransaction(newTransaction, "global");
        return newTransaction;
      }
      queueTransactionHashToRetrieve(network, txHash, firstSeen, priority = 0) {
        const newElement = {
          transaction: {
            hash: txHash,
            network,
            firstSeen
          },
          priority
        };
        const seen = this.isTransactionHashQueued(network, txHash);
        if (!seen) {
          const existingTransactionIndex = this.transactionsToRetrieve.findIndex((({priority: txPriority}) => newElement.priority > txPriority));
          if (existingTransactionIndex >= 0) {
            this.transactionsToRetrieve.splice(existingTransactionIndex, 0, newElement);
          } else {
            this.transactionsToRetrieve.push(newElement);
          }
        }
      }
      isTransactionHashQueued(txNetwork, txHash) {
        return this.transactionsToRetrieve.some((({transaction}) => transaction.hash === txHash && txNetwork.chainID === transaction.network.chainID));
      }
      removeTransactionHashFromQueue(network, txHash) {
        const seen = this.isTransactionHashQueued(network, txHash);
        if (seen) {
          this.transactionsToRetrieve = this.transactionsToRetrieve.filter((({transaction}) => transaction.hash !== txHash));
        }
      }
      async estimateGasLimit(network, transactionRequest) {
        const estimate = await this.providerForNetworkOrThrow(network).estimateGas(ethersTransactionFromTransactionRequest(transactionRequest));
        const uppedEstimate = estimate.add(estimate.div(10));
        return BigInt(uppedEstimate.toString());
      }
      async estimateGasPrice(network) {
        const estimate = await this.providerForNetworkOrThrow(network).getGasPrice();
        return estimate.toBigInt() * 11n / 10n;
      }
      async broadcastSignedTransaction(transaction) {
        try {
          const serialized = qethers_lib.utils.serializeTransaction(ethersTransactionFromSignedTransaction(transaction), transaction.signature || undefined);
          await Promise.all([ this.providerForNetworkOrThrow(transaction.network).sendTransaction(serialized).then((transactionResponse => {
            this.emitter.emit("transactionSend", transactionResponse.hash);
          })).catch((error => {
            lib_logger.debug("Broadcast error caught, saving failed status and releasing nonce...", transaction, error);
            this.saveTransaction({
              ...transaction,
              status: 0,
              error: error.toString()
            }, "global");
            return Promise.reject(error);
          })), this.subscribeToTransactionConfirmation(transaction.network, transaction), this.saveTransaction(transaction, "local") ]);
        } catch (error) {
          this.releaseEVMTransactionNonce(transaction);
          this.emitter.emit("transactionSendFailure");
          lib_logger.error("Error broadcasting transaction", transaction, error);
          throw error;
        }
      }
      async markAccountActivity({address, network}) {
        const isDefaultNetwork = DEFAULT_NETWORKS.some((n => n.chainID === network.chainID));
        if (!isDefaultNetwork) {
          lib_logger.warn(`Ignoring activity for unsupported network: ${network.name} (${network.chainID})`);
          return;
        }
        if (!(await this.getAccountsToTrack()).some((account => account.address === address && account.network === network))) {
          await this.addAccountToTrack({
            address,
            network
          });
        }
        const addressWasInactive = this.addressIsInactive(address);
        const networkWasInactive = this.networkIsInactive(network.chainID);
        this.markNetworkActivity(network.chainID);
        this.lastUserActivityOnAddress[address] = Date.now();
        if (addressWasInactive || networkWasInactive) {
          this.loadRecentAssetTransfers({
            address,
            network
          }).catch((error => {
            lib_logger.warn("Failed to load recent asset transfers:", error);
          }));
          this.getLatestBaseAccountBalance({
            address,
            network
          }).catch((error => {
            lib_logger.warn("Failed to get latest balance:", error);
          }));
        }
      }
      async markNetworkActivity(chainID) {
        const networkWasInactive = this.networkIsInactive(chainID);
        this.lastUserActivityOnNetwork[chainID] = Date.now();
        if (networkWasInactive) {
          this.pollBlockPricesForNetwork(chainID);
        }
      }
      addressIsInactive(address) {
        return Date.now() - NETWORK_POLLING_TIMEOUT > this.lastUserActivityOnAddress[address];
      }
      networkIsInactive(chainID) {
        return Date.now() - NETWORK_POLLING_TIMEOUT > this.lastUserActivityOnNetwork[chainID];
      }
      async pollBlockPrices() {
        for (let i = 1; i < GAS_POLLS_PER_PERIOD; i += 1) {
          setTimeout((async () => {
            await Promise.allSettled(this.subscribedNetworks.map((async ({network}) => this.pollBlockPricesForNetwork(network.chainID))));
          }), GAS_POLLING_PERIOD / GAS_POLLS_PER_PERIOD * (GAS_POLLING_PERIOD * MINUTE) * i);
        }
        await Promise.allSettled(this.subscribedNetworks.map((async ({network}) => this.pollBlockPricesForNetwork(network.chainID))));
      }
      async pollBlockPricesForNetwork(chainID) {
        if (!this.isCurrentlyActiveChainID(chainID)) {
          return;
        }
        const subscription = this.subscribedNetworks.find((({network}) => toHexChainID(network.chainID) === toHexChainID(chainID)));
        if (!subscription) {
          lib_logger.warn(`Can't fetch block prices for unsubscribed chainID ${chainID}`);
          return;
        }
        const blockPrices = await getBlockPrices(subscription.network, subscription.provider);
        this.emitter.emit("blockPrices", {
          blockPrices,
          network: subscription.network
        });
      }
      async pollLatestBlock(network, provider) {
        const ethersBlock = await provider.getBlock("latest");
        const block = blockFromProviderBlock(network, ethersBlock);
        await this.db.addBlock(block);
        this.emitter.emit("block", block);
      }
      async send(method, params, network) {
        return this.providerForNetworkOrThrow(network).send(method, params);
      }
      async getOrCancelTransaction(network, hash, firstSeen) {
        const provider = this.providerForNetworkOrThrow(network);
        const result = await provider.getTransaction(hash);
        if (!result) {
          const DROPPED_GRACE_PERIOD_MS = 2 * MINUTE;
          const ageMs = firstSeen !== undefined ? Date.now() - firstSeen : Infinity;
          if (ageMs < DROPPED_GRACE_PERIOD_MS) {
            lib_logger.debug(`Tx hash ${hash} not found on chain yet, but within grace period (${Math.round(ageMs / 1e3)}s old). Will retry.`);
            return null;
          }
          lib_logger.warn(`Tx hash ${hash} is found in our local registry but not on chain.`);
          this.removeTransactionHashFromQueue(network, hash);
          this.providerForNetwork(network)?.off(hash);
          const savedTx = await this.db.getTransaction(network, hash);
          if (savedTx && !("status" in savedTx)) {
            this.saveTransaction({
              ...savedTx,
              status: 0,
              error: "Transaction was in our local db but was not found on chain.",
              blockHash: null,
              blockHeight: null
            }, "global");
            await this.releaseEVMTransactionNonce(savedTx);
          }
        }
        return result;
      }
      async loadRecentAssetTransfers(addressNetwork) {
        const blockHeight = await this.getBlockHeight(addressNetwork.network) - BLOCKS_TO_SKIP_FOR_TRANSACTION_HISTORY;
        const fromBlock = blockHeight - BLOCKS_FOR_TRANSACTION_HISTORY;
        try {
          return await this.loadAssetTransfers(addressNetwork, BigInt(fromBlock), BigInt(blockHeight));
        } catch (err) {
          lib_logger.error("Failed loaded recent assets, retrying with shorter block range", addressNetwork, err);
        }
        return Promise.resolve();
      }
      async loadHistoricAssetTransfers(addressNetwork) {
        const oldest = await this.db.getOldestAccountAssetTransferLookup(addressNetwork) ?? BigInt(await this.getBlockHeight(addressNetwork.network));
        if (oldest !== 0n) {
          await this.loadAssetTransfers(addressNetwork, 0n, oldest);
        }
      }
      async loadAssetTransfers(addressOnNetwork, startBlock, endBlock) {
        if (this.supportedNetworks.every((network => network.chainID !== addressOnNetwork.network.chainID))) {
          lib_logger.error(`Asset transfer check not supported on network ${JSON.stringify(addressOnNetwork.network)}`);
        }
        const assetTransfers = await this.assetData.getAssetTransfers(addressOnNetwork);
        await this.db.recordAccountAssetTransferLookup(addressOnNetwork, startBlock, endBlock);
        this.emitter.emit("assetTransfers", {
          addressNetwork: addressOnNetwork,
          assetTransfers
        });
        const firstSeen = Date.now();
        const savedTransactionHashes = new Set(await this.db.getAllSavedTransactionHashes());
        assetTransfers.forEach(((a, idx) => {
          if (!savedTransactionHashes.has(a.txHash)) {
            this.queueTransactionHashToRetrieve(addressOnNetwork.network, a.txHash, firstSeen, idx <= TRANSACTIONS_WITH_PRIORITY_MAX_COUNT ? 0 : 1);
          }
        }));
      }
      async handleRecentIncomingAssetTransferAlarm(onlyActiveAccounts = false) {
        const accountsToTrack = await this.getAccountsToTrack(onlyActiveAccounts);
        await Promise.allSettled(accountsToTrack.map((async addressNetwork => this.loadRecentAssetTransfers(addressNetwork))));
      }
      isCurrentlyActiveChainID(chainID) {
        return Date.now() < this.lastUserActivityOnNetwork[chainID] + NETWORK_POLLING_TIMEOUT;
      }
      isCurrentlyActiveAddress(address) {
        return Date.now() < this.lastUserActivityOnAddress[address] + NETWORK_POLLING_TIMEOUT;
      }
      async handleRecentAssetTransferAlarm(onlyActiveAccounts = false) {
        const accountsToTrack = await this.getAccountsToTrack(onlyActiveAccounts);
        await Promise.allSettled(accountsToTrack.map((addressNetwork => this.loadRecentAssetTransfers(addressNetwork))));
      }
      async handleHistoricAssetTransferAlarm() {
        const accountsToTrack = await this.getAccountsToTrack();
        await Promise.allSettled(accountsToTrack.map((an => this.loadHistoricAssetTransfers(an))));
      }
      async handleQueuedTransactionAlarm() {
        if (!this.transactionToRetrieveGranularTimer && this.transactionsToRetrieve.length) {
          this.transactionToRetrieveGranularTimer = setInterval((() => {
            if (!this.transactionsToRetrieve.length && this.transactionToRetrieveGranularTimer) {
              this.transactionToRetrieveGranularTimer = undefined;
              return;
            }
            if (!this.transactionsToRetrieve.length) {
              return;
            }
            const {transaction} = this.transactionsToRetrieve[0];
            this.removeTransactionHashFromQueue(transaction.network, transaction.hash);
            this.retrieveTransaction(transaction);
          }), 2 * SECOND);
        }
      }
      async retrieveTransaction({network, hash, firstSeen}) {
        try {
          const result = await this.getOrCancelTransaction(network, hash, firstSeen);
          if (!result) {
            return;
          }
          const transaction = transactionFromEthersTransaction(result, network);
          await this.saveTransaction(transaction, "global");
          if (!("status" in transaction) && !transaction.blockHash && !transaction.blockHeight) {
            this.subscribeToTransactionConfirmation(transaction.network, transaction);
          } else if (transaction.blockHash) {
            await this.getBlockData(transaction.network, transaction.blockHash);
            this.retrieveTransactionReceipt(transaction.network, transaction);
          }
        } catch (error) {
          lib_logger.error(`Error retrieving transaction ${hash}`, error);
          if (Date.now() <= firstSeen + TRANSACTION_CHECK_LIFETIME_MS) {
            this.queueTransactionHashToRetrieve(network, hash, firstSeen);
          } else {
            lib_logger.warn(`Transaction ${hash} is too old to keep looking for it; treating ` + "it as expired.");
            this.db.getTransaction(network, hash).then((existingTransaction => {
              if (existingTransaction !== null) {
                lib_logger.debug("Found existing transaction for expired lookup; marking as " + "failed if no other status exists.");
                this.saveTransaction({
                  status: 0,
                  ...existingTransaction
                }, "local");
              }
            }));
          }
        }
      }
      async saveTransaction(transaction, dataSource) {
        const existing = await this.db.getTransaction(transaction.network, transaction.hash);
        const finalTransaction = {
          ...existing,
          ...transaction
        };
        let error = null;
        try {
          await this.db.addOrUpdateTransaction({
            ...existing,
            ...finalTransaction
          }, dataSource);
        } catch (err) {
          error = err;
          lib_logger.error(`Error saving tx ${finalTransaction}`, error);
        }
        try {
          const accounts = await this.getAccountsToTrack();
          const forAccounts = accounts.filter((({address}) => sameQEVMAddress(finalTransaction.from, address) || sameQEVMAddress(finalTransaction.to, address))).map((({address}) => normalizeQEVMAddress(address)));
          this.emitter.emit("transaction", {
            transaction: finalTransaction,
            forAccounts
          });
        } catch (err) {
          error = err;
          lib_logger.error(`Error emitting tx ${finalTransaction}`, error);
        }
        if (error) {
          throw error;
        }
      }
      async emitSavedTransactions(account) {
        const {address, network} = account;
        const transactionsForNetwork = await this.db.getTransactionsForNetwork(network);
        const transactions = transactionsForNetwork.filter((transaction => sameQEVMAddress(transaction.from, address) || sameQEVMAddress(transaction.to, address)));
        this.emitter.emit("initializeActivitiesForAccount", {
          transactions,
          account
        });
      }
      async filterTrackedAddressesOnNetworks(addressesOnNetworks) {
        const accounts = await this.getAccountsToTrack();
        return addressesOnNetworks.filter((({address, network}) => accounts.some((({address: trackedAddress, network: trackedNetwork}) => sameQEVMAddress(trackedAddress, address) && network.name === trackedNetwork.name))));
      }
      async fetchLatestBlockForNetwork(network) {
        const provider = this.providerForNetwork(network);
        if (provider) {
          try {
            const blockNumber = provider.getBlockNumber();
            const result = await provider.getBlock(blockNumber);
            const block = blockFromEthersBlock(network, result);
            await this.db.addBlock(block);
          } catch (e) {
            lib_logger.error("Error getting block number", e);
          }
        }
      }
      async subscribeToNewHeads(network) {
        const provider = this.providerForNetworkOrThrow(network);
        this.subscribedNetworks.push({
          network,
          provider
        });
        this.pollLatestBlock(network, provider);
        this.pollBlockPrices();
      }
      async subscribeToAccountTransactions({address, network}) {
        const provider = this.providerForNetworkOrThrow(network);
        this.subscribedAccounts.push({
          account: address,
          provider
        });
      }
      async handlePendingTransaction(transaction) {
        try {
          const {network} = transaction;
          const normalizedFromAddress = normalizeQEVMAddress(transaction.from);
          if (typeof network.chainID !== "undefined" && typeof this.evmChainLastSeenNoncesByNormalizedAddress[network.chainID]?.[normalizedFromAddress] !== "undefined" && this.evmChainLastSeenNoncesByNormalizedAddress[network.chainID]?.[normalizedFromAddress] <= transaction.nonce) {
            this.evmChainLastSeenNoncesByNormalizedAddress[network.chainID][normalizedFromAddress] = transaction.nonce;
          }
          await this.saveTransaction(transaction, "global");
          this.subscribeToTransactionConfirmation(network, transaction);
        } catch (error) {
          lib_logger.error(`Error saving tx: ${transaction}`, error);
        }
      }
      async subscribeToTransactionConfirmation(network, transaction) {
        const provider = this.providerForNetworkOrThrow(network);
        provider.once(transaction.hash, (confirmedReceipt => {
          this.saveTransaction(enrichTransactionWithReceipt(transaction, confirmedReceipt), "global");
          this.removeTransactionHashFromQueue(network, transaction.hash);
        }));
        this.queueTransactionHashToRetrieve(network, transaction.hash, Date.now());
      }
      async retrieveTransactionReceipt(network, transaction) {
        const provider = this.providerForNetworkOrThrow(network);
        const receipt = await provider.getTransactionReceipt(transaction.hash);
        if (receipt) {
          await this.saveTransaction(enrichTransactionWithReceipt(transaction, receipt), "global");
        }
      }
      async getNetworkBaseAssets() {
        return this.db.getAllBaseAssets();
      }
      async addCustomChain(chainInfo) {
        const network = await this.db.addQEVMNetwork({
          chainName: chainInfo.chainName,
          chainID: chainInfo.chainId,
          decimals: chainInfo.nativeCurrency.decimals,
          symbol: chainInfo.nativeCurrency.symbol,
          assetName: chainInfo.nativeCurrency.name,
          rpcUrls: chainInfo.rpcUrls,
          blockExplorerURL: chainInfo.blockExplorerUrl
        });
        await this.updateSupportedNetworks();
        this.providers.evm[chainInfo.chainId] = makeSerialFallbackProvider(chainInfo.chainId, chainInfo.rpcUrls);
        await this.startTrackingNetworkOrThrow(chainInfo.chainId);
        this.emitter.emit("customChainAdded", chainInfo);
        return network;
      }
      async removeCustomChain(chainID) {
        this.trackedNetworks = this.trackedNetworks.filter((network => network.chainID !== chainID));
        await this.db.removeQEVMNetwork(chainID);
        await this.updateSupportedNetworks();
      }
      async updateSupportedNetworks() {
        const supportedNetworks = await this.db.getAllQEVMNetworks();
        this.supportedNetworks = supportedNetworks;
        this.emitter.emit("supportedNetworks", supportedNetworks);
      }
      async queryAccountTokenDetails(contractAddress, addressOnNetwork, existingAsset) {
        const {network} = addressOnNetwork;
        const balance = await this.assetData.getTokenBalance(addressOnNetwork, contractAddress);
        if (existingAsset) {
          return {
            asset: existingAsset,
            amount: balance.amount
          };
        }
        const asset = await this.assetData.getTokenMetadata({
          contractAddress,
          homeNetwork: network
        }).catch((() => undefined));
        if (!asset) {
          throw lib_logger.buildError("Unable to retrieve metadata for custom asset", contractAddress, "on chain:", network.chainID);
        }
        return {
          asset,
          amount: balance.amount
        };
      }
    }
    var dayjs_min = __webpack_require__(4353);
    var dayjs_min_default = __webpack_require__.n(dayjs_min);
    function isEIP2612TypedData(typedData) {
      if (typeof typedData.message.spender === "string") {
        if (typedData.domain.chainId === Number(ZEUS.chainID) && typedData.primaryType === "Permit" && [ "owner", "spender", "value", "nonce", "deadline" ].every((key => key in typedData.message))) {
          return true;
        }
      }
      return false;
    }
    async function enrichEIP2612SignTypedDataRequest(typedData, nameService, asset) {
      const {message, domain} = typedData;
      const {value, owner, spender, nonce} = message;
      const formattedValue = asset ? `${Number(value) / 10 ** (asset?.decimals ?? 0)} ${asset.symbol}` : `${value}`;
      const token = formattedValue === `${value}` ? domain.name : null;
      const [sourceName, ownerName, spenderName] = (await Promise.all([ await nameService.lookUpName({
        address: spender,
        network: ZEUS
      }), await nameService.lookUpName({
        address: owner,
        network: ZEUS
      }, false), await nameService.lookUpName({
        address: spender,
        network: ZEUS
      }, false) ])).map((nameOnNetwork => nameOnNetwork?.resolved?.nameOnNetwork.name));
      return {
        type: "EIP-2612",
        source: sourceName ?? spender,
        displayFields: {
          owner: ownerName ?? owner,
          spender: spenderName ?? spender,
          tokenContract: domain.verifyingContract || "unknown",
          value: formattedValue,
          ...token ? {
            token
          } : {},
          nonce,
          expiry: dayjs_min_default().unix(Number(message.deadline)).format("DD MMM YYYY")
        }
      };
    }
    function getDistinctRecipentAddressesFromERC20Logs(logs) {
      return [ ...new Set([ ...logs.map((({recipientAddress}) => recipientAddress)) ]) ];
    }
    const getERC20LogsForAddresses = (logs, addresses) => {
      const relevantAddresses = new Set(addresses);
      return logs.filter((log => relevantAddresses.has(normalizeQEVMAddress(log.recipientAddress)) || relevantAddresses.has(normalizeQEVMAddress(log.senderAddress))));
    };
    function getRecipient(transaction) {
      const {annotation} = transaction;
      switch (annotation?.type) {
       case "asset-transfer":
        return {
          address: annotation.recipient?.address,
          name: annotation.recipient?.annotation.nameRecord?.resolved.nameOnNetwork.name
        };

       case "contract-interaction":
        return {
          address: transaction.to,
          name: annotation.contractInfo?.annotation.nameRecord?.resolved.nameOnNetwork.name
        };

       case "asset-approval":
        return {
          address: annotation.spender.address,
          name: annotation.spender.annotation?.nameRecord?.resolved.nameOnNetwork.name
        };

       default:
        return {
          address: transaction.to
        };
      }
    }
    function getSender(transaction) {
      const {annotation} = transaction;
      switch (annotation?.type) {
       case "asset-transfer":
        return {
          address: annotation.sender.address,
          name: annotation.sender?.annotation.nameRecord?.resolved.nameOnNetwork.name
        };

       default:
        return {
          address: transaction.from
        };
      }
    }
    function getRelevantTransactionAddresses(transaction, trackedAccounts) {
      const {address: recipientAddress} = getRecipient(transaction);
      const {address: senderAddress} = getSender(transaction);
      return trackedAccounts.filter((({address}) => sameQEVMAddress(recipientAddress, address) || sameQEVMAddress(senderAddress, address))).map((({address}) => normalizeQEVMAddress(address)));
    }
    var fixed_point_logger;
    function convertFixedPoint(fixedPoint, fixedPointDecimals, targetDecimals) {
      if (fixedPointDecimals >= targetDecimals) {
        return fixedPoint / 10n ** BigInt(fixedPointDecimals - targetDecimals);
      }
      return fixedPoint * 10n ** BigInt(targetDecimals - fixedPointDecimals);
    }
    function convertFixedPointNumber({amount, decimals}, targetDecimals) {
      return {
        amount: convertFixedPoint(amount, decimals, targetDecimals),
        decimals: targetDecimals
      };
    }
    function multiplyFixedPointNumbers({amount: amount1, decimals: decimals1}, {amount: amount2, decimals: decimals2}, desiredResultDecimals) {
      const baseResult = {
        amount: amount1 * amount2,
        decimals: decimals1 + decimals2
      };
      if (typeof desiredResultDecimals === "undefined") {
        return baseResult;
      }
      return convertFixedPointNumber(baseResult, desiredResultDecimals);
    }
    function multiplyByFloat(fixedPointNumber, floatingPoint) {
      const floatingDecimals = (floatingPoint.toString().split(".")[1] ?? "").length;
      return convertFixedPointNumber(multiplyFixedPointNumbers(fixedPointNumber, {
        amount: BigInt(Math.floor(floatingPoint * 10 ** floatingDecimals)),
        decimals: floatingDecimals
      }), fixedPointNumber.decimals).amount;
    }
    function toFixedPoint(floatingPoint, fixedPointDecimals) {
      return multiplyByFloat({
        amount: 10n ** BigInt(fixedPointDecimals),
        decimals: fixedPointDecimals
      }, floatingPoint);
    }
    function toFixedPointNumber(floatingPoint, fixedPointDecimals) {
      return {
        amount: toFixedPoint(floatingPoint, fixedPointDecimals),
        decimals: fixedPointDecimals
      };
    }
    function parseToFixedPointNumber(floatingPointString) {
      if (!floatingPointString.match(/^[^0-9]*([0-9,]+)(?:\.([0-9]*))?$/)) {
        return undefined;
      }
      const [whole, decimals, ...extra] = floatingPointString.split(".");
      if (extra.length > 0) {
        return undefined;
      }
      const noThousandsSeparatorWhole = whole.replace(",", "");
      const setDecimals = decimals ?? "";
      try {
        return {
          amount: BigInt([ noThousandsSeparatorWhole, setDecimals ].join("")),
          decimals: setDecimals.length
        };
      } catch (error) {
        fixed_point_logger.debug(`Error parsing ${floatingPointString} to fixed-point number:`, error);
        return undefined;
      }
    }
    function fixedPointNumberToString({amount, decimals}, trimTrailingZeros = true) {
      const undecimaledAmount = amount.toString();
      const preDecimalLength = undecimaledAmount.length - decimals;
      const preDecimalCharacters = preDecimalLength > 0 ? undecimaledAmount.substring(0, preDecimalLength) : "0";
      const postDecimalCharacters = "0".repeat(Math.max(-preDecimalLength, 0)) + undecimaledAmount.substring(preDecimalLength);
      const trimmedPostDecimalCharacters = trimTrailingZeros ? postDecimalCharacters.replace(/0*$/, "") : postDecimalCharacters;
      const decimalString = trimmedPostDecimalCharacters.length > 0 ? `.${trimmedPostDecimalCharacters}` : "";
      return `${preDecimalCharacters}${decimalString}`;
    }
    function fromFixedPoint(fixedPoint, fixedPointDecimals, desiredDecimals) {
      const fixedPointDesiredDecimalsAmount = fixedPoint / 10n ** BigInt(Math.max(1, fixedPointDecimals - desiredDecimals));
      return Number(fixedPointDesiredDecimalsAmount) / 10 ** Math.min(desiredDecimals, fixedPointDecimals);
    }
    function fromFixedPointNumber({amount, decimals}, desiredDecimals) {
      return fromFixedPoint(amount, decimals, desiredDecimals);
    }
    function isFungibleAsset(asset) {
      return "decimals" in asset;
    }
    function isSmartContractFungibleAsset(asset) {
      return "homeNetwork" in asset && isFungibleAsset(asset);
    }
    function isFungibleAssetAmount(assetAmount) {
      return isFungibleAsset(assetAmount.asset);
    }
    function flipPricePoint(pricePoint) {
      const {pair, amounts, time} = pricePoint;
      return {
        pair: [ pair[1], pair[0] ],
        amounts: [ amounts[1], amounts[0] ],
        time
      };
    }
    function convertAssetAmountViaPricePoint(sourceAssetAmount, assetPricePoint) {
      if (typeof assetPricePoint === "undefined") {
        return undefined;
      }
      const [sourceAsset, targetAsset] = assetPricePoint.pair;
      const [sourceConversionFactor, targetConversionFactor] = assetPricePoint.amounts;
      if (sourceAssetAmount.asset.symbol === sourceAsset.symbol && isFungibleAsset(sourceAsset) && isFungibleAsset(targetAsset)) {
        const targetCurrencyAmount = sourceAssetAmount.amount * targetConversionFactor / sourceConversionFactor;
        return {
          asset: targetAsset,
          amount: targetCurrencyAmount
        };
      }
      if (sourceAssetAmount.asset.symbol === sourceAsset.symbol && isFungibleAsset(targetAsset) && sourceConversionFactor === 1n) {
        return {
          asset: targetAsset,
          amount: sourceAssetAmount.amount * targetConversionFactor
        };
      }
      return undefined;
    }
    function unitPricePointForPricePoint(assetPricePoint) {
      if (typeof assetPricePoint === "undefined") {
        return undefined;
      }
      const sourceAsset = assetPricePoint.pair[0];
      const unitPrice = convertAssetAmountViaPricePoint({
        amount: "decimals" in sourceAsset ? 1n * 10n ** BigInt(sourceAsset.decimals) : 1n,
        asset: sourceAsset
      }, assetPricePoint);
      if (typeof unitPrice !== "undefined") {
        return {
          unitPrice,
          time: assetPricePoint.time
        };
      }
      return undefined;
    }
    function assetAmountToDesiredDecimals(assetAmount, desiredDecimals) {
      const {amount, asset: {decimals}} = assetAmount;
      return fromFixedPoint(amount, decimals, desiredDecimals);
    }
    const hardcodedMainCurrencySymbol = "USD";
    const hardcodedMainCurrencySign = "$";
    var asset_utils_BUILT_IN_NETWORK_BASE_ASSETS;
    function isNetworkBaseAsset(asset) {
      return "chainID" in asset;
    }
    function isBaseAssetForNetwork(asset, network) {
      return isNetworkBaseAsset(asset) && asset.symbol === network.baseAsset.symbol && asset.chainID === network.baseAsset.chainID && asset.name === network.baseAsset.name;
    }
    function getBuiltInNetworkBaseAsset(symbol, chainID) {
      return asset_utils_BUILT_IN_NETWORK_BASE_ASSETS.find((asset => asset.symbol === symbol && asset.chainID === chainID));
    }
    function sameNetworkBaseAsset(asset1, asset2) {
      if ("homeNetwork" in asset1 || "homeNetwork" in asset2 || !isNetworkBaseAsset(asset1) || !isNetworkBaseAsset(asset2)) {
        return false;
      }
      return asset1.symbol === asset2.symbol && asset1.chainID === asset2.chainID && asset1.name === asset2.name;
    }
    function sameBuiltInNetworkBaseAsset(asset1, asset2) {
      return asset_utils_BUILT_IN_NETWORK_BASE_ASSETS.some((baseAsset => sameNetworkBaseAsset(baseAsset, asset1) && sameNetworkBaseAsset(baseAsset, asset2)));
    }
    function formatCurrencyAmount(currencySymbol, currencyAmount, desiredDecimals) {
      return new Intl.NumberFormat("default", {
        style: "currency",
        currency: currencySymbol,
        minimumFractionDigits: desiredDecimals,
        maximumFractionDigits: desiredDecimals
      }).format(currencyAmount).split(hardcodedMainCurrencySign)[1];
    }
    function enrichAssetAmountWithMainCurrencyValues(assetAmount, assetPricePoint, desiredDecimals) {
      const convertedAssetAmount = convertAssetAmountViaPricePoint(assetAmount, assetPricePoint);
      const {unitPrice} = unitPricePointForPricePoint(assetPricePoint) ?? {
        unitPrice: undefined
      };
      if (typeof convertedAssetAmount !== "undefined") {
        const convertedDecimalValue = assetAmountToDesiredDecimals(convertedAssetAmount, desiredDecimals);
        const unitPriceDecimalValue = typeof unitPrice === "undefined" ? undefined : assetAmountToDesiredDecimals(unitPrice, desiredDecimals);
        return {
          ...assetAmount,
          mainCurrencyAmount: convertedDecimalValue,
          localizedMainCurrencyAmount: formatCurrencyAmount(convertedAssetAmount.asset.symbol, convertedDecimalValue, desiredDecimals),
          unitPrice: unitPriceDecimalValue,
          localizedUnitPrice: typeof unitPriceDecimalValue === "undefined" ? undefined : formatCurrencyAmount(convertedAssetAmount.asset.symbol, unitPriceDecimalValue, desiredDecimals)
        };
      }
      return {
        ...assetAmount
      };
    }
    function enrichAssetAmountWithDecimalValues(assetAmount, desiredDecimals) {
      const decimalAmount = isFungibleAssetAmount(assetAmount) ? assetAmountToDesiredDecimals(assetAmount, desiredDecimals) : assetAmountToDesiredDecimals({
        ...assetAmount,
        asset: {
          ...assetAmount.asset,
          decimals: 0
        }
      }, desiredDecimals);
      return {
        ...assetAmount,
        decimalAmount,
        localizedDecimalAmount: decimalAmount.toLocaleString("default", {
          maximumFractionDigits: desiredDecimals
        })
      };
    }
    function heuristicDesiredDecimalsForUnitPrice(minimumDesiredDecimals, unitPrice) {
      const numericUnitPrice = typeof unitPrice === "undefined" || typeof unitPrice === "number" ? unitPrice : fromFixedPointNumber({
        amount: unitPrice.unitPrice.amount,
        decimals: unitPrice.unitPrice.asset.decimals
      }, 10);
      return Math.max(Math.ceil(Math.log10(numericUnitPrice ?? 0)), minimumDesiredDecimals);
    }
    function isTokenListAsset(asset) {
      const tokenListCount = asset.metadata?.tokenLists?.length ?? 0;
      return tokenListCount > 0;
    }
    function isBaselineTrustedAsset(asset) {
      return isTokenListAsset(asset) || isNetworkBaseAsset(asset);
    }
    function isVerifiedAsset(asset) {
      return asset.metadata?.verified !== undefined && asset.metadata.verified;
    }
    function isUnverifiedAsset(asset) {
      return !isVerifiedAsset(asset);
    }
    function isTrustedAsset(asset) {
      return isBaselineTrustedAsset(asset) || isVerifiedAsset(asset);
    }
    function isUntrustedAsset(asset) {
      return !isTrustedAsset(asset);
    }
    const getFullAssetID = asset => {
      if (isNetworkBaseAsset(asset)) {
        return `${asset.chainID}/base`;
      }
      return `${asset.homeNetwork.chainID}/${asset.contractAddress}`;
    };
    function isSameAsset(asset1, asset2) {
      if (typeof asset1 === "undefined" || typeof asset2 === "undefined") {
        return false;
      }
      if (isSmartContractFungibleAsset(asset1) && isSmartContractFungibleAsset(asset2)) {
        return sameNetwork(asset1.homeNetwork, asset2.homeNetwork) && sameQEVMAddress(asset1.contractAddress, asset2.contractAddress);
      }
      if (isSmartContractFungibleAsset(asset1) || isSmartContractFungibleAsset(asset2)) {
        return false;
      }
      if (isNetworkBaseAsset(asset1) && isNetworkBaseAsset(asset2)) {
        return sameNetworkBaseAsset(asset1, asset2);
      }
      return asset1.symbol === asset2.symbol;
    }
    async function resolveAddressAnnotation(chainService, nameService, addressOnNetwork) {
      const {address, network} = addressOnNetwork;
      const provider = chainService.providerForNetworkOrThrow(network);
      const [codeHex, balance, nameRecord] = await Promise.all([ provider.getCode(address), chainService.getLatestBaseAccountBalance(addressOnNetwork), nameService.lookUpName(addressOnNetwork) ]);
      return {
        balance,
        nameRecord,
        hasCode: codeHex !== "0x",
        timestamp: Date.now()
      };
    }
    async function enrichAddressOnNetwork(chainService, nameService, addressOnNetwork) {
      return {
        ...addressOnNetwork,
        annotation: await resolveAddressAnnotation(chainService, nameService, addressOnNetwork)
      };
    }
    const WRAPPED_ASSET_FUNCTIONS = {
      ...QERC20_FUNCTIONS,
      deposit: lib_utils.FunctionFragment.from("deposit() public payable"),
      withdraw: lib_utils.FunctionFragment.from("withdraw(uint amount) public")
    };
    const WRAPPED_ASSET_EVENTS = {
      Deposit: lib_utils.EventFragment.from("Deposit(address indexed dst, uint amount)"),
      Withdrawal: lib_utils.EventFragment.from("Withdrawal(address indexed src, uint amount)")
    };
    const WRAPPED_ASSET_ABI = Object.values(WRAPPED_ASSET_FUNCTIONS).concat(Object.values(WRAPPED_ASSET_EVENTS));
    const WRAPPED_ASSET_INTERFACE = new qethers_lib.qethers.utils.Interface(WRAPPED_ASSET_ABI);
    function parseLogsForWrappedDepositsAndWithdrawals(logs) {
      return logs.map((({contractAddress, data, topics}) => {
        try {
          const decodedDeposit = WRAPPED_ASSET_INTERFACE.decodeEventLog(WRAPPED_ASSET_EVENTS.Deposit, data, topics);
          if (typeof decodedDeposit.amount !== "undefined" && typeof decodedDeposit.dst !== "undefined") {
            return {
              contractAddress,
              amount: decodedDeposit.amount.toBigInt(),
              recipientAddress: decodedDeposit.dst,
              senderAddress: contractAddress
            };
          }
        } catch (e) {}
        try {
          const decodedWithdrawal = WRAPPED_ASSET_INTERFACE.decodeEventLog(WRAPPED_ASSET_EVENTS.Withdrawal, data, topics);
          if (typeof decodedWithdrawal.amount !== "undefined" && typeof decodedWithdrawal.src !== "undefined") {
            return {
              contractAddress,
              amount: decodedWithdrawal.amount.toBigInt(),
              recipientAddress: contractAddress,
              senderAddress: decodedWithdrawal.src
            };
          }
        } catch (_) {
          return undefined;
        }
        return undefined;
      })).filter((info => typeof info !== "undefined"));
    }
    function isFulfilledPromise(settledResult) {
      return settledResult.status === "fulfilled";
    }
    function isDefined(input) {
      return input !== undefined;
    }
    function assertUnreachable(x) {
      throw new Error(`Didn't expect to get here with value: ${x}`);
    }
    async function buildSubannotations(chainService, nameService, relevantTransferLogs, assets, addressEnrichmentsByAddress, network, desiredDecimals, resolvedTime, block) {
      const subannotations = (await Promise.allSettled(relevantTransferLogs.map((async ({contractAddress, amount, senderAddress, recipientAddress}) => {
        const matchingFungibleAsset = assets.find((asset => isSmartContractFungibleAsset(asset) && sameQEVMAddress(asset.contractAddress, contractAddress)));
        if (!matchingFungibleAsset) {
          return undefined;
        }
        const recipient = addressEnrichmentsByAddress[normalizeQEVMAddress(recipientAddress)] ?? await enrichAddressOnNetwork(chainService, nameService, {
          address: recipientAddress,
          network
        });
        const sender = addressEnrichmentsByAddress[normalizeQEVMAddress(senderAddress)] ?? await enrichAddressOnNetwork(chainService, nameService, {
          address: senderAddress,
          network
        });
        return {
          type: "asset-transfer",
          assetAmount: enrichAssetAmountWithDecimalValues({
            asset: matchingFungibleAsset,
            amount
          }, desiredDecimals),
          sender,
          recipient,
          timestamp: resolvedTime,
          blockTimestamp: block?.timestamp
        };
      })))).filter(isFulfilledPromise).map((({value}) => value)).filter(isDefined);
      return subannotations;
    }
    async function annotationsFromLogs(chainService, indexingService, nameService, logs, network, desiredDecimals, resolvedTime, block) {
      const assets = indexingService.getCachedAssets(network);
      const accountAddresses = (await chainService.getAccountsToTrack()).map((account => account.address));
      const tokenTransferLogs = [ ...parseLogsForQERC20Transfers(logs), ...parseLogsForWrappedDepositsAndWithdrawals(logs) ];
      const relevantTransferLogs = getERC20LogsForAddresses(tokenTransferLogs, accountAddresses);
      const relevantAddresses = getDistinctRecipentAddressesFromERC20Logs(relevantTransferLogs).map(normalizeQEVMAddress);
      const addressEnrichmentsByAddress = Object.fromEntries((await Promise.allSettled(relevantAddresses.map((async address => [ address, await enrichAddressOnNetwork(chainService, nameService, {
        address,
        network
      }) ])))).filter(isFulfilledPromise).map((({value}) => value)).filter((([, annotation]) => isDefined(annotation))));
      const subannotations = await buildSubannotations(chainService, nameService, relevantTransferLogs, assets, addressEnrichmentsByAddress, network, desiredDecimals, resolvedTime, block);
      return subannotations;
    }
    async function resolveTransactionAnnotation(chainService, indexingService, nameService, network, transaction, desiredDecimals) {
      const assets = await indexingService.getCachedAssets(network);
      let txAnnotation = "annotation" in transaction && transaction.annotation !== undefined ? transaction.annotation : {
        blockTimestamp: undefined,
        timestamp: Date.now(),
        type: "contract-deployment",
        transactionLogoURL: assets.find((asset => asset.metadata?.logoURL && asset.symbol === transaction.network.baseAsset.symbol))?.metadata?.logoURL
      };
      let block;
      const {assetAmount: {amount: baseAssetBalance}} = await chainService.getLatestBaseAccountBalance({
        address: transaction.from,
        network
      });
      const {gasLimit, blockHash} = transaction;
      const additionalL1Gas = 0n;
      const gasFee = isEIP1559TransactionRequest(transaction) ? (transaction?.maxFeePerGas ?? 0n) * (gasLimit ?? 0n) + additionalL1Gas : ("gasPrice" in transaction && transaction?.gasPrice || 0n) * (gasLimit ?? 0n) + additionalL1Gas;
      txAnnotation.warnings ??= [];
      if (gasFee + (transaction.value ?? 0n) > baseAssetBalance) {
        if (!txAnnotation.warnings.includes("insufficient-funds")) {
          txAnnotation.warnings.push("insufficient-funds");
        }
      } else {
        txAnnotation.warnings = txAnnotation.warnings.filter((warning => warning !== "insufficient-funds"));
      }
      if (blockHash) {
        block = await chainService.getBlockData(network, blockHash);
        txAnnotation = {
          ...txAnnotation,
          blockTimestamp: block?.timestamp
        };
      }
      if (typeof transaction.to !== "undefined") {
        const contractInfo = await enrichAddressOnNetwork(chainService, nameService, {
          address: transaction.to,
          network
        });
        txAnnotation = txAnnotation.type === "contract-deployment" ? {
          ...txAnnotation,
          type: "contract-interaction",
          contractInfo: await enrichAddressOnNetwork(chainService, nameService, {
            address: transaction.to,
            network
          })
        } : txAnnotation;
        if (txAnnotation.type === "asset-swap") {
          txAnnotation = {
            ...txAnnotation,
            swapContractInfo: contractInfo
          };
        }
        if (transaction.input === null || transaction.input === "0x" || typeof transaction.input === "undefined") {
          const recipient = contractInfo;
          const sender = await enrichAddressOnNetwork(chainService, nameService, {
            address: transaction.from,
            network
          });
          if (typeof transaction.value !== "undefined") {
            if (recipient.annotation.hasCode && !(recipient.annotation.nameRecord?.system === "qwal-known-contracts" || recipient.annotation.nameRecord?.system === "qwal-address-book")) {
              txAnnotation.warnings ??= [];
              txAnnotation.warnings.push("send-to-contract");
            }
            txAnnotation = {
              ...txAnnotation,
              type: "asset-transfer",
              sender,
              recipient,
              assetAmount: enrichAssetAmountWithDecimalValues({
                asset: network.baseAsset,
                amount: transaction.value
              }, desiredDecimals)
            };
          }
        } else {
          const erc20Tx = parseQERC20Tx(transaction.input);
          const matchingFungibleAsset = assets.find((asset => isSmartContractFungibleAsset(asset) && sameQEVMAddress(asset.contractAddress, transaction.to)));
          const transactionLogoURL = matchingFungibleAsset?.metadata?.logoURL;
          if (matchingFungibleAsset && erc20Tx && (erc20Tx.name === "transfer" || erc20Tx.name === "transferFrom")) {
            const [sender, recipient] = await Promise.all([ enrichAddressOnNetwork(chainService, nameService, {
              address: erc20Tx.args.from ?? transaction.from,
              network
            }), enrichAddressOnNetwork(chainService, nameService, {
              address: erc20Tx.args.to,
              network
            }) ]);
            txAnnotation = {
              ...txAnnotation,
              type: "asset-transfer",
              transactionLogoURL,
              sender,
              recipient,
              assetAmount: enrichAssetAmountWithDecimalValues({
                asset: matchingFungibleAsset,
                amount: BigInt(erc20Tx.args.amount)
              }, desiredDecimals)
            };
            if (sameQEVMAddress(erc20Tx.args.to, transaction.to)) {
              txAnnotation.warnings ??= [];
              txAnnotation.warnings.push("send-to-token");
            }
            if (recipient.annotation.hasCode && !(recipient.annotation.nameRecord?.system === "qwal-known-contracts" || recipient.annotation.nameRecord?.system === "qwal-address-book")) {
              txAnnotation.warnings ??= [];
              txAnnotation.warnings.push("send-to-contract");
            }
          } else if (matchingFungibleAsset && erc20Tx && erc20Tx.name === "approve") {
            const spender = await enrichAddressOnNetwork(chainService, nameService, {
              address: erc20Tx.args.spender,
              network
            });
            if (!spender.annotation.hasCode) {
              txAnnotation.warnings ??= [];
              txAnnotation.warnings.push("approve-eoa");
            }
            txAnnotation = {
              ...txAnnotation,
              type: "asset-approval",
              transactionLogoURL,
              spender,
              assetAmount: enrichAssetAmountWithDecimalValues({
                asset: matchingFungibleAsset,
                amount: BigInt(erc20Tx.args.value)
              }, desiredDecimals)
            };
          }
        }
      }
      if ("logs" in transaction && typeof transaction.logs !== "undefined") {
        const subannotations = await annotationsFromLogs(chainService, indexingService, nameService, transaction.logs, network, desiredDecimals, txAnnotation.timestamp, block);
        if (subannotations.length > 0) {
          txAnnotation.subannotations = subannotations;
        }
      }
      return txAnnotation;
    }
    class EnrichmentService extends BaseService {
      static create=async (chainService, indexingService, nameService) => new this(await chainService, await indexingService, await nameService);
      constructor(chainService, indexingService, nameService) {
        super({});
        this.chainService = chainService;
        this.indexingService = indexingService;
        this.nameService = nameService;
      }
      async internalStartService() {
        await super.internalStartService();
        await this.connectChainServiceEvents();
      }
      async connectChainServiceEvents() {
        this.chainService.emitter.on("transaction", (async ({transaction}) => {
          const accounts = await this.chainService.getAccountsToTrack();
          const enrichedTransaction = await this.enrichTransaction(transaction, 2);
          this.emitter.emit("enrichedEVMTransaction", {
            transaction: enrichedTransaction,
            forAccounts: getRelevantTransactionAddresses(enrichedTransaction, accounts)
          });
        }));
      }
      async enrichTransactionSignature(network, transaction, desiredDecimals) {
        const enrichedTxSignatureRequest = {
          ...transaction,
          network,
          annotation: await resolveTransactionAnnotation(this.chainService, this.indexingService, this.nameService, network, transaction, desiredDecimals)
        };
        this.emitter.emit("enrichedEVMTransactionSignatureRequest", enrichedTxSignatureRequest);
        return enrichedTxSignatureRequest;
      }
      async enrichSignTypedDataRequest(signTypedDataRequest) {
        let annotation;
        const {typedData} = signTypedDataRequest;
        if (isEIP2612TypedData(typedData)) {
          const assets = this.indexingService.getCachedAssets(ZEUS);
          const correspondingAsset = assets.find((asset => {
            if (typedData.domain.verifyingContract && "contractAddress" in asset && asset.contractAddress) {
              return (0, address_lib.getAddress)(asset.contractAddress) === (0, address_lib.getAddress)(typedData.domain.verifyingContract);
            }
            return false;
          }));
          annotation = await enrichEIP2612SignTypedDataRequest(typedData, this.nameService, correspondingAsset);
        }
        const enrichedSignTypedDataRequest = {
          ...signTypedDataRequest,
          annotation
        };
        this.emitter.emit("enrichedSignTypedDataRequest", enrichedSignTypedDataRequest);
        return enrichedSignTypedDataRequest;
      }
      async enrichTransaction(transaction, desiredDecimals) {
        return {
          ...transaction,
          annotation: await resolveTransactionAnnotation(this.chainService, this.indexingService, this.nameService, transaction.network, transaction, desiredDecimals)
        };
      }
    }
    async function getPrices(_assets, _vsCurrencies) {
      lib_logger.debug("getPrices called — no price oracle configured, returning []");
      return [];
    }
    async function getTokenPrices(_tokenAddresses, _fiatCurrency, _network) {
      lib_logger.debug("getTokenPrices called — no price oracle configured, returning {}");
      return {};
    }
    function getPricePoint(asset, unitPricePoint) {
      return {
        pair: [ asset, USD ],
        amounts: [ 1n * 10n ** BigInt(asset.decimals), BigInt(Math.trunc(Number(unitPricePoint.unitPrice.amount) / 10 ** unitPricePoint.unitPrice.asset.decimals * 10 ** USD.decimals)) ],
        time: unitPricePoint.time
      };
    }
    var lodash = __webpack_require__(2543);
    var lodash_default = __webpack_require__.n(lodash);
    const BATCH_SIZE = 20;
    const SPOT_PRICE_ORACLE_CONSTANTS = {};
    const PRICE_ORACLE_FUNCTIONS = {
      getRate: lib_utils.FunctionFragment.from("getRate(address srcToken, address dstToken, bool useWrappers) external view returns (uint256 weightedRate)"),
      getRateToEth: lib_utils.FunctionFragment.from("getRateToEth(address srcToken, bool useSrcWrappers) external view returns (uint256 weightedRate)")
    };
    const PRICE_ORACLE_ABI = Object.values(PRICE_ORACLE_FUNCTIONS);
    const PRICE_ORACLE_INTERFACE = new qethers_lib.utils.Interface(PRICE_ORACLE_ABI);
    const toUSDPricePoint = (asset, coinPrice) => {
      const assetPrecision = "decimals" in asset ? asset.decimals : 0;
      return {
        pair: [ USD, asset ],
        amounts: [ toFixedPoint(coinPrice, USD.decimals), 10n ** BigInt(assetPrecision) ],
        time: Date.now()
      };
    };
    const getRateForBaseAsset = async (network, provider) => {
      const constants = SPOT_PRICE_ORACLE_CONSTANTS[network.chainID];
      if (!constants) {
        return null;
      }
      const offChainOracleContract = new qethers_lib.Contract(constants.oracleAddress, PRICE_ORACLE_ABI, provider);
      return offChainOracleContract.callStatic.getRateToEth(constants.USDCAddress, true);
    };
    const getBaseAssetPriceFromRate = (rate, network) => {
      const constants = SPOT_PRICE_ORACLE_CONSTANTS[network.chainID];
      if (!constants) return 0;
      const numerator = qethers_lib.BigNumber.from(10).pow(constants.USDCDecimals);
      const denominator = qethers_lib.BigNumber.from(10).pow(network.baseAsset.decimals);
      const BaseAssetPerUSD = denominator.mul(100).div(qethers_lib.BigNumber.from(rate).mul(numerator).div(denominator));
      return Number(BaseAssetPerUSD) / 100;
    };
    async function getUSDPriceForBaseAsset(network, provider) {
      const rate = await getRateForBaseAsset(network, provider);
      if (rate === null) {
        lib_logger.debug(`getUSDPriceForBaseAsset: no oracle configured for chain ${network.chainID} — returning zero price`);
        return toUSDPricePoint(network.baseAsset, 0);
      }
      const USDPriceOfBaseAsset = getBaseAssetPriceFromRate(rate, network);
      return toUSDPricePoint(network.baseAsset, USDPriceOfBaseAsset);
    }
    const getRatesForTokens = async (assets, provider, network) => {
      if (SPOT_PRICE_ORACLE_CONSTANTS[network.chainID] === undefined) {
        return [];
      }
      const constants = SPOT_PRICE_ORACLE_CONSTANTS[network.chainID];
      const multicall = new qethers_lib.Contract(MULTICALL_CONTRACT_ADDRESS, MULTICALL_ABI, provider);
      const response = await multicall.callStatic.tryBlockAndAggregate(false, assets.map((asset => {
        const callData = PRICE_ORACLE_INTERFACE.encodeFunctionData("getRate", [ constants.USDCAddress, asset.contractAddress, true ]);
        return [ constants.oracleAddress, callData ];
      })));
      return response.returnData.map(((data, i) => ({
        asset: assets[i],
        response: data
      })));
    };
    const getTokenPriceFromRate = (rate, asset, network) => {
      const constants = SPOT_PRICE_ORACLE_CONSTANTS[network.chainID];
      if (!constants) return 0;
      const numerator = qethers_lib.BigNumber.from(10).pow(constants.USDCDecimals);
      const denominator = asset.decimals ? qethers_lib.BigNumber.from(10).pow(asset.decimals) : qethers_lib.BigNumber.from(1);
      const tokenPerUSDC = denominator.mul(100).div(qethers_lib.BigNumber.from(rate).mul(numerator).div(denominator));
      return Number(tokenPerUSDC) / 100;
    };
    async function getUSDPriceForTokens(assets, network, provider) {
      if (!SPOT_PRICE_ORACLE_CONSTANTS[network.chainID]) {
        lib_logger.debug(`getUSDPriceForTokens: no oracle configured for chain ${network.chainID} — skipping ${assets.length} token(s)`);
        return {};
      }
      if (assets.length > BATCH_SIZE) {
        const batches = lodash_default().range(0, assets.length / BATCH_SIZE).map((batch => assets.slice(batch * BATCH_SIZE, batch * BATCH_SIZE + BATCH_SIZE)));
        lib_logger.debug("Batching assets price lookup by length", assets.length, BATCH_SIZE, batches);
        return logRejectedAndReturnFulfilledResults("Some batch asset price lookups failed", await Promise.allSettled(batches.map((subAssets => getUSDPriceForTokens(subAssets, network, provider)))), batches).reduce(((allPrices, pricesSubset) => ({
          ...allPrices,
          ...pricesSubset
        })), {});
      }
      const tokenRates = await getRatesForTokens(assets, provider, network);
      const pricePoints = {};
      tokenRates.forEach((({asset, response}) => {
        if (asset.symbol === "USDC") {
          pricePoints[asset.contractAddress] = {
            unitPrice: {
              asset: USD,
              amount: BigInt(10 ** USD.decimals)
            },
            time: Date.now()
          };
          return;
        }
        if (response.success !== true || qethers_lib.BigNumber.from(response.returnData).isZero()) {
          return;
        }
        const USDPriceOfToken = getTokenPriceFromRate(qethers_lib.BigNumber.from(response.returnData), asset, network);
        pricePoints[asset.contractAddress] = {
          unitPrice: {
            asset: USD,
            amount: BigInt(Math.trunc(USDPriceOfToken * 10 ** USD.decimals))
          },
          time: Date.now()
        };
      }));
      return pricePoints;
    }
    var web_lib = __webpack_require__(6637);
    function scoreAssetSimilarity(a, b) {
      let score = 0;
      if (a.symbol === b.symbol) {
        score += 1;
      }
      if (a.name === b.name) {
        score += 1;
      }
      if ("decimals" in a && "decimals" in b && a.decimals === b.decimals) {
        score += 1;
      } else if ("decimals" in a || "decimals" in b) {
        score -= 1;
      }
      if ("homeNetwork" in a && "homeNetwork" in b && sameNetwork(a.homeNetwork, b.homeNetwork)) {
        score += 1;
      } else if ("homeNetwork" in a || "homeNetwork" in b) {
        score -= 1;
      }
      return score;
    }
    function prioritizedAssetSimilarityKeys(asset) {
      let similarityKeys = [];
      if (isSmartContractFungibleAsset(asset)) {
        const normalizedContractAddressAndNetwork = `${normalizeQEVMAddress(asset.contractAddress)}-${asset.homeNetwork.chainID}`;
        similarityKeys = [ ...similarityKeys, normalizedContractAddressAndNetwork ];
      }
      return [ ...similarityKeys, asset.symbol ];
    }
    function findClosestAssetIndex(assetToFind, assets, minimumSimilarityScore = 2) {
      const [bestScore, index] = assets.reduce((([runningScore, runningScoreIndex], asset, i) => {
        const score = scoreAssetSimilarity(assetToFind, asset);
        if (score > runningScore) {
          return [ score, i ];
        }
        return [ runningScore, runningScoreIndex ];
      }), [ 0, -1 ]);
      if (bestScore >= minimumSimilarityScore && index >= 0) {
        return index;
      }
      return undefined;
    }
    const QEVM_ADDRESS_PATTERN = /^0x[a-fA-F0-9]{40}$|^0x[a-fA-F0-9]{64}$/;
    function isValidQEVMTokenListResponse(response) {
      if (typeof response !== "object" || response === null) {
        lib_logger.debug("QEVM token list validation failed: response is not an object");
        return false;
      }
      const obj = response;
      if (typeof obj.name !== "string") {
        lib_logger.debug("Token list validation failed: missing or invalid 'name'");
        return false;
      }
      if (typeof obj.timestamp !== "string") {
        lib_logger.debug("Token list validation failed: missing or invalid 'timestamp'");
        return false;
      }
      if (!Array.isArray(obj.tokens)) {
        lib_logger.debug("Token list validation failed: 'tokens' is not an array");
        return false;
      }
      if (typeof obj.version !== "object" || obj.version === null) {
        lib_logger.debug("Token list validation failed: missing or invalid 'version'");
        return false;
      }
      const version = obj.version;
      if (typeof version.major !== "number" || typeof version.minor !== "number" || typeof version.patch !== "number") {
        lib_logger.debug("Token list validation failed: 'version' fields are not numbers");
        return false;
      }
      const invalidToken = obj.tokens.find((token => {
        if (typeof token !== "object" || token === null) return true;
        const t = token;
        return !(typeof t.chainId === "number" && typeof t.address === "string" && typeof t.name === "string" && typeof t.symbol === "string" && typeof t.decimals === "number" && QEVM_ADDRESS_PATTERN.test(t.address));
      }));
      if (invalidToken !== undefined) {
        lib_logger.debug("Token list validation failed: invalid token entry", invalidToken);
        return false;
      }
      return true;
    }
    async function fetchAndValidateTokenList(url) {
      let ok = true;
      const response = await (0, web_lib.fetchJson)({
        url,
        timeout: 10 * SECOND
      }).catch((() => {
        ok = false;
      }));
      if (!ok) {
        throw new Error(`Error resolving token list at ${url}`);
      }
      if (!isValidQEVMTokenListResponse(response)) {
        throw new Error(`Invalid token list at ${url}`);
      }
      return {
        tokenList: response,
        url
      };
    }
    async function fetchAndValidateTokenLists(urls) {
      return (await Promise.allSettled(urls.map(fetchAndValidateTokenList))).filter((l => l.status === "fulfilled")).map((l => l.value));
    }
    function tokenListToFungibleAssetsForNetwork(network, {url: tokenListURL, tokenList}) {
      const networkChainID = Number(network.chainID);
      const tokenListCitation = {
        url: tokenListURL,
        name: tokenList.name,
        logoURL: tokenList.logoURI
      };
      return tokenList.tokens.filter((({chainId, symbol}) => chainId === networkChainID && symbol !== network.baseAsset.symbol)).map((tokenMetadata => ({
        metadata: {
          ...tokenMetadata.logoURI ? {
            logoURL: tokenMetadata.logoURI
          } : {},
          tokenLists: [ tokenListCitation ]
        },
        name: tokenMetadata.name,
        symbol: tokenMetadata.symbol,
        decimals: tokenMetadata.decimals,
        homeNetwork: network,
        contractAddress: normalizeQEVMAddress(tokenMetadata.address)
      })));
    }
    function mergeAssets(...assetLists) {
      function tokenReducer(seenAssetsBySimilarityKey, asset) {
        const updatedSeenAssetsBySimilarityKey = {
          ...seenAssetsBySimilarityKey
        };
        const similarityKeys = prioritizedAssetSimilarityKeys(asset);
        const referenceKey = similarityKeys[0];
        updatedSeenAssetsBySimilarityKey[referenceKey] ??= [];
        const matchingAssetIndex = findClosestAssetIndex(asset, updatedSeenAssetsBySimilarityKey[referenceKey]);
        if (typeof matchingAssetIndex !== "undefined") {
          const matchingAsset = updatedSeenAssetsBySimilarityKey[referenceKey][matchingAssetIndex];
          updatedSeenAssetsBySimilarityKey[referenceKey][matchingAssetIndex] = {
            ...asset,
            ...matchingAsset,
            metadata: {
              ...matchingAsset.metadata,
              ...asset.metadata,
              tokenLists: Object.values((matchingAsset.metadata?.tokenLists || [])?.concat(asset.metadata?.tokenLists ?? []).reduce(((citations, tokenListCitation) => ({
                ...citations,
                [tokenListCitation.url]: [ ...citations[tokenListCitation.url] ?? [], tokenListCitation ]
              })), {})).flatMap((duplicateList => duplicateList.find((list => list.logoURL !== undefined)) ?? duplicateList[0]))
            }
          };
        } else {
          updatedSeenAssetsBySimilarityKey[referenceKey].push(asset);
        }
        return updatedSeenAssetsBySimilarityKey;
      }
      const mergedAssetsBy = assetLists.flat().reduce(tokenReducer, {});
      const mergedAssets = Object.values(mergedAssetsBy).flat();
      return mergedAssets.sort(((a, b) => (a.metadata?.tokenLists?.length || 0) - (b.metadata?.tokenLists?.length || 0)));
    }
    const memoizedMergeAssets = (0, lodash.memoize)(mergeAssets, ((...assetLists) => assetLists.reduce(((acc, curr) => acc + curr.length), 0)));
    function networkAssetsFromLists(network, tokenLists) {
      const fungibleAssets = tokenLists.map((tokenListAndReference => tokenListToFungibleAssetsForNetwork(network, tokenListAndReference)));
      return memoizedMergeAssets(...fungibleAssets);
    }
    function assetID(asset) {
      const id = `${asset.symbol}`;
      if (!("contractAddress" in asset) || !("homeNetwork" in asset) || "coinType" in asset) {
        return id;
      }
      const network = asset.homeNetwork;
      return `${id}/${asset.contractAddress}/${network.family}/${network.name}`;
    }
    function normalizePricePoint(pricePoint) {
      const asset1ID = assetID(pricePoint.pair[0]);
      const asset2ID = assetID(pricePoint.pair[1]);
      return asset1ID.localeCompare(asset2ID) > 0 ? {
        ...pricePoint,
        asset1ID,
        asset2ID
      } : {
        time: pricePoint.time,
        pair: [ pricePoint.pair[1], pricePoint.pair[0] ],
        amounts: [ pricePoint.amounts[1], pricePoint.amounts[0] ],
        asset1ID: asset2ID,
        asset2ID: asset1ID
      };
    }
    function numberArrayCompare(arr1, arr2) {
      for (let i = 0; i < arr1.length; i += 1) {
        if (arr1[i] > arr2[i]) {
          return 1;
        }
        if (arr1[i] < arr2[i]) {
          return -1;
        }
      }
      return 0;
    }
    class IndexingDatabase extends Xn {
      constructor(options) {
        super("qwal/indexing", options);
        this.version(1).stores({
          prices: "++id,time,[asset1ID+asset2ID]",
          balances: "++id,address,assetAmount.amount,assetAmount.asset.symbol,network.name,blockHeight,retrievedAt",
          tokenLists: "++id,url,retrievedAt",
          customAssets: "&[contractAddress+homeNetwork.name],contractAddress,symbol,homeNetwork.chainID,homeNetwork.name",
          assetsToTrack: "&[contractAddress+homeNetwork.name],symbol,contractAddress,homeNetwork.family,homeNetwork.chainID,homeNetwork.name"
        });
      }
      async savePriceMeasurement(pricePoint, retrievedAt, dataSource, exchange) {
        const measurement = {
          ...normalizePricePoint(pricePoint),
          retrievedAt,
          dataSource,
          exchange
        };
        await this.prices.add(measurement);
      }
      async getLatestAccountBalance(address, network, asset) {
        const balanceCandidates = await this.balances.where("retrievedAt").above(Date.now() - 7 * 24 * 60 * 60 * 1e3).filter((balance => balance.address === address && balance.assetAmount.asset.symbol === asset.symbol && balance.network.name === network.name)).reverse().sortBy("retrievedAt");
        return balanceCandidates.length > 0 ? balanceCandidates[0] : null;
      }
      async addAssetToTrack(asset) {
        this.assetsToTrack.put(asset);
      }
      async getAssetsToTrack() {
        return this.assetsToTrack.toArray();
      }
      async isTrackingAsset(asset) {
        return await this.getTrackedAssetByAddressAndNetwork(asset.homeNetwork, asset.contractAddress) !== undefined;
      }
      async getAllCustomAssets() {
        return this.customAssets.toArray();
      }
      async getActiveCustomAssetsByNetworks(networks) {
        return (await this.customAssets.where("homeNetwork.chainID").anyOf(networks.map((network => network.chainID))).toArray()).filter((asset => asset?.metadata?.removed !== true));
      }
      async getRemovedCustomAssetsByNetworks(networks) {
        return (await this.customAssets.where("homeNetwork.chainID").anyOf(networks.map((network => network.chainID))).toArray()).filter((asset => asset?.metadata?.removed === true));
      }
      async getCustomAssetByAddressAndNetwork(network, contractAddress) {
        return this.customAssets.where("[contractAddress+homeNetwork.name]").equals([ contractAddress, network.name ]).first();
      }
      async getTrackedAssetByAddressAndNetwork(network, contractAddress) {
        return this.assetsToTrack.where("[contractAddress+homeNetwork.name]").equals([ contractAddress, network.name ]).first();
      }
      async addOrUpdateCustomAsset(asset) {
        this.customAssets.put(asset);
      }
      async addBalances(accountBalances) {
        await this.balances.bulkAdd(accountBalances);
      }
      async getLatestTokenList(url) {
        const candidateLists = await this.tokenLists.where("url").equals(url).reverse().sortBy("retrievedAt");
        if (candidateLists.length > 0) {
          return candidateLists[0];
        }
        return null;
      }
      async saveTokenList(url, list) {
        const cachedList = {
          name: list.name,
          logoURL: list.logoURI,
          url,
          retrievedAt: Date.now(),
          list
        };
        await this.tokenLists.add(cachedList);
      }
      async getLatestTokenLists(urls) {
        const candidateLists = await this.tokenLists.where("url").anyOf(urls).toArray();
        return Object.entries(candidateLists.reduce(((acc, cachedList) => {
          if (!(cachedList.url in acc)) {
            acc[cachedList.url] = cachedList.list;
          } else {
            const orig = acc[cachedList.url];
            const origV = [ orig.version.major, orig.version.minor, orig.version.patch ];
            const cachedV = [ cachedList.list.version.major, cachedList.list.version.minor, cachedList.list.version.patch ];
            if (numberArrayCompare(origV, cachedV) < 0) {
              acc[cachedList.url] = cachedList.list;
            }
          }
          return {
            ...acc
          };
        }), {})).map((([k, v]) => ({
          url: k,
          tokenList: v
        })));
      }
    }
    async function getOrCreateDb(options) {
      return new IndexingDatabase(options);
    }
    const FAST_TOKEN_REFRESH_BLOCK_RANGE = 10;
    const ACCELERATED_TOKEN_REFRESH_TIMEOUT = 300;
    const getAssetsByAddress = assets => {
      const activeAssetsByAddress = assets.reduce(((agg, t) => {
        const newAgg = {
          ...agg
        };
        newAgg[t.contractAddress.toLowerCase()] = t;
        return newAgg;
      }), {});
      return activeAssetsByAddress;
    };
    const getActiveAssetsByAddressForNetwork = (network, activeAssetsToTrack) => {
      const networkActiveAssets = activeAssetsToTrack.filter((asset => asset.homeNetwork.chainID === network.chainID));
      return getAssetsByAddress(networkActiveAssets);
    };
    function allowVerifyAssetByManualImport(asset, verified) {
      if (!isBaselineTrustedAsset(asset) && isUnverifiedAsset(asset)) {
        return !!verified;
      }
      return false;
    }
    class IndexingService extends BaseService {
      scheduledTokenRefresh=false;
      lastPriceAlarmTime=0;
      cachedAssets=Object.fromEntries(Object.keys(NETWORK_BY_CHAIN_ID).map((network => [ network, [] ])));
      static create=async (preferenceService, chainService, dexieOptions) => new this(await getOrCreateDb(dexieOptions), await preferenceService, await chainService);
      constructor(db, preferenceService, chainService) {
        super({
          balance: {
            schedule: {
              periodInMinutes: 1
            },
            handler: () => this.handleBalanceAlarm()
          },
          forceBalance: {
            schedule: {
              periodInMinutes: 12 * HOUR / MINUTE
            },
            handler: () => this.handleBalanceAlarm()
          },
          balanceRefresh: {
            schedule: {
              periodInMinutes: 1
            },
            handler: () => this.handleBalanceRefresh()
          },
          prices: {
            schedule: {
              delayInMinutes: 1,
              periodInMinutes: 10
            },
            handler: () => this.handlePriceAlarm()
          }
        });
        this.db = db;
        this.preferenceService = preferenceService;
        this.chainService = chainService;
      }
      async internalStartService() {
        await super.internalStartService();
        this.connectChainServiceEvents();
        const tokenListLoad = this.fetchAndCacheTokenLists();
        this.chainService.emitter.once("serviceStarted").then((async () => {
          this.handlePriceAlarm();
          const trackedNetworks = await this.chainService.getTrackedNetworks();
          await Promise.allSettled(trackedNetworks.map((async network => {
            await this.cacheAssetsForNetwork(network);
            this.emitter.emit("assetsLoaded", {
              assets: this.getCachedAssets(network),
              loadingScope: "network"
            });
          })));
          tokenListLoad.then((async () => {
            await Promise.allSettled(trackedNetworks.map((async network => {
              await this.cacheAssetsForNetwork(network);
              this.emitter.emit("assetsLoaded", {
                assets: this.getCachedAssets(network),
                loadingScope: "network"
              });
            })));
            await this.loadAccountBalances();
          })).catch((err => {
            lib_logger.error("Token list load failed during startup refresh:", err);
          }));
        }));
      }
      async getAssetsToTrack() {
        return this.db.getAssetsToTrack();
      }
      async addAssetToTrack(asset) {
        await this.db.addAssetToTrack(asset);
      }
      async isTrackingAsset(asset) {
        return this.db.isTrackingAsset(asset);
      }
      async addOrUpdateCustomAsset(asset) {
        await this.db.addOrUpdateCustomAsset(asset);
        await this.cacheAssetsForNetwork(asset.homeNetwork);
      }
      async getLatestAccountBalance(account, network, asset) {
        return this.db.getLatestAccountBalance(account, network, asset);
      }
      getCachedAssets(network) {
        return this.cachedAssets[network.chainID] ?? [];
      }
      async cacheAssetsForNetwork(network) {
        const trackedAssets = (await this.db.getAssetsToTrack()).filter((asset => sameNetwork(asset.homeNetwork, network)));
        const customAssets = await this.db.getActiveCustomAssetsByNetworks([ network ]);
        const tokenListPrefs = await this.preferenceService.getTokenListPreferences();
        const tokenLists = await this.db.getLatestTokenLists(tokenListPrefs.urls);
        this.cachedAssets[network.chainID] = mergeAssets([ network.baseAsset ], trackedAssets, customAssets, networkAssetsFromLists(network, tokenLists));
      }
      getKnownSmartContractAsset(network, contractAddress) {
        const knownAssets = this.getCachedAssets(network);
        const searchResult = knownAssets.find((asset => isSmartContractFungibleAsset(asset) && sameNetwork(asset.homeNetwork, network) && sameQEVMAddress(asset.contractAddress, contractAddress)));
        return searchResult;
      }
      acceleratedTokenRefresh={
        timeout: undefined,
        assetLookups: []
      };
      notifyEnrichedTransaction(enrichedEVMTransaction) {
        const jointAnnotations = typeof enrichedEVMTransaction.annotation === "undefined" ? [] : [ enrichedEVMTransaction.annotation, ...enrichedEVMTransaction.annotation.subannotations ?? [] ];
        jointAnnotations.forEach((async annotation => {
          if (typeof annotation !== "undefined" && annotation.type === "asset-transfer" && isSmartContractFungibleAsset(annotation.assetAmount.asset)) {
            const {asset} = annotation.assetAmount;
            const annotationAddressesOnNetwork = [ annotation.sender.address, annotation.recipient.address ].map((address => ({
              address,
              network: enrichedEVMTransaction.network
            })));
            const trackedAddresesOnNetworks = await this.chainService.filterTrackedAddressesOnNetworks(annotationAddressesOnNetwork);
            const baselineTrustedAsset = typeof this.getKnownSmartContractAsset(enrichedEVMTransaction.network, asset.contractAddress) !== "undefined" || (await this.chainService.filterTrackedAddressesOnNetworks([ {
              address: normalizeQEVMAddress(enrichedEVMTransaction.from),
              network: enrichedEVMTransaction.network
            } ])).length > 0;
            if (baselineTrustedAsset) {
              const assetLookups = trackedAddresesOnNetworks.map((addressOnNetwork => ({
                asset,
                addressOnNetwork
              })));
              this.acceleratedTokenRefresh.assetLookups.push(...assetLookups);
              this.acceleratedTokenRefresh.timeout ??= self.setTimeout(this.handleAcceleratedTokenRefresh.bind(this), ACCELERATED_TOKEN_REFRESH_TIMEOUT);
            }
          }
        }));
      }
      async handleAcceleratedTokenRefresh() {
        try {
          const {assetLookups} = this.acceleratedTokenRefresh;
          this.acceleratedTokenRefresh.timeout = undefined;
          this.acceleratedTokenRefresh.assetLookups = [];
          const lookupsByAddressOnNetwork = assetLookups.reduce(((lookups, {asset, addressOnNetwork: {address, network}}) => {
            const existingAddressOnNetworkIndex = lookups.findIndex((([{address: existingAddress, network: existingNetwork}]) => sameQEVMAddress(address, existingAddress) && sameNetwork(network, existingNetwork)));
            if (existingAddressOnNetworkIndex !== -1) {
              lookups[existingAddressOnNetworkIndex][1].push(asset);
            } else {
              lookups.push([ {
                address,
                network
              }, [ asset ] ]);
            }
            return lookups;
          }), []);
          lookupsByAddressOnNetwork.forEach((([addressOnNetwork, assets]) => {
            this.retrieveTokenBalances(addressOnNetwork, assets);
          }));
        } catch (error) {
          lib_logger.error("Error during accelerated token refresh", error);
        }
      }
      async connectChainServiceEvents() {
        this.chainService.emitter.on("assetTransfers", (async ({addressNetwork, assetTransfers}) => {
          assetTransfers.forEach((transfer => {
            const fungibleAsset = transfer.assetAmount.asset;
            if (isSmartContractFungibleAsset(fungibleAsset)) {
              this.addTokenToTrackByContract(addressNetwork.network, fungibleAsset.contractAddress, {
                discoveryTxHash: {
                  [addressNetwork.address]: transfer.txHash
                }
              });
            }
          }));
        }));
        this.chainService.emitter.on("newAccountToTrack", (async addressOnNetwork => {
          await this.loadAccountBalancesFor(addressOnNetwork);
          this.handlePriceAlarm();
        }));
        this.chainService.emitter.on("transaction", (async ({transaction, forAccounts}) => {
          if ("status" in transaction && transaction.status === 1 && transaction.blockHeight > await this.chainService.getBlockHeight(transaction.network) - FAST_TOKEN_REFRESH_BLOCK_RANGE) {
            this.scheduledTokenRefresh = true;
          }
          if ("status" in transaction && (transaction.status === 1 || transaction.status === 0)) {
            forAccounts.forEach((accountAddress => {
              this.chainService.getLatestBaseAccountBalance({
                address: accountAddress,
                network: transaction.network
              });
            }));
          }
        }));
      }
      async retrieveTokenBalances(unsafeAddressNetwork, smartContractAssets) {
        const addressNetwork = normalizeAddressOnNetwork(unsafeAddressNetwork);
        const balances = await this.chainService.assetData.getTokenBalances(addressNetwork, smartContractAssets?.map((({contractAddress}) => contractAddress)));
        const listedAssetByAddress = (smartContractAssets ?? []).reduce(((acc, asset) => {
          acc[normalizeQEVMAddress(asset.contractAddress)] = asset;
          return acc;
        }), {});
        const removedCustomAssets = await this.db.getRemovedCustomAssetsByNetworks([ addressNetwork.network ]);
        const unfilteredAccountBalances = await Promise.allSettled(balances.map((async ({smartContract: {contractAddress}, amount}) => {
          const knownAsset = listedAssetByAddress[normalizeQEVMAddress(contractAddress)] ?? this.getKnownSmartContractAsset(addressNetwork.network, contractAddress);
          if (amount > 0) {
            if (knownAsset) {
              await this.addAssetToTrack(knownAsset);
            } else {
              await this.addTokenToTrackByContract(addressNetwork.network, contractAddress);
            }
          }
          if (knownAsset) {
            const accountBalance = {
              ...addressNetwork,
              assetAmount: {
                asset: knownAsset,
                amount
              },
              retrievedAt: Date.now(),
              dataSource: "global"
            };
            return accountBalance;
          }
          return undefined;
        })));
        const accountBalances = unfilteredAccountBalances.reduce(((acc, current) => {
          if (current.status === "fulfilled" && current.value && !removedCustomAssets.some((asset => isSameAsset(asset, current.value?.assetAmount.asset)))) {
            return [ ...acc, current.value ];
          }
          return acc;
        }), []);
        await this.db.addBalances(accountBalances);
        this.emitter.emit("accountsWithBalances", {
          balances: accountBalances,
          addressOnNetwork: addressNetwork
        });
        return balances;
      }
      async updateAssetMetadata(asset, metadata) {
        const updatedAsset = {
          ...asset,
          metadata: {
            ...asset.metadata,
            ...metadata
          }
        };
        await this.db.addOrUpdateCustomAsset(updatedAsset);
        await this.cacheAssetsForNetwork(asset.homeNetwork);
        this.emitter.emit("refreshAsset", updatedAsset);
      }
      async hideAsset(asset) {
        const metadata = {
          ...asset.metadata,
          removed: true
        };
        await this.db.addOrUpdateCustomAsset({
          ...asset,
          metadata
        });
        await this.cacheAssetsForNetwork(asset.homeNetwork);
        this.emitter.emit("removeAssetData", asset);
      }
      async removeDiscoveryTxHash(address) {
        const customAssets = await this.db.getAllCustomAssets();
        customAssets.filter((asset => asset.metadata?.discoveryTxHash?.[address] !== undefined)).forEach((assetWithDiscoveryHashReference => {
          const {metadata} = assetWithDiscoveryHashReference;
          if (Object.keys(metadata?.discoveryTxHash ?? {}).length !== 0) {
            delete metadata?.discoveryTxHash?.[address];
            this.updateAssetMetadata(assetWithDiscoveryHashReference, metadata ?? {});
          }
        }));
      }
      async importCustomToken(asset) {
        const customAsset = {
          ...asset,
          metadata: {
            ...asset.metadata ?? {},
            verified: true
          }
        };
        await this.addTokenToTrackByContract(asset.homeNetwork, asset.contractAddress, customAsset.metadata);
        try {
          const addresses = await this.chainService.getTrackedAddressesOnNetwork(asset.homeNetwork);
          await Promise.allSettled(addresses.map((async addressNetwork => {
            await this.retrieveTokenBalances(addressNetwork, [ customAsset ]);
          })));
          return true;
        } catch (error) {
          lib_logger.error("Error retrieving new custom token balances for ", asset, ": ", error);
          return false;
        }
      }
      async addTokenToTrackByContract(network, contractAddress, metadata = {}) {
        const normalizedAddress = normalizeQEVMAddress(contractAddress);
        const knownAsset = this.getKnownSmartContractAsset(network, normalizedAddress);
        if (knownAsset && !allowVerifyAssetByManualImport(knownAsset, metadata?.verified)) {
          await this.addAssetToTrack(knownAsset);
          return knownAsset;
        }
        let customAsset = await this.db.getCustomAssetByAddressAndNetwork(network, normalizedAddress);
        if (!customAsset) {
          customAsset = await this.chainService.assetData.getTokenMetadata({
            contractAddress: normalizedAddress,
            homeNetwork: network
          }) || undefined;
        }
        if (customAsset) {
          const isRemoved = customAsset?.metadata?.removed ?? false;
          const isVerified = metadata.verified ?? false;
          if (!isRemoved || isRemoved && isVerified) {
            if (Object.keys(metadata).length !== 0) {
              customAsset.metadata ??= {};
              if (metadata.verified !== undefined) {
                customAsset.metadata.verified = metadata.verified;
              }
              if (metadata.discoveryTxHash) {
                customAsset.metadata.discoveryTxHash ??= {};
                Object.assign(customAsset.metadata.discoveryTxHash, metadata.discoveryTxHash);
              }
              if (metadata.logoURL) {
                customAsset.metadata.logoURL = metadata.logoURL;
              }
              if (isRemoved) {
                customAsset.metadata.removed = false;
              }
            }
            await this.addOrUpdateCustomAsset(customAsset);
            this.emitter.emit("refreshAsset", customAsset);
            await this.addAssetToTrack(customAsset);
          }
        }
        return customAsset;
      }
      async getBaseAssetsPrices() {
        try {
          const baseAssets = await this.chainService.getNetworkBaseAssets();
          let basicPrices = await getPrices(baseAssets, FIAT_CURRENCIES);
          if (basicPrices.length === 0) {
            basicPrices = await Promise.all([ ZEUS ].map((async network => {
              const provider = this.chainService.providerForNetworkOrThrow(network);
              return getUSDPriceForBaseAsset(network, provider);
            })));
          }
          const measuredAt = Date.now();
          basicPrices.forEach((pricePoint => {
            this.db.savePriceMeasurement(pricePoint, measuredAt, "qevm").catch((err => lib_logger.error("Error saving price point", err, pricePoint, measuredAt)));
          }));
          this.emitter.emit("prices", basicPrices);
        } catch (e) {
          lib_logger.error("Error getting base asset prices", BUILT_IN_NETWORK_BASE_ASSETS, FIAT_CURRENCIES);
        }
      }
      async getTrackedAssetsPrices() {
        const trackedNetworks = await this.chainService.getTrackedNetworks();
        const assetsToTrack = trackedNetworks.flatMap((network => this.getCachedAssets(network)));
        const activeAssetsToTrack = assetsToTrack.filter(isSmartContractFungibleAsset).filter(isTrustedAsset);
        try {
          const allActiveAssetsByAddress = getAssetsByAddress(activeAssetsToTrack);
          const activeAssetsByNetwork = trackedNetworks.map((network => ({
            activeAssetsByAddress: getActiveAssetsByAddressForNetwork(network, activeAssetsToTrack),
            network
          }))).filter((({activeAssetsByAddress}) => Object.keys(activeAssetsByAddress).length > 0));
          const measuredAt = Date.now();
          const activeAssetPricesByNetwork = logRejectedAndReturnFulfilledResults("Failed to retrieve token prices for network", await Promise.allSettled(activeAssetsByNetwork.map((async ({activeAssetsByAddress, network}) => {
            const tokenPrices = await getTokenPrices(Object.keys(activeAssetsByAddress), USD, network);
            if (Object.keys(tokenPrices).length) {
              return tokenPrices;
            }
            const provider = this.chainService.providerForNetworkOrThrow(network);
            return getUSDPriceForTokens(Object.values(activeAssetsByAddress), network, provider);
          }))), activeAssetsByNetwork);
          const activeAssetPrices = activeAssetPricesByNetwork.flatMap((activeAssetPrice => Object.entries(activeAssetPrice)));
          if (activeAssetPrices.length === 0) {
            return;
          }
          const pricePoints = activeAssetPrices.map((([contractAddress, unitPricePoint]) => {
            const asset = allActiveAssetsByAddress[contractAddress.toLowerCase()];
            if (asset) {
              const pricePoint = getPricePoint(asset, unitPricePoint);
              this.db.savePriceMeasurement(pricePoint, measuredAt, "qevm").catch((() => lib_logger.error("Error saving price point", pricePoint, measuredAt)));
              return pricePoint;
            }
            lib_logger.warn("Discarding price from unknown asset", contractAddress, unitPricePoint);
            return null;
          })).filter((pricePoint => pricePoint !== null));
          this.emitter.emit("prices", pricePoints);
        } catch (err) {
          lib_logger.error("Error getting token prices", activeAssetsToTrack, err);
        }
      }
      async handlePriceAlarm() {
        if (Date.now() < this.lastPriceAlarmTime + 5 * SECOND) {
          return;
        }
        this.lastPriceAlarmTime = Date.now();
        this.getBaseAssetsPrices();
        this.getTrackedAssetsPrices();
      }
      async fetchAndCacheTokenLists() {
        const tokenListPrefs = await this.preferenceService.getTokenListPreferences();
        const tokenListFetchResults = await Promise.allSettled(tokenListPrefs.urls.map((async url => {
          const cachedList = await this.db.getLatestTokenList(url);
          if (!cachedList) {
            try {
              const newListRef = await fetchAndValidateTokenList(url);
              await this.db.saveTokenList(url, newListRef.tokenList);
            } catch (err) {
              lib_logger.error(`Error fetching, validating, and saving token list ${url}`, err);
            }
          }
        })));
        lib_logger.errorLogRejectedPromises("Error fetching, validating, and saving token lists", tokenListFetchResults, tokenListPrefs.urls);
        const assetCacheResults = await Promise.allSettled(this.chainService.supportedNetworks.map((async network => {
          await this.cacheAssetsForNetwork(network);
          this.emitter.emit("assetsLoaded", {
            assets: this.getCachedAssets(network),
            loadingScope: "network"
          });
        })));
        lib_logger.errorLogRejectedPromises("Error caching network asset results", assetCacheResults, this.chainService.supportedNetworks);
      }
      async handleBalanceRefresh() {
        if (this.scheduledTokenRefresh) {
          await this.handleBalanceAlarm();
          this.scheduledTokenRefresh = false;
        }
      }
      async loadAccountBalancesFor(addressOnNetwork) {
        const {network} = addressOnNetwork;
        const loadBaseAccountBalance = this.chainService.getLatestBaseAccountBalance(addressOnNetwork);
        const assetsToCheck = this.getCachedAssets(network).filter(isSmartContractFungibleAsset);
        const loadTokenBalances = this.retrieveTokenBalances(addressOnNetwork, assetsToCheck);
        return Promise.all([ loadBaseAccountBalance, loadTokenBalances ]);
      }
      async loadAccountBalances(onlyActiveAccounts = false) {
        const accounts = await this.chainService.getAccountsToTrack(onlyActiveAccounts);
        const balanceLoadResults = await Promise.allSettled(accounts.map((addressOnNetwork => this.loadAccountBalancesFor(addressOnNetwork))));
        lib_logger.errorLogRejectedPromises("Account balances failed to load for", balanceLoadResults, accounts);
      }
      async handleBalanceAlarm() {
        const [, balanceResults] = await Promise.allSettled([ this.fetchAndCacheTokenLists(), this.loadAccountBalances(true) ]);
        if (balanceResults.status === "rejected") {
          lib_logger.error("Balance loading failed during balance alarm:", balanceResults.reason);
        }
      }
    }
    var transactions_lib = __webpack_require__(3776);
    var crypto_browserify = __webpack_require__(1565);
    var argon2 = __webpack_require__(6452);
    var argon2_default = __webpack_require__.n(argon2);
    var Buffer = __webpack_require__(8287)["Buffer"];
    let VaultVersion = function(VaultVersion) {
      VaultVersion[VaultVersion["PBKDF2"] = 1] = "PBKDF2";
      VaultVersion[VaultVersion["Argon2"] = 2] = "Argon2";
      return VaultVersion;
    }({});
    function bufferToBase64(array) {
      return Buffer.from(array).toString("base64");
    }
    function base64ToBuffer(s) {
      return Buffer.from(s, "base64");
    }
    async function generateSalt() {
      const saltBuffer = crypto.getRandomValues(new Uint8Array(64));
      return bufferToBase64(saltBuffer);
    }
    function requireCryptoGlobal(message) {
      if (__webpack_require__.g.crypto === undefined) {
        throw new Error(`${message || "Qwal"} requires WebCrypto API support — is this being run in a modern browser?`);
      }
    }
    async function deprecatedDerivePbkdf2KeyFromPassword(password, existingSalt) {
      const {crypto} = __webpack_require__.g;
      const salt = existingSalt || await generateSalt();
      const encoder = new TextEncoder;
      const derivationKey = await crypto.subtle.importKey("raw", encoder.encode(password), {
        name: "PBKDF2"
      }, false, [ "deriveKey" ]);
      const key = await crypto.subtle.deriveKey({
        name: "PBKDF2",
        salt: encoder.encode(salt),
        iterations: 1e6,
        hash: "SHA-256"
      }, derivationKey, {
        name: "AES-GCM",
        length: 256
      }, false, [ "encrypt", "decrypt" ]);
      return {
        key,
        salt
      };
    }
    async function deriveArgon2KeyFromPassword(password, existingSalt) {
      const {crypto} = __webpack_require__.g;
      const salt = existingSalt || await generateSalt();
      const {hash} = await argon2_default().hash({
        pass: password,
        salt,
        hashLen: 32
      });
      const key = await crypto.subtle.importKey("raw", hash, {
        name: "AES-GCM",
        length: 256
      }, false, [ "encrypt", "decrypt" ]);
      return {
        key,
        salt
      };
    }
    async function deriveSymmetricKeyFromPassword(version, password, existingSalt) {
      switch (version) {
       case VaultVersion.PBKDF2:
        return deprecatedDerivePbkdf2KeyFromPassword(password, existingSalt);

       case VaultVersion.Argon2:
        return deriveArgon2KeyFromPassword(password, existingSalt);

       default:
        throw new Error(`Unsupported vault version: ${version}`);
      }
    }
    async function encryptVault(vaultData) {
      requireCryptoGlobal("Encrypting a vault");
      const {crypto} = __webpack_require__.g;
      const {vault, passwordOrSaltedKey, version} = vaultData;
      const {key, salt} = typeof passwordOrSaltedKey === "string" ? await deriveSymmetricKeyFromPassword(version, passwordOrSaltedKey) : passwordOrSaltedKey;
      const encoder = new TextEncoder;
      const initializationVector = crypto.getRandomValues(new Uint8Array(16));
      const encodedPlaintext = encoder.encode(JSON.stringify(vault));
      const cipherText = await crypto.subtle.encrypt({
        name: "AES-GCM",
        iv: initializationVector
      }, key, encodedPlaintext);
      return {
        salt,
        initializationVector: bufferToBase64(initializationVector),
        cipherText: bufferToBase64(cipherText)
      };
    }
    async function decryptVault(vaultData) {
      const {vault, passwordOrSaltedKey} = vaultData;
      requireCryptoGlobal("Decrypting a vault");
      const {crypto} = __webpack_require__.g;
      const {initializationVector, salt, cipherText} = vault;
      const {key} = typeof passwordOrSaltedKey === "string" ? await deriveSymmetricKeyFromPassword(vaultData.version, passwordOrSaltedKey, salt) : passwordOrSaltedKey;
      const plaintext = await crypto.subtle.decrypt({
        name: "AES-GCM",
        iv: base64ToBuffer(initializationVector)
      }, key, base64ToBuffer(cipherText));
      return JSON.parse((new TextDecoder).decode(plaintext));
    }
    async function getEncryptedVaults() {
      const data = await browser_polyfill_default().storage.local.get("qwalVaults");
      if (!("qwalVaults" in data) || typeof data.qwalVaults !== "object") {
        return {
          version: VaultVersion.Argon2,
          vaults: []
        };
      }
      const {qwalVaults} = data;
      if ("version" in qwalVaults && "vaults" in qwalVaults && (qwalVaults.version === VaultVersion.PBKDF2 || qwalVaults.version === VaultVersion.Argon2) && Array.isArray(qwalVaults.vaults)) {
        return qwalVaults;
      }
      throw new Error("Encrypted vaults are using an unkown serialization format");
    }
    function equalVaults(vault1, vault2) {
      if (vault1.salt !== vault2.salt) {
        return false;
      }
      if (vault1.initializationVector !== vault2.initializationVector) {
        return false;
      }
      if (vault1.cipherText !== vault2.cipherText) {
        return false;
      }
      return true;
    }
    async function writeLatestEncryptedVault(encryptedVault) {
      const serializedVaults = await getEncryptedVaults();
      const vaults = [ ...serializedVaults.vaults ];
      const currentLatest = vaults.reduce(((newestVault, nextVault) => newestVault && newestVault.timeSaved > nextVault.timeSaved ? newestVault : nextVault), null);
      const oldVault = currentLatest && currentLatest.vault;
      if (!oldVault || !equalVaults(oldVault, encryptedVault)) {
        await browser_polyfill_default().storage.local.set({
          qwalVaults: {
            ...serializedVaults,
            vaults: [ ...serializedVaults.vaults, {
              timeSaved: Date.now(),
              vault: encryptedVault
            } ]
          }
        });
      }
    }
    async function migrateVaultsToLatestVersion(password) {
      const serializedVaults = await getEncryptedVaults();
      if (serializedVaults.version === VaultVersion.Argon2) {
        return {
          encryptedData: serializedVaults,
          migrated: false
        };
      }
      const {vaults} = serializedVaults;
      try {
        const newVaults = await Promise.all(vaults.map((async ({vault, timeSaved}) => {
          const deprecatedSaltedKey = await deprecatedDerivePbkdf2KeyFromPassword(password, vault.salt);
          const newSaltedKey = await deriveArgon2KeyFromPassword(password, vault.salt);
          const deprecatedDecryptedVault = await decryptVault({
            version: VaultVersion.PBKDF2,
            vault,
            passwordOrSaltedKey: deprecatedSaltedKey
          });
          const newEncryptedVault = await encryptVault({
            version: VaultVersion.Argon2,
            vault: deprecatedDecryptedVault,
            passwordOrSaltedKey: newSaltedKey
          });
          const newDecryptedVault = await decryptVault({
            version: VaultVersion.Argon2,
            vault: newEncryptedVault,
            passwordOrSaltedKey: newSaltedKey
          });
          if (JSON.stringify(newDecryptedVault) !== JSON.stringify(deprecatedDecryptedVault)) {
            throw new Error("Failed to migrate vaults to Argon2. Decrypted vaults do not match.");
          }
          return {
            timeSaved,
            vault: newEncryptedVault
          };
        })));
        const newSerializedVaults = {
          version: VaultVersion.Argon2,
          vaults: newVaults
        };
        await browser_polyfill_default().storage.local.set({
          qwalVaults: newSerializedVaults
        });
        return {
          encryptedData: newSerializedVaults,
          migrated: true
        };
      } catch (error) {
        lib_logger.error("Failed to migrate vaults to Argon2", error);
        return {
          encryptedData: serializedVaults,
          migrated: false,
          errorMessage: String(error)
        };
      }
    }
    const DEFAULT_AUTOLOCK_INTERVAL = 60 * MINUTE;
    const defaultPreferences = {
      tokenLists: {
        autoUpdate: false,
        urls: [ "https://raw.githubusercontent.com/k0oda/quantumevm-static/main/qevm.tokenlist.json" ]
      },
      currency: USD,
      defaultWallet: false,
      selectedAccount: {
        address: "",
        network: ZEUS
      },
      accountSignersSettings: [],
      autoLockInterval: DEFAULT_AUTOLOCK_INTERVAL,
      shouldShowNotifications: false
    };
    const defaults = defaultPreferences;
    var internal_signer_Buffer = __webpack_require__(8287)["Buffer"];
    let SignerImportSource = function(SignerImportSource) {
      SignerImportSource["import"] = "import";
      SignerImportSource["internal"] = "internal";
      return SignerImportSource;
    }({});
    let SignerSourceTypes = function(SignerSourceTypes) {
      SignerSourceTypes["keyPair"] = "keyPair";
      SignerSourceTypes["jsonFile"] = "jsonFile";
      return SignerSourceTypes;
    }({});
    function normalizeSeedPhrase(phrase) {
      return phrase.trim().toLowerCase().replace(/[^a-z\s]/g, "").replace(/\s+/g, " ");
    }
    class InternalSignerService extends BaseService {
      #cachedKey=null;
      #cachedVaultVersion=VaultVersion.PBKDF2;
      #keyPairs=[];
      #signerMetadata={};
      #hiddenAccounts={};
      #sessionId=null;
      #internalAutoLockInterval=DEFAULT_AUTOLOCK_INTERVAL;
      static create=async preferenceService => new this(await preferenceService);
      constructor(preferenceService) {
        super({
          autolock: {
            schedule: {
              periodInMinutes: 1
            },
            handler: () => {
              this.autolockIfNeeded();
            }
          }
        });
        this.preferenceService = preferenceService;
      }
      async internalStartService() {
        await lib_utils.SigningKey.initialize();
        await this.#validateSession();
        await super.internalStartService();
        this.#internalAutoLockInterval = await this.preferenceService.getAutoLockInterval();
        if ((await getEncryptedVaults()).vaults.length > 0) {
          this.emitter.emit("locked", this.locked());
        }
      }
      async internalStopService() {
        await this.lock();
        await super.internalStopService();
      }
      async updateAutoLockInterval() {
        this.#internalAutoLockInterval = await this.preferenceService.getAutoLockInterval();
        await this.autolockIfNeeded();
      }
      locked() {
        return this.#cachedKey === null;
      }
      #unlock() {
        this.lastActivity = Date.now();
        this.lastOutsideActivity = Date.now();
        this.#createSession();
        this.emitter.emit("locked", false);
      }
      async unlock(password, ignoreExistingVaults = false) {
        if (!this.locked()) {
          lib_logger.warn("InternalSignerService is already unlocked!");
          this.#unlock();
          return true;
        }
        const {encryptedData: {vaults, version}, ...migrationResults} = await migrateVaultsToLatestVersion(password);
        this.#cachedVaultVersion = version;
        if (migrationResults.migrated) {
          this.emitter.emit("vaultMigrationCompleted", {
            newVaultVersion: version
          });
        } else if (migrationResults.errorMessage !== undefined) {
          this.emitter.emit("vaultMigrationCompleted", {
            errorMessage: migrationResults.errorMessage
          });
        }
        if (!ignoreExistingVaults) {
          const currentEncryptedVault = vaults.slice(-1)[0]?.vault;
          if (currentEncryptedVault) {
            const saltedKey = await deriveSymmetricKeyFromPassword(version, password, currentEncryptedVault.salt);
            let plainTextVault;
            try {
              plainTextVault = await decryptVault({
                version,
                vault: currentEncryptedVault,
                passwordOrSaltedKey: saltedKey
              });
              this.#cachedKey = saltedKey;
            } catch (err) {
              return false;
            }
            this.#signerMetadata = {};
            this.#keyPairs = [];
            for (const pk of plainTextVault.keyPairs || []) {
              const wallet = await qethers_lib.Wallet.create(new lib_utils.SigningKey(pk.privateKey, pk.publicKey));
              const existingWallet = this.#keyPairs.find((item => item.address.toLowerCase() === wallet.address.toLowerCase()));
              if (!existingWallet) {
                this.#keyPairs.push(wallet);
              }
            }
            this.#signerMetadata = {
              ...plainTextVault.metadata
            };
            this.#hiddenAccounts = {
              ...plainTextVault.hiddenAccounts
            };
          }
        }
        if (!this.#cachedKey) {
          this.#cachedKey = await deriveSymmetricKeyFromPassword(version, password);
          await this.#persistInternalSigners();
        }
        this.#unlock();
        this.#emitInternalSigners();
        return true;
      }
      async lock() {
        this.lastActivity = undefined;
        this.lastOutsideActivity = undefined;
        this.#cachedKey = null;
        this.#signerMetadata = {};
        this.#keyPairs = [];
        this.#clearSession();
        this.emitter.emit("locked", true);
        this.#emitInternalSigners();
      }
      markOutsideActivity() {
        if (typeof this.lastOutsideActivity !== "undefined") {
          this.lastOutsideActivity = Date.now();
        }
      }
      async autolockIfNeeded() {
        if (typeof this.lastActivity === "undefined" || typeof this.lastOutsideActivity === "undefined") {
          if (!this.locked()) {
            await this.lock();
          }
          return;
        }
        const now = Date.now();
        const timeSinceLastActivity = now - this.lastActivity;
        const timeSinceLastOutsideActivity = now - this.lastOutsideActivity;
        if (timeSinceLastActivity >= this.#internalAutoLockInterval) {
          this.lock();
        } else if (timeSinceLastOutsideActivity >= this.#internalAutoLockInterval) {
          this.lock();
        }
      }
      requireUnlocked() {
        if (this.locked()) {
          throw new Error("InternalSignerService must be unlocked.");
        }
        this.lastActivity = Date.now();
        this.markOutsideActivity();
      }
      async importSigner(signerMetadata) {
        this.requireUnlocked();
        try {
          let address;
          if (signerMetadata.type === SignerSourceTypes.keyPair) {
            address = await this.#importKeyPair(signerMetadata.mnemonic);
          } else if (signerMetadata.type === SignerSourceTypes.jsonFile) {
            const {jsonFile, password} = signerMetadata;
            address = await this.#importJSON(jsonFile, password);
          } else {
            throw new Error("Unexpected signer type encountered during Signer import");
          }
          const normalizedAddress = normalizeQEVMAddress(address);
          this.#hiddenAccounts[normalizedAddress] = false;
          await this.#persistInternalSigners();
          this.emitter.emit("address", normalizedAddress);
          this.#emitInternalSigners();
          return normalizedAddress;
        } catch (error) {
          lib_logger.error("Signer import failed:", error);
          return null;
        }
      }
      async #importKeyPair(mnemonics) {
        const normalizedMnemonics = normalizeSeedPhrase(mnemonics);
        const newWallet = await qethers_lib.Wallet.create(normalizedMnemonics);
        const normalizedAddress = normalizeQEVMAddress(newWallet.address);
        if (this.#findSigner(normalizedAddress)) {
          return normalizedAddress;
        }
        this.#keyPairs.push(newWallet);
        this.#signerMetadata[normalizedAddress] = {
          source: SignerImportSource.import
        };
        return normalizedAddress;
      }
      async #importJSON(jsonFile, password) {
        const newWallet = await qethers_lib.Wallet.fromEncryptedJson(jsonFile, password);
        const normalizedAddress = normalizeQEVMAddress(newWallet.address);
        if (this.#findSigner(normalizedAddress)) {
          return normalizedAddress;
        }
        this.#keyPairs.push(newWallet);
        this.#signerMetadata[normalizedAddress] = {
          source: SignerImportSource.import
        };
        return normalizedAddress;
      }
      getSignerSourceForAddress(address) {
        const signerWithType = this.#findSigner(address);
        if (!signerWithType) return null;
        const normalizedAddress = normalizeQEVMAddress(address);
        const metadataKeys = Object.keys(this.#signerMetadata);
        const matchingMetadataKey = metadataKeys.find((key => normalizeQEVMAddress(key) === normalizedAddress));
        if (matchingMetadataKey) {
          return this.#signerMetadata[matchingMetadataKey].source;
        }
        return null;
      }
      getKeyPairs() {
        this.requireUnlocked();
        return this.#keyPairs.map((wallet => ({
          privateKey: wallet.privateKey,
          publicKey: wallet.publicKey,
          address: normalizeQEVMAddress(wallet.address)
        })));
      }
      async removeAccount(address) {
        const normalizedAddress = normalizeQEVMAddress(address);
        this.#hiddenAccounts[normalizedAddress] = true;
        const hiddenAccountKeys = Object.keys(this.#hiddenAccounts);
        hiddenAccountKeys.forEach((key => {
          if (normalizeQEVMAddress(key) === normalizedAddress) {
            this.#hiddenAccounts[key] = true;
          }
        }));
        const keyPairSigner = this.#findkeyPair(normalizedAddress);
        if (keyPairSigner === null) return;
        if (keyPairSigner !== null) {
          this.#removekeyPair(normalizedAddress);
        }
        await this.#persistInternalSigners();
        this.#emitInternalSigners();
      }
      #removekeyPair(address) {
        const normalizedAddress = normalizeQEVMAddress(address);
        const filteredKeyPairs = this.#keyPairs.filter((wallet => normalizeQEVMAddress(wallet.address) !== normalizedAddress));
        if (filteredKeyPairs.length === this.#keyPairs.length) {
          throw new Error(`Attempting to remove wallet that does not exist. Address: (${address})`);
        }
        this.#keyPairs = filteredKeyPairs;
        const metadataKeys = Object.keys(this.#signerMetadata);
        const matchingMetadataKey = metadataKeys.find((key => normalizeQEVMAddress(key) === normalizedAddress));
        if (matchingMetadataKey) {
          delete this.#signerMetadata[matchingMetadataKey];
        }
        return filteredKeyPairs;
      }
      async exportPrivateKey(address) {
        this.requireUnlocked();
        const signerKeyPair = this.#findSigner(address);
        if (!signerKeyPair) {
          lib_logger.error(`Export private-public key pair for address ${address} failed`);
          return null;
        }
        return signerKeyPair.signer.privateKey;
      }
      async exportMnemonic(_address) {
        throw new Error("This needs to be implemented to return mnemonics from the Wallet, not the keyring");
      }
      #findkeyPair(account) {
        const normalizedAccount = normalizeQEVMAddress(account);
        const keyPair = this.#keyPairs.find((item => normalizeQEVMAddress(item.address) === normalizedAccount));
        return keyPair ?? null;
      }
      #findSigner(account) {
        const keyPair = this.#findkeyPair(account);
        if (keyPair) {
          return {
            signer: keyPair,
            type: SignerSourceTypes.keyPair
          };
        }
        return null;
      }
      async signTransaction(addressOnNetwork, txRequest) {
        this.requireUnlocked();
        const {address: account, network} = addressOnNetwork;
        const signerKeyPair = this.#findSigner(account);
        if (!signerKeyPair) {
          throw new Error(`Signing transaction failed. Signer for address ${account} was not found.`);
        }
        const ethersTxRequest = ethersTransactionFromTransactionRequest(txRequest);
        const signedRawTx = await signerKeyPair.signer.signTransaction(ethersTxRequest);
        const tx = (0, transactions_lib.parse)(signedRawTx);
        if (!tx.hash || !tx.from || !tx.signature) {
          throw new Error("Transaction doesn't appear to have been signed.");
        }
        const {to, gasPrice, gasLimit, maxFeePerGas, maxPriorityFeePerGas, hash, from, nonce, data, value, type, signature} = tx;
        if (typeof maxPriorityFeePerGas === "undefined" || typeof maxFeePerGas === "undefined" || type !== 2) {
          const signedTx = {
            hash,
            from,
            to,
            nonce,
            input: data,
            value: value.toBigInt(),
            type,
            gasPrice: gasPrice?.toBigInt() ?? null,
            gasLimit: gasLimit.toBigInt(),
            maxFeePerGas: null,
            maxPriorityFeePerGas: null,
            signature,
            blockHash: null,
            blockHeight: null,
            asset: network.baseAsset,
            network
          };
          return signedTx;
        }
        const signedTx = {
          hash,
          from,
          to,
          nonce,
          input: data,
          value: value.toBigInt(),
          type,
          gasPrice: null,
          maxFeePerGas: maxFeePerGas.toBigInt(),
          maxPriorityFeePerGas: maxPriorityFeePerGas.toBigInt(),
          gasLimit: gasLimit.toBigInt(),
          signature,
          blockHash: null,
          blockHeight: null,
          asset: network.baseAsset,
          network
        };
        return signedTx;
      }
      async signTypedData({typedData, account}) {
        this.requireUnlocked();
        const {domain, types, message} = typedData;
        const signerWithType = this.#findSigner(account);
        if (!signerWithType) {
          throw new Error(`Signing data failed. Signer for address ${account} was not found.`);
        }
        const {EIP712Domain: _, ...typesForSigning} = types;
        try {
          const signature = await signerWithType.signer._signTypedData(domain, typesForSigning, message);
          return signature;
        } catch (error) {
          throw new Error("Signing data failed");
        }
      }
      async personalSign({signingData, account}) {
        this.requireUnlocked();
        const signerWithType = this.#findSigner(account);
        if (!signerWithType) {
          throw new Error(`Personal sign failed. Signer for address ${account} was not found.`);
        }
        const messageBytes = (0, lib_utils.arrayify)(signingData);
        try {
          const signature = await signerWithType.signer.signMessage(messageBytes);
          return signature;
        } catch (error) {
          throw new Error("Signing data failed");
        }
      }
      generateNewMnemonics() {
        this.requireUnlocked();
        const wordlist = qethers_lib.wordlists.en;
        const WORD_COUNT = 24;
        const ENTROPY_BITS = 256;
        const entropyBytes = crypto_browserify.randomBytes(ENTROPY_BITS / 8);
        const hash = crypto_browserify.createHash("sha256").update(entropyBytes).digest();
        const checksumBits = ENTROPY_BITS / 32;
        const allBytes = internal_signer_Buffer.concat([ entropyBytes, hash.slice(0, 1) ]);
        let bitString = "";
        for (const byte of allBytes) {
          bitString += byte.toString(2).padStart(8, "0");
        }
        bitString = bitString.slice(0, ENTROPY_BITS + checksumBits);
        const result = [];
        for (let i = 0; i < WORD_COUNT; i++) {
          const chunk = bitString.slice(i * 11, (i + 1) * 11);
          const index = parseInt(chunk, 2);
          result.push(wordlist.getWord(index));
        }
        const normalized = normalizeSeedPhrase(result.join(" ")).split(" ");
        return {
          id: "AA",
          mnemonic: normalized
        };
      }
      #emitInternalSigners() {
        if (this.locked()) {
          this.emitter.emit("internalSigners", {
            keyPairs: [],
            metadata: {}
          });
        } else {
          const keyPairs = this.getKeyPairs();
          this.emitter.emit("internalSigners", {
            keyPairs,
            metadata: {
              ...this.#signerMetadata
            }
          });
        }
      }
      async #persistInternalSigners() {
        this.requireUnlocked();
        if (this.#cachedKey !== null) {
          const SerializedKeyPairs = this.#keyPairs.map((wallet => ({
            version: 1,
            privateKey: wallet.privateKey,
            publicKey: wallet.publicKey
          })));
          const hiddenAccounts = {
            ...this.#hiddenAccounts
          };
          const metadata = {
            ...this.#signerMetadata
          };
          const vault = await encryptVault({
            version: this.#cachedVaultVersion,
            passwordOrSaltedKey: this.#cachedKey,
            vault: {
              keyPairs: SerializedKeyPairs,
              metadata,
              hiddenAccounts
            }
          });
          await writeLatestEncryptedVault(vault);
        }
      }
      async #validateSession() {
        try {
          if (typeof window !== "undefined" && window.sessionStorage) {
            const sessionId = window.sessionStorage.getItem("qwal_session");
            const unlockTimestamp = window.sessionStorage.getItem("qwal_unlock_time");
            if (!sessionId || !unlockTimestamp) {
              if (!this.locked()) {
                await this.lock();
              }
              return;
            }
            const unlockTime = parseInt(unlockTimestamp, 10);
            const now = Date.now();
            const sessionValid = now - unlockTime < 24 * 60 * 60 * 1e3;
            if (!sessionValid) {
              window.sessionStorage.removeItem("qwal_session");
              window.sessionStorage.removeItem("qwal_unlock_time");
              if (!this.locked()) {
                await this.lock();
              }
              return;
            }
            this.#sessionId = sessionId;
          }
        } catch (error) {
          lib_logger.warn("Session validation failed, ensuring wallet is locked:", error);
          if (!this.locked()) {
            await this.lock();
          }
        }
      }
      #createSession() {
        try {
          if (typeof window !== "undefined" && window.sessionStorage) {
            const sessionId = `qwal_session_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
            const unlockTime = Date.now();
            window.sessionStorage.setItem("qwal_session", sessionId);
            window.sessionStorage.setItem("qwal_unlock_time", unlockTime.toString());
            this.#sessionId = sessionId;
          }
        } catch (error) {
          lib_logger.warn("Failed to create session:", error);
        }
      }
      #clearSession() {
        try {
          if (typeof window !== "undefined" && window.sessionStorage) {
            window.sessionStorage.removeItem("qwal_session");
            window.sessionStorage.removeItem("qwal_unlock_time");
          }
        } catch (error) {
          lib_logger.warn("Failed to clear session:", error);
        }
        this.#sessionId = null;
      }
    }
    var jtd_validators = __webpack_require__(1415);
    var json_validators = __webpack_require__(5307);
    const abi = [ "function tokenURI(uint256 _tokenId) external view returns (string)" ];
    async function getTokenURI(provider, tokenAddress, tokenID) {
      const tokenContract = new qethers_lib.Contract(tokenAddress, abi).connect(provider);
      return tokenContract.tokenURI(tokenID);
    }
    async function getTokenMetadata(provider, tokenAddress, tokenID) {
      const uri = await getTokenURI(provider, tokenAddress, tokenID);
      if (uri) {
        const jsonResponse = await (0, web_lib.fetchJson)(uri);
        if ((0, jtd_validators.QJ)(jsonResponse)) {
          return {
            name: jsonResponse.name,
            description: jsonResponse.description,
            image: jsonResponse.image
          };
        }
        lib_logger.warn("Invalid QERC-721 metadata", tokenAddress, tokenID, jsonResponse);
      } else {
        lib_logger.warn("No token URI was found, perhaps this isn't an QERC-721 metadata-compliant NFT?", tokenAddress, tokenID);
      }
      return undefined;
    }
    const ipfsGateway = new URL("https://ipfs.io/ipfs/");
    const arweaveGateway = new URL("https://arweave.net/");
    function changeURLProtocolAndBase(url, baseURL) {
      const newURL = new URL(url);
      newURL.protocol = baseURL.protocol;
      newURL.hostname = baseURL.hostname;
      newURL.pathname = `${baseURL.pathname}/${url.hostname}`;
      if (url.pathname !== "" && url.pathname !== "/") {
        newURL.pathname += url.pathname;
      }
      return newURL;
    }
    function storageGatewayURL(url) {
      const protocol = url.slice(0, url.indexOf("//"));
      switch (protocol) {
       case "ipfs:":
        {
          const contentId = url.split("ipfs://")[1];
          return new URL(contentId, ipfsGateway);
        }

       case "ar:":
        return changeURLProtocolAndBase(new URL(url), arweaveGateway);

       default:
        return new URL(url);
      }
    }
    const QEVM_NAME_SUPPORTED_NETWORKS = [ ZEUS ];
    function ensResolverFor(chainService) {
      return {
        type: "ENS",
        canAttemptNameResolution() {
          return true;
        },
        canAttemptAvatarResolution(addressOrNameOnNetwork) {
          if ("name" in addressOrNameOnNetwork) {
            return this.canAttemptAddressResolution(addressOrNameOnNetwork);
          }
          return true;
        },
        canAttemptAddressResolution({name, network}) {
          return name.endsWith(".qevm") && QEVM_NAME_SUPPORTED_NETWORKS.some((supportedNetwork => sameNetwork(network, supportedNetwork)));
        },
        async lookUpAddressForName({name, network}) {
          const address = await (chainService.providerForNetwork(ZEUS)?.resolveName(name));
          if (address === undefined || address === null) {
            return undefined;
          }
          return {
            address,
            network
          };
        },
        async lookUpAvatar(addressOrNameOnNetwork) {
          const {network} = addressOrNameOnNetwork;
          const {name} = "name" in addressOrNameOnNetwork ? addressOrNameOnNetwork : await this.lookUpNameForAddress(addressOrNameOnNetwork) ?? {
            name: undefined
          };
          const provider = chainService.providerForNetwork(ZEUS);
          if (name === undefined || provider === undefined) {
            return undefined;
          }
          const {url: avatarUrn} = await ((await provider.getResolver(name))?.getAvatar()) ?? {
            url: undefined
          };
          if (avatarUrn === undefined) {
            return undefined;
          }
          return {
            uri: avatarUrn,
            network
          };
        },
        async lookUpNameForAddress({address, network}) {
          const name = await (chainService.providerForNetwork(ZEUS)?.lookupAddress(address));
          if (name === undefined || name === null) {
            return undefined;
          }
          return {
            name,
            network
          };
        }
      };
    }
    function addressBookResolverFor(preferenceService) {
      return {
        type: "qwal-address-book",
        canAttemptNameResolution() {
          return true;
        },
        canAttemptAvatarResolution() {
          return false;
        },
        canAttemptAddressResolution() {
          return true;
        },
        async lookUpAddressForName(nameOnNetwork) {
          return preferenceService.lookUpAddressForName(nameOnNetwork);
        },
        async lookUpAvatar() {
          throw new Error("Avatar resolution not supported in address book.");
        },
        async lookUpNameForAddress(addressOnNetwork) {
          return preferenceService.lookUpNameForAddress(addressOnNetwork);
        }
      };
    }
    function knownContractResolverFor(preferenceService) {
      return {
        type: "qwal-known-contracts",
        canAttemptNameResolution() {
          return true;
        },
        canAttemptAvatarResolution() {
          return false;
        },
        canAttemptAddressResolution() {
          return true;
        },
        lookUpAddressForName: preferenceService.lookUpAddressForContractName.bind(preferenceService),
        async lookUpAvatar() {
          throw new Error("Avatar resolution not supported in known contracts resolver.");
        },
        lookUpNameForAddress: preferenceService.lookUpNameForContractAddress.bind(preferenceService)
      };
    }
    const resolvers = {
      ensResolverFor,
      addressBookResolverFor,
      knownContractResolverFor
    };
    const MINIMUM_RECORD_EXPIRY = 10 * SECOND;
    class NameService extends BaseService {
      resolvers=[];
      cachedResolvedEIP155Avatars={};
      cachedResolvedNames={
        QEVM: {}
      };
      static create=async (chainService, preferenceService) => new this(await chainService, await preferenceService);
      constructor(chainService, preferenceService) {
        super({});
        this.chainService = chainService;
        this.resolvers = [ addressBookResolverFor(preferenceService), knownContractResolverFor(preferenceService), ensResolverFor(chainService) ];
        preferenceService.emitter.on("addressBookEntryModified", (async ({network, address}) => {
          this.clearNameCacheEntry(network.chainID, address);
          await this.lookUpName({
            network,
            address
          });
        }));
        chainService.emitter.on("newAccountToTrack", (async addressOnNetwork => {
          try {
            await this.lookUpName(addressOnNetwork);
          } catch (error) {
            lib_logger.error("Error fetching name for address", addressOnNetwork, error);
          }
        }));
        this.emitter.on("resolvedName", (async ({from: {addressOnNetwork}}) => {
          try {
            const avatar = await this.lookUpAvatar(addressOnNetwork);
            if (avatar) {
              this.emitter.emit("resolvedAvatar", avatar);
            }
          } catch (error) {
            lib_logger.error("Error fetching avatar for address", addressOnNetwork, error);
          }
        }));
      }
      async lookUpEthereumAddress(nameOnNetwork) {
        const workingResolvers = this.resolvers.filter((resolver => resolver.canAttemptAddressResolution(nameOnNetwork)));
        const firstMatchingResolution = (await Promise.allSettled(workingResolvers.map((async resolver => ({
          type: resolver.type,
          resolved: await resolver.lookUpAddressForName(nameOnNetwork)
        }))))).filter(isFulfilledPromise).find((({value: {resolved}}) => resolved !== undefined))?.value;
        if (firstMatchingResolution === undefined || firstMatchingResolution.resolved === undefined) {
          return undefined;
        }
        const {type: resolverType, resolved: addressOnNetwork} = firstMatchingResolution;
        const normalizedAddressOnNetwork = normalizeAddressOnNetwork(addressOnNetwork);
        const resolvedRecord = {
          from: nameOnNetwork,
          resolved: {
            addressOnNetwork: normalizedAddressOnNetwork
          },
          system: resolverType
        };
        this.emitter.emit("resolvedAddress", resolvedRecord);
        return resolvedRecord;
      }
      async lookUpName(addressOnNetwork, checkCache = true) {
        const {address, network} = normalizeAddressOnNetwork(addressOnNetwork);
        if (!this.cachedResolvedNames[network.family][network.chainID]) {
          this.cachedResolvedNames[network.family][network.chainID] = {};
        }
        const cachedResolvedNameRecord = this.cachedResolvedNames[network.family]?.[network.chainID]?.[address];
        if (checkCache && cachedResolvedNameRecord) {
          const {resolved: {expiresAt}} = cachedResolvedNameRecord;
          if (expiresAt >= Date.now()) {
            return cachedResolvedNameRecord;
          }
        }
        const workingResolvers = this.resolvers.filter((resolver => resolver.canAttemptNameResolution({
          address,
          network
        })));
        const localResolvers = [ ...workingResolvers ].filter((resolver => resolver.type === "qwal-address-book" || resolver.type === "qwal-known-contracts"));
        const remoteResolvers = [ ...workingResolvers ].filter((resolver => resolver.type !== "qwal-address-book" && resolver.type !== "qwal-known-contracts"));
        let firstMatchingResolution = (await Promise.allSettled(localResolvers.map((async resolver => ({
          type: resolver.type,
          resolved: await resolver.lookUpNameForAddress({
            address,
            network
          })
        }))))).filter(isFulfilledPromise).find((({value: {resolved}}) => resolved !== undefined))?.value;
        if (!firstMatchingResolution) {
          firstMatchingResolution = (await Promise.allSettled(remoteResolvers.map((async resolver => ({
            type: resolver.type,
            resolved: await resolver.lookUpNameForAddress({
              address,
              network
            })
          }))))).filter(isFulfilledPromise).find((({value: {resolved}}) => resolved !== undefined))?.value;
        }
        if (firstMatchingResolution === undefined || firstMatchingResolution.resolved === undefined) {
          return undefined;
        }
        const {type: resolverType, resolved: nameOnNetwork} = firstMatchingResolution;
        const nameRecord = {
          from: {
            addressOnNetwork: {
              address,
              network
            }
          },
          resolved: {
            nameOnNetwork,
            expiresAt: Date.now() + MINIMUM_RECORD_EXPIRY
          },
          system: resolverType
        };
        const cachedNameOnNetwork = cachedResolvedNameRecord?.resolved.nameOnNetwork;
        this.cachedResolvedNames[network.family][network.chainID][address] = nameRecord;
        if (cachedNameOnNetwork?.name !== nameOnNetwork.name) {
          this.emitter.emit("resolvedName", nameRecord);
        }
        return nameRecord;
      }
      clearNameCacheEntry(chainId, address) {
        if (this.cachedResolvedNames.QEVM[chainId]?.[address] !== undefined) {
          delete this.cachedResolvedNames.QEVM[chainId][address];
        }
      }
      removeAccount(address) {
        const chainIds = Object.keys(this.cachedResolvedNames.QEVM);
        chainIds.forEach((chainId => {
          this.clearNameCacheEntry(chainId, address);
        }));
      }
      async lookUpAvatar(addressOnNetwork) {
        const workingResolvers = this.resolvers.filter((resolver => resolver.canAttemptAvatarResolution(addressOnNetwork)));
        const firstMatchingResolution = (await Promise.allSettled(workingResolvers.map((async resolver => ({
          type: resolver.type,
          resolved: await resolver.lookUpAvatar(addressOnNetwork)
        }))))).filter(isFulfilledPromise).find((({value: {resolved}}) => resolved !== undefined))?.value;
        if (firstMatchingResolution === undefined || firstMatchingResolution.resolved === undefined) {
          return undefined;
        }
        const {type: resolverType, resolved: {uri: avatarUri}} = firstMatchingResolution;
        const baseResolvedAvatar = {
          from: {
            addressOnNetwork
          },
          system: resolverType
        };
        if (avatarUri instanceof URL) {
          return {
            ...baseResolvedAvatar,
            resolved: {
              avatar: storageGatewayURL(avatarUri.href)
            }
          };
        }
        if (avatarUri.match(/^eip155:1\/erc721:/)) {
          const normalizedAvatarUri = avatarUri.toLowerCase();
          if (normalizedAvatarUri in this.cachedResolvedEIP155Avatars) {
            return this.cachedResolvedEIP155Avatars[normalizedAvatarUri];
          }
          const provider = this.chainService.providerForNetwork(addressOnNetwork.network);
          const [, , , erc721Address, nftID] = avatarUri.split(/[:/]/);
          if (provider !== undefined && erc721Address !== undefined && nftID !== undefined) {
            const metadata = await getTokenMetadata(provider, erc721Address, BigInt(nftID));
            if (metadata !== undefined && metadata.image !== undefined) {
              const {image} = metadata;
              const resolvedGateway = {
                ...baseResolvedAvatar,
                resolved: {
                  avatar: storageGatewayURL(image)
                }
              };
              this.cachedResolvedEIP155Avatars[normalizedAvatarUri] = resolvedGateway;
              return resolvedGateway;
            }
          }
        }
        try {
          const plainURL = storageGatewayURL(avatarUri);
          return {
            ...baseResolvedAvatar,
            resolved: {
              avatar: plainURL
            }
          };
        } catch (error) {
          lib_logger.error("Unexpected avatar URI scheme", avatarUri);
          return undefined;
        }
      }
    }
    const getSignerRecordId = signer => {
      switch (signer.type) {
       case "keyPair":
        return `${signer.type}/${signer.walletID}`;

       default:
        throw new Error("This is not supported in Qwal");
      }
    };
    class PreferenceDatabase extends Xn {
      constructor() {
        super("qwal/preferences");
        this.version(1).stores({
          preferences: "++id",
          signersSettings: "&id",
          shownDismissableItems: "&id,shown"
        });
        this.on("populate", (tx => {
          tx.table("preferences").add({
            savedAt: Date.now(),
            ...defaults
          });
        }));
      }
      async getPreferences() {
        return this.preferences.reverse().first();
      }
      async setAutoLockInterval(newValue) {
        await this.preferences.toCollection().modify((storedPreferences => {
          const update = {
            autoLockInterval: newValue
          };
          Object.assign(storedPreferences, update);
        }));
      }
      async setShouldShowNotifications(newValue) {
        await this.preferences.toCollection().modify((storedPreferences => {
          const update = {
            shouldShowNotifications: newValue
          };
          Object.assign(storedPreferences, update);
        }));
      }
      async setDefaultWalletValue(defaultWallet) {
        await this.preferences.toCollection().modify({
          defaultWallet
        });
      }
      async setSelectedAccount(addressNetwork) {
        await this.preferences.toCollection().modify({
          selectedAccount: addressNetwork
        });
      }
      async getAccountSignerSettings() {
        return this.signersSettings.toArray();
      }
      async updateSignerTitle(signer, title) {
        await this.signersSettings.put({
          id: getSignerRecordId(signer),
          signer,
          title
        });
        return this.signersSettings.toArray();
      }
      async deleteAccountSignerSettings(signer) {
        await this.signersSettings.delete(getSignerRecordId(signer));
        return this.signersSettings.toArray();
      }
      async markDismissableItemAsShown(item) {
        await this.shownDismissableItems.put({
          id: item,
          shown: true
        });
      }
      async getShownDismissableItems() {
        return (await this.shownDismissableItems.toArray()).map((({id}) => id));
      }
      async wasDismissableItemAlreadyShown(item) {
        return (await this.shownDismissableItems.get(item))?.shown ?? false;
      }
    }
    async function getOrCreateDB() {
      return new PreferenceDatabase;
    }
    const sameAddressBookEntry = (a, b) => normalizeQEVMAddress(a.address) === normalizeQEVMAddress(b.address) && sameNetwork(a.network, b.network);
    const BUILT_IN_CONTRACTS = [ {
      network: ZEUS,
      address: normalizeQEVMAddress("0x0000000000000000000000000000000000000000000000000000000000000000"),
      name: "Empty Placeholder"
    } ];
    class PreferenceService extends BaseService {
      knownContracts=BUILT_IN_CONTRACTS;
      addressBook=[];
      static create=async () => {
        const db = await getOrCreateDB();
        return new this(db);
      };
      constructor(db) {
        super();
        this.db = db;
      }
      async internalStartService() {
        await super.internalStartService();
        this.emitter.emit("initializeDefaultWallet", await this.getDefaultWallet());
        this.emitter.emit("initializeSelectedAccount", await this.getSelectedAccount());
        this.emitter.emit("initializeShownDismissableItems", await this.getShownDismissableItems());
        this.emitter.emit("initializeNotificationsPreferences", await this.getShouldShowNotificationsPreferences());
      }
      async internalStopService() {
        this.db.close();
        await super.internalStopService();
      }
      addOrEditNameInAddressBook(newEntry) {
        const correspondingEntryIndex = this.addressBook.findIndex((entry => sameAddressBookEntry(newEntry, entry)));
        if (correspondingEntryIndex !== -1) {
          this.addressBook[correspondingEntryIndex] = newEntry;
        } else {
          this.addressBook.push({
            network: newEntry.network,
            name: newEntry.name,
            address: normalizeQEVMAddress(newEntry.address)
          });
        }
        this.emitter.emit("addressBookEntryModified", newEntry);
      }
      lookUpAddressForName({name, network}) {
        return this.addressBook.find((({name: entryName, network: entryNetwork}) => sameNetwork(network, entryNetwork) && name === entryName));
      }
      lookUpNameForAddress(addressOnNetwork) {
        return this.addressBook.find((addressBookEntry => sameAddressBookEntry(addressBookEntry, addressOnNetwork)));
      }
      async lookUpAddressForContractName({name, network}) {
        return this.knownContracts.find((({name: entryName, network: entryNetwork}) => sameNetwork(network, entryNetwork) && name === entryName));
      }
      async lookUpNameForContractAddress({address, network}) {
        return this.knownContracts.find((({address: entryAddress, network: entryNetwork}) => sameNetwork(network, entryNetwork) && normalizeQEVMAddress(address) === normalizeQEVMAddress(entryAddress)));
      }
      async deleteAccountSignerSettings(signer) {
        const updatedSignerSettings = await this.db.deleteAccountSignerSettings(signer);
        this.emitter.emit("updatedSignerSettings", updatedSignerSettings);
      }
      async updateAccountSignerTitle(signer, title) {
        const updatedSignerSettings = this.db.updateSignerTitle(signer, title);
        this.emitter.emit("updatedSignerSettings", await updatedSignerSettings);
      }
      async markDismissableItemAsShown(item) {
        await this.db.markDismissableItemAsShown(item);
        this.emitter.emit("dismissableItemMarkedAsShown", item);
      }
      async getShownDismissableItems() {
        return this.db.getShownDismissableItems();
      }
      async getShouldShowNotificationsPreferences() {
        return (await this.db.getPreferences()).shouldShowNotifications;
      }
      async setShouldShowNotifications(shouldShowNotifications) {
        if (shouldShowNotifications) {
          const granted = await browser_polyfill_default().permissions.request({
            permissions: [ "notifications" ]
          });
          await this.db.setShouldShowNotifications(granted);
          this.emitter.emit("setNotificationsPermission", granted);
          return granted;
        }
        return false;
      }
      async getAccountSignerSettings() {
        return this.db.getAccountSignerSettings();
      }
      async getCurrency() {
        return (await this.db.getPreferences())?.currency;
      }
      async getTokenListPreferences() {
        return (await this.db.getPreferences())?.tokenLists;
      }
      async getDefaultWallet() {
        return (await this.db.getPreferences())?.defaultWallet;
      }
      async getAutoLockInterval() {
        return (await this.db.getPreferences()).autoLockInterval;
      }
      async updateAutoLockInterval(newValue) {
        await this.db.setAutoLockInterval(newValue);
        this.emitter.emit("updateAutoLockInterval", newValue);
      }
      async setDefaultWalletValue(newDefaultWalletValue) {
        return this.db.setDefaultWalletValue(newDefaultWalletValue);
      }
      async getSelectedAccount() {
        return (await this.db.getPreferences())?.selectedAccount;
      }
      async setSelectedAccount(addressNetwork) {
        return this.db.setSelectedAccount(addressNetwork);
      }
    }
    const WINDOW_PROVIDER_TARGET = "qwallet-window-provider";
    const PROVIDER_BRIDGE_TARGET = "qwallet-provider-bridge";
    const EXTERNAL_PORT_NAME = "qwallet-external";
    const INTERNAL_PORT_NAME = "qwallet-internal";
    function getType(arg) {
      return Object.prototype.toString.call(arg).slice("[object ".length, -1);
    }
    function isObject(arg) {
      return getType(arg) === "Object";
    }
    function isArray(arg) {
      return Array.isArray(arg);
    }
    function isUndefined(arg) {
      return typeof arg === "undefined";
    }
    function isString(arg) {
      return getType(arg) === "String";
    }
    function isNumber(arg) {
      return getType(arg) === "Number";
    }
    function isMessageEvent(arg) {
      return arg instanceof MessageEvent;
    }
    function isRPCRequestParamsType(arg) {
      return isObject(arg) || isArray(arg);
    }
    function isWindowResponseEvent(arg) {
      return isMessageEvent(arg) && isString(arg.origin) && !isUndefined(arg.source) && isObject(arg.data) && isString(arg.data.id) && isString(arg.data.target) && !isUndefined(arg.data.result);
    }
    function isPortResponseEvent(arg) {
      return isObject(arg) && isString(arg.id) && !isUndefined(arg.result);
    }
    const AllowedQueryParamPage = {
      signTransaction: "/sign-transaction",
      addNewChain: "/add-evm-chain",
      dappPermission: "/dapp-permission",
      signData: "/sign-data",
      personalSignData: "/personal-sign"
    };
    function isAllowedQueryParamPage(url) {
      return Object.values(AllowedQueryParamPage).includes(url);
    }
    function isQwalInternalCommunication(arg) {
      return isObject(arg) && arg.id === "qwallet";
    }
    function isQwalConfigPayload(arg) {
      return isObject(arg) && arg.method === "qwal_getConfig";
    }
    function isQwalAccountPayload(arg) {
      return isObject(arg) && arg.method === "qwal_accountChanged" && isArray(arg.address);
    }
    const EIP1193_ERROR_CODES = {
      userRejectedRequest: {
        code: 4001,
        message: "The user rejected the request."
      },
      unauthorized: {
        code: 4100,
        message: "The requested method and/or account has not been authorized by the user."
      },
      unsupportedMethod: {
        code: 4200,
        message: "The Provider does not support the requested method."
      },
      disconnected: {
        code: 4900,
        message: "The Provider is disconnected from all chains."
      },
      chainDisconnected: {
        code: 4901,
        message: "The Provider is not connected to the requested chain."
      }
    };
    class EIP1193Error extends Error {
      constructor(eip1193Error) {
        super(eip1193Error.message);
        this.eip1193Error = eip1193Error;
      }
      toJSON() {
        return this.eip1193Error;
      }
    }
    function isEIP1193ErrorCodeNumber(code) {
      return isNumber(code) && Object.values(EIP1193_ERROR_CODES).map((e => e.code)).includes(code);
    }
    function isEIP1193Error(arg) {
      return isObject(arg) && isNumber(arg.code) && isEIP1193ErrorCodeNumber(arg.code) && isString(arg.message);
    }
    const keyPermissionsByChainIdAddressOrigin = (permissions, permissionMap) => {
      const map = permissionMap ?? {
        evm: {}
      };
      permissions.forEach((permission => {
        map.evm[permission.chainID] ??= {};
        map.evm[permission.chainID][permission.accountAddress] ??= {};
        map.evm[permission.chainID][permission.accountAddress][permission.origin] = permission;
      }));
      return map;
    };
    function parsedRPCErrorResponse(error) {
      try {
        const parsedError = JSON.parse(error.body).error;
        return {
          code: 4001,
          message: "message" in parsedError && parsedError.message ? parsedError.message[0].toUpperCase() + parsedError.message.slice(1) : EIP1193_ERROR_CODES.userRejectedRequest.message
        };
      } catch (err) {
        return undefined;
      }
    }
    function handleRPCErrorResponse(error) {
      let response;
      if (typeof error === "object" && error !== null) {
        if ("eip1193Error" in error) {
          const {eip1193Error} = error;
          if (isEIP1193Error(eip1193Error)) {
            response = eip1193Error;
          }
        } else if ("body" in error) {
          response = parsedRPCErrorResponse(error);
        } else if ("error" in error) {
          response = parsedRPCErrorResponse(error.error);
        }
      }
      return response ?? new EIP1193Error(EIP1193_ERROR_CODES.userRejectedRequest).toJSON();
    }
    const validateAddQuantumEVMChainParameter = ({chainId, chainName, blockExplorerUrls, iconUrls, nativeCurrency, rpcUrls}) => {
      if (!chainId || !chainName || !nativeCurrency || !blockExplorerUrls || !blockExplorerUrls.length || !rpcUrls || !rpcUrls.length) {
        throw new Error("Missing Chain Property");
      }
      if (!nativeCurrency.decimals || !nativeCurrency.name || !nativeCurrency.symbol) {
        throw new Error("Missing Currency Property");
      }
      return {
        chainId: chainId.startsWith("0x") ? String(parseInt(chainId, 16)) : chainId,
        chainName,
        nativeCurrency,
        blockExplorerUrl: blockExplorerUrls[0],
        iconUrl: iconUrls && iconUrls[0],
        rpcUrls
      };
    };
    function parseRPCRequestParams(enablingPermission, method, params) {
      switch (method) {
       case "eth_sign":
        return sameQEVMAddress(params[0], enablingPermission.accountAddress) ? params : [ params[1], params[0] ];

       case "personal_sign":
        return sameQEVMAddress(params[1], enablingPermission.accountAddress) ? params : [ params[1], params[0] ];

       default:
        return params;
      }
    }
    class ProviderBridgeServiceDatabase extends Xn {
      constructor() {
        super("qwal/provider-bridge-service");
        this.version(1).stores({
          dAppPermissions: "&[origin+accountAddress+chainID],origin,accountAddress,chainID"
        });
      }
      async getAllPermission() {
        const permissions = await this.dAppPermissions.toArray();
        return keyPermissionsByChainIdAddressOrigin(permissions);
      }
      async setPermission(permission) {
        return this.dAppPermissions.put(permission);
      }
      async deletePermission(origin, accountAddress, chainID) {
        return this.dAppPermissions.where({
          origin,
          accountAddress,
          chainID
        }).delete();
      }
      async deletePermissionByAddress(accountAddress) {
        return this.dAppPermissions.where({
          accountAddress
        }).delete();
      }
      async deletePermissionsByChain(chainID) {
        return this.dAppPermissions.where({
          chainID
        }).delete();
      }
      async checkPermission(origin, accountAddress, chainID) {
        return this.dAppPermissions.get({
          origin,
          accountAddress,
          chainID
        });
      }
    }
    async function db_getOrCreateDB() {
      return new ProviderBridgeServiceDatabase;
    }
    function checkPermissionSignTypedData(walletAddress, enablingPermission) {
      if (enablingPermission.state !== "allow" || !sameQEVMAddress(walletAddress, enablingPermission.accountAddress)) {
        throw new EIP1193Error(EIP1193_ERROR_CODES.unauthorized);
      }
    }
    function checkPermissionSign(walletAddress, enablingPermission) {
      if (enablingPermission.state !== "allow" || !sameQEVMAddress(walletAddress, enablingPermission.accountAddress)) {
        throw new EIP1193Error(EIP1193_ERROR_CODES.unauthorized);
      }
    }
    function checkPermissionSignTransaction(transactionRequest, enablingPermission) {
      if (typeof transactionRequest.chainId !== "undefined") {
        if (toHexChainID(transactionRequest.chainId) !== toHexChainID(enablingPermission.chainID)) {
          throw new EIP1193Error(EIP1193_ERROR_CODES.unauthorized);
        }
      }
      if (enablingPermission.state !== "allow" || !sameQEVMAddress(transactionRequest.from, enablingPermission.accountAddress)) {
        throw new EIP1193Error(EIP1193_ERROR_CODES.unauthorized);
      }
    }
    async function showExtensionPopup(url, additionalOptions = {}, onClose) {
      const {left = 0, top, width = 1920} = await browser_polyfill_default().windows.getCurrent();
      const popupWidth = 384;
      const popupHeight = 628;
      const queryString = new URLSearchParams({
        ...additionalOptions,
        page: url
      }).toString();
      const params = {
        url: `${browser_polyfill_default().runtime.getURL("popup.html")}?${queryString}`,
        type: "popup",
        left: left + width - popupWidth,
        top,
        width: popupWidth,
        height: popupHeight,
        focused: true
      };
      const window = await browser_polyfill_default().windows.create(params);
      if (onClose !== undefined) {
        const listener = windowId => {
          if (windowId === window.id) {
            onClose();
            browser_polyfill_default().windows.onRemoved.removeListener(listener);
          }
        };
        browser_polyfill_default().windows.onRemoved.addListener(listener);
      }
      return window;
    }
    const WEBSITE_ORIGIN = "https://quantumevm.com/" ?? 0;
    const QWAL_INTERNAL_ORIGIN = "@qwal-internal";
    class ProviderBridgeService extends BaseService {
      #pendingPermissionsRequests={};
      #pendingAddNetworkRequests={};
      addNetworkRequestId=0;
      openPorts=[];
      static create=async (internalEthereumProviderService, preferenceService) => new this(await db_getOrCreateDB(), await internalEthereumProviderService, await preferenceService);
      constructor(db, internalEthereumProviderService, preferenceService) {
        super();
        this.db = db;
        this.internalEthereumProviderService = internalEthereumProviderService;
        this.preferenceService = preferenceService;
      }
      async internalStartService() {
        await super.internalStartService();
        this.emitter.emit("initializeAllowedPages", await this.db.getAllPermission());
      }
      async onMessageListener(port, event) {
        const {url, tab} = port.sender;
        if (typeof url === "undefined") {
          return;
        }
        const {origin} = new URL(url);
        const response = {
          id: event.id,
          jsonrpc: "2.0",
          result: []
        };
        const network = await this.internalEthereumProviderService.getCurrentOrDefaultNetworkForOrigin(origin);
        const originPermission = await this.checkPermission(origin, network.chainID);
        if (origin === QWAL_INTERNAL_ORIGIN) {
          response.result = new EIP1193Error(EIP1193_ERROR_CODES.unauthorized).toJSON();
        } else if (isQwalConfigPayload(event.request)) {
          response.id = "qwallet";
          response.result = {
            method: event.request.method,
            defaultWallet: await this.preferenceService.getDefaultWallet(),
            chainId: toHexChainID(network.chainID)
          };
        } else if (event.request.method.startsWith("qwal_")) {
          switch (event.request.method) {
           case "qwal_setClaimReferrer":
            if (origin !== WEBSITE_ORIGIN) {
              lib_logger.warn(`invalid WEBSITE_ORIGIN ${WEBSITE_ORIGIN} when using a custom 'qwal_...' method`);
              return;
            }
            if (typeof event.request.params[0] !== "string") {
              lib_logger.warn("invalid 'qwal_setClaimReferrer' request");
              return;
            }
            this.emitter.emit("setClaimReferrer", String(event.request.params[0]));
            break;

           case "qwal_walletConnectInit":
            {
              const [wcUri] = event.request.params;
              if (typeof wcUri === "string") {
                await this.emitter.emit("walletConnectInit", wcUri);
              } else {
                lib_logger.warn("invalid 'qwal_walletConnectInit' request");
              }
              break;
            }

           default:
            lib_logger.debug(`Unknown method ${event.request.method} in 'ProviderBridgeService'`);
          }
          response.result = null;
        } else if (event.request.method === "eth_chainId" || event.request.method === "net_version") {
          response.result = await this.internalEthereumProviderService.routeSafeRPCRequest(event.request.method, event.request.params, origin);
        } else if (typeof originPermission !== "undefined") {
          response.result = await this.routeContentScriptRPCRequest(originPermission, event.request.method, event.request.params, origin);
        } else if (event.request.method === "eth_requestAccounts" || event.request.method === "wallet_requestPermissions") {
          const selectedAccount = await this.preferenceService.getSelectedAccount();
          const {address: accountAddress} = selectedAccount;
          const dAppChainID = Number(await this.internalEthereumProviderService.routeSafeRPCRequest("eth_chainId", [], origin)).toString();
          const [title, faviconUrl] = event.request.params.slice(-2);
          const existingPermission = await this.checkPermission(origin, dAppChainID);
          if (existingPermission !== undefined && existingPermission.state !== "allow" || this.#pendingPermissionsRequests[origin] !== undefined) {
            response.result = new EIP1193Error(EIP1193_ERROR_CODES.userRejectedRequest).toJSON();
          } else {
            const permissionRequest = {
              key: `${origin}_${accountAddress}_${dAppChainID}`,
              origin,
              chainID: dAppChainID,
              faviconUrl: faviconUrl || tab?.favIconUrl || "",
              title,
              state: "request",
              accountAddress
            };
            await this.requestPermission(permissionRequest);
            const newlyPersistedPermission = await this.checkPermission(origin, dAppChainID);
            if (typeof newlyPersistedPermission !== "undefined") {
              if (event.request.method === "wallet_requestPermissions") {
                response.result = await this.routeContentScriptRPCRequest(newlyPersistedPermission, "wallet_getPermissions", event.request.params, origin);
              } else {
                response.result = await this.routeContentScriptRPCRequest(newlyPersistedPermission, "eth_accounts", event.request.params, origin);
              }
              await this.internalEthereumProviderService.switchToSupportedNetwork(origin, network);
            } else {
              response.result = new EIP1193Error(EIP1193_ERROR_CODES.userRejectedRequest).toJSON();
            }
          }
        } else if (event.request.method === "eth_accounts") {
          const dAppChainID = Number(await this.internalEthereumProviderService.routeSafeRPCRequest("eth_chainId", [], origin)).toString();
          const permission = await this.checkPermission(origin, dAppChainID);
          response.result = [];
          if (permission) {
            response.result = await this.routeContentScriptRPCRequest(permission, "eth_accounts", event.request.params, origin);
          }
        } else {
          response.result = new EIP1193Error(EIP1193_ERROR_CODES.unauthorized).toJSON();
        }
        port.postMessage(response);
      }
      notifyContentScriptAboutConfigChange(newDefaultWalletValue) {
        this.openPorts.forEach((p => {
          p.postMessage({
            id: "qwallet",
            result: {
              method: "qwal_getConfig",
              defaultWallet: newDefaultWalletValue,
              shouldReload: true
            }
          });
        }));
      }
      notifyContentScriptsAboutAddressChange(newAddress) {
        this.openPorts.forEach((async port => {
          const {origin} = new URL(port.sender?.url);
          const {chainID} = await this.internalEthereumProviderService.getCurrentOrDefaultNetworkForOrigin(origin);
          if (await this.checkPermission(origin, chainID)) {
            port.postMessage({
              id: "qwallet",
              result: {
                method: "qwal_accountChanged",
                address: [ newAddress ]
              }
            });
          } else {
            port.postMessage({
              id: "qwallet",
              result: {
                method: "qwal_accountChanged",
                address: []
              }
            });
          }
        }));
      }
      async requestPermission(permissionRequest) {
        this.emitter.emit("requestPermission", permissionRequest);
        const permissionPromise = new Promise((resolve => {
          this.#pendingPermissionsRequests[permissionRequest.origin] = resolve;
          showExtensionPopup(AllowedQueryParamPage.dappPermission, {}, (() => {
            resolve("Time to move on");
          }));
        }));
        const result = await permissionPromise;
        if (this.#pendingPermissionsRequests[permissionRequest.origin]) {
          this.#pendingPermissionsRequests[permissionRequest.origin](result);
          delete this.#pendingPermissionsRequests[permissionRequest.origin];
        }
        return result;
      }
      async grantPermission(permission) {
        if (permission.state !== "allow" || !permission.accountAddress) return;
        await this.db.setPermission(permission);
        this.#pendingPermissionsRequests[permission.origin]?.(permission);
      }
      async denyOrRevokePermission(permission) {
        if (permission.state !== "deny" || !permission.accountAddress) {
          return;
        }
        const {address} = await this.preferenceService.getSelectedAccount();
        const deleted = await this.db.deletePermission(permission.origin, address, permission.chainID);
        this.#pendingPermissionsRequests[permission.origin]?.("Time to move on");
        this.internalEthereumProviderService.unsetCurrentNetworkForOrigin(permission.origin, permission.chainID);
        if (deleted > 0) {
          this.notifyContentScriptsAboutAddressChange();
        }
      }
      async revokePermissionsForAddress(revokeAddress) {
        await this.db.deletePermissionByAddress(revokeAddress);
        this.notifyContentScriptsAboutAddressChange();
      }
      async checkPermission(origin, chainID) {
        const {address: selectedAddress} = await this.preferenceService.getSelectedAccount();
        const currentAddress = selectedAddress;
        return this.db.checkPermission(origin, currentAddress, chainID);
      }
      async revokePermissionsForChain(chainId) {
        await this.db.deletePermissionsByChain(chainId);
      }
      async routeSafeRequest(method, params, origin, popupPromise) {
        const response = await this.internalEthereumProviderService.routeSafeRPCRequest(method, params, origin).finally((async () => {
          const popup = await popupPromise;
          if (typeof popup.id !== "undefined") {
            browser_polyfill_default().windows.remove(popup.id);
          }
        }));
        return response;
      }
      async routeContentScriptRPCRequest(enablingPermission, method, rawParams, origin) {
        const params = parseRPCRequestParams(enablingPermission, method, rawParams);
        try {
          switch (method) {
           case "eth_requestAccounts":
           case "eth_accounts":
            return [ enablingPermission.accountAddress ];

           case "wallet_requestPermissions":
           case "wallet_getPermissions":
            return [ {
              parentCapability: "eth_accounts",
              caveats: [ {
                type: "restrictReturnedAccounts",
                value: [ enablingPermission.accountAddress ]
              } ],
              date: Date.now()
            } ];

           case "eth_signTypedData":
           case "eth_signTypedData_v1":
           case "eth_signTypedData_v3":
           case "eth_signTypedData_v4":
            checkPermissionSignTypedData(params[0], enablingPermission);
            return await this.routeSafeRequest(method, params, origin, showExtensionPopup(AllowedQueryParamPage.signData));

           case "eth_sign":
            checkPermissionSign(params[0], enablingPermission);
            return await this.routeSafeRequest(method, params, origin, showExtensionPopup(AllowedQueryParamPage.personalSignData));

           case "personal_sign":
            checkPermissionSign(params[1], enablingPermission);
            return await this.routeSafeRequest(method, params, origin, showExtensionPopup(AllowedQueryParamPage.personalSignData));

           case "eth_signTransaction":
           case "eth_sendTransaction":
            checkPermissionSignTransaction({
              ...params[0],
              nonce: undefined
            }, enablingPermission);
            return await this.routeSafeRequest(method, params, origin, showExtensionPopup(AllowedQueryParamPage.signTransaction));

           case "wallet_switchEthereumChain":
            return await this.internalEthereumProviderService.routeSafeRPCRequest(method, params, origin);

           case "wallet_addEthereumChain":
            {
              const id = this.addNetworkRequestId.toString();
              this.addNetworkRequestId += 1;
              const [rawChainData, address, siteTitle, favicon] = params;
              const validatedData = validateAddQuantumEVMChainParameter(rawChainData);
              const supportedNetwork = await this.internalEthereumProviderService.getTrackedNetworkByChainId(validatedData.chainId);
              if (supportedNetwork) {
                return await this.internalEthereumProviderService.routeSafeRPCRequest(method, params, origin);
              }
              const window = await showExtensionPopup(AllowedQueryParamPage.addNewChain, {
                requestId: id.toString()
              });
              browser_polyfill_default().windows.onRemoved.addListener((removed => {
                if (removed === window.id) {
                  this.handleAddNetworkRequest(id, false);
                }
              }));
              const userConfirmation = new Promise(((resolve, reject) => {
                this.#pendingAddNetworkRequests[id] = {
                  resolve,
                  reject,
                  data: {
                    ...validatedData,
                    favicon,
                    siteTitle
                  }
                };
              }));
              await userConfirmation;
              const account = await this.preferenceService.getSelectedAccount();
              await this.grantPermission({
                ...enablingPermission,
                key: `${origin}_${account.address}_${validatedData.chainId}`,
                chainID: validatedData.chainId
              });
              return await this.internalEthereumProviderService.routeSafeRPCRequest(method, [ validatedData, address ], origin);
            }

           default:
            {
              return await this.internalEthereumProviderService.routeSafeRPCRequest(method, params, origin);
            }
          }
        } catch (error) {
          lib_logger.error("Error processing request", error);
          return handleRPCErrorResponse(error);
        }
      }
      getNewCustomRPCDetails(requestId) {
        return this.#pendingAddNetworkRequests[requestId].data;
      }
      handleAddNetworkRequest(id, success) {
        const request = this.#pendingAddNetworkRequests[id];
        if (success) {
          request.resolve();
        } else {
          request.reject();
        }
      }
      async connectPort(port) {
        if (port.name === EXTERNAL_PORT_NAME && port.sender?.url) {
          port.onMessage.addListener((event => {
            if (!event || typeof event !== "object" || !("id" in event) || typeof event.id !== "string" || !("request" in event) || typeof event.request !== "object") {
              lib_logger.error("Unexpected event on port", event);
              return;
            }
            this.onMessageListener(port, event);
          }));
          port.onDisconnect.addListener((() => {
            this.openPorts = this.openPorts.filter((openPort => openPort !== port));
          }));
          this.openPorts.push(port);
          port.postMessage({
            id: "qwallet",
            jsonrpc: "2.0",
            result: {
              method: "qwal_getConfig",
              defaultWallet: await this.preferenceService.getDefaultWallet()
            }
          });
        }
      }
    }
    var events = __webpack_require__(7007);
    class QwalWindowProvider extends events.EventEmitter {
      chainId="MISSING_ENV_VAR".WINDOW_PROVIDER_DEFAULT_CHAIN_ID ?? "0x101";
      connected=false;
      isQwal=true;
      isWeb3=true;
      requestResolvers=new Map;
      providerInfo={
        label: "Qwal",
        injectedNamespace: "qwal",
        iconURL: "TODO",
        identityFlag: "isQwal",
        checkIdentity: provider => !!provider && !!provider.isQwal
      };
      constructor(transport) {
        super();
        this.transport = transport;
        const internalListener = event => {
          let result;
          if (isWindowResponseEvent(event) && isQwalInternalCommunication(event.data)) {
            if (event.origin !== this.transport.origin || event.source !== window || event.data.target !== WINDOW_PROVIDER_TARGET) {
              return;
            }
            result = event.data.result;
          } else if (isPortResponseEvent(event) && isQwalInternalCommunication(event)) {
            result = event.result;
          } else {
            return;
          }
          if (isQwalConfigPayload(result)) {
            if (result.chainId && result.chainId !== this.chainId) {
              this.handleChainIdChange(result.chainId);
            }
          } else if (isQwalAccountPayload(result)) {
            this.handleAddressChange(result.address);
          }
        };
        this.request = this.request.bind(this);
        this.transport.addEventListener(internalListener);
        this.transport.addEventListener(this.internalBridgeListener.bind(this));
      }
      internalBridgeListener(event) {
        let id;
        let result;
        if (isWindowResponseEvent(event)) {
          if (event.origin !== this.transport.origin || event.source !== window || event.data.target !== WINDOW_PROVIDER_TARGET) {
            return;
          }
          id = event.data.id;
          result = event.data.result;
        } else if (isPortResponseEvent(event)) {
          id = event.id;
          result = event.result;
        } else {
          return;
        }
        const requestResolver = this.requestResolvers.get(id);
        if (!requestResolver) return;
        const {sendData, reject, resolve} = requestResolver;
        this.requestResolvers.delete(sendData.id);
        const {method: sentMethod} = sendData.request;
        if (isEIP1193Error(result)) {
          reject(result);
        }
        if (!this.connected) {
          this.connected = true;
          this.emit("connect", {
            chainId: this.chainId
          });
        }
        switch (sentMethod) {
         case "wallet_switchEthereumChain":
         case "wallet_addEthereumChain":
          if (result === null) {
            this.handleChainIdChange(sendData.request.params[0].chainId);
          }
          break;

         case "eth_chainId":
         case "net_version":
          if (typeof result === "string" && Number(this.chainId) !== Number(result)) {
            this.handleChainIdChange(result);
          }
          break;

         case "eth_accounts":
         case "eth_requestAccounts":
          if (Array.isArray(result) && result.length !== 0) {
            this.handleAddressChange(result);
          }
          break;

         default:
          break;
        }
        resolve(result);
      }
      async enable() {
        return this.request({
          method: "eth_requestAccounts"
        });
      }
      isConnected() {
        return this.connected;
      }
      send(methodOrRequest, paramsOrCallback) {
        if (typeof methodOrRequest === "string" && typeof paramsOrCallback !== "function") {
          return this.request({
            method: methodOrRequest,
            params: paramsOrCallback
          });
        }
        if (isObject(methodOrRequest) && typeof paramsOrCallback === "function") {
          return this.sendAsync(methodOrRequest, paramsOrCallback);
        }
        return Promise.reject(new Error("Unsupported function parameters"));
      }
      sendAsync(request, callback) {
        return this.request(request).then((response => callback(null, {
          result: response,
          id: request.id,
          jsonrpc: request.jsonrpc
        })), (error => callback(error, null)));
      }
      requestID=0n;
      request(arg) {
        const {method, params = []} = arg;
        if (typeof method !== "string") {
          return Promise.reject(new Error(`unsupported method type: ${method}`));
        }
        const sendData = {
          id: this.requestID.toString(),
          target: PROVIDER_BRIDGE_TARGET,
          request: {
            method,
            params
          }
        };
        this.requestID += 1n;
        this.transport.postMessage(sendData);
        return new Promise(((resolve, reject) => {
          this.requestResolvers.set(sendData.id, {
            resolve,
            reject,
            sendData
          });
        }));
      }
      handleChainIdChange(chainId) {
        this.chainId = chainId;
        this.emit("chainChanged", chainId);
        this.emit("networkChanged", Number(chainId).toString());
      }
      handleAddressChange(address) {
        if (this.selectedAddress !== address[0]) {
          this.selectedAddress = address[0];
          this.emit("accountsChanged", address);
        }
      }
    }
    class QwalWeb3Provider extends providers_lib.Web3Provider {
      switchChain(network) {
        return this.send("wallet_switchEthereumChain", [ {
          chainId: toHexChainID(network.chainID)
        } ]);
      }
      getSigner(addressOrIndex) {
        return super.getSigner(addressOrIndex);
      }
      static hexlifyTransaction(transaction, allowExtra) {
        const {annotation, ...transactionRequest} = transaction;
        return {
          ...providers_lib.Web3Provider.hexlifyTransaction(transactionRequest, allowExtra),
          annotation: encodeJSON(annotation)
        };
      }
    }
    var contract_utils_qethers;
    const internalProviderPort = {
      listeners: [],
      emitter: new (emittery_default()),
      addEventListener(listener) {
        this.listeners.push(listener);
      },
      removeEventListener(toRemove) {
        this.listeners = this.listeners.filter((listener => listener !== toRemove));
      },
      origin: (typeof window !== "undefined" ? window?.location?.origin : undefined) ?? "service-worker",
      postMessage(message) {
        this.emitter.emit("message", message);
      },
      postResponse(message) {
        this.listeners.forEach((listener => listener(message)));
      }
    };
    const internalProvider = new QwalWindowProvider(internalProviderPort);
    function getProvider() {
      return new QwalWeb3Provider(internalProvider);
    }
    const getContract = async (address, abi) => {
      const provider = getProvider();
      const signer = provider.getSigner();
      return new contract_utils_qethers.Contract(address, abi, signer);
    };
    const getSignerAddress = async () => {
      const provider = getProvider();
      const signer = provider.getSigner();
      const signerAddress = await signer.getAddress();
      return signerAddress;
    };
    const getCurrentTimestamp = async () => {
      const provider = getProvider();
      const {timestamp} = await provider.getBlock(provider.getBlockNumber());
      return timestamp;
    };
    function parseSigningData(signingData) {
      let normalizedData = signingData;
      if (signingData.startsWith("0x") && signingData.length > 66) {
        let possibleMessageString;
        try {
          possibleMessageString = (0, lib_utils.toUtf8String)(signingData);
        } catch (err) {}
        if (possibleMessageString !== undefined && (0, lib_utils.hexlify)((0, lib_utils.toUtf8Bytes)(possibleMessageString)) === signingData.toLowerCase()) {
          normalizedData = possibleMessageString;
        }
      }
      return {
        messageType: "eip191",
        signingData: normalizedData
      };
    }
    const isSameAccountSignerWithId = (signerA, signerB) => {
      if (signerA.type !== signerB.type) return false;
      switch (signerB.type) {
       case "keyPair":
        return signerB.walletID === signerA.walletID;

       default:
        return false;
      }
    };
    class InternalQuantumEVMProviderDatabase extends Xn {
      constructor() {
        super("qwal/internal-quantumevm-provider");
        this.version(1).stores({
          currentNetwork: "&origin,network.chainID"
        });
        this.on("populate", (tx => tx.db.table("currentNetwork").add({
          origin: QWAL_INTERNAL_ORIGIN,
          network: ZEUS
        })));
      }
      async setCurrentChainIdForOrigin(origin, network) {
        return this.currentNetwork.put({
          origin,
          network
        });
      }
      async unsetCurrentNetworkForOrigin(origin, chainID) {
        const originMatches = await this.currentNetwork.where({
          origin,
          "network.chainID": chainID
        }).count() > 0;
        if (originMatches) {
          await this.currentNetwork.delete(origin);
        }
      }
      async getCurrentNetworkForOrigin(origin) {
        const currentNetwork = await this.currentNetwork.get({
          origin
        });
        return currentNetwork?.network;
      }
      async removeStoredPreferencesForChain(chainID) {
        await this.currentNetwork.where({
          "network.chainID": chainID
        }).delete();
      }
    }
    async function internal_qevm_provider_db_getOrCreateDB() {
      return new InternalQuantumEVMProviderDatabase;
    }
    class InternalQuantumEVMProviderService extends BaseService {
      static create=async (chainService, preferenceService) => new this(await internal_qevm_provider_db_getOrCreateDB(), await chainService, await preferenceService);
      constructor(db, chainService, preferenceService) {
        super();
        this.db = db;
        this.chainService = chainService;
        this.preferenceService = preferenceService;
        internalProviderPort.emitter.on("message", (async event => {
          lib_logger.debug(`internal: request payload: ${JSON.stringify(event)}`);
          try {
            const response = {
              id: event.id,
              result: await this.routeSafeRPCRequest(event.request.method, event.request.params, QWAL_INTERNAL_ORIGIN)
            };
            lib_logger.debug("internal response:", response);
            internalProviderPort.postResponse(response);
          } catch (error) {
            lib_logger.debug("error processing request", event.id, error);
            internalProviderPort.postResponse({
              id: event.id,
              result: new EIP1193Error(EIP1193_ERROR_CODES.userRejectedRequest).toJSON()
            });
          }
        }));
      }
      async routeSafeRPCRequest(method, params, origin) {
        switch (method) {
         case "eth_signTypedData":
         case "eth_signTypedData_v1":
         case "eth_signTypedData_v3":
         case "eth_signTypedData_v4":
          return this.signTypedData({
            account: {
              address: params[0],
              network: await this.getCurrentOrDefaultNetworkForOrigin(origin)
            },
            typedData: JSON.parse(params[1])
          });

         case "eth_chainId":
          return toHexChainID((await this.getCurrentOrDefaultNetworkForOrigin(origin)).chainID);

         case "eth_blockNumber":
         case "eth_call":
         case "eth_estimateGas":
         case "eth_feeHistory":
         case "eth_gasPrice":
         case "eth_getBalance":
         case "eth_getBlockByHash":
         case "eth_getBlockByNumber":
         case "eth_getBlockTransactionCountByHash":
         case "eth_getBlockTransactionCountByNumber":
         case "eth_getCode":
         case "eth_getFilterChanges":
         case "eth_getFilterLogs":
         case "eth_getLogs":
         case "eth_getProof":
         case "eth_getStorageAt":
         case "eth_getTransactionByBlockHashAndIndex":
         case "eth_getTransactionByBlockNumberAndIndex":
         case "eth_getTransactionByHash":
         case "eth_getTransactionCount":
         case "eth_getTransactionReceipt":
         case "eth_getUncleByBlockHashAndIndex":
         case "eth_getUncleByBlockNumberAndIndex":
         case "eth_getUncleCountByBlockHash":
         case "eth_getUncleCountByBlockNumber":
         case "eth_maxPriorityFeePerGas":
         case "eth_newBlockFilter":
         case "eth_newFilter":
         case "eth_newPendingTransactionFilter":
         case "eth_protocolVersion":
         case "eth_sendRawTransaction":
         case "eth_subscribe":
         case "eth_syncing":
         case "eth_uninstallFilter":
         case "eth_unsubscribe":
         case "net_listening":
         case "net_version":
         case "web3_clientVersion":
         case "web3_sha3":
          return this.chainService.send(method, params, await this.getCurrentOrDefaultNetworkForOrigin(origin));

         case "eth_accounts":
          {
            const {address} = await this.preferenceService.getSelectedAccount();
            return [ address ];
          }

         case "eth_sendTransaction":
          return this.signTransaction({
            ...params[0]
          }, origin, true).then((async signed => {
            await this.chainService.broadcastSignedTransaction(signed);
            return signed.hash;
          }));

         case "eth_signTransaction":
          return this.signTransaction(params[0], origin, false).then((signedTransaction => (0, 
          transactions_lib.serialize)(ethersTransactionFromSignedTransaction(signedTransaction), signedTransaction.signature)));

         case "eth_sign":
          return this.signData({
            input: params[1],
            account: params[0]
          }, origin);

         case "personal_sign":
          return this.signData({
            input: params[0],
            account: params[1]
          }, origin);

         case "wallet_addEthereumChain":
          {
            const chainInfo = params[0];
            const {chainId} = chainInfo;
            const supportedNetwork = await this.getTrackedNetworkByChainId(chainId);
            if (supportedNetwork) {
              await this.switchToSupportedNetwork(origin, supportedNetwork);
              this.emitter.emit("selectedNetwork", supportedNetwork);
              return null;
            }
            try {
              const customNetwork = await this.chainService.addCustomChain(chainInfo);
              this.emitter.emit("selectedNetwork", customNetwork);
              return null;
            } catch (e) {
              lib_logger.error(e);
              throw new EIP1193Error(EIP1193_ERROR_CODES.userRejectedRequest);
            }
          }

         case "wallet_switchEthereumChain":
          {
            const newChainId = params[0].chainId;
            const supportedNetwork = await this.getTrackedNetworkByChainId(newChainId);
            if (supportedNetwork) {
              this.switchToSupportedNetwork(origin, supportedNetwork);
              return null;
            }
            throw new EIP1193Error(EIP1193_ERROR_CODES.chainDisconnected);
          }

         case "wallet_watchAsset":
          {
            const {type, options} = params[0] ? params[0] : params;
            if (type !== "ERC20") {
              throw new EIP1193Error(EIP1193_ERROR_CODES.unsupportedMethod);
            }
            if (options.chainId) {
              const supportedNetwork = await this.getTrackedNetworkByChainId(String(options.chainId));
              if (!supportedNetwork) {
                throw new EIP1193Error(EIP1193_ERROR_CODES.userRejectedRequest);
              }
              this.emitter.emit("watchAssetRequest", {
                contractAddress: (0, address_lib.getAddress)(options.address),
                network: supportedNetwork
              });
              return true;
            }
            const network = await this.getCurrentOrDefaultNetworkForOrigin(origin);
            this.emitter.emit("watchAssetRequest", {
              contractAddress: (0, address_lib.getAddress)(options.address),
              network
            });
            return true;
          }

         case "metamask_getProviderState":
         case "metamask_sendDomainMetadata":
         case "wallet_requestPermissions":
         case "estimateGas":
         case "eth_coinbase":
         case "eth_decrypt":
         case "eth_getEncryptionPublicKey":
         case "eth_getWork":
         case "eth_hashrate":
         case "eth_mining":
         case "eth_submitHashrate":
         case "eth_submitWork":
         case "metamask_accountsChanged":
         case "metamask_chainChanged":
         case "metamask_logWeb3ShimUsage":
         case "metamask_unlockStateChanged":
         case "metamask_watchAsset":
         case "net_peerCount":
         case "wallet_accountsChanged":
         case "wallet_registerOnboarding":
         default:
          throw new EIP1193Error(EIP1193_ERROR_CODES.unsupportedMethod);
        }
      }
      async getCurrentInternalNetwork() {
        return this.db.getCurrentNetworkForOrigin(QWAL_INTERNAL_ORIGIN);
      }
      async getCurrentOrDefaultNetworkForOrigin(origin) {
        const currentNetwork = await this.db.getCurrentNetworkForOrigin(origin);
        if (!currentNetwork) {
          const defaultNetwork = await this.getCurrentInternalNetwork();
          return defaultNetwork;
        }
        return currentNetwork;
      }
      async removePreferencesForChain(chainId) {
        await this.db.removeStoredPreferencesForChain(chainId);
      }
      async signTransaction(transactionRequest, origin, broadcastOnSign) {
        const annotation = origin === QWAL_INTERNAL_ORIGIN && "annotation" in transactionRequest && transactionRequest.annotation !== undefined ? decodeJSON(transactionRequest.annotation) : undefined;
        if (!transactionRequest.from) {
          throw new Error("Transactions must have a from address for signing.");
        }
        const currentNetwork = await this.getCurrentOrDefaultNetworkForOrigin(origin);
        const {from, ...convertedRequest} = transactionRequestFromEthersTransactionRequest({
          data: transactionRequest.input,
          ...transactionRequest,
          gasLimit: transactionRequest.gas,
          from: transactionRequest.from,
          to: transactionRequest.to
        });
        if (typeof from === "undefined") {
          throw new Error("Transactions must have a from address for signing.");
        }
        return new Promise(((resolve, reject) => {
          this.emitter.emit("transactionSignatureRequest", {
            payload: {
              ...convertedRequest,
              from,
              network: currentNetwork,
              annotation,
              broadcastOnSign
            },
            resolver: resolve,
            rejecter: reject
          });
        }));
      }
      async getTrackedNetworkByChainId(chainID) {
        const trackedNetworks = await this.chainService.getTrackedNetworks();
        const trackedNetwork = trackedNetworks.find((network => sameChainID(network.chainID, chainID)));
        if (trackedNetwork) {
          return trackedNetwork;
        }
        try {
          const newlyTrackedNetwork = await this.chainService.startTrackingNetworkOrThrow(chainID);
          return newlyTrackedNetwork;
        } catch (e) {
          lib_logger.warn(e);
          return undefined;
        }
      }
      async signTypedData(params) {
        const {EIP712Domain, ...typesForSigning} = params.typedData.types;
        const filteredTypedDataPayload = lib_utils._TypedDataEncoder.getPayload(params.typedData.domain, typesForSigning, params.typedData.message);
        const filteredRequest = {
          ...params,
          typedData: {
            ...filteredTypedDataPayload,
            types: {
              ...EIP712Domain === undefined ? {} : {
                EIP712Domain
              },
              ...filteredTypedDataPayload.types
            }
          }
        };
        return new Promise(((resolve, reject) => {
          this.emitter.emit("signTypedDataRequest", {
            payload: filteredRequest,
            resolver: resolve,
            rejecter: reject
          });
        }));
      }
      async switchToSupportedNetwork(origin, supportedNetwork) {
        const {address} = await this.preferenceService.getSelectedAccount();
        await this.chainService.markAccountActivity({
          address,
          network: supportedNetwork
        });
        await this.db.setCurrentChainIdForOrigin(origin, supportedNetwork);
      }
      async unsetCurrentNetworkForOrigin(origin, chainId) {
        await this.db.unsetCurrentNetworkForOrigin(origin, chainId);
      }
      async signData({input, account}, origin) {
        const hexInput = input.match(/^0x[0-9A-Fa-f]*$/) ? input : (0, lib_utils.hexlify)((0, 
        lib_utils.toUtf8Bytes)(input));
        const typeAndData = parseSigningData(input);
        const currentNetwork = await this.getCurrentOrDefaultNetworkForOrigin(origin);
        return new Promise(((resolve, reject) => {
          this.emitter.emit("signDataRequest", {
            payload: {
              account: {
                address: account,
                network: currentNetwork
              },
              rawSigningData: hexInput,
              ...typeAndData
            },
            resolver: resolve,
            rejecter: reject
          });
        }));
      }
    }
    const ReadOnlyAccountSigner = {
      type: "read-only"
    };
    function getSigningErrorReason(err) {
      if (err instanceof Error && err.message.toLowerCase().includes("user rejected")) {
        return "userRejected";
      }
      return "genericError";
    }
    class SigningService extends BaseService {
      addressHandlers=[];
      static create=async (internalSignerService, chainService) => new this(await internalSignerService, await chainService);
      constructor(internalSignerService, chainService) {
        super();
        this.internalSignerService = internalSignerService;
        this.chainService = chainService;
      }
      async internalStartService() {
        await super.internalStartService();
      }
      async signTransactionWithNonce(transactionWithNonce, accountSigner) {
        switch (accountSigner.type) {
         case "keyPair":
          return this.internalSignerService.signTransaction({
            address: transactionWithNonce.from,
            network: transactionWithNonce.network
          }, transactionWithNonce);

         case "read-only":
          throw new Error("Read-only signers cannot sign.");

         default:
          return assertUnreachable(accountSigner);
        }
      }
      async removeAccount(address, signerType) {
        if (signerType) {
          switch (signerType) {
           case "keyPair":
            await this.internalSignerService.removeAccount(address);
            break;

           case "read-only":
            break;

           default:
            assertUnreachable(signerType);
          }
        }
        await this.chainService.removeAccountToTrack(address);
      }
      async prepareForSigningRequest() {
        return Promise.resolve();
      }
      async signTransaction(transactionRequest, accountSigner) {
        const transactionWithNonce = await this.chainService.populateEVMTransactionNonce(transactionRequest);
        try {
          const signedTx = await this.signTransactionWithNonce(transactionWithNonce, accountSigner);
          this.emitter.emit("signingTxResponse", {
            type: "success-tx",
            signedTx
          });
          return signedTx;
        } catch (err) {
          this.emitter.emit("signingTxResponse", {
            type: "error",
            reason: getSigningErrorReason(err)
          });
          this.chainService.releaseEVMTransactionNonce(transactionWithNonce);
          throw err;
        }
      }
      addTrackedAddress(address, handler) {
        this.addressHandlers.push({
          address,
          signer: handler
        });
      }
      async signTypedData({typedData, account, accountSigner}) {
        try {
          let signedData;
          const chainId = typeof typedData.domain.chainId === "string" ? parseInt(typedData.domain.chainId) : typedData.domain.chainId;
          if (typedData.domain.chainId !== undefined && chainId !== parseInt(account.network.chainID)) {
            throw new Error("Attempting to sign typed data with mismatched chain IDs.");
          }
          switch (accountSigner.type) {
           case "keyPair":
            signedData = await this.internalSignerService.signTypedData({
              typedData,
              account: account.address
            });
            break;

           case "read-only":
            throw new Error("Read-only signers cannot sign.");

           default:
            assertUnreachable(accountSigner);
          }
          this.emitter.emit("signingDataResponse", {
            type: "success-data",
            signedData
          });
          return signedData;
        } catch (err) {
          this.emitter.emit("signingDataResponse", {
            type: "error",
            reason: getSigningErrorReason(err)
          });
          throw err;
        }
      }
      async signData(addressOnNetwork, hexDataToSign, accountSigner) {
        if (!hexDataToSign.startsWith("0x")) {
          throw new Error("Signing service can only sign hex data.");
        }
        try {
          let signedData;
          switch (accountSigner.type) {
           case "keyPair":
            signedData = await this.internalSignerService.personalSign({
              signingData: hexDataToSign,
              account: addressOnNetwork.address
            });
            break;

           case "read-only":
            throw new Error("Read-only signers cannot sign.");

           default:
            assertUnreachable(accountSigner);
          }
          this.emitter.emit("personalSigningResponse", {
            type: "success-data",
            signedData
          });
          return signedData;
        } catch (err) {
          if (getSigningErrorReason(err) === "userRejected") {
            this.emitter.emit("personalSigningResponse", {
              type: "error",
              reason: "userRejected"
            });
            lib_logger.debug("User rejected personal sign request", err);
            throw err;
          }
          this.emitter.emit("personalSigningResponse", {
            type: "error",
            reason: "genericError"
          });
          throw err;
        }
      }
    }
    function getNFTs(_accounts, _collections) {
      return [ Promise.resolve({
        nfts: [],
        nextPageURLs: {}
      }) ];
    }
    function getNFTCollections(_accounts) {
      return [ Promise.resolve([]) ];
    }
    async function getNFTsTransfers(_accounts, _timestamp) {
      return [];
    }
    const DEFAULT_PREFERENCES = {
      transfersLookupTimestamp: undefined,
      freshCollections: {}
    };
    class NFTsDatabase extends Xn {
      constructor() {
        super("qwal/nfts");
        this.version(1).stores({
          nfts: "&[id+collectionID+owner+network.chainID]",
          collections: "&[id+owner+network.chainID]",
          preferences: "++id"
        });
        this.on("populate", (tx => tx.db.table("preferences").add(DEFAULT_PREFERENCES)));
      }
      async updateNFTs(nfts) {
        await this.nfts.bulkPut(nfts);
      }
      async updateCollections(collections) {
        await this.collections.bulkPut(collections);
      }
      async updateCollectionData(collectionID, {address, network}, data) {
        const collection = await this.collections.get({
          id: collectionID,
          owner: address,
          "network.chainID": network.chainID
        });
        if (collection) {
          const updatedCollection = {
            ...collection,
            ...data
          };
          await this.updateCollections([ updatedCollection ]);
          return updatedCollection;
        }
        return undefined;
      }
      async getAllCollections() {
        return this.collections.toArray();
      }
      async getCollectionNFTsForAccount(collectionID, {address, network}) {
        return this.nfts.filter((nft => nft.collectionID === collectionID && sameQEVMAddress(nft.owner, address) && network.chainID === nft.network.chainID)).toArray();
      }
      async removeNFTsForAddress(address) {
        await this.nfts.filter((nft => sameQEVMAddress(nft.owner, address))).delete();
        await this.collections.filter((collection => sameQEVMAddress(collection.owner, address))).delete();
      }
      async removeNFTsByIDs(removedNFTsIDs) {
        const nftsToRemove = this.nfts.filter((nft => removedNFTsIDs.some((removedID => removedID === nft.id))));
        const collectionIdsToRemove = (await nftsToRemove.toArray()).reduce(((acc, nft) => {
          acc.add(nft.collectionID);
          return acc;
        }), new Set);
        await this.collections.filter((collection => collectionIdsToRemove.has(collection.id))).delete();
        await nftsToRemove.delete();
      }
      async setTransfersLookupTimestamp(transfersLookupTimestamp) {
        await this.preferences.toCollection().modify({
          transfersLookupTimestamp
        });
      }
      async setFreshCollections(freshCollections) {
        await this.preferences.toCollection().modify({
          freshCollections
        });
      }
      async setFreshCollectionsFromSavedData() {
        const freshCollections = {};
        const nfts = await this.nfts.toArray();
        nfts.forEach((nft => {
          const {collectionID} = nft;
          const {owner} = nft;
          freshCollections[collectionID] ??= {};
          freshCollections[collectionID][normalizeQEVMAddress(owner)] = true;
        }));
        await this.setFreshCollections(freshCollections);
        return freshCollections;
      }
      async getPreferences() {
        return await this.preferences.reverse().first() ?? DEFAULT_PREFERENCES;
      }
    }
    async function nfts_db_getOrCreateDB() {
      return new NFTsDatabase;
    }
    class NFTsService extends BaseService {
      #nextPageUrls={};
      #transfersLookupTimestamp;
      #freshCollections={};
      static create=async chainService => new this(await nfts_db_getOrCreateDB(), await chainService);
      constructor(db, chainService) {
        super();
        this.db = db;
        this.chainService = chainService;
        this.#transfersLookupTimestamp = getUNIXTimestamp();
      }
      async internalStartService() {
        await super.internalStartService();
        this.connectChainServiceEvents();
      }
      async internalStopService() {
        this.db.close();
        await super.internalStopService();
      }
      async connectChainServiceEvents() {
        this.chainService.emitter.once("serviceStarted").then((async () => {
          this.emitter.emit("isReloadingNFTs", true);
          const {transfersLookupTimestamp, freshCollections} = await this.db.getPreferences();
          let collections = await this.db.getAllCollections();
          if (!collections.length) {
            await this.initializeCollections();
            collections = await this.db.getAllCollections();
          }
          this.#transfersLookupTimestamp = transfersLookupTimestamp ?? await this.setTransfersLookupTimestamp();
          this.#freshCollections = Object.keys(freshCollections).length ? freshCollections : await this.db.setFreshCollectionsFromSavedData();
          this.emitter.emit("initializeNFTs", collections);
          this.emitter.emit("isReloadingNFTs", false);
        }));
        this.chainService.emitter.on("newAccountToTrack", (async addressOnNetwork => {
          this.emitter.emit("isReloadingNFTs", true);
          await this.initializeCollections([ addressOnNetwork ]);
          this.emitter.emit("isReloadingNFTs", false);
        }));
      }
      async initializeCollections(accounts) {
        const accountsToFetch = accounts ?? await this.chainService.getAccountsToTrack();
        if (accountsToFetch.length) {
          await this.fetchCollections(accountsToFetch);
        }
      }
      async refreshCollections(accounts) {
        const accountsToFetch = accounts ?? await this.chainService.getAccountsToTrack();
        if (!accountsToFetch.length) return;
        const transfers = await this.fetchTransferredNFTs(accountsToFetch);
        if (transfers.length) {
          await this.fetchCollections(accountsToFetch);
        }
      }
      async fetchCollections(accounts) {
        await Promise.all(getNFTCollections(accounts).map((async request => request.then((async collections => {
          await this.db.updateCollections(collections);
          this.emitter.emit("updateCollections", await this.db.getAllCollections());
        })))));
      }
      async refreshNFTsFromCollection(collectionID, account) {
        this.setFreshCollection(collectionID, account.address, false);
        await this.db.setFreshCollections(this.#freshCollections);
        await this.fetchNFTsFromCollection(collectionID, account);
      }
      async fetchNFTsFromCollection(collectionID, account) {
        if (this.#freshCollections[collectionID]?.[normalizeQEVMAddress(account.address)]) {
          await this.fetchNFTsFromDatabase(collectionID, account);
        } else {
          await Promise.allSettled(getNFTs([ account ], [ collectionID ]).map((async request => {
            const {nfts, nextPageURLs} = await request;
            await this.updateSavedNFTs(collectionID, account, nfts, nextPageURLs);
          })));
        }
      }
      async fetchNFTsFromDatabase(collectionID, account) {
        await this.emitter.emit("updateNFTs", {
          collectionID,
          account,
          nfts: await this.db.getCollectionNFTsForAccount(collectionID, account),
          hasNextPage: !!this.#nextPageUrls[collectionID]?.[account.address]
        });
      }
      async fetchNFTsFromNextPage(collectionID, account) {
        const nextPage = this.#nextPageUrls[collectionID]?.[account.address];
        if (nextPage) {
          delete this.#nextPageUrls[collectionID][account.address];
        }
      }
      async updateSavedNFTs(collectionID, account, nfts, nextPageURLs) {
        await this.db.updateNFTs(nfts);
        const updatedNFTs = await this.db.getCollectionNFTsForAccount(collectionID, account);
        this.updateNextPages(nextPageURLs);
        let updatedCollection;
        if (updatedNFTs.some((nft => nft.isBadge))) {
          updatedCollection = await this.db.updateCollectionData(collectionID, account, {
            hasBadges: true
          });
        }
        if (updatedCollection) {
          this.emitter.emit("updateCollections", [ updatedCollection ]);
        }
        this.setFreshCollection(collectionID, account.address, !!updatedNFTs.length);
        await this.db.setFreshCollections(this.#freshCollections);
        const hasNextPage = !!Object.keys(nextPageURLs).length;
        await this.emitter.emit("updateNFTs", {
          collectionID,
          account,
          nfts: updatedNFTs,
          hasNextPage
        });
      }
      updateNextPages(nextPageURLs) {
        Object.keys(nextPageURLs).forEach((collectionID => Object.entries(nextPageURLs[collectionID]).forEach((([address, url]) => {
          this.#nextPageUrls[collectionID] ??= {};
          this.#nextPageUrls[collectionID][address] = url;
        }))));
      }
      setFreshCollection(collectionID, address, isFresh) {
        this.#freshCollections[collectionID] ??= {};
        this.#freshCollections[collectionID][normalizeQEVMAddress(address)] = isFresh;
      }
      async removeNFTsForAddress(address) {
        Object.keys(this.#freshCollections).forEach((collectionID => {
          if (this.#freshCollections[collectionID][normalizeQEVMAddress(address)]) {
            this.setFreshCollection(collectionID, address, false);
          }
        }));
        await this.db.removeNFTsForAddress(address);
        await this.db.setFreshCollections(this.#freshCollections);
      }
      async setTransfersLookupTimestamp() {
        const timestamp = getUNIXTimestamp(Date.now() - 2 * MINUTE);
        await this.db.setTransfersLookupTimestamp(timestamp);
        return timestamp;
      }
      async fetchTransferredNFTs(accounts) {
        const transfers = await getNFTsTransfers(accounts, this.#transfersLookupTimestamp);
        this.#transfersLookupTimestamp = await this.setTransfersLookupTimestamp();
        transfers.forEach((transfer => {
          const {collectionID, to, from, isKnownFromAddress, isKnownToAddress} = transfer;
          if (collectionID && to && isKnownToAddress) {
            this.setFreshCollection(collectionID, to, false);
          }
          if (collectionID && from && isKnownFromAddress) {
            this.setFreshCollection(collectionID, from, false);
          }
        }));
        await this.db.setFreshCollections(this.#freshCollections);
        const knownFromAddress = transfers.filter((transfer => transfer.isKnownFromAddress));
        if (knownFromAddress.length) {
          await this.db.removeNFTsByIDs(knownFromAddress.map((transferred => transferred.id)));
          this.emitter.emit("removeTransferredNFTs", knownFromAddress);
        }
        return transfers;
      }
    }
    var Emittery;
    function getNoopService() {
      return Promise.resolve({
        startService: () => Promise.resolve(),
        stopService: () => Promise.resolve(),
        emitter: new Emittery
      });
    }
    function immer_esm_n(n) {
      for (var r = arguments.length, t = Array(r > 1 ? r - 1 : 0), e = 1; e < r; e++) t[e - 1] = arguments[e];
      if (false) {
        var i, o;
      }
      throw Error("[Immer] minified error nr: " + n + (t.length ? " " + t.map((function(n) {
        return "'" + n + "'";
      })).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
    }
    function immer_esm_r(n) {
      return !!n && !!n[immer_esm_Q];
    }
    function immer_esm_t(n) {
      var r;
      return !!n && (function(n) {
        if (!n || "object" != typeof n) return !1;
        var r = Object.getPrototypeOf(n);
        if (null === r) return !0;
        var t = Object.hasOwnProperty.call(r, "constructor") && r.constructor;
        return t === Object || "function" == typeof t && Function.toString.call(t) === immer_esm_Z;
      }(n) || Array.isArray(n) || !!n[immer_esm_L] || !!(null === (r = n.constructor) || void 0 === r ? void 0 : r[immer_esm_L]) || immer_esm_s(n) || immer_esm_v(n));
    }
    function immer_esm_e(t) {
      return immer_esm_r(t) || immer_esm_n(23, t), t[immer_esm_Q].t;
    }
    function immer_esm_i(n, r, t) {
      void 0 === t && (t = !1), 0 === immer_esm_o(n) ? (t ? Object.keys : immer_esm_nn)(n).forEach((function(e) {
        t && "symbol" == typeof e || r(e, n[e], n);
      })) : n.forEach((function(t, e) {
        return r(e, t, n);
      }));
    }
    function immer_esm_o(n) {
      var r = n[immer_esm_Q];
      return r ? r.i > 3 ? r.i - 4 : r.i : Array.isArray(n) ? 1 : immer_esm_s(n) ? 2 : immer_esm_v(n) ? 3 : 0;
    }
    function immer_esm_u(n, r) {
      return 2 === immer_esm_o(n) ? n.has(r) : Object.prototype.hasOwnProperty.call(n, r);
    }
    function immer_esm_a(n, r) {
      return 2 === immer_esm_o(n) ? n.get(r) : n[r];
    }
    function immer_esm_f(n, r, t) {
      var e = immer_esm_o(n);
      2 === e ? n.set(r, t) : 3 === e ? n.add(t) : n[r] = t;
    }
    function immer_esm_c(n, r) {
      return n === r ? 0 !== n || 1 / n == 1 / r : n != n && r != r;
    }
    function immer_esm_s(n) {
      return immer_esm_X && n instanceof Map;
    }
    function immer_esm_v(n) {
      return immer_esm_q && n instanceof Set;
    }
    function immer_esm_p(n) {
      return n.o || n.t;
    }
    function immer_esm_l(n) {
      if (Array.isArray(n)) return Array.prototype.slice.call(n);
      var r = immer_esm_rn(n);
      delete r[immer_esm_Q];
      for (var t = immer_esm_nn(r), e = 0; e < t.length; e++) {
        var i = t[e], o = r[i];
        !1 === o.writable && (o.writable = !0, o.configurable = !0), (o.get || o.set) && (r[i] = {
          configurable: !0,
          writable: !0,
          enumerable: o.enumerable,
          value: n[i]
        });
      }
      return Object.create(Object.getPrototypeOf(n), r);
    }
    function immer_esm_d(n, e) {
      return void 0 === e && (e = !1), immer_esm_y(n) || immer_esm_r(n) || !immer_esm_t(n) || (immer_esm_o(n) > 1 && (n.set = n.add = n.clear = n.delete = immer_esm_h), 
      Object.freeze(n), e && immer_esm_i(n, (function(n, r) {
        return immer_esm_d(r, !0);
      }), !0)), n;
    }
    function immer_esm_h() {
      immer_esm_n(2);
    }
    function immer_esm_y(n) {
      return null == n || "object" != typeof n || Object.isFrozen(n);
    }
    function immer_esm_b(r) {
      var t = immer_esm_tn[r];
      return t || immer_esm_n(18, r), t;
    }
    function immer_esm_m(n, r) {
      immer_esm_tn[n] || (immer_esm_tn[n] = r);
    }
    function immer_esm_() {
      return true || 0, immer_esm_U;
    }
    function immer_esm_j(n, r) {
      r && (immer_esm_b("Patches"), n.u = [], n.s = [], n.v = r);
    }
    function immer_esm_g(n) {
      immer_esm_O(n), n.p.forEach(immer_esm_S), n.p = null;
    }
    function immer_esm_O(n) {
      n === immer_esm_U && (immer_esm_U = n.l);
    }
    function immer_esm_w(n) {
      return immer_esm_U = {
        p: [],
        l: immer_esm_U,
        h: n,
        m: !0,
        _: 0
      };
    }
    function immer_esm_S(n) {
      var r = n[immer_esm_Q];
      0 === r.i || 1 === r.i ? r.j() : r.g = !0;
    }
    function immer_esm_P(r, e) {
      e._ = e.p.length;
      var i = e.p[0], o = void 0 !== r && r !== i;
      return e.h.O || immer_esm_b("ES5").S(e, r, o), o ? (i[immer_esm_Q].P && (immer_esm_g(e), 
      immer_esm_n(4)), immer_esm_t(r) && (r = immer_esm_M(e, r), e.l || immer_esm_x(e, r)), 
      e.u && immer_esm_b("Patches").M(i[immer_esm_Q].t, r, e.u, e.s)) : r = immer_esm_M(e, i, []), 
      immer_esm_g(e), e.u && e.v(e.u, e.s), r !== immer_esm_H ? r : void 0;
    }
    function immer_esm_M(n, r, t) {
      if (immer_esm_y(r)) return r;
      var e = r[immer_esm_Q];
      if (!e) return immer_esm_i(r, (function(i, o) {
        return immer_esm_A(n, e, r, i, o, t);
      }), !0), r;
      if (e.A !== n) return r;
      if (!e.P) return immer_esm_x(n, e.t, !0), e.t;
      if (!e.I) {
        e.I = !0, e.A._--;
        var o = 4 === e.i || 5 === e.i ? e.o = immer_esm_l(e.k) : e.o, u = o, a = !1;
        3 === e.i && (u = new Set(o), o.clear(), a = !0), immer_esm_i(u, (function(r, i) {
          return immer_esm_A(n, e, o, r, i, t, a);
        })), immer_esm_x(n, o, !1), t && n.u && immer_esm_b("Patches").N(e, t, n.u, n.s);
      }
      return e.o;
    }
    function immer_esm_A(e, i, o, a, c, s, v) {
      if (false && 0, immer_esm_r(c)) {
        var p = immer_esm_M(e, c, s && i && 3 !== i.i && !immer_esm_u(i.R, a) ? s.concat(a) : void 0);
        if (immer_esm_f(o, a, p), !immer_esm_r(p)) return;
        e.m = !1;
      } else v && o.add(c);
      if (immer_esm_t(c) && !immer_esm_y(c)) {
        if (!e.h.D && e._ < 1) return;
        immer_esm_M(e, c), i && i.A.l || immer_esm_x(e, c);
      }
    }
    function immer_esm_x(n, r, t) {
      void 0 === t && (t = !1), !n.l && n.h.D && n.m && immer_esm_d(r, t);
    }
    function immer_esm_z(n, r) {
      var t = n[immer_esm_Q];
      return (t ? immer_esm_p(t) : n)[r];
    }
    function immer_esm_I(n, r) {
      if (r in n) for (var t = Object.getPrototypeOf(n); t; ) {
        var e = Object.getOwnPropertyDescriptor(t, r);
        if (e) return e;
        t = Object.getPrototypeOf(t);
      }
    }
    function immer_esm_k(n) {
      n.P || (n.P = !0, n.l && immer_esm_k(n.l));
    }
    function immer_esm_E(n) {
      n.o || (n.o = immer_esm_l(n.t));
    }
    function immer_esm_N(n, r, t) {
      var e = immer_esm_s(r) ? immer_esm_b("MapSet").F(r, t) : immer_esm_v(r) ? immer_esm_b("MapSet").T(r, t) : n.O ? function(n, r) {
        var t = Array.isArray(n), e = {
          i: t ? 1 : 0,
          A: r ? r.A : immer_esm_(),
          P: !1,
          I: !1,
          R: {},
          l: r,
          t: n,
          k: null,
          o: null,
          j: null,
          C: !1
        }, i = e, o = immer_esm_en;
        t && (i = [ e ], o = immer_esm_on);
        var u = Proxy.revocable(i, o), a = u.revoke, f = u.proxy;
        return e.k = f, e.j = a, f;
      }(r, t) : immer_esm_b("ES5").J(r, t);
      return (t ? t.A : immer_esm_()).p.push(e), e;
    }
    function immer_esm_R(e) {
      return immer_esm_r(e) || immer_esm_n(22, e), function n(r) {
        if (!immer_esm_t(r)) return r;
        var e, u = r[immer_esm_Q], c = immer_esm_o(r);
        if (u) {
          if (!u.P && (u.i < 4 || !immer_esm_b("ES5").K(u))) return u.t;
          u.I = !0, e = immer_esm_D(r, c), u.I = !1;
        } else e = immer_esm_D(r, c);
        return immer_esm_i(e, (function(r, t) {
          u && immer_esm_a(u.t, r) === t || immer_esm_f(e, r, n(t));
        })), 3 === c ? new Set(e) : e;
      }(e);
    }
    function immer_esm_D(n, r) {
      switch (r) {
       case 2:
        return new Map(n);

       case 3:
        return Array.from(n);
      }
      return immer_esm_l(n);
    }
    function immer_esm_F() {
      function t(n, r) {
        var t = s[n];
        return t ? t.enumerable = r : s[n] = t = {
          configurable: !0,
          enumerable: r,
          get: function() {
            var r = this[immer_esm_Q];
            return false && 0, immer_esm_en.get(r, n);
          },
          set: function(r) {
            var t = this[immer_esm_Q];
            false && 0, immer_esm_en.set(t, n, r);
          }
        }, t;
      }
      function e(n) {
        for (var r = n.length - 1; r >= 0; r--) {
          var t = n[r][immer_esm_Q];
          if (!t.P) switch (t.i) {
           case 5:
            a(t) && immer_esm_k(t);
            break;

           case 4:
            o(t) && immer_esm_k(t);
          }
        }
      }
      function o(n) {
        for (var r = n.t, t = n.k, e = immer_esm_nn(t), i = e.length - 1; i >= 0; i--) {
          var o = e[i];
          if (o !== immer_esm_Q) {
            var a = r[o];
            if (void 0 === a && !immer_esm_u(r, o)) return !0;
            var f = t[o], s = f && f[immer_esm_Q];
            if (s ? s.t !== a : !immer_esm_c(f, a)) return !0;
          }
        }
        var v = !!r[immer_esm_Q];
        return e.length !== immer_esm_nn(r).length + (v ? 0 : 1);
      }
      function a(n) {
        var r = n.k;
        if (r.length !== n.t.length) return !0;
        var t = Object.getOwnPropertyDescriptor(r, r.length - 1);
        if (t && !t.get) return !0;
        for (var e = 0; e < r.length; e++) if (!r.hasOwnProperty(e)) return !0;
        return !1;
      }
      function f(r) {
        r.g && immer_esm_n(3, JSON.stringify(immer_esm_p(r)));
      }
      var s = {};
      immer_esm_m("ES5", {
        J: function(n, r) {
          var e = Array.isArray(n), i = function(n, r) {
            if (n) {
              for (var e = Array(r.length), i = 0; i < r.length; i++) Object.defineProperty(e, "" + i, t(i, !0));
              return e;
            }
            var o = immer_esm_rn(r);
            delete o[immer_esm_Q];
            for (var u = immer_esm_nn(o), a = 0; a < u.length; a++) {
              var f = u[a];
              o[f] = t(f, n || !!o[f].enumerable);
            }
            return Object.create(Object.getPrototypeOf(r), o);
          }(e, n), o = {
            i: e ? 5 : 4,
            A: r ? r.A : immer_esm_(),
            P: !1,
            I: !1,
            R: {},
            l: r,
            t: n,
            k: i,
            o: null,
            g: !1,
            C: !1
          };
          return Object.defineProperty(i, immer_esm_Q, {
            value: o,
            writable: !0
          }), i;
        },
        S: function(n, t, o) {
          o ? immer_esm_r(t) && t[immer_esm_Q].A === n && e(n.p) : (n.u && function n(r) {
            if (r && "object" == typeof r) {
              var t = r[immer_esm_Q];
              if (t) {
                var e = t.t, o = t.k, f = t.R, c = t.i;
                if (4 === c) immer_esm_i(o, (function(r) {
                  r !== immer_esm_Q && (void 0 !== e[r] || immer_esm_u(e, r) ? f[r] || n(o[r]) : (f[r] = !0, 
                  immer_esm_k(t)));
                })), immer_esm_i(e, (function(n) {
                  void 0 !== o[n] || immer_esm_u(o, n) || (f[n] = !1, immer_esm_k(t));
                })); else if (5 === c) {
                  if (a(t) && (immer_esm_k(t), f.length = !0), o.length < e.length) for (var s = o.length; s < e.length; s++) f[s] = !1; else for (var v = e.length; v < o.length; v++) f[v] = !0;
                  for (var p = Math.min(o.length, e.length), l = 0; l < p; l++) o.hasOwnProperty(l) || (f[l] = !0), 
                  void 0 === f[l] && n(o[l]);
                }
              }
            }
          }(n.p[0]), e(n.p));
        },
        K: function(n) {
          return 4 === n.i ? o(n) : a(n);
        }
      });
    }
    function immer_esm_T() {
      function e(n) {
        if (!immer_esm_t(n)) return n;
        if (Array.isArray(n)) return n.map(e);
        if (immer_esm_s(n)) return new Map(Array.from(n.entries()).map((function(n) {
          return [ n[0], e(n[1]) ];
        })));
        if (immer_esm_v(n)) return new Set(Array.from(n).map(e));
        var r = Object.create(Object.getPrototypeOf(n));
        for (var i in n) r[i] = e(n[i]);
        return immer_esm_u(n, immer_esm_L) && (r[immer_esm_L] = n[immer_esm_L]), r;
      }
      function f(n) {
        return immer_esm_r(n) ? e(n) : n;
      }
      var c = "add";
      immer_esm_m("Patches", {
        $: function(r, t) {
          return t.forEach((function(t) {
            for (var i = t.path, u = t.op, f = r, s = 0; s < i.length - 1; s++) {
              var v = immer_esm_o(f), p = i[s];
              "string" != typeof p && "number" != typeof p && (p = "" + p), 0 !== v && 1 !== v || "__proto__" !== p && "constructor" !== p || immer_esm_n(24), 
              "function" == typeof f && "prototype" === p && immer_esm_n(24), "object" != typeof (f = immer_esm_a(f, p)) && immer_esm_n(15, i.join("/"));
            }
            var l = immer_esm_o(f), d = e(t.value), h = i[i.length - 1];
            switch (u) {
             case "replace":
              switch (l) {
               case 2:
                return f.set(h, d);

               case 3:
                immer_esm_n(16);

               default:
                return f[h] = d;
              }

             case c:
              switch (l) {
               case 1:
                return "-" === h ? f.push(d) : f.splice(h, 0, d);

               case 2:
                return f.set(h, d);

               case 3:
                return f.add(d);

               default:
                return f[h] = d;
              }

             case "remove":
              switch (l) {
               case 1:
                return f.splice(h, 1);

               case 2:
                return f.delete(h);

               case 3:
                return f.delete(t.value);

               default:
                return delete f[h];
              }

             default:
              immer_esm_n(17, u);
            }
          })), r;
        },
        N: function(n, r, t, e) {
          switch (n.i) {
           case 0:
           case 4:
           case 2:
            return function(n, r, t, e) {
              var o = n.t, s = n.o;
              immer_esm_i(n.R, (function(n, i) {
                var v = immer_esm_a(o, n), p = immer_esm_a(s, n), l = i ? immer_esm_u(o, n) ? "replace" : c : "remove";
                if (v !== p || "replace" !== l) {
                  var d = r.concat(n);
                  t.push("remove" === l ? {
                    op: l,
                    path: d
                  } : {
                    op: l,
                    path: d,
                    value: p
                  }), e.push(l === c ? {
                    op: "remove",
                    path: d
                  } : "remove" === l ? {
                    op: c,
                    path: d,
                    value: f(v)
                  } : {
                    op: "replace",
                    path: d,
                    value: f(v)
                  });
                }
              }));
            }(n, r, t, e);

           case 5:
           case 1:
            return function(n, r, t, e) {
              var i = n.t, o = n.R, u = n.o;
              if (u.length < i.length) {
                var a = [ u, i ];
                i = a[0], u = a[1];
                var s = [ e, t ];
                t = s[0], e = s[1];
              }
              for (var v = 0; v < i.length; v++) if (o[v] && u[v] !== i[v]) {
                var p = r.concat([ v ]);
                t.push({
                  op: "replace",
                  path: p,
                  value: f(u[v])
                }), e.push({
                  op: "replace",
                  path: p,
                  value: f(i[v])
                });
              }
              for (var l = i.length; l < u.length; l++) {
                var d = r.concat([ l ]);
                t.push({
                  op: c,
                  path: d,
                  value: f(u[l])
                });
              }
              i.length < u.length && e.push({
                op: "replace",
                path: r.concat([ "length" ]),
                value: i.length
              });
            }(n, r, t, e);

           case 3:
            return function(n, r, t, e) {
              var i = n.t, o = n.o, u = 0;
              i.forEach((function(n) {
                if (!o.has(n)) {
                  var i = r.concat([ u ]);
                  t.push({
                    op: "remove",
                    path: i,
                    value: n
                  }), e.unshift({
                    op: c,
                    path: i,
                    value: n
                  });
                }
                u++;
              })), u = 0, o.forEach((function(n) {
                if (!i.has(n)) {
                  var o = r.concat([ u ]);
                  t.push({
                    op: c,
                    path: o,
                    value: n
                  }), e.unshift({
                    op: "remove",
                    path: o,
                    value: n
                  });
                }
                u++;
              }));
            }(n, r, t, e);
          }
        },
        M: function(n, r, t, e) {
          t.push({
            op: "replace",
            path: [],
            value: r === immer_esm_H ? void 0 : r
          }), e.push({
            op: "replace",
            path: [],
            value: n
          });
        }
      });
    }
    function immer_esm_C() {
      function r(n, r) {
        function t() {
          this.constructor = n;
        }
        a(n, r), n.prototype = (t.prototype = r.prototype, new t);
      }
      function e(n) {
        n.o || (n.R = new Map, n.o = new Map(n.t));
      }
      function o(n) {
        n.o || (n.o = new Set, n.t.forEach((function(r) {
          if (immer_esm_t(r)) {
            var e = immer_esm_N(n.A.h, r, n);
            n.p.set(r, e), n.o.add(e);
          } else n.o.add(r);
        })));
      }
      function u(r) {
        r.g && immer_esm_n(3, JSON.stringify(immer_esm_p(r)));
      }
      var a = function(n, r) {
        return (a = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(n, r) {
          n.__proto__ = r;
        } || function(n, r) {
          for (var t in r) r.hasOwnProperty(t) && (n[t] = r[t]);
        })(n, r);
      }, f = function() {
        function n(n, r) {
          return this[immer_esm_Q] = {
            i: 2,
            l: r,
            A: r ? r.A : immer_esm_(),
            P: !1,
            I: !1,
            o: void 0,
            R: void 0,
            t: n,
            k: this,
            C: !1,
            g: !1
          }, this;
        }
        r(n, Map);
        var o = n.prototype;
        return Object.defineProperty(o, "size", {
          get: function() {
            return immer_esm_p(this[immer_esm_Q]).size;
          }
        }), o.has = function(n) {
          return immer_esm_p(this[immer_esm_Q]).has(n);
        }, o.set = function(n, r) {
          var t = this[immer_esm_Q];
          return u(t), immer_esm_p(t).has(n) && immer_esm_p(t).get(n) === r || (e(t), immer_esm_k(t), 
          t.R.set(n, !0), t.o.set(n, r), t.R.set(n, !0)), this;
        }, o.delete = function(n) {
          if (!this.has(n)) return !1;
          var r = this[immer_esm_Q];
          return u(r), e(r), immer_esm_k(r), r.t.has(n) ? r.R.set(n, !1) : r.R.delete(n), 
          r.o.delete(n), !0;
        }, o.clear = function() {
          var n = this[immer_esm_Q];
          u(n), immer_esm_p(n).size && (e(n), immer_esm_k(n), n.R = new Map, immer_esm_i(n.t, (function(r) {
            n.R.set(r, !1);
          })), n.o.clear());
        }, o.forEach = function(n, r) {
          var t = this;
          immer_esm_p(this[immer_esm_Q]).forEach((function(e, i) {
            n.call(r, t.get(i), i, t);
          }));
        }, o.get = function(n) {
          var r = this[immer_esm_Q];
          u(r);
          var i = immer_esm_p(r).get(n);
          if (r.I || !immer_esm_t(i)) return i;
          if (i !== r.t.get(n)) return i;
          var o = immer_esm_N(r.A.h, i, r);
          return e(r), r.o.set(n, o), o;
        }, o.keys = function() {
          return immer_esm_p(this[immer_esm_Q]).keys();
        }, o.values = function() {
          var n, r = this, t = this.keys();
          return (n = {})[immer_esm_V] = function() {
            return r.values();
          }, n.next = function() {
            var n = t.next();
            return n.done ? n : {
              done: !1,
              value: r.get(n.value)
            };
          }, n;
        }, o.entries = function() {
          var n, r = this, t = this.keys();
          return (n = {})[immer_esm_V] = function() {
            return r.entries();
          }, n.next = function() {
            var n = t.next();
            if (n.done) return n;
            var e = r.get(n.value);
            return {
              done: !1,
              value: [ n.value, e ]
            };
          }, n;
        }, o[immer_esm_V] = function() {
          return this.entries();
        }, n;
      }(), c = function() {
        function n(n, r) {
          return this[immer_esm_Q] = {
            i: 3,
            l: r,
            A: r ? r.A : immer_esm_(),
            P: !1,
            I: !1,
            o: void 0,
            t: n,
            k: this,
            p: new Map,
            g: !1,
            C: !1
          }, this;
        }
        r(n, Set);
        var t = n.prototype;
        return Object.defineProperty(t, "size", {
          get: function() {
            return immer_esm_p(this[immer_esm_Q]).size;
          }
        }), t.has = function(n) {
          var r = this[immer_esm_Q];
          return u(r), r.o ? !!r.o.has(n) || !(!r.p.has(n) || !r.o.has(r.p.get(n))) : r.t.has(n);
        }, t.add = function(n) {
          var r = this[immer_esm_Q];
          return u(r), this.has(n) || (o(r), immer_esm_k(r), r.o.add(n)), this;
        }, t.delete = function(n) {
          if (!this.has(n)) return !1;
          var r = this[immer_esm_Q];
          return u(r), o(r), immer_esm_k(r), r.o.delete(n) || !!r.p.has(n) && r.o.delete(r.p.get(n));
        }, t.clear = function() {
          var n = this[immer_esm_Q];
          u(n), immer_esm_p(n).size && (o(n), immer_esm_k(n), n.o.clear());
        }, t.values = function() {
          var n = this[immer_esm_Q];
          return u(n), o(n), n.o.values();
        }, t.entries = function() {
          var n = this[immer_esm_Q];
          return u(n), o(n), n.o.entries();
        }, t.keys = function() {
          return this.values();
        }, t[immer_esm_V] = function() {
          return this.values();
        }, t.forEach = function(n, r) {
          for (var t = this.values(), e = t.next(); !e.done; ) n.call(r, e.value, e.value, this), 
          e = t.next();
        }, n;
      }();
      immer_esm_m("MapSet", {
        F: function(n, r) {
          return new f(n, r);
        },
        T: function(n, r) {
          return new c(n, r);
        }
      });
    }
    function immer_esm_J() {
      immer_esm_F(), immer_esm_C(), immer_esm_T();
    }
    function immer_esm_K(n) {
      return n;
    }
    function immer_esm_$(n) {
      return n;
    }
    var immer_esm_G, immer_esm_U, immer_esm_W = "undefined" != typeof Symbol && "symbol" == typeof Symbol("x"), immer_esm_X = "undefined" != typeof Map, immer_esm_q = "undefined" != typeof Set, immer_esm_B = "undefined" != typeof Proxy && void 0 !== Proxy.revocable && "undefined" != typeof Reflect, immer_esm_H = immer_esm_W ? Symbol.for("immer-nothing") : ((immer_esm_G = {})["immer-nothing"] = !0, 
    immer_esm_G), immer_esm_L = immer_esm_W ? Symbol.for("immer-draftable") : "__$immer_draftable", immer_esm_Q = immer_esm_W ? Symbol.for("immer-state") : "__$immer_state", immer_esm_V = "undefined" != typeof Symbol && Symbol.iterator || "@@iterator", immer_esm_Y = {
      0: "Illegal state",
      1: "Immer drafts cannot have computed properties",
      2: "This object has been frozen and should not be mutated",
      3: function(n) {
        return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + n;
      },
      4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
      5: "Immer forbids circular references",
      6: "The first or second argument to `produce` must be a function",
      7: "The third argument to `produce` must be a function or undefined",
      8: "First argument to `createDraft` must be a plain object, an array, or an immerable object",
      9: "First argument to `finishDraft` must be a draft returned by `createDraft`",
      10: "The given draft is already finalized",
      11: "Object.defineProperty() cannot be used on an Immer draft",
      12: "Object.setPrototypeOf() cannot be used on an Immer draft",
      13: "Immer only supports deleting array indices",
      14: "Immer only supports setting array indices and the 'length' property",
      15: function(n) {
        return "Cannot apply patch, path doesn't resolve: " + n;
      },
      16: 'Sets cannot have "replace" patches.',
      17: function(n) {
        return "Unsupported patch operation: " + n;
      },
      18: function(n) {
        return "The plugin for '" + n + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + n + "()` when initializing your application.";
      },
      20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",
      21: function(n) {
        return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '" + n + "'";
      },
      22: function(n) {
        return "'current' expects a draft, got: " + n;
      },
      23: function(n) {
        return "'original' expects a draft, got: " + n;
      },
      24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
    }, immer_esm_Z = "" + Object.prototype.constructor, immer_esm_nn = "undefined" != typeof Reflect && Reflect.ownKeys ? Reflect.ownKeys : void 0 !== Object.getOwnPropertySymbols ? function(n) {
      return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n));
    } : Object.getOwnPropertyNames, immer_esm_rn = Object.getOwnPropertyDescriptors || function(n) {
      var r = {};
      return immer_esm_nn(n).forEach((function(t) {
        r[t] = Object.getOwnPropertyDescriptor(n, t);
      })), r;
    }, immer_esm_tn = {}, immer_esm_en = {
      get: function(n, r) {
        if (r === immer_esm_Q) return n;
        var e = immer_esm_p(n);
        if (!immer_esm_u(e, r)) return function(n, r, t) {
          var e, i = immer_esm_I(r, t);
          return i ? "value" in i ? i.value : null === (e = i.get) || void 0 === e ? void 0 : e.call(n.k) : void 0;
        }(n, e, r);
        var i = e[r];
        return n.I || !immer_esm_t(i) ? i : i === immer_esm_z(n.t, r) ? (immer_esm_E(n), 
        n.o[r] = immer_esm_N(n.A.h, i, n)) : i;
      },
      has: function(n, r) {
        return r in immer_esm_p(n);
      },
      ownKeys: function(n) {
        return Reflect.ownKeys(immer_esm_p(n));
      },
      set: function(n, r, t) {
        var e = immer_esm_I(immer_esm_p(n), r);
        if (null == e ? void 0 : e.set) return e.set.call(n.k, t), !0;
        if (!n.P) {
          var i = immer_esm_z(immer_esm_p(n), r), o = null == i ? void 0 : i[immer_esm_Q];
          if (o && o.t === t) return n.o[r] = t, n.R[r] = !1, !0;
          if (immer_esm_c(t, i) && (void 0 !== t || immer_esm_u(n.t, r))) return !0;
          immer_esm_E(n), immer_esm_k(n);
        }
        return n.o[r] === t && (void 0 !== t || r in n.o) || Number.isNaN(t) && Number.isNaN(n.o[r]) || (n.o[r] = t, 
        n.R[r] = !0), !0;
      },
      deleteProperty: function(n, r) {
        return void 0 !== immer_esm_z(n.t, r) || r in n.t ? (n.R[r] = !1, immer_esm_E(n), 
        immer_esm_k(n)) : delete n.R[r], n.o && delete n.o[r], !0;
      },
      getOwnPropertyDescriptor: function(n, r) {
        var t = immer_esm_p(n), e = Reflect.getOwnPropertyDescriptor(t, r);
        return e ? {
          writable: !0,
          configurable: 1 !== n.i || "length" !== r,
          enumerable: e.enumerable,
          value: t[r]
        } : e;
      },
      defineProperty: function() {
        immer_esm_n(11);
      },
      getPrototypeOf: function(n) {
        return Object.getPrototypeOf(n.t);
      },
      setPrototypeOf: function() {
        immer_esm_n(12);
      }
    }, immer_esm_on = {};
    immer_esm_i(immer_esm_en, (function(n, r) {
      immer_esm_on[n] = function() {
        return arguments[0] = arguments[0][0], r.apply(this, arguments);
      };
    })), immer_esm_on.deleteProperty = function(r, t) {
      return false && 0, immer_esm_on.set.call(this, r, t, void 0);
    }, immer_esm_on.set = function(r, t, e) {
      return false && 0, immer_esm_en.set.call(this, r[0], t, e, r[0]);
    };
    var immer_esm_un = function() {
      function e(r) {
        var e = this;
        this.O = immer_esm_B, this.D = !0, this.produce = function(r, i, o) {
          if ("function" == typeof r && "function" != typeof i) {
            var u = i;
            i = r;
            var a = e;
            return function(n) {
              var r = this;
              void 0 === n && (n = u);
              for (var t = arguments.length, e = Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++) e[o - 1] = arguments[o];
              return a.produce(n, (function(n) {
                var t;
                return (t = i).call.apply(t, [ r, n ].concat(e));
              }));
            };
          }
          var f;
          if ("function" != typeof i && immer_esm_n(6), void 0 !== o && "function" != typeof o && immer_esm_n(7), 
          immer_esm_t(r)) {
            var c = immer_esm_w(e), s = immer_esm_N(e, r, void 0), v = !0;
            try {
              f = i(s), v = !1;
            } finally {
              v ? immer_esm_g(c) : immer_esm_O(c);
            }
            return "undefined" != typeof Promise && f instanceof Promise ? f.then((function(n) {
              return immer_esm_j(c, o), immer_esm_P(n, c);
            }), (function(n) {
              throw immer_esm_g(c), n;
            })) : (immer_esm_j(c, o), immer_esm_P(f, c));
          }
          if (!r || "object" != typeof r) {
            if (void 0 === (f = i(r)) && (f = r), f === immer_esm_H && (f = void 0), e.D && immer_esm_d(f, !0), 
            o) {
              var p = [], l = [];
              immer_esm_b("Patches").M(r, f, p, l), o(p, l);
            }
            return f;
          }
          immer_esm_n(21, r);
        }, this.produceWithPatches = function(n, r) {
          if ("function" == typeof n) return function(r) {
            for (var t = arguments.length, i = Array(t > 1 ? t - 1 : 0), o = 1; o < t; o++) i[o - 1] = arguments[o];
            return e.produceWithPatches(r, (function(r) {
              return n.apply(void 0, [ r ].concat(i));
            }));
          };
          var t, i, o = e.produce(n, r, (function(n, r) {
            t = n, i = r;
          }));
          return "undefined" != typeof Promise && o instanceof Promise ? o.then((function(n) {
            return [ n, t, i ];
          })) : [ o, t, i ];
        }, "boolean" == typeof (null == r ? void 0 : r.useProxies) && this.setUseProxies(r.useProxies), 
        "boolean" == typeof (null == r ? void 0 : r.autoFreeze) && this.setAutoFreeze(r.autoFreeze);
      }
      var i = e.prototype;
      return i.createDraft = function(e) {
        immer_esm_t(e) || immer_esm_n(8), immer_esm_r(e) && (e = immer_esm_R(e));
        var i = immer_esm_w(this), o = immer_esm_N(this, e, void 0);
        return o[immer_esm_Q].C = !0, immer_esm_O(i), o;
      }, i.finishDraft = function(r, t) {
        var e = r && r[immer_esm_Q];
        false && 0;
        var i = e.A;
        return immer_esm_j(i, t), immer_esm_P(void 0, i);
      }, i.setAutoFreeze = function(n) {
        this.D = n;
      }, i.setUseProxies = function(r) {
        r && !immer_esm_B && immer_esm_n(20), this.O = r;
      }, i.applyPatches = function(n, t) {
        var e;
        for (e = t.length - 1; e >= 0; e--) {
          var i = t[e];
          if (0 === i.path.length && "replace" === i.op) {
            n = i.value;
            break;
          }
        }
        e > -1 && (t = t.slice(e + 1));
        var o = immer_esm_b("Patches").$;
        return immer_esm_r(n) ? o(n, t) : this.produce(n, (function(n) {
          return o(n, t);
        }));
      }, e;
    }(), immer_esm_an = new immer_esm_un, immer_esm_fn = immer_esm_an.produce, immer_esm_cn = immer_esm_an.produceWithPatches.bind(immer_esm_an), immer_esm_sn = immer_esm_an.setAutoFreeze.bind(immer_esm_an), immer_esm_vn = immer_esm_an.setUseProxies.bind(immer_esm_an), immer_esm_pn = immer_esm_an.applyPatches.bind(immer_esm_an), immer_esm_ln = immer_esm_an.createDraft.bind(immer_esm_an), immer_esm_dn = immer_esm_an.finishDraft.bind(immer_esm_an);
    const immer_esm = immer_esm_fn;
    function _typeof(o) {
      "@babel/helpers - typeof";
      return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
        return typeof o;
      } : function(o) {
        return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
      }, _typeof(o);
    }
    function toPrimitive(t, r) {
      if ("object" != _typeof(t) || !t) return t;
      var e = t[Symbol.toPrimitive];
      if (void 0 !== e) {
        var i = e.call(t, r || "default");
        if ("object" != _typeof(i)) return i;
        throw new TypeError("@@toPrimitive must return a primitive value.");
      }
      return ("string" === r ? String : Number)(t);
    }
    function toPropertyKey(t) {
      var i = toPrimitive(t, "string");
      return "symbol" == _typeof(i) ? i : i + "";
    }
    function _defineProperty(e, r, t) {
      return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
        value: t,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : e[r] = t, e;
    }
    function ownKeys(e, r) {
      var t = Object.keys(e);
      if (Object.getOwnPropertySymbols) {
        var o = Object.getOwnPropertySymbols(e);
        r && (o = o.filter((function(r) {
          return Object.getOwnPropertyDescriptor(e, r).enumerable;
        }))), t.push.apply(t, o);
      }
      return t;
    }
    function _objectSpread2(e) {
      for (var r = 1; r < arguments.length; r++) {
        var t = null != arguments[r] ? arguments[r] : {};
        r % 2 ? ownKeys(Object(t), !0).forEach((function(r) {
          _defineProperty(e, r, t[r]);
        })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach((function(r) {
          Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
        }));
      }
      return e;
    }
    function formatProdErrorMessage(code) {
      return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + "use the non-minified dev environment for full errors. ";
    }
    var $$observable = function() {
      return typeof Symbol === "function" && Symbol.observable || "@@observable";
    }();
    var randomString = function randomString() {
      return Math.random().toString(36).substring(7).split("").join(".");
    };
    var ActionTypes = {
      INIT: "@@redux/INIT" + randomString(),
      REPLACE: "@@redux/REPLACE" + randomString(),
      PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
        return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
      }
    };
    function isPlainObject(obj) {
      if (typeof obj !== "object" || obj === null) return false;
      var proto = obj;
      while (Object.getPrototypeOf(proto) !== null) {
        proto = Object.getPrototypeOf(proto);
      }
      return Object.getPrototypeOf(obj) === proto;
    }
    function miniKindOf(val) {
      if (val === void 0) return "undefined";
      if (val === null) return "null";
      var type = typeof val;
      switch (type) {
       case "boolean":
       case "string":
       case "number":
       case "symbol":
       case "function":
        {
          return type;
        }
      }
      if (Array.isArray(val)) return "array";
      if (isDate(val)) return "date";
      if (isError(val)) return "error";
      var constructorName = ctorName(val);
      switch (constructorName) {
       case "Symbol":
       case "Promise":
       case "WeakMap":
       case "WeakSet":
       case "Map":
       case "Set":
        return constructorName;
      }
      return type.slice(8, -1).toLowerCase().replace(/\s/g, "");
    }
    function ctorName(val) {
      return typeof val.constructor === "function" ? val.constructor.name : null;
    }
    function isError(val) {
      return val instanceof Error || typeof val.message === "string" && val.constructor && typeof val.constructor.stackTraceLimit === "number";
    }
    function isDate(val) {
      if (val instanceof Date) return true;
      return typeof val.toDateString === "function" && typeof val.getDate === "function" && typeof val.setDate === "function";
    }
    function kindOf(val) {
      var typeOfVal = typeof val;
      if (false) {}
      return typeOfVal;
    }
    function createStore(reducer, preloadedState, enhancer) {
      var _ref2;
      if (typeof preloadedState === "function" && typeof enhancer === "function" || typeof enhancer === "function" && typeof arguments[3] === "function") {
        throw new Error(true ? formatProdErrorMessage(0) : 0);
      }
      if (typeof preloadedState === "function" && typeof enhancer === "undefined") {
        enhancer = preloadedState;
        preloadedState = undefined;
      }
      if (typeof enhancer !== "undefined") {
        if (typeof enhancer !== "function") {
          throw new Error(true ? formatProdErrorMessage(1) : 0);
        }
        return enhancer(createStore)(reducer, preloadedState);
      }
      if (typeof reducer !== "function") {
        throw new Error(true ? formatProdErrorMessage(2) : 0);
      }
      var currentReducer = reducer;
      var currentState = preloadedState;
      var currentListeners = [];
      var nextListeners = currentListeners;
      var isDispatching = false;
      function ensureCanMutateNextListeners() {
        if (nextListeners === currentListeners) {
          nextListeners = currentListeners.slice();
        }
      }
      function getState() {
        if (isDispatching) {
          throw new Error(true ? formatProdErrorMessage(3) : 0);
        }
        return currentState;
      }
      function subscribe(listener) {
        if (typeof listener !== "function") {
          throw new Error(true ? formatProdErrorMessage(4) : 0);
        }
        if (isDispatching) {
          throw new Error(true ? formatProdErrorMessage(5) : 0);
        }
        var isSubscribed = true;
        ensureCanMutateNextListeners();
        nextListeners.push(listener);
        return function unsubscribe() {
          if (!isSubscribed) {
            return;
          }
          if (isDispatching) {
            throw new Error(true ? formatProdErrorMessage(6) : 0);
          }
          isSubscribed = false;
          ensureCanMutateNextListeners();
          var index = nextListeners.indexOf(listener);
          nextListeners.splice(index, 1);
          currentListeners = null;
        };
      }
      function dispatch(action) {
        if (!isPlainObject(action)) {
          throw new Error(true ? formatProdErrorMessage(7) : 0);
        }
        if (typeof action.type === "undefined") {
          throw new Error(true ? formatProdErrorMessage(8) : 0);
        }
        if (isDispatching) {
          throw new Error(true ? formatProdErrorMessage(9) : 0);
        }
        try {
          isDispatching = true;
          currentState = currentReducer(currentState, action);
        } finally {
          isDispatching = false;
        }
        var listeners = currentListeners = nextListeners;
        for (var i = 0; i < listeners.length; i++) {
          var listener = listeners[i];
          listener();
        }
        return action;
      }
      function replaceReducer(nextReducer) {
        if (typeof nextReducer !== "function") {
          throw new Error(true ? formatProdErrorMessage(10) : 0);
        }
        currentReducer = nextReducer;
        dispatch({
          type: ActionTypes.REPLACE
        });
      }
      function observable() {
        var _ref;
        var outerSubscribe = subscribe;
        return _ref = {
          subscribe: function subscribe(observer) {
            if (typeof observer !== "object" || observer === null) {
              throw new Error(true ? formatProdErrorMessage(11) : 0);
            }
            function observeState() {
              if (observer.next) {
                observer.next(getState());
              }
            }
            observeState();
            var unsubscribe = outerSubscribe(observeState);
            return {
              unsubscribe
            };
          }
        }, _ref[$$observable] = function() {
          return this;
        }, _ref;
      }
      dispatch({
        type: ActionTypes.INIT
      });
      return _ref2 = {
        dispatch,
        subscribe,
        getState,
        replaceReducer
      }, _ref2[$$observable] = observable, _ref2;
    }
    var legacy_createStore = null && createStore;
    function warning(message) {
      if (typeof console !== "undefined" && typeof console.error === "function") {
        console.error(message);
      }
      try {
        throw new Error(message);
      } catch (e) {}
    }
    function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
      var reducerKeys = Object.keys(reducers);
      var argumentName = action && action.type === ActionTypes.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
      if (reducerKeys.length === 0) {
        return "Store does not have a valid reducer. Make sure the argument passed " + "to combineReducers is an object whose values are reducers.";
      }
      if (!isPlainObject(inputState)) {
        return "The " + argumentName + ' has unexpected type of "' + kindOf(inputState) + '". Expected argument to be an object with the following ' + ('keys: "' + reducerKeys.join('", "') + '"');
      }
      var unexpectedKeys = Object.keys(inputState).filter((function(key) {
        return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
      }));
      unexpectedKeys.forEach((function(key) {
        unexpectedKeyCache[key] = true;
      }));
      if (action && action.type === ActionTypes.REPLACE) return;
      if (unexpectedKeys.length > 0) {
        return "Unexpected " + (unexpectedKeys.length > 1 ? "keys" : "key") + " " + ('"' + unexpectedKeys.join('", "') + '" found in ' + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ('"' + reducerKeys.join('", "') + '". Unexpected keys will be ignored.');
      }
    }
    function assertReducerShape(reducers) {
      Object.keys(reducers).forEach((function(key) {
        var reducer = reducers[key];
        var initialState = reducer(undefined, {
          type: ActionTypes.INIT
        });
        if (typeof initialState === "undefined") {
          throw new Error(true ? formatProdErrorMessage(12) : 0);
        }
        if (typeof reducer(undefined, {
          type: ActionTypes.PROBE_UNKNOWN_ACTION()
        }) === "undefined") {
          throw new Error(true ? formatProdErrorMessage(13) : 0);
        }
      }));
    }
    function combineReducers(reducers) {
      var reducerKeys = Object.keys(reducers);
      var finalReducers = {};
      for (var i = 0; i < reducerKeys.length; i++) {
        var key = reducerKeys[i];
        if (false) {}
        if (typeof reducers[key] === "function") {
          finalReducers[key] = reducers[key];
        }
      }
      var finalReducerKeys = Object.keys(finalReducers);
      var unexpectedKeyCache;
      if (false) {}
      var shapeAssertionError;
      try {
        assertReducerShape(finalReducers);
      } catch (e) {
        shapeAssertionError = e;
      }
      return function combination(state, action) {
        if (state === void 0) {
          state = {};
        }
        if (shapeAssertionError) {
          throw shapeAssertionError;
        }
        if (false) {
          var warningMessage;
        }
        var hasChanged = false;
        var nextState = {};
        for (var _i = 0; _i < finalReducerKeys.length; _i++) {
          var _key = finalReducerKeys[_i];
          var reducer = finalReducers[_key];
          var previousStateForKey = state[_key];
          var nextStateForKey = reducer(previousStateForKey, action);
          if (typeof nextStateForKey === "undefined") {
            var actionType = action && action.type;
            throw new Error(true ? formatProdErrorMessage(14) : 0);
          }
          nextState[_key] = nextStateForKey;
          hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
        }
        hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
        return hasChanged ? nextState : state;
      };
    }
    function bindActionCreator(actionCreator, dispatch) {
      return function() {
        return dispatch(actionCreator.apply(this, arguments));
      };
    }
    function bindActionCreators(actionCreators, dispatch) {
      if (typeof actionCreators === "function") {
        return bindActionCreator(actionCreators, dispatch);
      }
      if (typeof actionCreators !== "object" || actionCreators === null) {
        throw new Error(true ? formatProdErrorMessage(16) : 0);
      }
      var boundActionCreators = {};
      for (var key in actionCreators) {
        var actionCreator = actionCreators[key];
        if (typeof actionCreator === "function") {
          boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
        }
      }
      return boundActionCreators;
    }
    function compose() {
      for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
        funcs[_key] = arguments[_key];
      }
      if (funcs.length === 0) {
        return function(arg) {
          return arg;
        };
      }
      if (funcs.length === 1) {
        return funcs[0];
      }
      return funcs.reduce((function(a, b) {
        return function() {
          return a(b.apply(void 0, arguments));
        };
      }));
    }
    function applyMiddleware() {
      for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
        middlewares[_key] = arguments[_key];
      }
      return function(createStore) {
        return function() {
          var store = createStore.apply(void 0, arguments);
          var _dispatch = function dispatch() {
            throw new Error(true ? formatProdErrorMessage(15) : 0);
          };
          var middlewareAPI = {
            getState: store.getState,
            dispatch: function dispatch() {
              return _dispatch.apply(void 0, arguments);
            }
          };
          var chain = middlewares.map((function(middleware) {
            return middleware(middlewareAPI);
          }));
          _dispatch = compose.apply(void 0, chain)(store.dispatch);
          return _objectSpread2(_objectSpread2({}, store), {}, {
            dispatch: _dispatch
          });
        };
      };
    }
    function createThunkMiddleware(extraArgument) {
      var middleware = function middleware(_ref) {
        var dispatch = _ref.dispatch, getState = _ref.getState;
        return function(next) {
          return function(action) {
            if (typeof action === "function") {
              return action(dispatch, getState, extraArgument);
            }
            return next(action);
          };
        };
      };
      return middleware;
    }
    var thunk = createThunkMiddleware();
    thunk.withExtraArgument = createThunkMiddleware;
    const es = thunk;
    var isDraft;
    var current;
    var createSelector;
    var isDraft3;
    var createNextState3;
    var process = __webpack_require__(5606);
    var __extends = undefined && undefined.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __);
      };
    }();
    var __generator = undefined && undefined.__generator || function(thisArg, body) {
      var _ = {
        label: 0,
        sent: function() {
          if (t[0] & 1) throw t[1];
          return t[1];
        },
        trys: [],
        ops: []
      }, f, y, t, g;
      return g = {
        next: verb(0),
        throw: verb(1),
        return: verb(2)
      }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
        return this;
      }), g;
      function verb(n) {
        return function(v) {
          return step([ n, v ]);
        };
      }
      function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
          if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 
          0) : y.next) && !(t = t.call(y, op[1])).done) return t;
          if (y = 0, t) op = [ op[0] & 2, t.value ];
          switch (op[0]) {
           case 0:
           case 1:
            t = op;
            break;

           case 4:
            _.label++;
            return {
              value: op[1],
              done: false
            };

           case 5:
            _.label++;
            y = op[1];
            op = [ 0 ];
            continue;

           case 7:
            op = _.ops.pop();
            _.trys.pop();
            continue;

           default:
            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
              _ = 0;
              continue;
            }
            if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
              _.label = op[1];
              break;
            }
            if (op[0] === 6 && _.label < t[1]) {
              _.label = t[1];
              t = op;
              break;
            }
            if (t && _.label < t[2]) {
              _.label = t[2];
              _.ops.push(op);
              break;
            }
            if (t[2]) _.ops.pop();
            _.trys.pop();
            continue;
          }
          op = body.call(thisArg, _);
        } catch (e) {
          op = [ 6, e ];
          y = 0;
        } finally {
          f = t = 0;
        }
        if (op[0] & 5) throw op[1];
        return {
          value: op[0] ? op[1] : void 0,
          done: true
        };
      }
    };
    var __spreadArray = undefined && undefined.__spreadArray || function(to, from) {
      for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) to[j] = from[i];
      return to;
    };
    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 = function(obj, key, value) {
      return key in obj ? __defProp(obj, key, {
        enumerable: true,
        configurable: true,
        writable: true,
        value
      }) : obj[key] = value;
    };
    var __spreadValues = function(a, b) {
      for (var prop in b || (b = {})) if (__hasOwnProp.call(b, prop)) __defNormalProp(a, prop, b[prop]);
      if (__getOwnPropSymbols) for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
        var prop = _c[_i];
        if (__propIsEnum.call(b, prop)) __defNormalProp(a, prop, b[prop]);
      }
      return a;
    };
    var __spreadProps = function(a, b) {
      return __defProps(a, __getOwnPropDescs(b));
    };
    var __async = function(__this, __arguments, generator) {
      return new Promise((function(resolve, reject) {
        var fulfilled = function(value) {
          try {
            step(generator.next(value));
          } catch (e) {
            reject(e);
          }
        };
        var rejected = function(value) {
          try {
            step(generator.throw(value));
          } catch (e) {
            reject(e);
          }
        };
        var step = function(x) {
          return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
        };
        step((generator = generator.apply(__this, __arguments)).next());
      }));
    };
    var createDraftSafeSelector = function() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      var selector = createSelector.apply(void 0, args);
      var wrappedSelector = function(value) {
        var rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
          rest[_i - 1] = arguments[_i];
        }
        return selector.apply(void 0, __spreadArray([ isDraft(value) ? current(value) : value ], rest));
      };
      return wrappedSelector;
    };
    var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
      if (arguments.length === 0) return void 0;
      if (typeof arguments[0] === "object") return compose;
      return compose.apply(null, arguments);
    };
    var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {
      return function(noop2) {
        return noop2;
      };
    };
    function redux_toolkit_esm_isPlainObject(value) {
      if (typeof value !== "object" || value === null) return false;
      var proto = Object.getPrototypeOf(value);
      if (proto === null) return true;
      var baseProto = proto;
      while (Object.getPrototypeOf(baseProto) !== null) {
        baseProto = Object.getPrototypeOf(baseProto);
      }
      return proto === baseProto;
    }
    var hasMatchFunction = function(v) {
      return v && typeof v.match === "function";
    };
    function createAction(type, prepareAction) {
      function actionCreator() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        if (prepareAction) {
          var prepared = prepareAction.apply(void 0, args);
          if (!prepared) {
            throw new Error("prepareAction did not return an object");
          }
          return __spreadValues(__spreadValues({
            type,
            payload: prepared.payload
          }, "meta" in prepared && {
            meta: prepared.meta
          }), "error" in prepared && {
            error: prepared.error
          });
        }
        return {
          type,
          payload: args[0]
        };
      }
      actionCreator.toString = function() {
        return "" + type;
      };
      actionCreator.type = type;
      actionCreator.match = function(action) {
        return action.type === type;
      };
      return actionCreator;
    }
    function isAction(action) {
      return redux_toolkit_esm_isPlainObject(action) && "type" in action;
    }
    function isActionCreator(action) {
      return typeof action === "function" && "type" in action && hasMatchFunction(action);
    }
    function isFSA(action) {
      return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
    }
    function isValidKey(key) {
      return [ "type", "payload", "error", "meta" ].indexOf(key) > -1;
    }
    function redux_toolkit_esm_getType(actionCreator) {
      return "" + actionCreator;
    }
    function getMessage(type) {
      var splitType = type ? ("" + type).split("/") : [];
      var actionName = splitType[splitType.length - 1] || "actionCreator";
      return 'Detected an action creator with type "' + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload.";
    }
    function createActionCreatorInvariantMiddleware(options) {
      if (options === void 0) {
        options = {};
      }
      if (true) {
        return function() {
          return function(next) {
            return function(action) {
              return next(action);
            };
          };
        };
      }
      var _c, isActionCreator2;
    }
    function getTimeMeasureUtils(maxDelay, fnName) {
      var elapsed = 0;
      return {
        measureTime: function(fn) {
          var started = Date.now();
          try {
            return fn();
          } finally {
            var finished = Date.now();
            elapsed += finished - started;
          }
        },
        warnIfExceeded: function() {
          if (elapsed > maxDelay) {
            console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.");
          }
        }
      };
    }
    var MiddlewareArray = function(_super) {
      __extends(MiddlewareArray, _super);
      function MiddlewareArray() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        var _this = _super.apply(this, args) || this;
        Object.setPrototypeOf(_this, MiddlewareArray.prototype);
        return _this;
      }
      Object.defineProperty(MiddlewareArray, Symbol.species, {
        get: function() {
          return MiddlewareArray;
        },
        enumerable: false,
        configurable: true
      });
      MiddlewareArray.prototype.concat = function() {
        var arr = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          arr[_i] = arguments[_i];
        }
        return _super.prototype.concat.apply(this, arr);
      };
      MiddlewareArray.prototype.prepend = function() {
        var arr = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          arr[_i] = arguments[_i];
        }
        if (arr.length === 1 && Array.isArray(arr[0])) {
          return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([ void 0 ], arr[0].concat(this))));
        }
        return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([ void 0 ], arr.concat(this))));
      };
      return MiddlewareArray;
    }(Array);
    var EnhancerArray = function(_super) {
      __extends(EnhancerArray, _super);
      function EnhancerArray() {
        var args = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          args[_i] = arguments[_i];
        }
        var _this = _super.apply(this, args) || this;
        Object.setPrototypeOf(_this, EnhancerArray.prototype);
        return _this;
      }
      Object.defineProperty(EnhancerArray, Symbol.species, {
        get: function() {
          return EnhancerArray;
        },
        enumerable: false,
        configurable: true
      });
      EnhancerArray.prototype.concat = function() {
        var arr = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          arr[_i] = arguments[_i];
        }
        return _super.prototype.concat.apply(this, arr);
      };
      EnhancerArray.prototype.prepend = function() {
        var arr = [];
        for (var _i = 0; _i < arguments.length; _i++) {
          arr[_i] = arguments[_i];
        }
        if (arr.length === 1 && Array.isArray(arr[0])) {
          return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([ void 0 ], arr[0].concat(this))));
        }
        return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([ void 0 ], arr.concat(this))));
      };
      return EnhancerArray;
    }(Array);
    function freezeDraftable(val) {
      return immer_esm_t(val) ? immer_esm(val, (function() {})) : val;
    }
    var isProduction = null && "production" === "production";
    var prefix = "Invariant failed";
    function invariant(condition, message) {
      if (condition) {
        return;
      }
      if (isProduction) {
        throw new Error(prefix);
      }
      throw new Error(prefix + ": " + (message || ""));
    }
    function stringify(obj, serializer, indent, decycler) {
      return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
    }
    function getSerialize(serializer, decycler) {
      var stack = [], keys = [];
      if (!decycler) decycler = function(_, value) {
        if (stack[0] === value) return "[Circular ~]";
        return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
      };
      return function(key, value) {
        if (stack.length > 0) {
          var thisPos = stack.indexOf(this);
          ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
          ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
          if (~stack.indexOf(value)) value = decycler.call(this, key, value);
        } else stack.push(value);
        return serializer == null ? value : serializer.call(this, key, value);
      };
    }
    function isImmutableDefault(value) {
      return typeof value !== "object" || value == null || Object.isFrozen(value);
    }
    function trackForMutations(isImmutable, ignorePaths, obj) {
      var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
      return {
        detectMutations: function() {
          return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
        }
      };
    }
    function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) {
      if (ignorePaths === void 0) {
        ignorePaths = [];
      }
      if (path === void 0) {
        path = "";
      }
      if (checkedObjects === void 0) {
        checkedObjects = new Set;
      }
      var tracked = {
        value: obj
      };
      if (!isImmutable(obj) && !checkedObjects.has(obj)) {
        checkedObjects.add(obj);
        tracked.children = {};
        for (var key in obj) {
          var childPath = path ? path + "." + key : key;
          if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
            continue;
          }
          tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
        }
      }
      return tracked;
    }
    function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
      if (ignoredPaths === void 0) {
        ignoredPaths = [];
      }
      if (sameParentRef === void 0) {
        sameParentRef = false;
      }
      if (path === void 0) {
        path = "";
      }
      var prevObj = trackedProperty ? trackedProperty.value : void 0;
      var sameRef = prevObj === obj;
      if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
        return {
          wasMutated: true,
          path
        };
      }
      if (isImmutable(prevObj) || isImmutable(obj)) {
        return {
          wasMutated: false
        };
      }
      var keysToDetect = {};
      for (var key in trackedProperty.children) {
        keysToDetect[key] = true;
      }
      for (var key in obj) {
        keysToDetect[key] = true;
      }
      var hasIgnoredPaths = ignoredPaths.length > 0;
      var _loop_1 = function(key) {
        var nestedPath = path ? path + "." + key : key;
        if (hasIgnoredPaths) {
          var hasMatches = ignoredPaths.some((function(ignored) {
            if (ignored instanceof RegExp) {
              return ignored.test(nestedPath);
            }
            return nestedPath === ignored;
          }));
          if (hasMatches) {
            return "continue";
          }
        }
        var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
        if (result.wasMutated) {
          return {
            value: result
          };
        }
      };
      for (var key in keysToDetect) {
        var state_1 = _loop_1(key);
        if (typeof state_1 === "object") return state_1.value;
      }
      return {
        wasMutated: false
      };
    }
    function createImmutableStateInvariantMiddleware(options) {
      if (options === void 0) {
        options = {};
      }
      if (true) {
        return function() {
          return function(next) {
            return function(action) {
              return next(action);
            };
          };
        };
      }
      var _c, isImmutable, ignoredPaths, _d, warnAfter, ignore;
      var track;
    }
    function isPlain(val) {
      var type = typeof val;
      return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || redux_toolkit_esm_isPlainObject(val);
    }
    function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
      if (path === void 0) {
        path = "";
      }
      if (isSerializable === void 0) {
        isSerializable = isPlain;
      }
      if (ignoredPaths === void 0) {
        ignoredPaths = [];
      }
      var foundNestedSerializable;
      if (!isSerializable(value)) {
        return {
          keyPath: path || "<root>",
          value
        };
      }
      if (typeof value !== "object" || value === null) {
        return false;
      }
      if (cache == null ? void 0 : cache.has(value)) return false;
      var entries = getEntries != null ? getEntries(value) : Object.entries(value);
      var hasIgnoredPaths = ignoredPaths.length > 0;
      var _loop_2 = function(key, nestedValue) {
        var nestedPath = path ? path + "." + key : key;
        if (hasIgnoredPaths) {
          var hasMatches = ignoredPaths.some((function(ignored) {
            if (ignored instanceof RegExp) {
              return ignored.test(nestedPath);
            }
            return nestedPath === ignored;
          }));
          if (hasMatches) {
            return "continue";
          }
        }
        if (!isSerializable(nestedValue)) {
          return {
            value: {
              keyPath: nestedPath,
              value: nestedValue
            }
          };
        }
        if (typeof nestedValue === "object") {
          foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
          if (foundNestedSerializable) {
            return {
              value: foundNestedSerializable
            };
          }
        }
      };
      for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
        var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
        var state_2 = _loop_2(key, nestedValue);
        if (typeof state_2 === "object") return state_2.value;
      }
      if (cache && isNestedFrozen(value)) cache.add(value);
      return false;
    }
    function isNestedFrozen(value) {
      if (!Object.isFrozen(value)) return false;
      for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
        var nestedValue = _c[_i];
        if (typeof nestedValue !== "object" || nestedValue === null) continue;
        if (!isNestedFrozen(nestedValue)) return false;
      }
      return true;
    }
    function createSerializableStateInvariantMiddleware(options) {
      if (options === void 0) {
        options = {};
      }
      if (true) {
        return function() {
          return function(next) {
            return function(action) {
              return next(action);
            };
          };
        };
      }
      var _c, isSerializable, getEntries, _d, ignoredActions, _e, ignoredActionPaths, _f, ignoredPaths, _g, warnAfter, _h, ignoreState, _j, ignoreActions, _k, disableCache;
      var cache;
    }
    function isBoolean(x) {
      return typeof x === "boolean";
    }
    function curryGetDefaultMiddleware() {
      return function curriedGetDefaultMiddleware(options) {
        return getDefaultMiddleware(options);
      };
    }
    function getDefaultMiddleware(options) {
      if (options === void 0) {
        options = {};
      }
      var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f;
      var middlewareArray = new MiddlewareArray;
      if (thunk) {
        if (isBoolean(thunk)) {
          middlewareArray.push(es);
        } else {
          middlewareArray.push(es.withExtraArgument(thunk.extraArgument));
        }
      }
      if (false) {
        var actionCreatorOptions, serializableOptions, immutableOptions;
      }
      return middlewareArray;
    }
    var IS_PRODUCTION = "production" === "production";
    function configureStore(options) {
      var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
      var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;
      var rootReducer;
      if (typeof reducer === "function") {
        rootReducer = reducer;
      } else if (redux_toolkit_esm_isPlainObject(reducer)) {
        rootReducer = combineReducers(reducer);
      } else {
        throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
      }
      var finalMiddleware = middleware;
      if (typeof finalMiddleware === "function") {
        finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
        if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
          throw new Error("when using a middleware builder function, an array of middleware must be returned");
        }
      }
      if (!IS_PRODUCTION && finalMiddleware.some((function(item) {
        return typeof item !== "function";
      }))) {
        throw new Error("each middleware provided to configureStore must be a function");
      }
      var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);
      var finalCompose = compose;
      if (devTools) {
        finalCompose = composeWithDevTools(__spreadValues({
          trace: !IS_PRODUCTION
        }, typeof devTools === "object" && devTools));
      }
      var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
      var storeEnhancers = defaultEnhancers;
      if (Array.isArray(enhancers)) {
        storeEnhancers = __spreadArray([ middlewareEnhancer ], enhancers);
      } else if (typeof enhancers === "function") {
        storeEnhancers = enhancers(defaultEnhancers);
      }
      var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
      return createStore(rootReducer, preloadedState, composedEnhancer);
    }
    function executeReducerBuilderCallback(builderCallback) {
      var actionsMap = {};
      var actionMatchers = [];
      var defaultCaseReducer;
      var builder = {
        addCase: function(typeOrActionCreator, reducer) {
          if (false) {}
          var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
          if (!type) {
            throw new Error("`builder.addCase` cannot be called with an empty action type");
          }
          if (type in actionsMap) {
            throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
          }
          actionsMap[type] = reducer;
          return builder;
        },
        addMatcher: function(matcher, reducer) {
          if (false) {}
          actionMatchers.push({
            matcher,
            reducer
          });
          return builder;
        },
        addDefaultCase: function(reducer) {
          if (false) {}
          defaultCaseReducer = reducer;
          return builder;
        }
      };
      builderCallback(builder);
      return [ actionsMap, actionMatchers, defaultCaseReducer ];
    }
    function isStateFunction(x) {
      return typeof x === "function";
    }
    var hasWarnedAboutObjectNotation = false;
    function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
      if (actionMatchers === void 0) {
        actionMatchers = [];
      }
      if (false) {}
      var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [ mapOrBuilderCallback, actionMatchers, defaultCaseReducer ], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
      var getInitialState;
      if (isStateFunction(initialState)) {
        getInitialState = function() {
          return freezeDraftable(initialState());
        };
      } else {
        var frozenInitialState_1 = freezeDraftable(initialState);
        getInitialState = function() {
          return frozenInitialState_1;
        };
      }
      function reducer(state, action) {
        if (state === void 0) {
          state = getInitialState();
        }
        var caseReducers = __spreadArray([ actionsMap[action.type] ], finalActionMatchers.filter((function(_c) {
          var matcher = _c.matcher;
          return matcher(action);
        })).map((function(_c) {
          var reducer2 = _c.reducer;
          return reducer2;
        })));
        if (caseReducers.filter((function(cr) {
          return !!cr;
        })).length === 0) {
          caseReducers = [ finalDefaultCaseReducer ];
        }
        return caseReducers.reduce((function(previousState, caseReducer) {
          if (caseReducer) {
            if (immer_esm_r(previousState)) {
              var draft = previousState;
              var result = caseReducer(draft, action);
              if (result === void 0) {
                return previousState;
              }
              return result;
            } else if (!immer_esm_t(previousState)) {
              var result = caseReducer(previousState, action);
              if (result === void 0) {
                if (previousState === null) {
                  return previousState;
                }
                throw Error("A case reducer on a non-draftable value must not return undefined");
              }
              return result;
            } else {
              return immer_esm(previousState, (function(draft) {
                return caseReducer(draft, action);
              }));
            }
          }
          return previousState;
        }), state);
      }
      reducer.getInitialState = getInitialState;
      return reducer;
    }
    var hasWarnedAboutObjectNotation2 = false;
    function getType2(slice, actionKey) {
      return slice + "/" + actionKey;
    }
    function createSlice(options) {
      var name = options.name;
      if (!name) {
        throw new Error("`name` is a required option for createSlice");
      }
      if (typeof process !== "undefined" && "production" === "development") {}
      var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
      var reducers = options.reducers || {};
      var reducerNames = Object.keys(reducers);
      var sliceCaseReducersByName = {};
      var sliceCaseReducersByType = {};
      var actionCreators = {};
      reducerNames.forEach((function(reducerName) {
        var maybeReducerWithPrepare = reducers[reducerName];
        var type = getType2(name, reducerName);
        var caseReducer;
        var prepareCallback;
        if ("reducer" in maybeReducerWithPrepare) {
          caseReducer = maybeReducerWithPrepare.reducer;
          prepareCallback = maybeReducerWithPrepare.prepare;
        } else {
          caseReducer = maybeReducerWithPrepare;
        }
        sliceCaseReducersByName[reducerName] = caseReducer;
        sliceCaseReducersByType[type] = caseReducer;
        actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
      }));
      function buildReducer() {
        if (false) {}
        var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [ options.extraReducers ], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
        var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
        return createReducer(initialState, (function(builder) {
          for (var key in finalCaseReducers) {
            builder.addCase(key, finalCaseReducers[key]);
          }
          for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
            var m = actionMatchers_1[_i];
            builder.addMatcher(m.matcher, m.reducer);
          }
          if (defaultCaseReducer) {
            builder.addDefaultCase(defaultCaseReducer);
          }
        }));
      }
      var _reducer;
      return {
        name,
        reducer: function(state, action) {
          if (!_reducer) _reducer = buildReducer();
          return _reducer(state, action);
        },
        actions: actionCreators,
        caseReducers: sliceCaseReducersByName,
        getInitialState: function() {
          if (!_reducer) _reducer = buildReducer();
          return _reducer.getInitialState();
        }
      };
    }
    function getInitialEntityState() {
      return {
        ids: [],
        entities: {}
      };
    }
    function createInitialStateFactory() {
      function getInitialState(additionalState) {
        if (additionalState === void 0) {
          additionalState = {};
        }
        return Object.assign(getInitialEntityState(), additionalState);
      }
      return {
        getInitialState
      };
    }
    function createSelectorsFactory() {
      function getSelectors(selectState) {
        var selectIds = function(state) {
          return state.ids;
        };
        var selectEntities = function(state) {
          return state.entities;
        };
        var selectAll = createDraftSafeSelector(selectIds, selectEntities, (function(ids, entities) {
          return ids.map((function(id) {
            return entities[id];
          }));
        }));
        var selectId = function(_, id) {
          return id;
        };
        var selectById = function(entities, id) {
          return entities[id];
        };
        var selectTotal = createDraftSafeSelector(selectIds, (function(ids) {
          return ids.length;
        }));
        if (!selectState) {
          return {
            selectIds,
            selectEntities,
            selectAll,
            selectTotal,
            selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
          };
        }
        var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
        return {
          selectIds: createDraftSafeSelector(selectState, selectIds),
          selectEntities: selectGlobalizedEntities,
          selectAll: createDraftSafeSelector(selectState, selectAll),
          selectTotal: createDraftSafeSelector(selectState, selectTotal),
          selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
        };
      }
      return {
        getSelectors
      };
    }
    function createSingleArgumentStateOperator(mutator) {
      var operator = createStateOperator((function(_, state) {
        return mutator(state);
      }));
      return function operation(state) {
        return operator(state, void 0);
      };
    }
    function createStateOperator(mutator) {
      return function operation(state, arg) {
        function isPayloadActionArgument(arg2) {
          return isFSA(arg2);
        }
        var runMutator = function(draft) {
          if (isPayloadActionArgument(arg)) {
            mutator(arg.payload, draft);
          } else {
            mutator(arg, draft);
          }
        };
        if (isDraft3(state)) {
          runMutator(state);
          return state;
        } else {
          return createNextState3(state, runMutator);
        }
      };
    }
    function selectIdValue(entity, selectId) {
      var key = selectId(entity);
      if (false) {}
      return key;
    }
    function ensureEntitiesArray(entities) {
      if (!Array.isArray(entities)) {
        entities = Object.values(entities);
      }
      return entities;
    }
    function splitAddedUpdatedEntities(newEntities, selectId, state) {
      newEntities = ensureEntitiesArray(newEntities);
      var added = [];
      var updated = [];
      for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
        var entity = newEntities_1[_i];
        var id = selectIdValue(entity, selectId);
        if (id in state.entities) {
          updated.push({
            id,
            changes: entity
          });
        } else {
          added.push(entity);
        }
      }
      return [ added, updated ];
    }
    function createUnsortedStateAdapter(selectId) {
      function addOneMutably(entity, state) {
        var key = selectIdValue(entity, selectId);
        if (key in state.entities) {
          return;
        }
        state.ids.push(key);
        state.entities[key] = entity;
      }
      function addManyMutably(newEntities, state) {
        newEntities = ensureEntitiesArray(newEntities);
        for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
          var entity = newEntities_2[_i];
          addOneMutably(entity, state);
        }
      }
      function setOneMutably(entity, state) {
        var key = selectIdValue(entity, selectId);
        if (!(key in state.entities)) {
          state.ids.push(key);
        }
        state.entities[key] = entity;
      }
      function setManyMutably(newEntities, state) {
        newEntities = ensureEntitiesArray(newEntities);
        for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
          var entity = newEntities_3[_i];
          setOneMutably(entity, state);
        }
      }
      function setAllMutably(newEntities, state) {
        newEntities = ensureEntitiesArray(newEntities);
        state.ids = [];
        state.entities = {};
        addManyMutably(newEntities, state);
      }
      function removeOneMutably(key, state) {
        return removeManyMutably([ key ], state);
      }
      function removeManyMutably(keys, state) {
        var didMutate = false;
        keys.forEach((function(key) {
          if (key in state.entities) {
            delete state.entities[key];
            didMutate = true;
          }
        }));
        if (didMutate) {
          state.ids = state.ids.filter((function(id) {
            return id in state.entities;
          }));
        }
      }
      function removeAllMutably(state) {
        Object.assign(state, {
          ids: [],
          entities: {}
        });
      }
      function takeNewKey(keys, update, state) {
        var original2 = state.entities[update.id];
        var updated = Object.assign({}, original2, update.changes);
        var newKey = selectIdValue(updated, selectId);
        var hasNewKey = newKey !== update.id;
        if (hasNewKey) {
          keys[update.id] = newKey;
          delete state.entities[update.id];
        }
        state.entities[newKey] = updated;
        return hasNewKey;
      }
      function updateOneMutably(update, state) {
        return updateManyMutably([ update ], state);
      }
      function updateManyMutably(updates, state) {
        var newKeys = {};
        var updatesPerEntity = {};
        updates.forEach((function(update) {
          if (update.id in state.entities) {
            updatesPerEntity[update.id] = {
              id: update.id,
              changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
            };
          }
        }));
        updates = Object.values(updatesPerEntity);
        var didMutateEntities = updates.length > 0;
        if (didMutateEntities) {
          var didMutateIds = updates.filter((function(update) {
            return takeNewKey(newKeys, update, state);
          })).length > 0;
          if (didMutateIds) {
            state.ids = Object.keys(state.entities);
          }
        }
      }
      function upsertOneMutably(entity, state) {
        return upsertManyMutably([ entity ], state);
      }
      function upsertManyMutably(newEntities, state) {
        var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
        updateManyMutably(updated, state);
        addManyMutably(added, state);
      }
      return {
        removeAll: createSingleArgumentStateOperator(removeAllMutably),
        addOne: createStateOperator(addOneMutably),
        addMany: createStateOperator(addManyMutably),
        setOne: createStateOperator(setOneMutably),
        setMany: createStateOperator(setManyMutably),
        setAll: createStateOperator(setAllMutably),
        updateOne: createStateOperator(updateOneMutably),
        updateMany: createStateOperator(updateManyMutably),
        upsertOne: createStateOperator(upsertOneMutably),
        upsertMany: createStateOperator(upsertManyMutably),
        removeOne: createStateOperator(removeOneMutably),
        removeMany: createStateOperator(removeManyMutably)
      };
    }
    function createSortedStateAdapter(selectId, sort) {
      var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
      function addOneMutably(entity, state) {
        return addManyMutably([ entity ], state);
      }
      function addManyMutably(newEntities, state) {
        newEntities = ensureEntitiesArray(newEntities);
        var models = newEntities.filter((function(model) {
          return !(selectIdValue(model, selectId) in state.entities);
        }));
        if (models.length !== 0) {
          merge(models, state);
        }
      }
      function setOneMutably(entity, state) {
        return setManyMutably([ entity ], state);
      }
      function setManyMutably(newEntities, state) {
        newEntities = ensureEntitiesArray(newEntities);
        if (newEntities.length !== 0) {
          merge(newEntities, state);
        }
      }
      function setAllMutably(newEntities, state) {
        newEntities = ensureEntitiesArray(newEntities);
        state.entities = {};
        state.ids = [];
        addManyMutably(newEntities, state);
      }
      function updateOneMutably(update, state) {
        return updateManyMutably([ update ], state);
      }
      function updateManyMutably(updates, state) {
        var appliedUpdates = false;
        for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
          var update = updates_1[_i];
          var entity = state.entities[update.id];
          if (!entity) {
            continue;
          }
          appliedUpdates = true;
          Object.assign(entity, update.changes);
          var newId = selectId(entity);
          if (update.id !== newId) {
            delete state.entities[update.id];
            state.entities[newId] = entity;
          }
        }
        if (appliedUpdates) {
          resortEntities(state);
        }
      }
      function upsertOneMutably(entity, state) {
        return upsertManyMutably([ entity ], state);
      }
      function upsertManyMutably(newEntities, state) {
        var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
        updateManyMutably(updated, state);
        addManyMutably(added, state);
      }
      function areArraysEqual(a, b) {
        if (a.length !== b.length) {
          return false;
        }
        for (var i = 0; i < a.length && i < b.length; i++) {
          if (a[i] === b[i]) {
            continue;
          }
          return false;
        }
        return true;
      }
      function merge(models, state) {
        models.forEach((function(model) {
          state.entities[selectId(model)] = model;
        }));
        resortEntities(state);
      }
      function resortEntities(state) {
        var allEntities = Object.values(state.entities);
        allEntities.sort(sort);
        var newSortedIds = allEntities.map(selectId);
        var ids = state.ids;
        if (!areArraysEqual(ids, newSortedIds)) {
          state.ids = newSortedIds;
        }
      }
      return {
        removeOne,
        removeMany,
        removeAll,
        addOne: createStateOperator(addOneMutably),
        updateOne: createStateOperator(updateOneMutably),
        upsertOne: createStateOperator(upsertOneMutably),
        setOne: createStateOperator(setOneMutably),
        setMany: createStateOperator(setManyMutably),
        setAll: createStateOperator(setAllMutably),
        addMany: createStateOperator(addManyMutably),
        updateMany: createStateOperator(updateManyMutably),
        upsertMany: createStateOperator(upsertManyMutably)
      };
    }
    function createEntityAdapter(options) {
      if (options === void 0) {
        options = {};
      }
      var _c = __spreadValues({
        sortComparer: false,
        selectId: function(instance) {
          return instance.id;
        }
      }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
      var stateFactory = createInitialStateFactory();
      var selectorsFactory = createSelectorsFactory();
      var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
      return __spreadValues(__spreadValues(__spreadValues({
        selectId,
        sortComparer
      }, stateFactory), selectorsFactory), stateAdapter);
    }
    var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
    var nanoid = function(size) {
      if (size === void 0) {
        size = 21;
      }
      var id = "";
      var i = size;
      while (i--) {
        id += urlAlphabet[Math.random() * 64 | 0];
      }
      return id;
    };
    var commonProperties = [ "name", "message", "stack", "code" ];
    var RejectWithValue = function() {
      function RejectWithValue(payload, meta) {
        this.payload = payload;
        this.meta = meta;
      }
      return RejectWithValue;
    }();
    var FulfillWithMeta = function() {
      function FulfillWithMeta(payload, meta) {
        this.payload = payload;
        this.meta = meta;
      }
      return FulfillWithMeta;
    }();
    var miniSerializeError = function(value) {
      if (typeof value === "object" && value !== null) {
        var simpleError = {};
        for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
          var property = commonProperties_1[_i];
          if (typeof value[property] === "string") {
            simpleError[property] = value[property];
          }
        }
        return simpleError;
      }
      return {
        message: String(value)
      };
    };
    var createAsyncThunk = function() {
      function createAsyncThunk2(typePrefix, payloadCreator, options) {
        var fulfilled = createAction(typePrefix + "/fulfilled", (function(payload, requestId, arg, meta) {
          return {
            payload,
            meta: __spreadProps(__spreadValues({}, meta || {}), {
              arg,
              requestId,
              requestStatus: "fulfilled"
            })
          };
        }));
        var pending = createAction(typePrefix + "/pending", (function(requestId, arg, meta) {
          return {
            payload: void 0,
            meta: __spreadProps(__spreadValues({}, meta || {}), {
              arg,
              requestId,
              requestStatus: "pending"
            })
          };
        }));
        var rejected = createAction(typePrefix + "/rejected", (function(error, requestId, arg, payload, meta) {
          return {
            payload,
            error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
            meta: __spreadProps(__spreadValues({}, meta || {}), {
              arg,
              requestId,
              rejectedWithValue: !!payload,
              requestStatus: "rejected",
              aborted: (error == null ? void 0 : error.name) === "AbortError",
              condition: (error == null ? void 0 : error.name) === "ConditionError"
            })
          };
        }));
        var displayedWarning = false;
        var AC = typeof AbortController !== "undefined" ? AbortController : function() {
          function class_1() {
            this.signal = {
              aborted: false,
              addEventListener: function() {},
              dispatchEvent: function() {
                return false;
              },
              onabort: function() {},
              removeEventListener: function() {},
              reason: void 0,
              throwIfAborted: function() {}
            };
          }
          class_1.prototype.abort = function() {
            if (false) {}
          };
          return class_1;
        }();
        function actionCreator(arg) {
          return function(dispatch, getState, extra) {
            var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
            var abortController = new AC;
            var abortReason;
            var started = false;
            function abort(reason) {
              abortReason = reason;
              abortController.abort();
            }
            var promise2 = function() {
              return __async(this, null, (function() {
                var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
                return __generator(this, (function(_c) {
                  switch (_c.label) {
                   case 0:
                    _c.trys.push([ 0, 4, , 5 ]);
                    conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, {
                      getState,
                      extra
                    });
                    if (!isThenable(conditionResult)) return [ 3, 2 ];
                    return [ 4, conditionResult ];

                   case 1:
                    conditionResult = _c.sent();
                    _c.label = 2;

                   case 2:
                    if (conditionResult === false || abortController.signal.aborted) {
                      throw {
                        name: "ConditionError",
                        message: "Aborted due to condition callback returning false."
                      };
                    }
                    started = true;
                    abortedPromise = new Promise((function(_, reject) {
                      return abortController.signal.addEventListener("abort", (function() {
                        return reject({
                          name: "AbortError",
                          message: abortReason || "Aborted"
                        });
                      }));
                    }));
                    dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, {
                      requestId,
                      arg
                    }, {
                      getState,
                      extra
                    })));
                    return [ 4, Promise.race([ abortedPromise, Promise.resolve(payloadCreator(arg, {
                      dispatch,
                      getState,
                      extra,
                      requestId,
                      signal: abortController.signal,
                      abort,
                      rejectWithValue: function(value, meta) {
                        return new RejectWithValue(value, meta);
                      },
                      fulfillWithValue: function(value, meta) {
                        return new FulfillWithMeta(value, meta);
                      }
                    })).then((function(result) {
                      if (result instanceof RejectWithValue) {
                        throw result;
                      }
                      if (result instanceof FulfillWithMeta) {
                        return fulfilled(result.payload, requestId, arg, result.meta);
                      }
                      return fulfilled(result, requestId, arg);
                    })) ]) ];

                   case 3:
                    finalAction = _c.sent();
                    return [ 3, 5 ];

                   case 4:
                    err_1 = _c.sent();
                    finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
                    return [ 3, 5 ];

                   case 5:
                    skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
                    if (!skipDispatch) {
                      dispatch(finalAction);
                    }
                    return [ 2, finalAction ];
                  }
                }));
              }));
            }();
            return Object.assign(promise2, {
              abort,
              requestId,
              arg,
              unwrap: function() {
                return promise2.then(unwrapResult);
              }
            });
          };
        }
        return Object.assign(actionCreator, {
          pending,
          rejected,
          fulfilled,
          typePrefix
        });
      }
      createAsyncThunk2.withTypes = function() {
        return createAsyncThunk2;
      };
      return createAsyncThunk2;
    }();
    function unwrapResult(action) {
      if (action.meta && action.meta.rejectedWithValue) {
        throw action.payload;
      }
      if (action.error) {
        throw action.error;
      }
      return action.payload;
    }
    function isThenable(value) {
      return value !== null && typeof value === "object" && typeof value.then === "function";
    }
    var matches = function(matcher, action) {
      if (hasMatchFunction(matcher)) {
        return matcher.match(action);
      } else {
        return matcher(action);
      }
    };
    function isAnyOf() {
      var matchers = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        matchers[_i] = arguments[_i];
      }
      return function(action) {
        return matchers.some((function(matcher) {
          return matches(matcher, action);
        }));
      };
    }
    function isAllOf() {
      var matchers = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        matchers[_i] = arguments[_i];
      }
      return function(action) {
        return matchers.every((function(matcher) {
          return matches(matcher, action);
        }));
      };
    }
    function hasExpectedRequestMetadata(action, validStatus) {
      if (!action || !action.meta) return false;
      var hasValidRequestId = typeof action.meta.requestId === "string";
      var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
      return hasValidRequestId && hasValidRequestStatus;
    }
    function isAsyncThunkArray(a) {
      return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
    }
    function isPending() {
      var asyncThunks = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        asyncThunks[_i] = arguments[_i];
      }
      if (asyncThunks.length === 0) {
        return function(action) {
          return hasExpectedRequestMetadata(action, [ "pending" ]);
        };
      }
      if (!isAsyncThunkArray(asyncThunks)) {
        return isPending()(asyncThunks[0]);
      }
      return function(action) {
        var matchers = asyncThunks.map((function(asyncThunk) {
          return asyncThunk.pending;
        }));
        var combinedMatcher = isAnyOf.apply(void 0, matchers);
        return combinedMatcher(action);
      };
    }
    function isRejected() {
      var asyncThunks = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        asyncThunks[_i] = arguments[_i];
      }
      if (asyncThunks.length === 0) {
        return function(action) {
          return hasExpectedRequestMetadata(action, [ "rejected" ]);
        };
      }
      if (!isAsyncThunkArray(asyncThunks)) {
        return isRejected()(asyncThunks[0]);
      }
      return function(action) {
        var matchers = asyncThunks.map((function(asyncThunk) {
          return asyncThunk.rejected;
        }));
        var combinedMatcher = isAnyOf.apply(void 0, matchers);
        return combinedMatcher(action);
      };
    }
    function isRejectedWithValue() {
      var asyncThunks = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        asyncThunks[_i] = arguments[_i];
      }
      var hasFlag = function(action) {
        return action && action.meta && action.meta.rejectedWithValue;
      };
      if (asyncThunks.length === 0) {
        return function(action) {
          var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
          return combinedMatcher(action);
        };
      }
      if (!isAsyncThunkArray(asyncThunks)) {
        return isRejectedWithValue()(asyncThunks[0]);
      }
      return function(action) {
        var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
        return combinedMatcher(action);
      };
    }
    function isFulfilled() {
      var asyncThunks = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        asyncThunks[_i] = arguments[_i];
      }
      if (asyncThunks.length === 0) {
        return function(action) {
          return hasExpectedRequestMetadata(action, [ "fulfilled" ]);
        };
      }
      if (!isAsyncThunkArray(asyncThunks)) {
        return isFulfilled()(asyncThunks[0]);
      }
      return function(action) {
        var matchers = asyncThunks.map((function(asyncThunk) {
          return asyncThunk.fulfilled;
        }));
        var combinedMatcher = isAnyOf.apply(void 0, matchers);
        return combinedMatcher(action);
      };
    }
    function isAsyncThunkAction() {
      var asyncThunks = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        asyncThunks[_i] = arguments[_i];
      }
      if (asyncThunks.length === 0) {
        return function(action) {
          return hasExpectedRequestMetadata(action, [ "pending", "fulfilled", "rejected" ]);
        };
      }
      if (!isAsyncThunkArray(asyncThunks)) {
        return isAsyncThunkAction()(asyncThunks[0]);
      }
      return function(action) {
        var matchers = [];
        for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
          var asyncThunk = asyncThunks_1[_i];
          matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
        }
        var combinedMatcher = isAnyOf.apply(void 0, matchers);
        return combinedMatcher(action);
      };
    }
    var assertFunction = function(func, expected) {
      if (typeof func !== "function") {
        throw new TypeError(expected + " is not a function");
      }
    };
    var noop = function() {};
    var catchRejection = function(promise2, onError) {
      if (onError === void 0) {
        onError = noop;
      }
      promise2.catch(onError);
      return promise2;
    };
    var addAbortSignalListener = function(abortSignal, callback) {
      abortSignal.addEventListener("abort", callback, {
        once: true
      });
      return function() {
        return abortSignal.removeEventListener("abort", callback);
      };
    };
    var abortControllerWithReason = function(abortController, reason) {
      var signal = abortController.signal;
      if (signal.aborted) {
        return;
      }
      if (!("reason" in signal)) {
        Object.defineProperty(signal, "reason", {
          enumerable: true,
          value: reason,
          configurable: true,
          writable: true
        });
      }
      abortController.abort(reason);
    };
    var task = "task";
    var listener = "listener";
    var completed = "completed";
    var cancelled = "cancelled";
    var taskCancelled = "task-" + cancelled;
    var taskCompleted = "task-" + completed;
    var listenerCancelled = listener + "-" + cancelled;
    var listenerCompleted = listener + "-" + completed;
    var TaskAbortError = function() {
      function TaskAbortError(code) {
        this.code = code;
        this.name = "TaskAbortError";
        this.message = task + " " + cancelled + " (reason: " + code + ")";
      }
      return TaskAbortError;
    }();
    var validateActive = function(signal) {
      if (signal.aborted) {
        throw new TaskAbortError(signal.reason);
      }
    };
    function raceWithSignal(signal, promise2) {
      var cleanup = noop;
      return new Promise((function(resolve, reject) {
        var notifyRejection = function() {
          return reject(new TaskAbortError(signal.reason));
        };
        if (signal.aborted) {
          notifyRejection();
          return;
        }
        cleanup = addAbortSignalListener(signal, notifyRejection);
        promise2.finally((function() {
          return cleanup();
        })).then(resolve, reject);
      })).finally((function() {
        cleanup = noop;
      }));
    }
    var runTask = function(task2, cleanUp) {
      return __async(void 0, null, (function() {
        var value, error_1;
        return __generator(this, (function(_c) {
          switch (_c.label) {
           case 0:
            _c.trys.push([ 0, 3, 4, 5 ]);
            return [ 4, Promise.resolve() ];

           case 1:
            _c.sent();
            return [ 4, task2() ];

           case 2:
            value = _c.sent();
            return [ 2, {
              status: "ok",
              value
            } ];

           case 3:
            error_1 = _c.sent();
            return [ 2, {
              status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
              error: error_1
            } ];

           case 4:
            cleanUp == null ? void 0 : cleanUp();
            return [ 7 ];

           case 5:
            return [ 2 ];
          }
        }));
      }));
    };
    var createPause = function(signal) {
      return function(promise2) {
        return catchRejection(raceWithSignal(signal, promise2).then((function(output) {
          validateActive(signal);
          return output;
        })));
      };
    };
    var createDelay = function(signal) {
      var pause = createPause(signal);
      return function(timeoutMs) {
        return pause(new Promise((function(resolve) {
          return setTimeout(resolve, timeoutMs);
        })));
      };
    };
    var redux_toolkit_esm_assign = Object.assign;
    var INTERNAL_NIL_TOKEN = {};
    var alm = "listenerMiddleware";
    var createFork = function(parentAbortSignal, parentBlockingPromises) {
      var linkControllers = function(controller) {
        return addAbortSignalListener(parentAbortSignal, (function() {
          return abortControllerWithReason(controller, parentAbortSignal.reason);
        }));
      };
      return function(taskExecutor, opts) {
        assertFunction(taskExecutor, "taskExecutor");
        var childAbortController = new AbortController;
        linkControllers(childAbortController);
        var result = runTask((function() {
          return __async(void 0, null, (function() {
            var result2;
            return __generator(this, (function(_c) {
              switch (_c.label) {
               case 0:
                validateActive(parentAbortSignal);
                validateActive(childAbortController.signal);
                return [ 4, taskExecutor({
                  pause: createPause(childAbortController.signal),
                  delay: createDelay(childAbortController.signal),
                  signal: childAbortController.signal
                }) ];

               case 1:
                result2 = _c.sent();
                validateActive(childAbortController.signal);
                return [ 2, result2 ];
              }
            }));
          }));
        }), (function() {
          return abortControllerWithReason(childAbortController, taskCompleted);
        }));
        if (opts == null ? void 0 : opts.autoJoin) {
          parentBlockingPromises.push(result);
        }
        return {
          result: createPause(parentAbortSignal)(result),
          cancel: function() {
            abortControllerWithReason(childAbortController, taskCancelled);
          }
        };
      };
    };
    var createTakePattern = function(startListening, signal) {
      var take = function(predicate, timeout) {
        return __async(void 0, null, (function() {
          var unsubscribe, tuplePromise, promises, output;
          return __generator(this, (function(_c) {
            switch (_c.label) {
             case 0:
              validateActive(signal);
              unsubscribe = function() {};
              tuplePromise = new Promise((function(resolve, reject) {
                var stopListening = startListening({
                  predicate,
                  effect: function(action, listenerApi) {
                    listenerApi.unsubscribe();
                    resolve([ action, listenerApi.getState(), listenerApi.getOriginalState() ]);
                  }
                });
                unsubscribe = function() {
                  stopListening();
                  reject();
                };
              }));
              promises = [ tuplePromise ];
              if (timeout != null) {
                promises.push(new Promise((function(resolve) {
                  return setTimeout(resolve, timeout, null);
                })));
              }
              _c.label = 1;

             case 1:
              _c.trys.push([ 1, , 3, 4 ]);
              return [ 4, raceWithSignal(signal, Promise.race(promises)) ];

             case 2:
              output = _c.sent();
              validateActive(signal);
              return [ 2, output ];

             case 3:
              unsubscribe();
              return [ 7 ];

             case 4:
              return [ 2 ];
            }
          }));
        }));
      };
      return function(predicate, timeout) {
        return catchRejection(take(predicate, timeout));
      };
    };
    var getListenerEntryPropsFrom = function(options) {
      var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
      if (type) {
        predicate = createAction(type).match;
      } else if (actionCreator) {
        type = actionCreator.type;
        predicate = actionCreator.match;
      } else if (matcher) {
        predicate = matcher;
      } else if (predicate) {} else {
        throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
      }
      assertFunction(effect, "options.listener");
      return {
        predicate,
        type,
        effect
      };
    };
    var createListenerEntry = function(options) {
      var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
      var id = nanoid();
      var entry = {
        id,
        effect,
        type,
        predicate,
        pending: new Set,
        unsubscribe: function() {
          throw new Error("Unsubscribe not initialized");
        }
      };
      return entry;
    };
    var cancelActiveListeners = function(entry) {
      entry.pending.forEach((function(controller) {
        abortControllerWithReason(controller, listenerCancelled);
      }));
    };
    var createClearListenerMiddleware = function(listenerMap) {
      return function() {
        listenerMap.forEach(cancelActiveListeners);
        listenerMap.clear();
      };
    };
    var safelyNotifyError = function(errorHandler, errorToNotify, errorInfo) {
      try {
        errorHandler(errorToNotify, errorInfo);
      } catch (errorHandlerError) {
        setTimeout((function() {
          throw errorHandlerError;
        }), 0);
      }
    };
    var addListener = createAction(alm + "/add");
    var clearAllListeners = createAction(alm + "/removeAll");
    var removeListener = createAction(alm + "/remove");
    var defaultErrorHandler = function() {
      var args = [];
      for (var _i = 0; _i < arguments.length; _i++) {
        args[_i] = arguments[_i];
      }
      console.error.apply(console, __spreadArray([ alm + "/error" ], args));
    };
    function createListenerMiddleware(middlewareOptions) {
      var _this = this;
      if (middlewareOptions === void 0) {
        middlewareOptions = {};
      }
      var listenerMap = new Map;
      var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
      assertFunction(onError, "onError");
      var insertEntry = function(entry) {
        entry.unsubscribe = function() {
          return listenerMap.delete(entry.id);
        };
        listenerMap.set(entry.id, entry);
        return function(cancelOptions) {
          entry.unsubscribe();
          if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
            cancelActiveListeners(entry);
          }
        };
      };
      var findListenerEntry = function(comparator) {
        for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
          var entry = _c[_i];
          if (comparator(entry)) {
            return entry;
          }
        }
        return void 0;
      };
      var startListening = function(options) {
        var entry = findListenerEntry((function(existingEntry) {
          return existingEntry.effect === options.effect;
        }));
        if (!entry) {
          entry = createListenerEntry(options);
        }
        return insertEntry(entry);
      };
      var stopListening = function(options) {
        var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
        var entry = findListenerEntry((function(entry2) {
          var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
          return matchPredicateOrType && entry2.effect === effect;
        }));
        if (entry) {
          entry.unsubscribe();
          if (options.cancelActive) {
            cancelActiveListeners(entry);
          }
        }
        return !!entry;
      };
      var notifyListener = function(entry, action, api, getOriginalState) {
        return __async(_this, null, (function() {
          var internalTaskController, take, autoJoinPromises, listenerError_1;
          return __generator(this, (function(_c) {
            switch (_c.label) {
             case 0:
              internalTaskController = new AbortController;
              take = createTakePattern(startListening, internalTaskController.signal);
              autoJoinPromises = [];
              _c.label = 1;

             case 1:
              _c.trys.push([ 1, 3, 4, 6 ]);
              entry.pending.add(internalTaskController);
              return [ 4, Promise.resolve(entry.effect(action, redux_toolkit_esm_assign({}, api, {
                getOriginalState,
                condition: function(predicate, timeout) {
                  return take(predicate, timeout).then(Boolean);
                },
                take,
                delay: createDelay(internalTaskController.signal),
                pause: createPause(internalTaskController.signal),
                extra,
                signal: internalTaskController.signal,
                fork: createFork(internalTaskController.signal, autoJoinPromises),
                unsubscribe: entry.unsubscribe,
                subscribe: function() {
                  listenerMap.set(entry.id, entry);
                },
                cancelActiveListeners: function() {
                  entry.pending.forEach((function(controller, _, set) {
                    if (controller !== internalTaskController) {
                      abortControllerWithReason(controller, listenerCancelled);
                      set.delete(controller);
                    }
                  }));
                }
              }))) ];

             case 2:
              _c.sent();
              return [ 3, 6 ];

             case 3:
              listenerError_1 = _c.sent();
              if (!(listenerError_1 instanceof TaskAbortError)) {
                safelyNotifyError(onError, listenerError_1, {
                  raisedBy: "effect"
                });
              }
              return [ 3, 6 ];

             case 4:
              return [ 4, Promise.allSettled(autoJoinPromises) ];

             case 5:
              _c.sent();
              abortControllerWithReason(internalTaskController, listenerCompleted);
              entry.pending.delete(internalTaskController);
              return [ 7 ];

             case 6:
              return [ 2 ];
            }
          }));
        }));
      };
      var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
      var middleware = function(api) {
        return function(next) {
          return function(action) {
            if (!isAction(action)) {
              return next(action);
            }
            if (addListener.match(action)) {
              return startListening(action.payload);
            }
            if (clearAllListeners.match(action)) {
              clearListenerMiddleware();
              return;
            }
            if (removeListener.match(action)) {
              return stopListening(action.payload);
            }
            var originalState = api.getState();
            var getOriginalState = function() {
              if (originalState === INTERNAL_NIL_TOKEN) {
                throw new Error(alm + ": getOriginalState can only be called synchronously");
              }
              return originalState;
            };
            var result;
            try {
              result = next(action);
              if (listenerMap.size > 0) {
                var currentState = api.getState();
                var listenerEntries = Array.from(listenerMap.values());
                for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
                  var entry = listenerEntries_1[_i];
                  var runListener = false;
                  try {
                    runListener = entry.predicate(action, currentState, originalState);
                  } catch (predicateError) {
                    runListener = false;
                    safelyNotifyError(onError, predicateError, {
                      raisedBy: "predicate"
                    });
                  }
                  if (!runListener) {
                    continue;
                  }
                  notifyListener(entry, action, api, getOriginalState);
                }
              }
            } finally {
              originalState = INTERNAL_NIL_TOKEN;
            }
            return result;
          };
        };
      };
      return {
        middleware,
        startListening,
        stopListening,
        clearListeners: clearListenerMiddleware
      };
    }
    var SHOULD_AUTOBATCH = "RTK_autoBatch";
    var prepareAutoBatched = function() {
      return function(payload) {
        var _c;
        return {
          payload,
          meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
        };
      };
    };
    var promise;
    var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : globalThis) : function(cb) {
      return (promise || (promise = Promise.resolve())).then(cb).catch((function(err) {
        return setTimeout((function() {
          throw err;
        }), 0);
      }));
    };
    var createQueueWithTimer = function(timeout) {
      return function(notify) {
        setTimeout(notify, timeout);
      };
    };
    var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);
    var autoBatchEnhancer = function(options) {
      if (options === void 0) {
        options = {
          type: "raf"
        };
      }
      return function(next) {
        return function() {
          var args = [];
          for (var _i = 0; _i < arguments.length; _i++) {
            args[_i] = arguments[_i];
          }
          var store = next.apply(void 0, args);
          var notifying = true;
          var shouldNotifyAtEndOfTick = false;
          var notificationQueued = false;
          var listeners = new Set;
          var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
          var notifyListeners = function() {
            notificationQueued = false;
            if (shouldNotifyAtEndOfTick) {
              shouldNotifyAtEndOfTick = false;
              listeners.forEach((function(l) {
                return l();
              }));
            }
          };
          return Object.assign({}, store, {
            subscribe: function(listener2) {
              var wrappedListener = function() {
                return notifying && listener2();
              };
              var unsubscribe = store.subscribe(wrappedListener);
              listeners.add(listener2);
              return function() {
                unsubscribe();
                listeners.delete(listener2);
              };
            },
            dispatch: function(action) {
              var _a;
              try {
                notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
                shouldNotifyAtEndOfTick = !notifying;
                if (shouldNotifyAtEndOfTick) {
                  if (!notificationQueued) {
                    notificationQueued = true;
                    queueCallback(notifyListeners);
                  }
                }
                return store.dispatch(action);
              } finally {
                notifying = true;
              }
            }
          });
        };
      };
    };
    immer_esm_F();
    const allAliases = {};
    const asyncThunkProperties = (() => {
      const temp = [ "typePrefix", "pending", "rejected", "fulfilled" ];
      const exhaustiveList = temp;
      return exhaustiveList;
    })();
    function createBackgroundAsyncThunk(typePrefix, payloadCreator, options) {
      if (allAliases[typePrefix]) {
        throw new Error(`Attempted to register an alias twice: ${typePrefix}`);
      }
      const baseThunkActionCreator = createAsyncThunk(typePrefix, (async (...args) => {
        try {
          return await payloadCreator(...args);
        } catch (error) {
          lib_logger.error("Async thunk failed", error);
          throw error;
        }
      }), options);
      const webextActionCreator = Object.assign((payload => ({
        type: typePrefix,
        payload
      })), Object.fromEntries(asyncThunkProperties.map((prop => [ prop, baseThunkActionCreator[prop] ]))));
      allAliases[typePrefix] = action => baseThunkActionCreator(action.payload);
      return webextActionCreator;
    }
    const noopAction = createBackgroundAsyncThunk("noop", (() => {}));
    let AccountType = function(AccountType) {
      AccountType["ReadOnly"] = "read-only";
      AccountType["keyPair"] = "keyPair";
      AccountType["Imported"] = "imported";
      AccountType["Internal"] = "internal";
      return AccountType;
    }({});
    const accountTypes = [ AccountType.Internal, AccountType.Imported, AccountType.keyPair, AccountType.ReadOnly ];
    const DEFAULT_ACCOUNT_NAMES = [ "Phoenix", "Matilda", "Sirius", "Topa", "Atos", "Sport", "Lola", "Foz" ];
    const availableDefaultNames = [ ...DEFAULT_ACCOUNT_NAMES ];
    const initialState = {
      accountsData: {
        evm: {}
      },
      combinedData: {
        totalMainCurrencyValue: "",
        assets: []
      }
    };
    function newAccountData(address, network, accountsState) {
      const normalizedAddress = normalizeQEVMAddress(address);
      const existingAccountsCount = Object.keys(accountsState.accountsData.evm[network.chainID]).filter((key => normalizeQEVMAddress(key) !== normalizedAddress)).length;
      const sameAccountOnDifferentChain = Object.values(accountsState.accountsData.evm).flatMap((chain => Object.values(chain))).find((accountData => accountData !== "loading" && normalizeQEVMAddress(accountData.address) === normalizedAddress));
      const defaultNameIndex = existingAccountsCount % availableDefaultNames.length + Number(BigInt(normalizedAddress) % BigInt(availableDefaultNames.length - existingAccountsCount % availableDefaultNames.length));
      let defaultAccountName = sameAccountOnDifferentChain?.defaultName;
      if (typeof defaultAccountName === "undefined") {
        defaultAccountName = availableDefaultNames[defaultNameIndex];
        availableDefaultNames.splice(defaultNameIndex, 1);
        availableDefaultNames.unshift(defaultAccountName);
      }
      const defaultAccountAvatar = `./images/avatars/${defaultAccountName.toLowerCase()}@2x.png`;
      return {
        address: normalizedAddress,
        network,
        balances: {},
        ens: {},
        defaultName: defaultAccountName,
        defaultAvatar: defaultAccountAvatar
      };
    }
    function updateCombinedData(immerState) {
      const filteredEvm = Object.keys(immerState.accountsData.evm).filter((key => !TEST_NETWORK_BY_CHAIN_ID.has(key))).reduce(((evm, key) => ({
        ...evm,
        [key]: immerState.accountsData.evm[key]
      })), {});
      const combinedAccountBalances = Object.values(filteredEvm).flatMap((accountDataByChain => Object.values(accountDataByChain))).flatMap((ad => ad === "loading" ? [] : Object.values(ad.balances).map((ab => ab.assetAmount))));
      immerState.combinedData.assets = Object.values(combinedAccountBalances.filter((({asset}) => isTrustedAsset(asset))).reduce(((acc, combinedAssetAmount) => {
        const {asset} = combinedAssetAmount;
        const assetID = asset.symbol;
        let {amount} = combinedAssetAmount;
        if (acc[assetID]?.asset) {
          const accAsset = acc[assetID].asset;
          const existingDecimals = isFungibleAsset(accAsset) ? accAsset.decimals : 0;
          const newDecimals = isFungibleAsset(combinedAssetAmount.asset) ? combinedAssetAmount.asset.decimals : 0;
          if (newDecimals !== existingDecimals) {
            amount = convertFixedPoint(amount, newDecimals, existingDecimals);
          }
        }
        if (acc[assetID]) {
          acc[assetID].amount += amount;
        } else {
          acc[assetID] = {
            ...combinedAssetAmount
          };
        }
        return acc;
      }), {}));
    }
    function getOrCreateAccountData(accountState, account, network) {
      const normalizedAddress = normalizeQEVMAddress(account);
      const accountData = accountState.accountsData.evm[network.chainID][normalizedAddress];
      if (accountData === "loading" || !accountData) {
        return newAccountData(normalizedAddress, network, accountState);
      }
      return accountData;
    }
    const accountSlice = createSlice({
      name: "account",
      initialState,
      reducers: {
        loadAccount: (immerState, {payload: {address, network}}) => {
          const normalizedAddress = normalizeQEVMAddress(address);
          if (immerState.accountsData.evm[network.chainID]?.[normalizedAddress] !== undefined) {
            return;
          }
          if (immerState.accountsData.evm[network.chainID]) {
            const existingEntries = Object.keys(immerState.accountsData.evm[network.chainID]);
            const duplicateKey = existingEntries.find((key => normalizeQEVMAddress(key) === normalizedAddress && key !== normalizedAddress));
            if (duplicateKey) {
              const existingData = immerState.accountsData.evm[network.chainID][duplicateKey];
              if (existingData !== undefined) {
                immerState.accountsData.evm[network.chainID][normalizedAddress] = existingData;
              }
              delete immerState.accountsData.evm[network.chainID][duplicateKey];
              return;
            }
          }
          immerState.accountsData.evm[network.chainID] ??= {};
          immerState.accountsData.evm[network.chainID] = {
            ...immerState.accountsData.evm[network.chainID],
            [normalizedAddress]: "loading"
          };
        },
        deleteAccount: (immerState, {payload: address}) => {
          const normalizedAddress = normalizeQEVMAddress(address);
          const {evm} = immerState.accountsData;
          const hasAddress = Object.keys(evm ?? {}).some((chainID => Object.keys(evm[chainID]).some((addressOnChain => normalizeQEVMAddress(addressOnChain) === normalizedAddress))));
          if (!hasAddress) {
            return;
          }
          Object.keys(evm).forEach((chainId => {
            const updatedChain = {
              ...evm[chainId]
            };
            let foundAndDeleted = false;
            Object.keys(updatedChain).forEach((key => {
              if (normalizeQEVMAddress(key) === normalizedAddress) {
                delete updatedChain[key];
                foundAndDeleted = true;
              }
            }));
            if (foundAndDeleted) {
              immerState.accountsData.evm[chainId] = updatedChain;
            }
          }));
          updateCombinedData(immerState);
        },
        updateAccountBalance: (immerState, {payload: {balances}}) => {
          balances.forEach((updatedAccountBalance => {
            const {address, network, assetAmount: {asset}} = updatedAccountBalance;
            const normalizedAddress = normalizeQEVMAddress(address);
            const assetID = getFullAssetID(asset);
            let existingAccountData = immerState.accountsData.evm[network.chainID]?.[normalizedAddress];
            if (existingAccountData === undefined && immerState.accountsData.evm[network.chainID]) {
              const existingEntries = Object.keys(immerState.accountsData.evm[network.chainID]);
              const duplicateKey = existingEntries.find((key => normalizeQEVMAddress(key) === normalizedAddress && key !== normalizedAddress));
              if (duplicateKey) {
                existingAccountData = immerState.accountsData.evm[network.chainID][duplicateKey];
                if (existingAccountData !== undefined) {
                  immerState.accountsData.evm[network.chainID][normalizedAddress] = existingAccountData;
                  delete immerState.accountsData.evm[network.chainID][duplicateKey];
                }
              }
            }
            if (existingAccountData === undefined) {
              return;
            }
            if (existingAccountData !== "loading") {
              if (updatedAccountBalance.assetAmount.amount === 0n && existingAccountData.balances[assetID] === undefined && !isBaseAssetForNetwork(asset, network)) {
                return;
              }
              existingAccountData.balances[assetID] = updatedAccountBalance;
            } else {
              immerState.accountsData.evm[network.chainID][normalizedAddress] = {
                ...newAccountData(normalizedAddress, network, immerState),
                balances: {
                  [assetID]: updatedAccountBalance
                }
              };
            }
          }));
          updateCombinedData(immerState);
        },
        updateAccountName: (immerState, {payload: {address, network, name}}) => {
          const normalizedAddress = normalizeQEVMAddress(address);
          if (immerState.accountsData.evm[network.chainID]?.[normalizedAddress] === undefined) {
            return;
          }
          immerState.accountsData.evm[network.chainID] ??= {};
          const baseAccountData = getOrCreateAccountData(immerState, normalizedAddress, network);
          immerState.accountsData.evm[network.chainID][normalizedAddress] = {
            ...baseAccountData,
            ens: {
              ...baseAccountData.ens,
              name
            }
          };
        },
        updateENSAvatar: (immerState, {payload: {address, network, avatar}}) => {
          const normalizedAddress = normalizeQEVMAddress(address);
          if (immerState.accountsData.evm[network.chainID]?.[normalizedAddress] === undefined) {
            return;
          }
          immerState.accountsData.evm[network.chainID] ??= {};
          const baseAccountData = getOrCreateAccountData(immerState, normalizedAddress, network);
          immerState.accountsData.evm[network.chainID][normalizedAddress] = {
            ...baseAccountData,
            ens: {
              ...baseAccountData.ens,
              avatarURL: avatar
            }
          };
        },
        updateAccountAssetReferences: (immerState, {payload: assets}) => {
          const assetsByChainID = {};
          assets.forEach((asset => {
            assetsByChainID[asset.homeNetwork.chainID] ??= [];
            assetsByChainID[asset.homeNetwork.chainID].push(asset);
          }));
          Object.keys(assetsByChainID).forEach((chainID => {
            const allAccounts = immerState.accountsData.evm[chainID];
            Object.keys(allAccounts ?? {}).forEach((address => {
              const account = allAccounts[address];
              if (account !== "loading") {
                assetsByChainID[chainID].forEach((asset => {
                  const {assetAmount} = account.balances[getFullAssetID(asset)] ?? {
                    assetAmount: undefined
                  };
                  if (assetAmount && isSmartContractFungibleAsset(assetAmount.asset) && sameQEVMAddress(assetAmount.asset.contractAddress, asset.contractAddress)) {
                    Object.assign(assetAmount.asset, asset);
                  }
                }));
              }
            }));
          }));
          updateCombinedData(immerState);
        },
        removeAssetReferences: (immerState, {payload: asset}) => {
          const allAccounts = immerState.accountsData.evm[asset.homeNetwork.chainID];
          Object.keys(allAccounts).forEach((address => {
            const account = allAccounts[address];
            if (account !== "loading") {
              Object.values(account.balances).forEach((({assetAmount}) => {
                if (isSameAsset(assetAmount.asset, asset)) {
                  delete account.balances[getFullAssetID(assetAmount.asset)];
                }
              }));
            }
          }));
          updateCombinedData(immerState);
        },
        removeChainBalances: (immerState, {payload: chainID}) => {
          delete immerState.accountsData.evm[chainID];
        }
      }
    });
    const {deleteAccount, loadAccount, updateAccountBalance, updateAccountName, updateENSAvatar, updateAccountAssetReferences, removeAssetReferences, removeChainBalances} = accountSlice.actions;
    const accounts = accountSlice.reducer;
    const resolveNameOnNetwork = createBackgroundAsyncThunk("account/resolveNameOnNetwork", (async (nameOnNetwork, {extra: {main}}) => main.resolveNameOnNetwork(nameOnNetwork)));
    const addAddressNetwork = createBackgroundAsyncThunk("account/addAccount", (async (addressNetwork, {dispatch, extra: {main}}) => {
      const normalizedAddressNetwork = {
        address: addressNetwork.address,
        network: addressNetwork.network
      };
      dispatch(loadAccount(normalizedAddressNetwork));
      await main.addAccount(normalizedAddressNetwork);
    }));
    const addOrEditAddressName = createBackgroundAsyncThunk("account/addOrEditAddressName", (async (payload, {extra: {main}}) => {
      await main.addOrEditAddressName(payload);
    }));
    const removeAccount = createBackgroundAsyncThunk("account/removeAccount", (async (payload, {extra: {main}}) => {
      const {addressOnNetwork, signer, lastAddressInAccount} = payload;
      const normalizedAddress = normalizeQEVMAddress(addressOnNetwork.address);
      await main.removeAccount(normalizedAddress, signer, lastAddressInAccount);
    }));
    const assets_initialState = [];
    const assetsSlice = createSlice({
      name: "assets",
      initialState: assets_initialState,
      reducers: {
        assetsLoaded: (immerState, {payload: {assets: newAssets, loadingScope}}) => {
          const networksToReset = loadingScope === "network" ? newAssets.reduce(((uniqueNetworks, asset) => {
            const lastNetwork = uniqueNetworks.at(-1);
            return "homeNetwork" in asset && (uniqueNetworks.length === 0 || lastNetwork && !sameNetwork(asset.homeNetwork, lastNetwork)) ? [ ...uniqueNetworks, asset.homeNetwork ] : uniqueNetworks;
          }), []) : [];
          const newAssetsBySymbol = {};
          newAssets.forEach((asset => {
            newAssetsBySymbol[asset.symbol] ??= [];
            newAssetsBySymbol[asset.symbol].push(asset);
          }));
          const pruneIndexes = [];
          immerState.forEach(((existingAsset, i) => {
            const matchingNewAssets = (newAssetsBySymbol[existingAsset.symbol] ?? []).filter((newAsset => isSameAsset(existingAsset, newAsset)));
            const assetOnAResettingNetwork = loadingScope === "network" && networksToReset.some((network => "homeNetwork" in existingAsset && sameNetwork(existingAsset.homeNetwork, network)));
            if (matchingNewAssets.length === 0) {
              if (loadingScope === "all" || loadingScope === "network" && assetOnAResettingNetwork) {
                pruneIndexes.push(i);
                return;
              }
              return;
            }
            if (loadingScope === "all" || loadingScope === "network" && assetOnAResettingNetwork) {
              Object.assign(existingAsset, matchingNewAssets[0]);
            } else {
              immerState[i].metadata = matchingNewAssets[0].metadata;
            }
            newAssetsBySymbol[existingAsset.symbol] = newAssetsBySymbol[existingAsset.symbol].filter((newAsset => !matchingNewAssets.includes(newAsset)));
          }));
          if (pruneIndexes.length === 1) {
            immerState.splice(pruneIndexes[0], 1);
          } else if (pruneIndexes.length > 1) {
            const currentRun = {
              runStart: pruneIndexes[0],
              runLength: 1
            };
            for (let i = 1; i < pruneIndexes.length; i += 1) {
              if (pruneIndexes[i] === currentRun.runStart + currentRun.runLength) {
                currentRun.runLength += 1;
              } else {
                immerState.splice(currentRun.runStart, currentRun.runLength);
                currentRun.runStart = pruneIndexes[i];
                currentRun.runLength = 1;
              }
            }
          }
          Object.values(newAssetsBySymbol).flat().forEach((newAsset => {
            immerState.push(newAsset);
          }));
        },
        removeAsset: (immerState, {payload: removedAsset}) => immerState.filter((asset => !isSameAsset(asset, removedAsset)))
      }
    });
    const {assetsLoaded, removeAsset} = assetsSlice.actions;
    const assets = assetsSlice.reducer;
    const updateAssetMetadata = createBackgroundAsyncThunk("assets/updateAssetMetadata", (async ({asset, metadata}, {extra: {main}}) => {
      await main.updateAssetMetadata(asset, metadata);
    }));
    const refreshAsset = createBackgroundAsyncThunk("assets/refreshAsset", (async ({asset}, {dispatch}) => {
      await dispatch(assetsLoaded({
        assets: [ asset ],
        loadingScope: "incremental"
      }));
      await dispatch(updateAccountAssetReferences([ asset ]));
    }));
    const hideAsset = createBackgroundAsyncThunk("assets/hideAsset", (async ({asset}, {extra: {main}}) => {
      await main.hideAsset(asset);
    }));
    const removeAssetData = createBackgroundAsyncThunk("assets/removeAssetData", (async ({asset}, {dispatch}) => {
      await dispatch(removeAsset(asset));
      await dispatch(removeAssetReferences(asset));
    }));
    const transferAsset = createBackgroundAsyncThunk("assets/transferAsset", (async ({fromAddressNetwork: {address: fromAddress, network: fromNetwork}, toAddressNetwork: {address: toAddress, network: toNetwork}, assetAmount, gasLimit, nonce}) => {
      if (!sameNetwork(fromNetwork, toNetwork)) {
        throw new Error("Only same-network transfers are supported for now.");
      }
      const provider = getProvider();
      await provider.switchChain(fromNetwork);
      let networkVerified = false;
      try {
        const network = await provider.getNetwork();
        if (network.chainId.toString() === fromNetwork.chainID) {
          networkVerified = true;
        }
      } catch (e) {
        if (e && typeof e === "object" && "code" in e && "message" in e && e.code === "NETWORK_ERROR" && typeof e.message === "string" && e.message.includes("underlying network changed")) {
          const {detectedNetwork} = e;
          if (detectedNetwork && detectedNetwork.chainId.toString() === fromNetwork.chainID) {
            networkVerified = true;
          } else {
            throw new Error(`Network switched to unexpected chainId: ${detectedNetwork?.chainId}`);
          }
        } else {
          throw e;
        }
      }
      if (!networkVerified) {
        throw new Error(`Failed to verify network switch to ${fromNetwork.chainID}`);
      }
      const freshProvider = getProvider();
      const signer = freshProvider.getSigner();
      if (isBaseAssetForNetwork(assetAmount.asset, fromNetwork)) {
        lib_logger.debug(`Sending ${assetAmount.amount} ${assetAmount.asset.symbol} from ` + `${fromAddress} to ${toAddress} as a base asset transfer.`);
        await signer.sendTransaction({
          from: fromAddress,
          to: toAddress,
          value: assetAmount.amount,
          gasLimit,
          nonce
        });
      } else if (isSmartContractFungibleAsset(assetAmount.asset)) {
        lib_logger.debug(`Sending ${assetAmount.amount} ${assetAmount.asset.symbol} from ` + `${fromAddress} to ${toAddress} as an ERC20 transfer.`);
        const token = new qethers_lib.qethers.Contract(assetAmount.asset.contractAddress, QERC20_INTERFACE, signer);
        const transactionDetails = await token.populateTransaction.transfer(toAddress, assetAmount.amount);
        await signer.sendUncheckedTransaction({
          ...transactionDetails,
          gasLimit: gasLimit ?? transactionDetails.gasLimit,
          nonce
        });
      } else {
        throw new Error("Only base fungible smart contract asset transfers are supported for now.");
      }
    }));
    const importCustomToken = createBackgroundAsyncThunk("assets/importCustomToken", (async ({asset}, {extra: {main}}) => ({
      success: await main.importCustomToken(asset)
    })));
    const checkTokenContractDetails = createBackgroundAsyncThunk("assets/checkTokenContractDetails", (async ({contractAddress, network}, {getState, extra: {main}}) => {
      const state = getState();
      const currentAccount = state.ui.selectedAccount;
      try {
        return await main.queryCustomTokenDetails(contractAddress, {
          ...currentAccount,
          network
        });
      } catch (error) {
        return null;
      }
    }));
    var NOT_FOUND = "NOT_FOUND";
    function createSingletonCache(equals) {
      var entry;
      return {
        get: function get(key) {
          if (entry && equals(entry.key, key)) {
            return entry.value;
          }
          return NOT_FOUND;
        },
        put: function put(key, value) {
          entry = {
            key,
            value
          };
        },
        getEntries: function getEntries() {
          return entry ? [ entry ] : [];
        },
        clear: function clear() {
          entry = undefined;
        }
      };
    }
    function createLruCache(maxSize, equals) {
      var entries = [];
      function get(key) {
        var cacheIndex = entries.findIndex((function(entry) {
          return equals(key, entry.key);
        }));
        if (cacheIndex > -1) {
          var entry = entries[cacheIndex];
          if (cacheIndex > 0) {
            entries.splice(cacheIndex, 1);
            entries.unshift(entry);
          }
          return entry.value;
        }
        return NOT_FOUND;
      }
      function put(key, value) {
        if (get(key) === NOT_FOUND) {
          entries.unshift({
            key,
            value
          });
          if (entries.length > maxSize) {
            entries.pop();
          }
        }
      }
      function getEntries() {
        return entries;
      }
      function clear() {
        entries = [];
      }
      return {
        get,
        put,
        getEntries,
        clear
      };
    }
    var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
      return a === b;
    };
    function createCacheKeyComparator(equalityCheck) {
      return function areArgumentsShallowlyEqual(prev, next) {
        if (prev === null || next === null || prev.length !== next.length) {
          return false;
        }
        var length = prev.length;
        for (var i = 0; i < length; i++) {
          if (!equalityCheck(prev[i], next[i])) {
            return false;
          }
        }
        return true;
      };
    }
    function defaultMemoize(func, equalityCheckOrOptions) {
      var providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : {
        equalityCheck: equalityCheckOrOptions
      };
      var _providedOptions$equa = providedOptions.equalityCheck, equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa, _providedOptions$maxS = providedOptions.maxSize, maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS, resultEqualityCheck = providedOptions.resultEqualityCheck;
      var comparator = createCacheKeyComparator(equalityCheck);
      var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);
      function memoized() {
        var value = cache.get(arguments);
        if (value === NOT_FOUND) {
          value = func.apply(null, arguments);
          if (resultEqualityCheck) {
            var entries = cache.getEntries();
            var matchingEntry = entries.find((function(entry) {
              return resultEqualityCheck(entry.value, value);
            }));
            if (matchingEntry) {
              value = matchingEntry.value;
            }
          }
          cache.put(arguments, value);
        }
        return value;
      }
      memoized.clearCache = function() {
        return cache.clear();
      };
      return memoized;
    }
    function getDependencies(funcs) {
      var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
      if (!dependencies.every((function(dep) {
        return typeof dep === "function";
      }))) {
        var dependencyTypes = dependencies.map((function(dep) {
          return typeof dep === "function" ? "function " + (dep.name || "unnamed") + "()" : typeof dep;
        })).join(", ");
        throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
      }
      return dependencies;
    }
    function createSelectorCreator(memoize) {
      for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
        memoizeOptionsFromArgs[_key - 1] = arguments[_key];
      }
      var createSelector = function createSelector() {
        for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
          funcs[_key2] = arguments[_key2];
        }
        var _recomputations = 0;
        var _lastResult;
        var directlyPassedOptions = {
          memoizeOptions: undefined
        };
        var resultFunc = funcs.pop();
        if (typeof resultFunc === "object") {
          directlyPassedOptions = resultFunc;
          resultFunc = funcs.pop();
        }
        if (typeof resultFunc !== "function") {
          throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
        }
        var _directlyPassedOption = directlyPassedOptions, _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2;
        var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [ memoizeOptions ];
        var dependencies = getDependencies(funcs);
        var memoizedResultFunc = memoize.apply(void 0, [ function recomputationWrapper() {
          _recomputations++;
          return resultFunc.apply(null, arguments);
        } ].concat(finalMemoizeOptions));
        var selector = memoize((function dependenciesChecker() {
          var params = [];
          var length = dependencies.length;
          for (var i = 0; i < length; i++) {
            params.push(dependencies[i].apply(null, arguments));
          }
          _lastResult = memoizedResultFunc.apply(null, params);
          return _lastResult;
        }));
        Object.assign(selector, {
          resultFunc,
          memoizedResultFunc,
          dependencies,
          lastResult: function lastResult() {
            return _lastResult;
          },
          recomputations: function recomputations() {
            return _recomputations;
          },
          resetRecomputations: function resetRecomputations() {
            return _recomputations = 0;
          }
        });
        return selector;
      };
      return createSelector;
    }
    var es_createSelector = createSelectorCreator(defaultMemoize);
    var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
      if (selectorCreator === void 0) {
        selectorCreator = es_createSelector;
      }
      if (typeof selectors !== "object") {
        throw new Error("createStructuredSelector expects first argument to be an object " + ("where each property is a selector, instead received a " + typeof selectors));
      }
      var objectKeys = Object.keys(selectors);
      var resultSelector = selectorCreator(objectKeys.map((function(key) {
        return selectors[key];
      })), (function() {
        for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
          values[_key3] = arguments[_key3];
        }
        return values.reduce((function(composition, value, index) {
          composition[objectKeys[index]] = value;
          return composition;
        }), {});
      }));
      return resultSelector;
    };
    const defaultSettings = {
      hideDust: false,
      defaultWallet: false,
      showTestNetworks: true,
      showNotifications: undefined,
      showUnverifiedAssets: false,
      hideBanners: false,
      autoLockInterval: DEFAULT_AUTOLOCK_INTERVAL
    };
    const emitter = new (emittery_default());
    const ui_initialState = {
      showingActivityDetailID: null,
      selectedAccount: {
        address: "",
        network: ZEUS
      },
      initializationLoadingTimeExpired: false,
      settings: defaultSettings,
      snackbarMessage: "",
      slippageTolerance: .01,
      accountSignerSettings: []
    };
    const uiSlice = createSlice({
      name: "ui",
      initialState: ui_initialState,
      reducers: {
        toggleHideDust: (immerState, {payload: shouldHideDust}) => {
          immerState.settings.hideDust = shouldHideDust;
        },
        toggleTestNetworks: (immerState, {payload: showTestNetworks}) => {
          immerState.settings.showTestNetworks = showTestNetworks;
        },
        toggleShowUnverifiedAssets: (immerState, {payload: showUnverifiedAssets}) => {
          immerState.settings.showUnverifiedAssets = showUnverifiedAssets;
        },
        toggleNotifications: (immerState, {payload: showNotifications}) => {
          immerState.settings.showNotifications = showNotifications;
        },
        toggleHideBanners: (state, {payload: hideBanners}) => ({
          ...state,
          settings: {
            ...state.settings,
            hideBanners
          }
        }),
        setShowingActivityDetail: (state, {payload: transactionID}) => ({
          ...state,
          showingActivityDetailID: transactionID
        }),
        setSelectedAccount: (immerState, {payload: addressNetwork}) => {
          immerState.selectedAccount = addressNetwork;
        },
        initializationLoadingTimeHitLimit: state => ({
          ...state,
          initializationLoadingTimeExpired: true
        }),
        setSnackbarMessage: (state, {payload: snackbarMessage}) => ({
          ...state,
          snackbarMessage
        }),
        clearSnackbarMessage: state => ({
          ...state,
          snackbarMessage: ""
        }),
        setDefaultWallet: (state, {payload: defaultWallet}) => ({
          ...state,
          settings: {
            ...state.settings,
            defaultWallet
          }
        }),
        setShownDismissableItems: (state, {payload: shownDismissableItems}) => ({
          ...state,
          shownDismissableItems
        }),
        dismissableItemMarkedAsShown: (state, {payload: shownDismissableItem}) => ({
          ...state,
          shownDismissableItems: [ ...state.shownDismissableItems ?? [], shownDismissableItem ]
        }),
        setRouteHistoryEntries: (state, {payload: routeHistoryEntries}) => ({
          ...state,
          routeHistoryEntries
        }),
        setSlippageTolerance: (state, {payload: slippageTolerance}) => ({
          ...state,
          slippageTolerance
        }),
        setAccountsSignerSettings: (state, {payload}) => ({
          ...state,
          accountSignerSettings: payload
        }),
        setAutoLockInterval: (state, {payload}) => ({
          ...state,
          settings: {
            ...state.settings,
            autoLockInterval: payload
          }
        })
      }
    });
    const {setShowingActivityDetail, initializationLoadingTimeHitLimit, toggleHideDust, toggleTestNetworks, toggleShowUnverifiedAssets, toggleHideBanners, toggleNotifications, setSelectedAccount, setSnackbarMessage, setDefaultWallet, setShownDismissableItems, dismissableItemMarkedAsShown, clearSnackbarMessage, setRouteHistoryEntries, setSlippageTolerance, setAccountsSignerSettings, setAutoLockInterval} = uiSlice.actions;
    const ui = uiSlice.reducer;
    const setShouldShowNotifications = createBackgroundAsyncThunk("ui/showNotifications", (async shouldShowNotifications => {
      await emitter.emit("shouldShowNotifications", shouldShowNotifications);
    }));
    const setNewDefaultWalletValue = createBackgroundAsyncThunk("ui/setNewDefaultWalletValue", (async (defaultWallet, {dispatch}) => {
      await emitter.emit("newDefaultWalletValue", defaultWallet);
      dispatch(uiSlice.actions.setDefaultWallet(defaultWallet));
    }));
    const setNewSelectedAccount = createBackgroundAsyncThunk("ui/setNewCurrentAddressValue", (async (addressNetwork, {dispatch}) => {
      await emitter.emit("newSelectedAccount", addressNetwork);
      dispatch(uiSlice.actions.setSelectedAccount(addressNetwork));
      await emitter.emit("newSelectedAccountSwitched", addressNetwork);
    }));
    const updateSignerTitle = createBackgroundAsyncThunk("ui/updateSignerTitle", (async ([signer, title], {extra: {main}}) => main.updateSignerTitle(signer, title)));
    const markDismissableItemAsShown = createBackgroundAsyncThunk("ui/markDismissableItemAsShown", (async (item, {extra: {main}}) => main.markDismissableItemAsShown(item)));
    const getAddNetworkRequestDetails = createBackgroundAsyncThunk("ui/getAddNetworkRequestDetails", (async (requestId, {extra: {main}}) => main.getAddNetworkRequestDetails(requestId)));
    const addNetworkUserResponse = createBackgroundAsyncThunk("ui/handleAddNetworkConfirmation", (async ([requestId, result]) => {
      emitter.emit("addCustomNetworkResponse", [ requestId, result ]);
    }));
    const updateAutoLockInterval = createBackgroundAsyncThunk("ui/updateAutoLockInterval", (async newValue => {
      const parsedValue = parseInt(newValue, 10);
      if (Number.isNaN(parsedValue) || parsedValue <= 1) {
        throw new Error("Invalid value for auto lock timer");
      }
      emitter.emit("updateAutoLockInterval", parsedValue);
    }));
    const userActivityEncountered = createBackgroundAsyncThunk("ui/userActivityEncountered", (async addressNetwork => {
      await emitter.emit("userActivityEncountered", addressNetwork);
    }));
    const setSelectedNetwork = createBackgroundAsyncThunk("ui/setSelectedNetwork", (async (network, {getState, dispatch}) => {
      const state = getState();
      const {ui, account} = state;
      const currentlySelectedChainID = ui.selectedAccount.network.chainID;
      emitter.emit("newSelectedNetwork", network);
      Object.keys(account.accountsData.evm[currentlySelectedChainID]).forEach((address => {
        if (!account.accountsData.evm[network.chainID]?.[address]) {
          dispatch(addAddressNetwork({
            address,
            network
          }));
        }
      }));
      dispatch(setNewSelectedAccount({
        ...ui.selectedAccount,
        network
      }));
    }));
    const refreshBackgroundPage = createBackgroundAsyncThunk("ui/refreshBackgroundPage", (async () => {
      await emitter.emit("refreshBackgroundPage", null);
    }));
    const selectUI = es_createSelector((state => state.ui), (uiState => uiState));
    const selectSettings = es_createSelector(selectUI, (ui => ui.settings));
    const selectHideDust = es_createSelector(selectSettings, (settings => settings?.hideDust));
    const selectAutoLockTimer = es_createSelector(selectSettings, (settings => settings.autoLockInterval));
    const selectSnackbarMessage = es_createSelector(selectUI, (ui => ui.snackbarMessage));
    const selectDefaultWallet = es_createSelector(selectSettings, (settings => settings?.defaultWallet));
    const selectSlippageTolerance = es_createSelector(selectUI, (ui => ui.slippageTolerance));
    const selectInitializationTimeExpired = es_createSelector(selectUI, (ui => ui.initializationLoadingTimeExpired));
    const selectShowTestNetworks = es_createSelector(selectSettings, (settings => settings?.showTestNetworks));
    const selectShowUnverifiedAssets = es_createSelector(selectSettings, (settings => settings?.showUnverifiedAssets));
    const selectShowNotifications = es_createSelector(selectSettings, (settings => settings?.showNotifications));
    const selectHideBanners = es_createSelector(selectSettings, (settings => settings?.hideBanners));
    function selectShouldShowDismissableItem(dismissableItem) {
      return state => {
        const itemWasShown = selectUI(state).shownDismissableItems?.includes(dismissableItem) ?? false;
        return !itemWasShown;
      };
    }
    const internal_signer_initialState = {
      keyPairs: [],
      metadata: {},
      status: "uninitialized",
      mnemonicsToVerify: null
    };
    const internal_signer_emitter = new (emittery_default());
    const importSigner = createBackgroundAsyncThunk("internalSigner/importSigner", (async (signerRaw, {getState, dispatch, extra: {main}}) => {
      const address = await main.importSigner(signerRaw);
      if (!address) {
        return {
          success: false,
          errorMessage: "Unexpected error during account import."
        };
      }
      const {ui} = getState();
      dispatch(setNewSelectedAccount({
        address,
        network: ui.selectedAccount.network
      }));
      return {
        success: true
      };
    }));
    const internalSignerSlice = createSlice({
      name: "internalSigner",
      initialState: internal_signer_initialState,
      reducers: {
        internalSignerLocked: state => ({
          ...state,
          status: "locked"
        }),
        internalSignerUnlocked: state => ({
          ...state,
          status: "unlocked"
        }),
        updateInternalSigners: (state, {payload: {keyPairs, metadata}}) => {
          if (state.status === "locked" && keyPairs.length === 0) {
            return state;
          }
          return {
            ...state,
            keyPairs,
            metadata
          };
        },
        setMnemonicsToVerify: (state, {payload}) => ({
          ...state,
          mnemonicsToVerify: payload
        })
      }
    });
    const {updateInternalSigners, internalSignerLocked, internalSignerUnlocked, setMnemonicsToVerify} = internalSignerSlice.actions;
    const internal_signer = internalSignerSlice.reducer;
    const generateNewMnemonics = createBackgroundAsyncThunk("internalSigner/generateNewMnemonics", (async () => {
      await internal_signer_emitter.emit("generateNewMnemonics");
    }));
    const deriveAddress = createBackgroundAsyncThunk("internalSigner/deriveAddress", (async id => {
      await internal_signer_emitter.emit("deriveAddress", id);
    }));
    const unlockInternalSigners = createBackgroundAsyncThunk("internalSigner/unlockInternalSigners", (async (password, {extra: {main}}) => ({
      success: await main.unlockInternalSigners(password)
    })));
    const lockInternalSigners = createBackgroundAsyncThunk("internalSigner/lockInternalSigners", (async () => {
      await internal_signer_emitter.emit("lockInternalSigners");
    }));
    const createPassword = createBackgroundAsyncThunk("internalSigner/createPassword", (async password => {
      await internal_signer_emitter.emit("createPassword", password);
    }));
    const validateSession = createBackgroundAsyncThunk("internalSigner/validateSession", (async (_, {extra: {main}}) => ({
      isValid: await main.validateSession()
    })));
    const exportMnemonic = createBackgroundAsyncThunk("internalSigner/exportMnemonic", (async (address, {extra: {main}}) => main.exportMnemonic(address)));
    const exportPrivateKey = createBackgroundAsyncThunk("internalSigner/exportPrivateKey", (async (address, {extra: {main}}) => main.exportPrivateKey(address)));
    const selectCurrentNetwork = es_createSelector((state => state.ui.selectedAccount.network), (selectedNetwork => selectedNetwork));
    const selectCurrentAccount = es_createSelector((state => state.ui.selectedAccount), (({address, network}) => ({
      address,
      network,
      truncatedAddress: address.toLowerCase().slice(0, 7)
    })));
    const selectShowingActivityDetail = es_createSelector((state => state.activities.activities), selectCurrentAccount, (state => state.ui.showingActivityDetailID), ((activities, currentAccountOnNetwork, showingActivityDetailID) => {
      if (!showingActivityDetailID) {
        return null;
      }
      return activities[currentAccountOnNetwork.address]?.[currentAccountOnNetwork.network.chainID]?.find((activity => activity.hash === showingActivityDetailID)) ?? null;
    }));
    const selectCurrentAddressNetwork = es_createSelector((state => state.ui.selectedAccount), (selectedAccount => selectedAccount));
    const selectMainCurrencySymbol = es_createSelector((_ => null), (() => hardcodedMainCurrencySymbol));
    const selectMainCurrencySign = es_createSelector((_ => null), (() => hardcodedMainCurrencySign));
    const selectMainCurrency = es_createSelector((state => state.ui), (state => state.assets), (state => selectMainCurrencySymbol(state)), ((_, assets, mainCurrencySymbol) => assets.find((asset => asset.symbol === mainCurrencySymbol))));
    const networks_initialState = {
      evmNetworks: {},
      blockInfo: {
        1: {
          blockHeight: null,
          baseFeePerGas: null
        }
      }
    };
    const networksSlice = createSlice({
      name: "networks",
      initialState: networks_initialState,
      reducers: {
        blockSeen: (immerState, {payload: blockPayload}) => {
          const block = blockPayload;
          if (!(block.network.chainID in immerState.blockInfo)) {
            immerState.blockInfo[block.network.chainID] = {
              blockHeight: block.blockHeight,
              baseFeePerGas: block?.baseFeePerGas ?? null
            };
          } else if (block.blockHeight > (immerState.blockInfo[block.network.chainID].blockHeight || 0)) {
            immerState.blockInfo[block.network.chainID].blockHeight = block.blockHeight;
            immerState.blockInfo[block.network.chainID].baseFeePerGas = block?.baseFeePerGas ?? null;
          }
        },
        setEVMNetworks: (immerState, {payload}) => {
          const chainIds = payload.map((network => network.chainID));
          payload.forEach((network => {
            immerState.evmNetworks[network.chainID] = network;
          }));
          Object.keys(immerState.evmNetworks).forEach((chainID => {
            if (!chainIds.includes(chainID)) {
              delete immerState.evmNetworks[chainID];
              delete immerState.blockInfo[chainID];
            }
          }));
        }
      }
    });
    const {blockSeen, setEVMNetworks} = networksSlice.actions;
    const networks = networksSlice.reducer;
    const removeCustomChain = createBackgroundAsyncThunk("networks/removeCustomChain", (async (chainID, {getState, dispatch, extra: {main}}) => {
      const store = getState();
      const currentNetwork = selectCurrentNetwork(store);
      if (currentNetwork.chainID === chainID) {
        await dispatch(setSelectedNetwork(ZEUS));
      }
      await dispatch(removeChainBalances(chainID));
      return main.removeEVMNetwork(chainID);
    }));
    const ESTIMATED_FEE_MULTIPLIERS = {
      70: 11n,
      95: 13n,
      99: 18n,
      0: 20n
    };
    const ESTIMATED_FEE_MULTIPLIERS_BY_TYPE = {
      regular: 11n,
      express: 13n,
      instant: 18n
    };
    const MAX_FEE_MULTIPLIER = {
      70: 13n,
      95: 15n,
      99: 20n,
      0: 20n
    };
    const INSTANT = 99;
    const EXPRESS = 95;
    const REGULAR = 70;
    const CUSTOM = 0;
    let TransactionConstructionStatus = function(TransactionConstructionStatus) {
      TransactionConstructionStatus["Idle"] = "idle";
      TransactionConstructionStatus["Pending"] = "pending";
      TransactionConstructionStatus["Loaded"] = "loaded";
      TransactionConstructionStatus["Signed"] = "signed";
      return TransactionConstructionStatus;
    }({});
    let NetworkFeeTypeChosen = function(NetworkFeeTypeChosen) {
      NetworkFeeTypeChosen["Regular"] = "regular";
      NetworkFeeTypeChosen["Express"] = "express";
      NetworkFeeTypeChosen["Instant"] = "instant";
      NetworkFeeTypeChosen["Custom"] = "custom";
      return NetworkFeeTypeChosen;
    }({});
    const defaultCustomGas = {
      maxFeePerGas: 0n,
      maxPriorityFeePerGas: 0n,
      confidence: 0
    };
    const transaction_construction_initialState = {
      status: TransactionConstructionStatus.Idle,
      feeTypeSelected: NetworkFeeTypeChosen.Regular,
      estimatedFeesPerGas: {},
      transactionLikelyFails: false,
      customFeesPerGas: defaultCustomGas
    };
    const transaction_construction_emitter = new (emittery_default());
    const makeBlockEstimate = (type, estimatedFeesPerGas) => {
      let maxFeePerGas = estimatedFeesPerGas.estimatedPrices.find((el => el.confidence === type))?.maxFeePerGas;
      if (typeof maxFeePerGas === "undefined") {
        maxFeePerGas = estimatedFeesPerGas.baseFeePerGas;
      }
      maxFeePerGas = maxFeePerGas * MAX_FEE_MULTIPLIER[type] / 10n;
      return {
        maxFeePerGas,
        confidence: type,
        maxPriorityFeePerGas: estimatedFeesPerGas.estimatedPrices.find((el => el.confidence === type))?.maxPriorityFeePerGas ?? 0n,
        price: estimatedFeesPerGas.estimatedPrices.find((el => el.confidence === type))?.price ?? 0n
      };
    };
    const updateTransactionData = createBackgroundAsyncThunk("transaction-construction/update-transaction", (async payload => {
      await transaction_construction_emitter.emit("updateTransaction", payload);
    }));
    const signTransaction = createBackgroundAsyncThunk("transaction-construction/sign", (async request => {
      await transaction_construction_emitter.emit("requestSignature", request);
    }));
    const transactionSlice = createSlice({
      name: "transaction-construction",
      initialState: transaction_construction_initialState,
      reducers: {
        transactionRequest: (state, {payload: {transactionRequest, transactionLikelyFails}}) => {
          const newState = {
            ...state,
            status: TransactionConstructionStatus.Loaded,
            signedTransaction: undefined,
            transactionRequest: {
              ...transactionRequest
            },
            transactionLikelyFails
          };
          const feeType = state.feeTypeSelected;
          const {chainID} = transactionRequest.network;
          if (isEIP1559TransactionRequest(newState.transactionRequest) && isEIP1559TransactionRequest(transactionRequest)) {
            const estimatedMaxFeePerGas = feeType === NetworkFeeTypeChosen.Custom ? state.customFeesPerGas?.maxFeePerGas : state.estimatedFeesPerGas?.[chainID]?.[feeType]?.maxFeePerGas;
            newState.transactionRequest.maxFeePerGas = estimatedMaxFeePerGas ?? transactionRequest.maxFeePerGas;
            const estimatedMaxPriorityFeePerGas = feeType === NetworkFeeTypeChosen.Custom ? state.customFeesPerGas?.maxPriorityFeePerGas : state.estimatedFeesPerGas?.[chainID]?.[feeType]?.maxPriorityFeePerGas;
            newState.transactionRequest.maxPriorityFeePerGas = estimatedMaxPriorityFeePerGas ?? transactionRequest.maxPriorityFeePerGas;
          }
          if (!isEIP1559TransactionRequest(transactionRequest) && !isEIP1559TransactionRequest(newState.transactionRequest)) {
            newState.transactionRequest.gasPrice = state.estimatedFeesPerGas?.[chainID]?.[feeType]?.price ?? transactionRequest.gasPrice;
          }
          return newState;
        },
        clearTransactionState: (state, {payload}) => ({
          estimatedFeesPerGas: state.estimatedFeesPerGas,
          status: payload,
          feeTypeSelected: state.feeTypeSelected ?? NetworkFeeTypeChosen.Regular,
          broadcastOnSign: false,
          transactionLikelyFails: false,
          signedTransaction: undefined,
          customFeesPerGas: state.customFeesPerGas
        }),
        updateRollupEstimates: (immerState, {payload}) => {
          const {estimatedRollupFee, estimatedRollupGwei} = payload;
          if (immerState.transactionRequest && !isEIP1559TransactionRequest(immerState.transactionRequest)) {
            immerState.transactionRequest.estimatedRollupFee = estimatedRollupFee;
            immerState.transactionRequest.estimatedRollupGwei = estimatedRollupGwei;
          }
        },
        setFeeType: (immerState, {payload}) => {
          immerState.feeTypeSelected = payload;
        },
        signed: (state, {payload}) => ({
          ...state,
          status: TransactionConstructionStatus.Signed,
          signedTransaction: payload
        }),
        broadcastOnSign: (state, {payload}) => ({
          ...state,
          broadcastOnSign: payload
        }),
        transactionLikelyFails: state => ({
          ...state,
          transactionLikelyFails: true
        }),
        estimatedFeesPerGas: (immerState, {payload: {estimatedFeesPerGas, network}}) => {
          immerState.estimatedFeesPerGas = {
            ...immerState.estimatedFeesPerGas ?? {},
            [network.chainID]: {
              baseFeePerGas: estimatedFeesPerGas.baseFeePerGas,
              instant: makeBlockEstimate(INSTANT, estimatedFeesPerGas),
              express: makeBlockEstimate(EXPRESS, estimatedFeesPerGas),
              regular: makeBlockEstimate(REGULAR, estimatedFeesPerGas)
            }
          };
        },
        setCustomGas: (immerState, {payload: {maxPriorityFeePerGas, maxFeePerGas}}) => {
          immerState.customFeesPerGas = {
            maxPriorityFeePerGas,
            maxFeePerGas,
            confidence: 0
          };
        },
        clearCustomGas: immerState => {
          immerState.customFeesPerGas = defaultCustomGas;
          immerState.feeTypeSelected = NetworkFeeTypeChosen.Regular;
        },
        setCustomGasLimit: (immerState, {payload: gasLimit}) => {
          if (typeof gasLimit !== "undefined" && immerState.transactionRequest && isEIP1559TransactionRequest(immerState.transactionRequest)) {
            immerState.transactionRequest.gasLimit = gasLimit;
          }
        }
      },
      extraReducers: builder => {
        builder.addCase(updateTransactionData.pending, (immerState => {
          immerState.status = TransactionConstructionStatus.Pending;
          immerState.signedTransaction = undefined;
        }));
      }
    });
    const {transactionRequest, clearTransactionState, transactionLikelyFails, broadcastOnSign, signed, setFeeType, estimatedFeesPerGas, setCustomGas, clearCustomGas, updateRollupEstimates, setCustomGasLimit} = transactionSlice.actions;
    const transaction_construction = transactionSlice.reducer;
    const broadcastSignedTransaction = createBackgroundAsyncThunk("transaction-construction/broadcast", (async transaction => {
      await transaction_construction_emitter.emit("broadcastSignedTransaction", transaction);
    }));
    const transactionSigned = createBackgroundAsyncThunk("transaction-construction/transaction-signed", (async (transaction, {dispatch, getState}) => {
      await dispatch(signed(transaction));
      const {transactionConstruction} = getState();
      if (transactionConstruction.broadcastOnSign ?? false) {
        await dispatch(broadcastSignedTransaction(transaction));
      }
    }));
    const rejectTransactionSignature = createBackgroundAsyncThunk("transaction-construction/reject", (async (_, {dispatch}) => {
      await transaction_construction_emitter.emit("signatureRejected");
      dispatch(transactionSlice.actions.clearTransactionState(TransactionConstructionStatus.Idle));
    }));
    const selectCurrentAccountActivities = es_createSelector((state => state.activities.activities), selectCurrentAccount, selectCurrentNetwork, ((activities, account, network) => activities?.[account.address]?.[network.chainID] ?? []));
    const selectActivitesHashesForEnrichment = es_createSelector(selectCurrentAccountActivities, (currentActivities => currentActivities.flatMap((activity => "type" in activity ? [] : activity.hash))));
    const getAllAddresses = es_createSelector((state => state.account), (account => [ ...new Set(Object.values(account.accountsData.evm).flatMap((chainAddresses => Object.keys(chainAddresses)))) ]));
    const selectAccountSignersByAddress = es_createSelector(getAllAddresses, (allAddresses => {
      const result = {};
      allAddresses.forEach((address => {
        result[address] = {
          type: "keyPair",
          walletID: undefined
        };
      }));
      return result;
    }));
    const selectCurrentAccountSigner = es_createSelector(selectAccountSignersByAddress, selectCurrentAccount, ((signingAccounts, selectedAccount) => signingAccounts[selectedAccount.address]));
    const prices_initialState = {};
    const pricesSlice = createSlice({
      name: "prices",
      initialState: prices_initialState,
      reducers: {
        newPricePoints: (immerState, {payload: pricePoints}) => {
          pricePoints.forEach((pricePoint => {
            const fiatCurrency = pricePoint.pair.find((asset => FIAT_CURRENCIES_SYMBOL.includes(asset.symbol)));
            const [pricedAsset] = pricePoint.pair.filter((asset => asset !== fiatCurrency));
            if (fiatCurrency && isTrustedAsset(pricedAsset)) {
              const assetId = getFullAssetID(pricedAsset);
              immerState[assetId] ??= {};
              immerState[assetId][fiatCurrency.symbol] = pricePoint;
            }
          }));
        },
        updatePriceAssetReferences: (immerState, {payload: assets}) => {
          assets.forEach((asset => {
            const assetId = getFullAssetID(asset);
            Object.values(immerState[assetId] ?? {}).forEach((immerPricePoint => {
              const updateIndex = immerPricePoint.pair.findIndex((priceAsset => isSameAsset(asset, priceAsset)));
              if (updateIndex > -1) {
                Object.assign(immerPricePoint.pair[updateIndex], asset);
              }
            }));
          }));
        }
      }
    });
    const {newPricePoints, updatePriceAssetReferences} = pricesSlice.actions;
    const prices = pricesSlice.reducer;
    const selectPricesState = state => state;
    const selectAsset = (_, asset) => asset;
    const selectPairedAssetSymbol = (_, _2, pairedAssetSymbol) => pairedAssetSymbol;
    const selectAssetPricePoint = es_createSelector([ selectPricesState, selectAsset, selectPairedAssetSymbol ], ((prices, assetToFind, pairedAssetSymbol) => {
      const getTargetAssetFromPricePoint = pricePoint => pricePoint.pair.filter((({symbol}) => symbol !== pairedAssetSymbol))[0];
      const hasRecentPriceData = assetPriceData => !!assetPriceData?.[pairedAssetSymbol];
      let pricedAsset;
      if (isSmartContractFungibleAsset(assetToFind)) {
        const assetID = getFullAssetID(assetToFind);
        if (hasRecentPriceData(prices[assetID])) {
          pricedAsset = prices[assetID];
        }
        if (!isTrustedAsset(assetToFind)) {
          return undefined;
        }
      }
      if (!pricedAsset) {
        pricedAsset = Object.values(prices).find((assetPriceData => hasRecentPriceData(assetPriceData) && getTargetAssetFromPricePoint(assetPriceData[pairedAssetSymbol]).symbol === assetToFind.symbol));
      }
      if (pricedAsset) {
        let pricePoint = pricedAsset[pairedAssetSymbol];
        if (pricePoint.pair[0].symbol !== assetToFind.symbol) {
          pricePoint = flipPricePoint(pricePoint);
        }
        const assetDecimals = isFungibleAsset(assetToFind) ? assetToFind.decimals : 0;
        const pricePointAssetDecimals = isFungibleAsset(pricePoint.pair[0]) ? pricePoint.pair[0].decimals : 0;
        if (assetDecimals !== pricePointAssetDecimals) {
          const {amounts} = pricePoint;
          pricePoint = {
            ...pricePoint,
            amounts: [ convertFixedPoint(amounts[0], pricePointAssetDecimals, assetDecimals), amounts[1] ]
          };
        }
        return pricePoint;
      }
      return undefined;
    }));
    var accountsSelectors_DEFAULT_ACCOUNT_NAMES;
    const desiredDecimals = {
      default: 2,
      greater: 6
    };
    const EXCEPTION_ASSETS_BY_SYMBOL = [ "BTC", "sBTC", "WBTC", "tBTC" ].map((symbol => symbol.toUpperCase()));
    const userValueDustThreshold = 2;
    const shouldForciblyDisplayAsset = assetAmount => isNetworkBaseAsset(assetAmount.asset);
    function determineAssetDisplayAndVerify(assetAmount, {hideDust, showUnverifiedAssets}) {
      const isTrusted = isTrustedAsset(assetAmount.asset);
      if (shouldForciblyDisplayAsset(assetAmount)) {
        return {
          displayAsset: true,
          trustedAsset: isTrusted
        };
      }
      const isNotDust = typeof assetAmount.mainCurrencyAmount === "undefined" ? true : assetAmount.mainCurrencyAmount > userValueDustThreshold;
      const isPresent = assetAmount.decimalAmount > 0;
      const showDust = !hideDust;
      const verificationStatusAllowsVisibility = showUnverifiedAssets || isTrusted;
      const enoughBalanceToBeVisible = isPresent && (isNotDust || showDust);
      return {
        displayAsset: verificationStatusAllowsVisibility && enoughBalanceToBeVisible,
        trustedAsset: isTrusted
      };
    }
    const computeCombinedAssetAmountsData = (assetAmounts, assets, mainCurrencySymbol, hideDust, showUnverifiedAssets, prices) => {
      const allAssetAmounts = assetAmounts.map((assetAmount => {
        const assetPricePoint = selectAssetPricePoint(prices, assetAmount.asset, mainCurrencySymbol);
        const mainCurrencyEnrichedAssetAmount = enrichAssetAmountWithMainCurrencyValues(assetAmount, assetPricePoint, desiredDecimals.default);
        const fullyEnrichedAssetAmount = enrichAssetAmountWithDecimalValues(mainCurrencyEnrichedAssetAmount, heuristicDesiredDecimalsForUnitPrice(EXCEPTION_ASSETS_BY_SYMBOL.includes(assetAmount.asset.symbol.toUpperCase()) ? desiredDecimals.greater : desiredDecimals.default, mainCurrencyEnrichedAssetAmount.unitPrice));
        return fullyEnrichedAssetAmount;
      })).sort(((asset1, asset2) => {
        const leftIsBaseAsset = isNetworkBaseAsset(asset1.asset);
        const rightIsBaseAsset = isNetworkBaseAsset(asset2.asset);
        if (leftIsBaseAsset !== rightIsBaseAsset) {
          return leftIsBaseAsset ? -1 : 1;
        }
        if (asset1.mainCurrencyAmount !== undefined && asset2.mainCurrencyAmount !== undefined) {
          return asset2.mainCurrencyAmount - asset1.mainCurrencyAmount;
        }
        if (asset1.mainCurrencyAmount === asset2.mainCurrencyAmount) {
          return asset1.asset.symbol.localeCompare(asset2.asset.symbol);
        }
        return asset1.mainCurrencyAmount === undefined ? 1 : -1;
      }));
      const {combinedAssetAmounts, unverifiedAssetAmounts} = allAssetAmounts.reduce(((acc, assetAmount) => {
        const {displayAsset, trustedAsset} = determineAssetDisplayAndVerify(assetAmount, {
          hideDust,
          showUnverifiedAssets
        });
        if (displayAsset) {
          if (trustedAsset) {
            acc.combinedAssetAmounts.push(assetAmount);
          } else {
            acc.unverifiedAssetAmounts.push(assetAmount);
          }
        }
        return acc;
      }), {
        combinedAssetAmounts: [],
        unverifiedAssetAmounts: []
      });
      let totalMainCurrencyAmount;
      combinedAssetAmounts.forEach((assetAmount => {
        if (typeof assetAmount.mainCurrencyAmount !== "undefined") {
          totalMainCurrencyAmount ??= 0;
          totalMainCurrencyAmount += assetAmount.mainCurrencyAmount;
        }
      }));
      return {
        allAssetAmounts,
        combinedAssetAmounts,
        unverifiedAssetAmounts,
        totalMainCurrencyAmount
      };
    };
    const getAccountState = state => state.account;
    const getCurrentAccountState = state => {
      const {address, network} = state.ui.selectedAccount;
      return state.account.accountsData.evm[network.chainID]?.[normalizeQEVMAddress(address)];
    };
    const getAssetsState = state => state.assets;
    const getPricesState = state => state.prices;
    const selectAccountAndTimestampedActivities = es_createSelector(getAccountState, getAssetsState, getPricesState, selectHideDust, selectShowUnverifiedAssets, selectMainCurrencySymbol, ((account, assets, prices, hideDust, showUnverifiedAssets, mainCurrencySymbol) => {
      const {combinedAssetAmounts, totalMainCurrencyAmount} = computeCombinedAssetAmountsData(account.combinedData.assets, assets, mainCurrencySymbol, hideDust, showUnverifiedAssets, prices);
      return {
        combinedData: {
          assets: combinedAssetAmounts,
          totalMainCurrencyValue: totalMainCurrencyAmount ? formatCurrencyAmount(mainCurrencySymbol, totalMainCurrencyAmount, desiredDecimals.default) : undefined
        },
        accountData: account.accountsData
      };
    }));
    const selectCurrentAccountBalances = es_createSelector(getCurrentAccountState, getAssetsState, getPricesState, selectHideDust, selectShowUnverifiedAssets, selectMainCurrencySymbol, ((currentAccount, assets, prices, hideDust, showUnverifiedAssets, mainCurrencySymbol) => {
      if (typeof currentAccount === "undefined" || currentAccount === "loading") {
        return undefined;
      }
      const assetAmounts = Object.values(currentAccount.balances).map((balance => balance.assetAmount));
      const {allAssetAmounts, combinedAssetAmounts, unverifiedAssetAmounts, totalMainCurrencyAmount} = computeCombinedAssetAmountsData(assetAmounts, assets, mainCurrencySymbol, hideDust, showUnverifiedAssets, prices);
      return {
        allAssetAmounts,
        assetAmounts: combinedAssetAmounts,
        unverifiedAssetAmounts,
        totalMainCurrencyValue: totalMainCurrencyAmount ? formatCurrencyAmount(mainCurrencySymbol, totalMainCurrencyAmount, desiredDecimals.default) : undefined
      };
    }));
    function signerIdFor(accountSigner) {
      switch (accountSigner.type) {
       case "keyPair":
        return "keyPair";

       case "read-only":
        return null;

       default:
        return assertUnreachable(accountSigner);
      }
    }
    const signerTypeToAccountType = {
      keyPair: AccountType.keyPair,
      "read-only": AccountType.ReadOnly
    };
    const getAccountType = (address, signer) => {
      switch (true) {
       case signerTypeToAccountType[signer.type] === AccountType.keyPair:
        return signerTypeToAccountType[signer.type];

       default:
        return AccountType.Internal;
      }
    };
    const getTotalBalance = (accountBalances, prices, mainCurrencySymbol) => Object.values(accountBalances).map((({assetAmount}) => {
      const assetPricePoint = selectAssetPricePoint(prices, assetAmount.asset, mainCurrencySymbol);
      if (typeof assetPricePoint === "undefined") {
        return 0;
      }
      const convertedAmount = convertAssetAmountViaPricePoint(assetAmount, assetPricePoint);
      if (typeof convertedAmount === "undefined") {
        return 0;
      }
      return assetAmountToDesiredDecimals(convertedAmount, desiredDecimals.default);
    })).reduce(((total, assetBalance) => total + assetBalance), 0);
    function getNetworkAccountTotalsByCategory(state, network) {
      const accounts = getAccountState(state);
      const prices = getPricesState(state);
      const accountSignersByAddress = selectAccountSignersByAddress(state);
      const mainCurrencySymbol = selectMainCurrencySymbol(state);
      return Object.entries(accounts.accountsData.evm[network.chainID] ?? {}).filter((([, accountData]) => typeof accountData !== "undefined")).map((([address, accountData]) => {
        const shortenedAddress = truncateAddress(address);
        const accountSigner = accountSignersByAddress[address];
        const signerId = signerIdFor(accountSigner);
        const accountType = getAccountType(address, accountSigner);
        if (accountData === "loading") {
          return {
            address,
            network,
            shortenedAddress,
            accountType,
            signerId,
            accountSigner
          };
        }
        const {name, avatarURL} = accountData.ens;
        return {
          address,
          network,
          shortenedAddress,
          accountType,
          signerId,
          accountSigner,
          name: name ?? accountData.defaultName,
          avatarURL: avatarURL ?? accountData.defaultAvatar,
          localizedTotalMainCurrencyAmount: formatCurrencyAmount(mainCurrencySymbol, getTotalBalance(accountData.balances, prices, mainCurrencySymbol), desiredDecimals.default)
        };
      })).reduce(((seenTotalsByType, accountTotal) => ({
        ...seenTotalsByType,
        [accountTotal.accountType]: [ ...seenTotalsByType[accountTotal.accountType] ?? [], accountTotal ]
      })), {});
    }
    const selectNetworkAccountTotalsByCategoryResolver = es_createSelector((state => state), (state => network => getNetworkAccountTotalsByCategory(state, network)));
    const selectCurrentNetworkAccountTotalsByCategory = es_createSelector(selectNetworkAccountTotalsByCategoryResolver, selectCurrentNetwork, ((selectNetworkAccountTotalsByCategory, currentNetwork) => selectNetworkAccountTotalsByCategory(currentNetwork)));
    const selectAccountTotals = es_createSelector(selectCurrentNetworkAccountTotalsByCategory, (selectNetworkAccountTotalsByCategory => Object.values(selectNetworkAccountTotalsByCategory).flat()));
    const selectAccountTotalsForOverview = es_createSelector(getAccountState, getAssetsState, getPricesState, selectMainCurrencySymbol, ((accountsState, assetsState, pricesState, mainCurrencySymbol) => {
      const accountsTotal = {};
      Object.entries(accountsState.accountsData.evm).filter((([chainID, accounts]) => typeof accounts !== "undefined" && !TEST_NETWORK_BY_CHAIN_ID.has(chainID))).forEach((([chainID, accounts]) => Object.entries(accounts).forEach((([address, accountData]) => {
        if (accountData === "loading") return;
        const normalizedAddress = normalizeQEVMAddress(address);
        accountsTotal[normalizedAddress] ??= {
          ensName: accountData.ens.name,
          shortenedAddress: truncateAddress(address),
          totals: {}
        };
        accountsTotal[normalizedAddress].totals[chainID] = getTotalBalance(accountData.balances, pricesState, mainCurrencySymbol);
      }))));
      return accountsTotal;
    }));
    function findAccountTotal(categorizedAccountTotals, accountAddressOnNetwork) {
      return Object.values(categorizedAccountTotals).flat().find((({address, network}) => sameQEVMAddress(address, accountAddressOnNetwork.address) && sameNetwork(network, accountAddressOnNetwork.network)));
    }
    const getAccountTotal = (state, accountAddressOnNetwork) => findAccountTotal(selectNetworkAccountTotalsByCategoryResolver(state)(accountAddressOnNetwork.network), accountAddressOnNetwork);
    const getAccountNameOnChain = (state, accountAddressOnNetwork) => {
      const account = getAccountTotal(state, accountAddressOnNetwork);
      return account?.name && !accountsSelectors_DEFAULT_ACCOUNT_NAMES.includes(account.name) ? account.name : undefined;
    };
    const selectCurrentAccountTotal = es_createSelector(selectCurrentNetworkAccountTotalsByCategory, selectCurrentAccount, ((categorizedAccountTotals, currentAccount) => findAccountTotal(categorizedAccountTotals, currentAccount)));
    const accountsSelectors_getAllAddresses = es_createSelector(getAccountState, (account => account ? [ ...new Set(Object.values(account.accountsData.evm).flatMap((chainAddresses => Object.keys(chainAddresses)))) ] : []));
    const getAddressCount = es_createSelector(accountsSelectors_getAllAddresses, (allAddresses => allAddresses.length));
    const getAllNetworks = es_createSelector(getAccountState, (account => Object.keys(account.accountsData.evm).map((chainID => NETWORK_BY_CHAIN_ID[chainID]))));
    const getNetworkCountForOverview = es_createSelector(getAccountState, (account => Object.keys(account.accountsData.evm).filter((chainID => !TEST_NETWORK_BY_CHAIN_ID.has(chainID))).length));
    const getTotalBalanceForOverview = es_createSelector(selectAccountTotalsForOverview, selectMainCurrencySymbol, ((accountsTotal, currencySymbol) => formatCurrencyAmount(currencySymbol, Object.values(accountsTotal).reduce(((total, {totals}) => Object.values(totals).reduce(((sum, balance) => sum + balance), 0) + total), 0), 2)));
    const selectInternalSignerStatus = es_createSelector((state => state.internalSigner.status), (status => status));
    const selectWalletsByAddress = es_createSelector((state => state.internalSigner.keyPairs), (pkWallets => Object.fromEntries(pkWallets.map((wallet => [ wallet.address, wallet ])))));
    const getProviderBridgeState = state => state.dapp;
    const selectPermissionRequests = es_createSelector(getProviderBridgeState, (slice => Object.values(slice.permissionRequests)));
    const selectPendingPermissionRequests = es_createSelector(selectPermissionRequests, (permissionRequests => permissionRequests.filter((p => p.state === "request"))));
    const selectCurrentPendingPermission = es_createSelector(selectPendingPermissionRequests, (permissionRequests => permissionRequests.length > 0 ? permissionRequests[0] : undefined));
    const selectAllowedPages = es_createSelector((state => getProviderBridgeState(state).allowed), selectCurrentAccount, ((allowed, currentAccount) => {
      const permissions = [];
      Object.keys(allowed.evm).forEach((chainId => {
        Object.keys(allowed.evm[chainId]).forEach((address => {
          if (address === currentAccount.address) {
            Object.values(allowed.evm[chainId][address]).forEach((permission => {
              permissions.push(permission);
            }));
          }
        }));
      }));
      return permissions;
    }));
    const ETH_SYMBOLS = [ "ETH", "WETH" ];
    const isEnabledFilter = (id, filters) => filters.some((filter => id === filter.id && filter.isEnabled));
    const isETHPrice = collection => ETH_SYMBOLS.includes(collection?.floorPrice?.tokenSymbol ?? "");
    const getAdditionalDataForFilter = (id, accounts) => {
      const a = accounts.find((({address}) => address === id));
      return a ? {
        name: a.name ?? a.address,
        thumbnailURL: a.avatarURL
      } : {};
    };
    const sortByPrice = (type, collection1, collection2) => {
      if (collection1.floorPrice?.valueUSD === undefined) return 1;
      if (collection2.floorPrice?.valueUSD === undefined) return -1;
      if (type === "asc") {
        return collection1.floorPrice.valueUSD - collection2.floorPrice.valueUSD;
      }
      return collection2.floorPrice.valueUSD - collection1.floorPrice.valueUSD;
    };
    const sortByDate = (type, collection1, collection2) => {
      const transferDate1 = new Date(collection1.nfts[0]?.transferDate ?? "").getTime();
      const transferDate2 = new Date(collection2.nfts[0]?.transferDate ?? "").getTime();
      if (type === "new") {
        return transferDate1 > transferDate2 ? -1 : 1;
      }
      return transferDate1 > transferDate2 ? 1 : -1;
    };
    const sortNFTsByDate = (type, nfts) => {
      const sorted = nfts.sort(((nft1, nft2) => new Date(nft2.transferDate ?? "").getTime() - new Date(nft1.transferDate ?? "").getTime()));
      return type === "new" ? sorted : sorted.reverse();
    };
    const sortByNFTCount = (collection1, collection2) => (Number(collection2?.nftCount) || 0) - (Number(collection1?.nftCount) || 0);
    const sortCollections = (collection1, collection2, type) => {
      switch (type) {
       case "asc":
        return sortByPrice("asc", collection1, collection2);

       case "desc":
        return sortByPrice("desc", collection1, collection2);

       case "new":
        return sortByDate("new", collection1, collection2);

       case "old":
        return sortByDate("old", collection1, collection2);

       case "number":
        return sortByNFTCount(collection1, collection2);

       default:
        return 0;
      }
    };
    const sortNFTs = (collection, type) => {
      switch (type) {
       case "new":
        return {
          ...collection,
          nfts: sortNFTsByDate("new", collection.nfts)
        };

       case "old":
        return {
          ...collection,
          nfts: sortNFTsByDate("old", collection.nfts)
        };

       default:
        return collection;
      }
    };
    const getTotalFloorPrice = collections => collections.reduce(((acc, collection) => {
      if (!collection.floorPrice) return acc;
      const sum = collection.floorPrice.value * (collection.nftCount ?? 0);
      if (isETHPrice(collection)) {
        acc.ETH += sum;
      } else {
        acc[collection.floorPrice.tokenSymbol] ??= 0;
        acc[collection.floorPrice.tokenSymbol] += sum;
      }
      return acc;
    }), {
      ETH: 0
    });
    const getNFTsCount = collections => collections.reduce(((sum, collection) => sum + (collection.nftCount ?? 0)), 0);
    function enrichCollectionWithUSDFloorPrice(collection, prices, mainCurrencySymbol) {
      if (!collection.floorPrice) return collection;
      const {tokenSymbol, value} = collection.floorPrice;
      const symbol = isETHPrice(collection) ? "ETH" : tokenSymbol;
      const baseAsset = BUILT_IN_NETWORK_BASE_ASSETS.find((asset => symbol === asset.symbol));
      if (!baseAsset) return collection;
      const pricePoint = selectAssetPricePoint(prices, baseAsset, mainCurrencySymbol);
      const valueUSD = enrichAssetAmountWithMainCurrencyValues({
        asset: baseAsset,
        amount: BigInt(Math.round(value * 10 ** baseAsset.decimals))
      }, pricePoint, 2).mainCurrencyAmount ?? 0;
      return {
        ...collection,
        floorPrice: {
          value,
          valueUSD,
          tokenSymbol
        }
      };
    }
    const getFilteredCollections = (collections, filters, prices, mainCurrencySymbol) => {
      const applyPriceSort = filters.type === "asc" || filters.type === "desc";
      return collections.filter((collection => isEnabledFilter(collection.id, filters.collections) && isEnabledFilter(collection.owner, filters.accounts))).map((collection => {
        const collectionWithSortedNFTs = sortNFTs(collection, filters.type);
        return applyPriceSort ? enrichCollectionWithUSDFloorPrice(collectionWithSortedNFTs, prices, mainCurrencySymbol) : collectionWithSortedNFTs;
      })).sort(((collection1, collection2) => sortCollections(collection1, collection2, filters.type)));
    };
    const selectNFTs = es_createSelector((state => state.nfts), (nftsSlice => nftsSlice.nfts));
    const selectIsReloadingNFTs = es_createSelector((state => state.nfts), (nftsSlice => nftsSlice.isReloading));
    const selectCurrentAccountNFTs = es_createSelector(selectNFTs, selectCurrentAccount, ((nfts, account) => Object.values(nfts[account.network.chainID]?.[normalizeQEVMAddress(account.address)] ?? {})));
    const selectNFTFilters = es_createSelector((state => state.nfts), (nftsSlice => nftsSlice.filters));
    const selectEnrichedNFTFilters = es_createSelector(selectNFTFilters, selectAccountTotals, ((filters, accountTotals) => {
      const accounts = filters.accounts.reduce(((acc, filter) => {
        const additionalData = getAdditionalDataForFilter(filter.id, accountTotals);
        if (Object.keys(additionalData).length > 0) {
          return [ ...acc, {
            ...filter,
            ...additionalData
          } ];
        }
        return [ ...acc ];
      }), []);
      const collections = filters.collections.filter((({owners}) => {
        const enablingAccount = (owners ?? []).find((owner => accounts.find((account => account.id === owner && account.isEnabled))));
        return !!enablingAccount;
      })).sort(((collection1, collection2) => collection1.name.localeCompare(collection2.name)));
      return {
        ...filters,
        collections,
        accounts
      };
    }));
    const selectAllCollections = es_createSelector(selectNFTs, (nfts => Object.values(nfts).flatMap((byAddress => Object.values(byAddress).flatMap((byCollection => Object.values(byCollection)))))));
    const selectAllNFTCollections = es_createSelector(selectAllCollections, (collections => collections.filter((collection => !collection.hasBadges))));
    const selectAllNFTBadgesCollections = es_createSelector(selectAllCollections, (collections => collections.filter((collection => collection.hasBadges))));
    const selectFilteredNFTCollections = es_createSelector(selectAllNFTCollections, selectNFTFilters, getPricesState, selectMainCurrencySymbol, ((collections, filters, prices, mainCurrencySymbol) => getFilteredCollections(collections, filters, prices, mainCurrencySymbol)));
    const selectFilteredNFTBadgesCollections = es_createSelector(selectAllNFTBadgesCollections, selectNFTFilters, getPricesState, selectMainCurrencySymbol, ((collections, filters, prices, mainCurrencySymbol) => getFilteredCollections(collections, filters, prices, mainCurrencySymbol)));
    const selectCurrentAccountNFTsCount = es_createSelector(selectCurrentAccountNFTs, (collections => getNFTsCount(collections)));
    const selectAllNFTsCount = es_createSelector(selectAllNFTCollections, (collections => getNFTsCount(collections)));
    const selectAllNFTBadgesCount = es_createSelector(selectAllNFTBadgesCollections, (collections => getNFTsCount(collections)));
    const selectFilteredNFTsCount = es_createSelector(selectFilteredNFTCollections, (collections => getNFTsCount(collections)));
    const selectFilteredNFTBadgesCount = es_createSelector(selectFilteredNFTBadgesCollections, (collections => getNFTsCount(collections)));
    const selectFilteredNFTCollectionsCount = es_createSelector(selectFilteredNFTCollections, (collections => collections.length));
    const selectFilteredTotalFloorPrice = es_createSelector(selectFilteredNFTCollections, (collections => getTotalFloorPrice(collections)));
    const isDeleted = ability => ability.removedFromUi;
    const isExpired = ability => ability.closeAt ? new Date(ability.closeAt) < new Date : false;
    const filterByState = (ability, state) => {
      switch (state) {
       case "open":
        return !isDeleted(ability) && !isExpired(ability) && ability.completed === false;

       case "completed":
        return !isDeleted(ability) && !isExpired(ability) && ability.completed === true;

       case "expired":
        return !isDeleted(ability) && isExpired(ability);

       case "deleted":
        return isDeleted(ability);

       default:
        return true;
      }
    };
    const filterByType = (type, types) => types.includes(type);
    const filterByAddress = (address, accounts) => accounts.includes(address);
    const filterAbility = (ability, filter) => filterByAddress(ability.address, filter.accounts) && filterByState(ability, filter.state) && filterByType(ability.type, filter.types);
    const selectAbilities = es_createSelector((state => state.abilities), (abilitiesSlice => abilitiesSlice.abilities));
    const selectDescriptionHidden = es_createSelector((state => state.abilities.hideDescription), (hideDescription => hideDescription));
    const selectAbilityFilter = es_createSelector((state => state.abilities), (abilitiesSlice => abilitiesSlice.filter));
    const selectAbilityFilterState = es_createSelector((state => state.abilities), (abilitiesSlice => abilitiesSlice.filter.state));
    const selectAbilityFilterTypes = es_createSelector((state => state.abilities), (abilitiesSlice => abilitiesSlice.filter.types));
    const selectAbilityFilterAccounts = es_createSelector((state => state.abilities), (abilitiesSlice => abilitiesSlice.filter.accounts));
    const selectFilteredAbilities = es_createSelector(selectAbilityFilter, selectAbilities, ((filter, abilities) => {
      const activeAbilities = [];
      Object.values(abilities).forEach((addressAbilities => {
        activeAbilities.push(...Object.values(addressAbilities).filter((ability => filterAbility(ability, filter))));
      }));
      return activeAbilities;
    }));
    const selectOpenAbilityCount = es_createSelector(selectAbilityFilter, selectAbilities, ((filter, abilities) => Object.values(abilities).flatMap((address => Object.values(address))).filter((ability => filterAbility(ability, {
      ...filter,
      state: "open"
    }))).length));
    const selectTransactionNetwork = es_createSelector((state => state.transactionConstruction.transactionRequest?.network), (network => network));
    const selectDefaultNetworkFeeSettings = es_createSelector((state => state.transactionConstruction), (state => state.networks), selectCurrentNetwork, selectTransactionNetwork, ((transactionConstruction, networks, selectedNetwork, transactionNetwork) => {
      const currentNetwork = transactionNetwork || selectedNetwork;
      const selectedFeesPerGas = transactionConstruction.estimatedFeesPerGas?.[currentNetwork.chainID]?.[transactionConstruction.feeTypeSelected] ?? transactionConstruction.customFeesPerGas;
      return {
        feeType: transactionConstruction.feeTypeSelected,
        gasLimit: undefined,
        suggestedGasLimit: transactionConstruction.transactionRequest?.gasLimit,
        values: {
          maxFeePerGas: selectedFeesPerGas?.maxFeePerGas ?? 0n,
          maxPriorityFeePerGas: selectedFeesPerGas?.maxPriorityFeePerGas ?? 0n,
          gasPrice: selectedFeesPerGas?.price ?? 0n,
          baseFeePerGas: networks.blockInfo[currentNetwork.chainID]?.baseFeePerGas ?? undefined
        }
      };
    }));
    const selectEstimatedFeesPerGas = es_createSelector((state => state.transactionConstruction.estimatedFeesPerGas), selectTransactionNetwork, selectCurrentNetwork, ((gasData, transactionNetwork, selectedNetwork) => transactionNetwork ? gasData[transactionNetwork.chainID] : gasData[selectedNetwork.chainID]));
    const selectFeeType = es_createSelector((state => state.transactionConstruction.feeTypeSelected), (feeTypeChosen => feeTypeChosen));
    const selectBaseAsset = es_createSelector((state => state.transactionConstruction.transactionRequest?.network.baseAsset), (baseAsset => baseAsset));
    const selectTransactionMainCurrencyPricePoint = es_createSelector([ selectBaseAsset, getPricesState, state => selectMainCurrencySymbol(state), selectCurrentNetwork ], ((baseAsset, prices, mainCurrencySymbol, currentNetwork) => selectAssetPricePoint(prices, baseAsset ?? currentNetwork.baseAsset, mainCurrencySymbol)));
    const selectTransactionData = es_createSelector((state => state.transactionConstruction.transactionRequest), (transactionRequestData => transactionRequestData));
    const selectIsTransactionPendingSignature = es_createSelector((state => state.transactionConstruction.status), (status => status === "loaded" || status === "pending"));
    const selectIsTransactionLoaded = es_createSelector((state => state.transactionConstruction.status), (status => status === "loaded"));
    const selectIsTransactionSigned = es_createSelector((state => state.transactionConstruction.status), (status => status === "signed"));
    const selectCurrentlyChosenNetworkFees = es_createSelector((state => state.transactionConstruction?.estimatedFeesPerGas?.[state.transactionConstruction.feeTypeSelected]), (feeData => feeData));
    const selectHasInsufficientFunds = es_createSelector(selectTransactionData, (transactionDetails => !!transactionDetails?.annotation?.warnings?.includes("insufficient-funds")));
    const dapp_initialState = {
      permissionRequests: {},
      allowed: {
        evm: {}
      }
    };
    const dapp_emitter = new (emittery_default());
    const grantPermission = createBackgroundAsyncThunk("dapp-permission/permissionGrant", (async permission => {
      dapp_emitter.emit("grantPermission", {
        ...permission
      });
      return permission;
    }));
    const denyOrRevokePermission = createBackgroundAsyncThunk("dapp-permission/permissionDenyOrRevoke", (async permission => {
      await dapp_emitter.emit("denyOrRevokePermission", permission);
      return permission;
    }));
    const dappSlice = createSlice({
      name: "dapp-permission",
      initialState: dapp_initialState,
      reducers: {
        initializePermissions: (immerState, {payload: allowed}) => {
          immerState.allowed = allowed;
        },
        requestPermission: (state, {payload: request}) => {
          if (state.permissionRequests[request.origin]?.state !== "allow") {
            return {
              ...state,
              permissionRequests: {
                [request.origin]: {
                  ...request
                }
              }
            };
          }
          return state;
        },
        revokePermissionsForAddress: (immerState, {payload: address}) => {
          Object.keys(immerState.allowed.evm).forEach((chainID => {
            if (immerState.allowed.evm[chainID]?.[address]) {
              const {[address]: _, ...withoutAddressToRemove} = immerState.allowed.evm[chainID];
              immerState.allowed.evm[chainID] = withoutAddressToRemove;
            }
          }));
        }
      },
      extraReducers: builder => {
        builder.addCase(grantPermission.fulfilled, ((immerState, {payload: permission}) => {
          const updatedPermissionRequests = {
            ...immerState.permissionRequests
          };
          delete updatedPermissionRequests[permission.origin];
          const permissions = DEFAULT_NETWORKS.map((network => ({
            ...permission,
            chainID: network.chainID
          })));
          const allowedPermission = keyPermissionsByChainIdAddressOrigin(permissions, immerState.allowed);
          immerState.allowed = allowedPermission;
        })).addCase(denyOrRevokePermission.fulfilled, ((immerState, {payload: permission}) => {
          const updatedPermissionRequests = {
            ...immerState.permissionRequests
          };
          delete updatedPermissionRequests[permission.origin];
          Object.keys(immerState.allowed.evm).forEach((chainID => {
            if (immerState.allowed.evm[chainID]?.[permission.accountAddress]) {
              const {[permission.origin]: _, ...withoutOriginToRemove} = immerState.allowed.evm[chainID][permission.accountAddress];
              immerState.allowed.evm[chainID][permission.accountAddress] = withoutOriginToRemove;
            }
          }));
        }));
      }
    });
    const {requestPermission, initializePermissions, revokePermissionsForAddress} = dappSlice.actions;
    const dapp = dappSlice.reducer;
    const signingSliceEmitter = new (emittery_default());
    const signing_initialState = {
      typedDataRequest: undefined,
      signedTypedData: undefined,
      signedData: undefined,
      signDataRequest: undefined,
      additionalSigningStatus: undefined
    };
    const signTypedData = createBackgroundAsyncThunk("signing/signTypedData", (async data => {
      const {request: {account, typedData}, accountSigner} = data;
      await signingSliceEmitter.emit("requestSignTypedData", {
        typedData,
        account,
        accountSigner
      });
    }));
    const signData = createBackgroundAsyncThunk("signing/signData", (async data => {
      const {request, accountSigner} = data;
      await signingSliceEmitter.emit("requestSignData", {
        ...request,
        accountSigner
      });
    }));
    const signingSlice = createSlice({
      name: "signing",
      initialState: signing_initialState,
      reducers: {
        signedTypedData: (state, {payload}) => ({
          ...state,
          signedTypedData: payload,
          typedDataRequest: undefined
        }),
        typedDataRequest: (state, {payload}) => ({
          ...state,
          typedDataRequest: payload
        }),
        signDataRequest: (state, {payload}) => ({
          ...state,
          signDataRequest: payload
        }),
        signedData: (state, {payload}) => ({
          ...state,
          signedData: payload,
          signDataRequest: undefined
        }),
        clearSigningState: state => ({
          ...state,
          typedDataRequest: undefined,
          signDataRequest: undefined,
          additionalSigningStatus: undefined
        }),
        updateAdditionalSigningStatus: (state, {payload}) => ({
          ...state,
          additionalSigningStatus: payload
        })
      }
    });
    const {signedTypedData, typedDataRequest, signedData: signing_signedData, signDataRequest, clearSigningState, updateAdditionalSigningStatus} = signingSlice.actions;
    const signing = signingSlice.reducer;
    const selectTypedData = es_createSelector((state => state.signing.typedDataRequest), (signTypes => signTypes));
    const selectSigningData = es_createSelector((state => state.signing.signDataRequest), (signTypes => signTypes));
    const selectAdditionalSigningStatus = es_createSelector((state => state.signing.additionalSigningStatus), (additionalSigningStatus => additionalSigningStatus));
    const rejectDataSignature = createBackgroundAsyncThunk("signing/reject", (async (_, {dispatch}) => {
      await signingSliceEmitter.emit("signatureRejected");
      dispatch(signingSlice.actions.clearSigningState());
    }));
    var TxStatus = function(TxStatus) {
      TxStatus[TxStatus["FAIL"] = 0] = "FAIL";
      TxStatus[TxStatus["SUCCESS"] = 1] = "SUCCESS";
      return TxStatus;
    }(TxStatus || {});
    const INFINITE_VALUE = "infinite";
    const ACTIVITY_DECIMALS = 2;
    function isEnrichedTransaction(transaction) {
      return "annotation" in transaction;
    }
    function getAmount(tx) {
      const {value, network: {baseAsset: {symbol}}} = tx;
      if (value == null || typeof value === "undefined") {
        return "(Unknown)";
      }
      return `${convertToEth(value) || "0"} ${symbol}`;
    }
    function getBlockHeight(tx) {
      const {blockHeight} = tx;
      const status = "status" in tx ? tx.status : undefined;
      if (blockHeight !== null && status !== undefined && status !== TxStatus.SUCCESS) {
        return "(failed)";
      }
      if (blockHeight !== null) {
        return blockHeight.toString();
      }
      if (blockHeight === null && status === TxStatus.FAIL) {
        return "(dropped)";
      }
      return "(pending)";
    }
    function getGweiPrice(value) {
      if (value === null || typeof value === "undefined") {
        return "(Unknown)";
      }
      return `${weiToGwei(value) || "0"} Gwei`;
    }
    function getTimestamp(blockTimestamp) {
      return blockTimestamp ? new Date(blockTimestamp * 1e3).toLocaleString() : "(Unknown)";
    }
    const getAssetSymbol = transaction => {
      const {annotation} = transaction;
      switch (annotation?.type) {
       case "asset-transfer":
       case "asset-approval":
        return annotation.assetAmount.asset.symbol;

       default:
        return transaction.asset.symbol;
      }
    };
    const getValue = transaction => {
      const {asset, value} = transaction;
      const localizedValue = assetAmountToDesiredDecimals({
        asset,
        amount: value
      }, ACTIVITY_DECIMALS).toLocaleString("default", {
        maximumFractionDigits: ACTIVITY_DECIMALS
      });
      if (isEnrichedTransaction(transaction)) {
        const {annotation} = transaction;
        switch (annotation?.type) {
         case "asset-transfer":
          return annotation.assetAmount.localizedDecimalAmount;

         case "asset-approval":
          return isMaxUint256(annotation.assetAmount.amount) ? INFINITE_VALUE : annotation.assetAmount.localizedDecimalAmount;

         default:
          return localizedValue;
        }
      }
      return localizedValue;
    };
    const getActivity = transaction => {
      const {to, from, blockHeight, nonce, hash, blockHash, asset} = transaction;
      let activity = {
        status: "status" in transaction ? transaction.status : undefined,
        to: to && normalizeQEVMAddress(to),
        from: normalizeQEVMAddress(from),
        recipient: {
          address: to
        },
        sender: {
          address: from
        },
        blockHeight,
        assetSymbol: asset.symbol,
        nonce,
        hash,
        blockHash,
        value: getValue(transaction)
      };
      if (isEnrichedTransaction(transaction)) {
        const {annotation} = transaction;
        activity = {
          ...activity,
          type: annotation?.type,
          value: getValue(transaction),
          blockTimestamp: annotation?.blockTimestamp,
          assetLogoUrl: annotation?.transactionLogoURL,
          assetSymbol: getAssetSymbol(transaction),
          recipient: getRecipient(transaction),
          sender: getSender(transaction)
        };
      }
      return activity;
    };
    const sortActivities = (a, b) => {
      if (a.blockHeight === null || b.blockHeight === null || a.blockHeight === b.blockHeight) {
        if (a.nonce === b.nonce) {
          if (a.blockHeight === null) {
            return 1;
          }
          if (b.blockHeight === null) {
            return -1;
          }
        }
        return b.nonce - a.nonce;
      }
      if (a.blockHeight === null && b.blockHeight === null) {
        return 0;
      }
      if (a.blockHeight === null) {
        return -1;
      }
      if (b.blockHeight === null) {
        return 1;
      }
      return b.blockHeight - a.blockHeight;
    };
    function getActivityDetails(tx) {
      const {annotation} = tx;
      const assetTransfers = annotation?.subannotations === undefined ? [] : annotation.subannotations.map((subannotation => {
        if (subannotation.type === "asset-transfer" && (sameQEVMAddress(subannotation.sender.address, tx.from) || sameQEVMAddress(subannotation.recipient.address, tx.from))) {
          return {
            direction: sameQEVMAddress(subannotation.sender.address, tx.from) ? "out" : "in",
            assetSymbol: subannotation.assetAmount.asset.symbol,
            assetLogoUrl: subannotation.assetAmount.asset.metadata?.logoURL,
            localizedDecimalAmount: subannotation.assetAmount.localizedDecimalAmount
          };
        }
        return undefined;
      })).filter(isDefined);
      return [ {
        label: "Block Height",
        value: getBlockHeight(tx)
      }, {
        label: "Amount",
        value: getAmount(tx)
      }, {
        label: "Max Fee/Gas",
        value: getGweiPrice(tx.maxFeePerGas)
      }, {
        label: "Gas Price",
        value: getGweiPrice(tx.gasPrice)
      }, {
        label: "Gas",
        value: "gasUsed" in tx ? tx.gasUsed.toString() : ""
      }, {
        label: "Nonce",
        value: tx.nonce.toString()
      }, {
        label: "Timestamp",
        value: getTimestamp(tx.annotation?.blockTimestamp)
      } ].concat(assetTransfers.map((transfer => ({
        assetIconUrl: transfer.assetLogoUrl ?? "",
        label: transfer.assetSymbol,
        value: transfer.direction === "in" ? transfer.localizedDecimalAmount : `-${transfer.localizedDecimalAmount}`
      }))));
    }
    const ACTIVITIES_MAX_COUNT = 25;
    const cleanActivitiesArray = (activitiesArray = []) => {
      activitiesArray.sort(sortActivities);
      activitiesArray.splice(ACTIVITIES_MAX_COUNT);
    };
    const addActivityToState = activities => (address, chainID, transaction) => {
      const activity = getActivity(transaction);
      const normalizedAddress = normalizeQEVMAddress(address);
      activities[normalizedAddress] ??= {};
      activities[normalizedAddress][chainID] ??= [];
      const exisistingIndex = activities[normalizedAddress][chainID].findIndex((tx => tx.hash === transaction.hash));
      if (exisistingIndex !== -1) {
        activities[normalizedAddress][chainID][exisistingIndex] = activity;
      } else {
        activities[normalizedAddress][chainID].push(activity);
      }
    };
    const initializeActivitiesFromTransactions = ({transactions, accounts}) => {
      const activities = {};
      const addActivity = addActivityToState(activities);
      const normalizedAccounts = accounts.map((account => normalizeAddressOnNetwork(account)));
      transactions.forEach((transaction => {
        const {to, from, network} = transaction;
        const isTrackedTo = normalizedAccounts.some((({address, network: activeNetwork}) => network.chainID === activeNetwork.chainID && sameQEVMAddress(to, address)));
        const isTrackedFrom = normalizedAccounts.some((({address, network: activeNetwork}) => network.chainID === activeNetwork.chainID && sameQEVMAddress(from, address)));
        if (to && isTrackedTo) {
          addActivity(to, network.chainID, transaction);
        }
        if (from && isTrackedFrom) {
          addActivity(from, network.chainID, transaction);
        }
      }));
      normalizedAccounts.forEach((({address, network}) => cleanActivitiesArray(activities[address]?.[network.chainID])));
      return activities;
    };
    const activities_initialState = {
      activities: {}
    };
    const activitiesSlice = createSlice({
      name: "activities",
      initialState: activities_initialState,
      reducers: {
        initializeActivities: (immerState, {payload}) => ({
          activities: initializeActivitiesFromTransactions(payload)
        }),
        initializeActivitiesForAccount: (immerState, {payload: {transactions, account}}) => {
          const {address, network: {chainID}} = account;
          transactions.forEach((transaction => addActivityToState(immerState.activities)(address, chainID, transaction)));
          cleanActivitiesArray(immerState.activities[normalizeQEVMAddress(address)]?.[chainID]);
        },
        removeActivities: (immerState, {payload: address}) => {
          immerState.activities[address] = {};
        },
        addActivity: (immerState, {payload: {transaction, forAccounts}}) => {
          const {chainID} = transaction.network;
          forAccounts.forEach((address => {
            addActivityToState(immerState.activities)(address, chainID, transaction);
            cleanActivitiesArray(immerState.activities[normalizeQEVMAddress(address)]?.[chainID]);
          }));
        }
      }
    });
    const {initializeActivities, addActivity, removeActivities, initializeActivitiesForAccount} = activitiesSlice.actions;
    const activities = activitiesSlice.reducer;
    const fetchSelectedActivityDetails = createBackgroundAsyncThunk("activities/fetchSelectedActivityDetails", (async (activityHash, {extra: {main}}) => main.getActivityDetails(activityHash)));
    const nfts_emitter = new (emittery_default());
    function updateCollection(acc, collection) {
      const {id, name, nftCount, totalNftCount, network, owner, floorPrice, hasBadges, thumbnailURL} = collection;
      const {chainID} = network;
      const ownerAddress = normalizeQEVMAddress(owner);
      acc.nfts[chainID] ??= {};
      acc.nfts[chainID][ownerAddress] ??= {};
      const savedCollection = acc.nfts[chainID][ownerAddress][collection.id] ?? {};
      acc.nfts[chainID][ownerAddress][collection.id] = {
        id,
        name,
        nftCount: nftCount ?? savedCollection.nftCount ?? 0,
        totalNftCount,
        nfts: savedCollection.nfts ?? [],
        hasBadges: savedCollection.hasBadges || hasBadges,
        chainID,
        owner: ownerAddress,
        thumbnailURL,
        hasNextPage: false,
        floorPrice: floorPrice && {
          value: fromFixedPointNumber({
            amount: floorPrice.value,
            decimals: floorPrice.token.decimals
          }, 4),
          tokenSymbol: floorPrice.token.symbol
        }
      };
    }
    function updateFilter(acc, collection, type) {
      const {id, name, thumbnailURL, owner} = collection;
      const existingFilterId = acc.filters[type].findIndex((obj => obj.id === (type === "accounts" ? owner : id)));
      const filter = type === "accounts" ? {
        id: owner,
        name: owner
      } : {
        id,
        name,
        thumbnailURL
      };
      if (existingFilterId >= 0) {
        acc.filters[type][existingFilterId] = {
          ...acc.filters[type][existingFilterId],
          ...filter
        };
        if (type === "collections") {
          const owners = acc.filters[type][existingFilterId].owners ?? [];
          if (!owners.includes(owner)) {
            acc.filters[type][existingFilterId].owners = [ ...owners, owner ];
          }
        }
      } else {
        acc.filters[type].push({
          ...filter,
          isEnabled: true,
          ...type === "collections" && {
            owners: [ owner ]
          }
        });
      }
    }
    function updateFilters(acc, collection) {
      const {nftCount} = collection;
      if ((nftCount ?? 0) > 0) {
        updateFilter(acc, collection, "collections");
      }
      updateFilter(acc, collection, "accounts");
    }
    function parseNFTs(nfts) {
      return nfts.map((nft => {
        const {network, rarity, ...cached} = nft;
        return {
          ...cached,
          chainID: network.chainID,
          rarityRank: rarity.rank ?? null
        };
      }));
    }
    const NFTsSlice = createSlice({
      name: "nfts",
      initialState: {
        isReloading: false,
        nfts: {},
        filters: {
          collections: [],
          accounts: [],
          type: "desc"
        }
      },
      reducers: {
        initializeNFTs: (immerState, {payload: collections}) => {
          const state = {
            isReloading: false,
            nfts: {},
            filters: {
              collections: [],
              accounts: [],
              type: "desc"
            }
          };
          collections.forEach((collection => {
            updateCollection(state, collection);
            updateFilters(state, collection);
          }));
          return state;
        },
        updateNFTsCollections: (immerState, {payload: collections}) => {
          collections.forEach((collection => {
            updateCollection(immerState, collection);
            updateFilters(immerState, collection);
          }));
        },
        updateNFTs: (immerState, {payload}) => {
          const {account: {network, address}, collectionID, nfts, hasNextPage} = payload;
          const collectionToUpdate = immerState.nfts[network.chainID][normalizeQEVMAddress(address)][collectionID];
          collectionToUpdate.nfts = parseNFTs(nfts);
          collectionToUpdate.hasNextPage = hasNextPage;
        },
        updateIsReloading: (immerState, {payload: isReloading}) => {
          immerState.isReloading = isReloading;
        },
        deleteNFTsForAddress: (immerState, {payload: address}) => {
          const normalizedAddress = normalizeQEVMAddress(address);
          immerState.filters.accounts = immerState.filters.accounts.filter((({id}) => id !== address));
          immerState.filters.collections = immerState.filters.collections.flatMap((collection => {
            if (collection.owners?.includes(address)) {
              return collection.owners.length === 1 ? [] : {
                ...collection,
                owners: collection.owners.filter((owner => owner !== address))
              };
            }
            return collection;
          }));
          Object.keys(immerState.nfts).forEach((chainID => {
            delete immerState.nfts[chainID][normalizedAddress];
          }));
        },
        deleteTransferredNFTs: (immerState, {payload: transfers}) => {
          transfers.forEach((({id: nftID, chainID, from: address, collectionID}) => {
            if (!address || !collectionID) return;
            const normalizedAddress = normalizeQEVMAddress(address);
            const collection = immerState.nfts[chainID]?.[normalizedAddress]?.[collectionID];
            if (collection) {
              const hasLastNFT = (collection.nftCount ?? 0) <= 1;
              const hasCachedTransferredNFT = collection.nfts.some((nft => nft.id === nftID));
              collection.nftCount = (collection.nftCount || 1) - 1;
              if (hasCachedTransferredNFT || hasLastNFT) {
                if (collection.nfts.length === 1 || hasLastNFT) {
                  immerState.filters.collections = immerState.filters.collections.filter((({id}) => id !== collectionID));
                  delete immerState.nfts[chainID][normalizedAddress][collectionID];
                } else {
                  collection.nfts = collection.nfts.filter((nft => nft.id !== nftID));
                }
              }
            }
          }));
        },
        cleanCachedNFTs: immerState => {
          Object.keys(immerState.nfts).forEach((chainID => Object.keys(immerState.nfts[chainID]).forEach((address => Object.keys(immerState.nfts[chainID][address]).forEach((collectionID => {
            const collection = immerState.nfts[chainID][address][collectionID];
            if (!collection.hasBadges) {
              const reducedList = collection.nfts.slice(0, 2);
              collection.nfts = reducedList;
            }
          }))))));
        },
        updateCollectionFilter: (immerState, {payload: filter}) => {
          const idx = immerState.filters.collections.findIndex((({id}) => id === filter.id));
          immerState.filters.collections[idx] = filter;
        },
        updateAccountFilter: (immerState, {payload: filter}) => {
          const idx = immerState.filters.accounts.findIndex((({id}) => id === filter.id));
          immerState.filters.accounts[idx] = filter;
        },
        updateSortType: (immerState, {payload: type}) => {
          immerState.filters.type = type;
        }
      }
    });
    const {initializeNFTs, updateNFTsCollections, updateNFTs, updateIsReloading, deleteNFTsForAddress, deleteTransferredNFTs, cleanCachedNFTs, updateCollectionFilter, updateAccountFilter, updateSortType} = NFTsSlice.actions;
    const nfts = NFTsSlice.reducer;
    const fetchNFTsFromCollection = createBackgroundAsyncThunk("nfts/fetchNFTsFromCollection", (async payload => {
      await nfts_emitter.emit("fetchNFTs", payload);
    }));
    const refetchNFTsFromCollection = createBackgroundAsyncThunk("nfts/refetchNFTsFromCollection", (async payload => {
      await nfts_emitter.emit("refetchNFTs", payload);
    }));
    const fetchMoreNFTsFromCollection = createBackgroundAsyncThunk("nfts/fetchMoreNFTsFromCollection", (async payload => {
      await nfts_emitter.emit("fetchMoreNFTs", payload);
    }));
    const refetchCollections = createBackgroundAsyncThunk("nfts/refetchCollections", (async () => {
      await nfts_emitter.emit("refetchCollections");
    }));
    class AbilitiesDatabase extends Xn {
      constructor() {
        super("qwal/abilities");
        this.version(1).stores({
          abilities: "&[abilityId+address], interestRank"
        });
      }
      async updateAbilities(abilities) {
        await this.abilities.bulkPut(abilities);
      }
      async removeAbilities(abilities) {
        const keys = abilities.map((({abilityId, address}) => [ abilityId, address ]));
        await this.abilities.bulkDelete(keys);
      }
      async getAbilities() {
        return this.abilities.toArray();
      }
      async getSortedAbilities() {
        return this.abilities.orderBy("interestRank").toArray();
      }
      async getAbility(address, abilityId) {
        return this.abilities.get({
          address,
          abilityId
        });
      }
      async markAsCompleted(address, abilityId) {
        const ability = await this.getAbility(address, abilityId);
        if (ability) {
          const updatedAbility = {
            ...ability,
            completed: true
          };
          this.abilities.put(updatedAbility);
          return updatedAbility;
        }
        return undefined;
      }
      async markAsRemoved(address, abilityId) {
        const ability = await this.getAbility(address, abilityId);
        if (ability) {
          const updatedAbility = {
            ...ability,
            removedFromUi: true
          };
          this.abilities.put(updatedAbility);
          return updatedAbility;
        }
        return undefined;
      }
      async deleteAbilitiesForAccount(address) {
        return this.abilities.filter((ability => ability.address === address)).delete();
      }
    }
    async function abilities_db_getOrCreateDB() {
      return new AbilitiesDatabase;
    }
    class AbilitiesService extends BaseService {
      constructor(db, chainService) {
        super();
        this.db = db;
        this.chainService = chainService;
      }
      ABILITY_TIME_KEY="LAST_ABILITY_FETCH_TIME";
      static create=async chainService => new this(await abilities_db_getOrCreateDB(), await chainService);
      async internalStartService() {
        await super.internalStartService();
        await this.fetchAbilities();
      }
      async getNewAccountAbilities(address) {
        this.pollForAbilities(address);
        this.emitter.emit("newAccount", address);
      }
      async syncAbilities(latestAbilities) {
        const cachedAbilities = await this.db.getAbilities();
        const cachedAbilitiesById = Object.fromEntries(cachedAbilities.map((ability => [ ability.abilityId, ability ])));
        const syncedAbilities = latestAbilities.map((latestAbility => {
          const cachedAbility = cachedAbilitiesById[latestAbility.abilityId];
          delete cachedAbilitiesById[latestAbility.abilityId];
          const cachedCompleted = cachedAbility?.completed ?? false;
          return {
            ...latestAbility,
            removedFromUi: cachedAbility?.removedFromUi ?? false,
            completed: cachedCompleted || latestAbility.completed
          };
        }));
        const removedAbilities = Object.values(cachedAbilitiesById);
        if (removedAbilities.length > 0) {
          await this.db.removeAbilities(removedAbilities);
        }
        await this.db.updateAbilities(syncedAbilities);
        return this.db.getSortedAbilities();
      }
      async pollForAbilities(_address) {}
      async markAbilityAsCompleted(address, abilityId) {
        const ability = await this.db.markAsCompleted(address, abilityId);
        if (ability) {
          this.emitter.emit("updatedAbility", ability);
        }
      }
      async markAbilityAsRemoved(address, abilityId) {
        const ability = await this.db.markAsRemoved(address, abilityId);
        if (ability) {
          this.emitter.emit("updatedAbility", ability);
        }
      }
      async fetchAbilities() {
        const accountsToTrack = await this.chainService.getAccountsToTrack();
        const addresses = new Set(accountsToTrack.map((account => normalizeQEVMAddress(account.address))));
        for (const address of addresses) {
          this.emitter.emit("initAbilities", address);
        }
      }
      async refreshAbilities() {
        const lastFetchTime = Date.now();
        if (lastFetchTime && Number(lastFetchTime) + HOUR > Date.now()) {
          return;
        }
        await this.fetchAbilities();
      }
      async reportAndRemoveAbility(address, _abilitySlug, abilityId, _) {
        this.markAbilityAsRemoved(address, abilityId);
      }
      async deleteAbilitiesForAccount(address) {
        const deletedRecords = await this.db.deleteAbilitiesForAccount(address);
        if (deletedRecords > 0) {
          this.emitter.emit("deleteAbilities", address);
        }
        this.emitter.emit("deleteAccount", address);
      }
    }
    const ABILITY_TYPES_ENABLED = [ "mint", "airdrop", "vote", "access", "claim" ];
    const ABILITY_TYPES = [ ...ABILITY_TYPES_ENABLED, "event", "misc" ];
    const ABILITY_TYPE_COLOR = {
      mint: "#20c580",
      airdrop: "#FF1E6F",
      vote: "#E3C10B",
      result: "#E3C10B",
      access: "#02C0EA",
      event: "#FF8A1E",
      article: "#B2B2B2",
      misc: "#CBCBCB",
      claim: "#F4D530"
    };
    const isKeyPairAccount = (internalSigner, address) => internalSigner.keyPairs.flatMap((({address}) => address)).includes(address);
    const abilities_initialState = {
      filter: {
        state: "open",
        types: [ ...ABILITY_TYPES_ENABLED ],
        accounts: []
      },
      abilities: {},
      hideDescription: false
    };
    const abilitiesSlice = createSlice({
      name: "abilities",
      initialState: abilities_initialState,
      reducers: {
        setAbilitiesForAddress: (immerState, {payload}) => {
          const {address, abilities} = payload;
          immerState.abilities[address] = Object.fromEntries(abilities.map((ability => [ ability.abilityId, ability ])));
        },
        updateAbility: (immerState, {payload}) => {
          immerState.abilities[payload.address][payload.abilityId] = payload;
        },
        deleteAbilitiesForAccount: (immerState, {payload: address}) => {
          delete immerState.abilities[address];
        },
        deleteAbility: (immerState, {payload}) => {
          delete immerState.abilities[payload.address]?.[payload.abilityId];
        },
        toggleHideDescription: (immerState, {payload}) => {
          immerState.hideDescription = payload;
        },
        updateState: (immerState, {payload: state}) => {
          immerState.filter.state = state;
        },
        addType: (immerState, {payload: type}) => {
          immerState.filter.types.push(type);
        },
        deleteType: (immerState, {payload: type}) => {
          immerState.filter.types = immerState.filter.types.filter((value => value !== type));
        },
        addAccount: (immerState, {payload: account}) => {
          if (!immerState.filter.accounts.includes(account)) {
            immerState.filter.accounts.push(account);
          }
        },
        deleteAccount: (immerState, {payload: account}) => {
          immerState.filter.accounts = immerState.filter.accounts.filter((value => value !== account));
        }
      }
    });
    const {setAbilitiesForAddress, updateAbility, deleteAbilitiesForAccount, deleteAbility, toggleHideDescription, updateState, addType, deleteType, addAccount, deleteAccount: abilities_deleteAccount} = abilitiesSlice.actions;
    const completeAbility = createBackgroundAsyncThunk("abilities/completeAbility", (async ({address, abilityId}, {extra: {main}}) => {
      await main.markAbilityAsCompleted(address, abilityId);
    }));
    const removeAbility = createBackgroundAsyncThunk("abilities/removeAbility", (async ({address, abilityId}, {extra: {main}}) => {
      await main.markAbilityAsRemoved(address, abilityId);
    }));
    const reportAndRemoveAbility = createBackgroundAsyncThunk("abilities/reportAndRemoveAbility", (async ({address, abilitySlug, abilityId, reason}, {extra: {main}}) => {
      await main.reportAndRemoveAbility(address, abilitySlug, abilityId, reason);
    }));
    const initAbilities = createBackgroundAsyncThunk("abilities/initAbilities", (async (address, {dispatch, getState, extra: {main}}) => {
      const {internalSigner, abilities} = getState();
      if (isKeyPairAccount(internalSigner, address)) {
        await main.pollForAbilities(address);
        if (JSON.stringify(abilities) === JSON.stringify(abilities_initialState)) {
          dispatch(addAccount(address));
        }
      }
    }));
    const abilities = abilitiesSlice.reducer;
    const QWAL_ICON_URL = "https://quantumevm.com/static/images/favicon.svg";
    const NOTIFICATIONS_XP_DROP_THRESHOLD = 24 * HOUR;
    class NotificationsService extends BaseService {
      isPermissionGranted=null;
      clickHandlers={};
      static create=async preferenceService => new this(await preferenceService);
      constructor(preferenceService) {
        super();
        this.preferenceService = preferenceService;
      }
      async internalStartService() {
        await super.internalStartService();
        const boundHandleNotificationClicks = this.handleNotificationClicks.bind(this);
        const boundCleanUpNotificationClickHandler = this.cleanUpNotificationClickHandler.bind(this);
        this.preferenceService.emitter.on("initializeNotificationsPreferences", (async isPermissionGranted => {
          this.isPermissionGranted = isPermissionGranted;
        }));
        this.preferenceService.emitter.on("setNotificationsPermission", (isPermissionGranted => {
          this.isPermissionGranted = isPermissionGranted;
          if (this.isPermissionGranted) {
            browser_polyfill_default().notifications.onClicked.addListener(boundHandleNotificationClicks);
            browser_polyfill_default().notifications.onClosed.addListener(boundCleanUpNotificationClickHandler);
          } else {
            browser_polyfill_default().notifications.onClicked.removeListener(boundHandleNotificationClicks);
            browser_polyfill_default().notifications.onClosed.removeListener(boundCleanUpNotificationClickHandler);
          }
        }));
        if (this.isPermissionGranted) {
          browser_polyfill_default().notifications.onClicked.addListener(boundHandleNotificationClicks);
          browser_polyfill_default().notifications.onClosed.addListener(boundCleanUpNotificationClickHandler);
        }
      }
      handleNotificationClicks(notificationId) {
        this.clickHandlers?.[notificationId]();
      }
      cleanUpNotificationClickHandler(notificationId) {
        delete this.clickHandlers?.[notificationId];
      }
      notify({options, callback}) {
        if (!this.isPermissionGranted) {
          return;
        }
        const notificationId = (0, lodash.uniqueId)("notification-");
        const notificationOptions = {
          type: "basic",
          iconUrl: QWAL_ICON_URL,
          ...options
        };
        if (typeof callback === "function") {
          this.clickHandlers[notificationId] = callback;
        }
        browser_polyfill_default().notifications.create(notificationId, notificationOptions);
      }
      notifyXPDrop(callback) {
        const shouldShowXpDropNotifications = this.lastXpDropNotificationInMs ? Date.now() > this.lastXpDropNotificationInMs + NOTIFICATIONS_XP_DROP_THRESHOLD : true;
        if (shouldShowXpDropNotifications) {
          this.lastXpDropNotificationInMs = Date.now();
          const options = {
            title: "Weekly XP distributed",
            message: "Visit Subscape to see if you are eligible"
          };
          this.notify({
            options,
            callback
          });
        }
      }
    }
    const to_2 = prevState => {
      const typedPrevState = prevState;
      return {
        ...typedPrevState,
        ui: {
          ...typedPrevState.ui,
          settings: {
            ...typedPrevState.ui?.settings,
            showTestNetworks: true
          }
        }
      };
    };
    const REDUX_STATE_VERSION = 2;
    const allMigrations = {
      2: to_2
    };
    function migrateReduxState(previousState, previousVersion) {
      const resolvedVersion = previousVersion ?? 1;
      let migratedState = previousState;
      if (resolvedVersion < REDUX_STATE_VERSION) {
        const outstandingMigrations = Object.entries(allMigrations).sort((([a], [b]) => parseInt(a, 10) - parseInt(b, 10))).filter((([version]) => parseInt(version, 10) > resolvedVersion)).map((([, migration]) => migration));
        migratedState = outstandingMigrations.reduce(((state, migration) => migration(state)), migratedState);
      }
      return migratedState;
    }
    const migrations = null && allMigrations;
    const mainReducer = combineReducers({
      account: accounts,
      assets,
      activities,
      internalSigner: internal_signer,
      networks,
      transactionConstruction: transaction_construction,
      ui,
      dapp,
      signing,
      abilities,
      nfts,
      prices
    });
    const redux_slices = mainReducer;
    var store_encodeJSON;
    const wrapStore = (0, lib.Iq)();
    const devToolsSanitizer = input => {
      switch (typeof input) {
       case "bigint":
       case "object":
        return JSON.parse(store_encodeJSON(input));

       default:
        return input;
      }
    };
    async function persistStoreBsae(state) {
      if (true) {
        await browser_polyfill_default().storage.local.set({
          state: encodeJSON(state),
          version: REDUX_STATE_VERSION
        });
      }
    }
    const persistStore = (0, lodash.debounce)(persistStoreBsae, 50, {
      trailing: true,
      maxWait: 50
    });
    const reduxCache = store => next => action => {
      const result = next(action);
      const state = store.getState();
      persistStore(state);
      return result;
    };
    async function readAndMigrateState() {
      let savedReduxState = {};
      if (true) {
        const {state, stateDiffs, version} = await browser_polyfill_default().storage.local.get([ "state", "stateDiffs", "version" ]);
        if (state) {
          const restoredState = (stateDiffs ?? "").split("\n").filter((entry => entry.length > 0)).reduce(((previousState, currentStateDiffString) => patch(previousState, JSON.parse(currentStateDiffString))), decodeJSON(state));
          if (typeof restoredState === "object" && restoredState !== null) {
            savedReduxState = migrateReduxState(restoredState, version || undefined);
            await persistStoreBsae(savedReduxState);
          } else {
            throw new Error(`Unexpected JSON persisted for state: ${state}`);
          }
        }
      }
      return savedReduxState;
    }
    function initializeStore(thunkArgument, preloadedState) {
      const baseStore = configureStore({
        preloadedState,
        reducer: redux_slices,
        middleware: getDefaultMiddleware => {
          const middleware = getDefaultMiddleware({
            serializableCheck: {
              isSerializable: value => isPlain(value) || typeof value === "bigint"
            },
            thunk: {
              extraArgument: {
                main: thunkArgument
              }
            }
          });
          middleware.unshift((0, lib.nK)(allAliases));
          middleware.push(reduxCache);
          return middleware;
        },
        devTools: false,
        enhancers: false ? 0 : []
      });
      let storeUpdateLock;
      let releaseLock;
      const queueUpdate = (0, lodash.debounce)(((lastState, newState, updateFn) => {
        if (lastState !== newState) {
          const diff = differ_diff(lastState, newState);
          if (diff !== undefined) {
            updateFn(newState, [ diff ]);
          }
        }
        releaseLock();
      }), 30, {
        maxWait: 30,
        trailing: true
      });
      wrapStore(baseStore, {
        serializer: encodeJSON,
        deserializer: decodeJSON,
        diffStrategy: (oldObj, newObj, forceUpdate) => {
          if (!storeUpdateLock) {
            storeUpdateLock = new Promise((resolve => {
              releaseLock = () => {
                resolve();
                storeUpdateLock = null;
              };
            }));
          }
          queueUpdate(oldObj, newObj, forceUpdate);
          return [];
        },
        dispatchResponder: async (dispatchResult, send) => {
          try {
            const result = await dispatchResult;
            await storeUpdateLock;
            send({
              error: null,
              value: encodeJSON(result)
            });
          } catch (error) {
            lib_logger.error("Error awaiting and dispatching redux store result: ", error);
            await storeUpdateLock;
            send({
              error: encodeJSON(error),
              value: null
            });
          }
        }
      });
      return baseStore;
    }
    class ReduxService extends BaseService {
      static create=async () => {
        const preferenceService = PreferenceService.create();
        const internalSignerService = InternalSignerService.create(preferenceService);
        const chainService = ChainService.create(preferenceService, internalSignerService);
        const indexingService = IndexingService.create(preferenceService, chainService);
        const nameService = NameService.create(chainService, preferenceService);
        const enrichmentService = EnrichmentService.create(chainService, indexingService, nameService);
        const internalEthereumProviderService = InternalQuantumEVMProviderService.create(chainService, preferenceService);
        const providerBridgeService = ProviderBridgeService.create(internalEthereumProviderService, preferenceService);
        const notificationsService = NotificationsService.create(preferenceService);
        const signingService = SigningService.create(internalSignerService, chainService);
        const nftsService = NFTsService.create(chainService);
        const abilitiesService = AbilitiesService.create(chainService);
        const savedReduxState = readAndMigrateState();
        return new this(await savedReduxState, await preferenceService, await chainService, await enrichmentService, await indexingService, await internalSignerService, await nameService, await internalEthereumProviderService, await providerBridgeService, await signingService, await nftsService, await abilitiesService, await notificationsService);
      };
      constructor(savedReduxState, preferenceService, chainService, enrichmentService, indexingService, internalSignerService, nameService, internalEthereumProviderService, providerBridgeService, signingService, nftsService, abilitiesService, notificationsService) {
        super({
          initialLoadWaitExpired: {
            schedule: {
              delayInMinutes: 2.5
            },
            handler: () => this.store.dispatch(initializationLoadingTimeHitLimit())
          }
        });
        this.preferenceService = preferenceService;
        this.chainService = chainService;
        this.enrichmentService = enrichmentService;
        this.indexingService = indexingService;
        this.internalSignerService = internalSignerService;
        this.nameService = nameService;
        this.internalEthereumProviderService = internalEthereumProviderService;
        this.providerBridgeService = providerBridgeService;
        this.signingService = signingService;
        this.nftsService = nftsService;
        this.abilitiesService = abilitiesService;
        this.notificationsService = notificationsService;
        this.store = initializeStore(this, savedReduxState);
        this.initializeRedux();
      }
      async internalStartService() {
        await super.internalStartService();
        const servicesToBeStarted = [ this.preferenceService.startService(), this.chainService.startService(), this.indexingService.startService(), this.enrichmentService.startService(), this.internalSignerService.startService(), this.nameService.startService(), this.internalEthereumProviderService.startService(), this.providerBridgeService.startService(), this.signingService.startService(), this.nftsService.startService(), this.abilitiesService.startService(), this.notificationsService.startService() ];
        await Promise.all(servicesToBeStarted);
      }
      async internalStopService() {
        const servicesToBeStopped = [ this.preferenceService.stopService(), this.chainService.stopService(), this.indexingService.stopService(), this.enrichmentService.stopService(), this.internalSignerService.stopService(), this.nameService.stopService(), this.internalEthereumProviderService.stopService(), this.providerBridgeService.stopService(), this.signingService.stopService(), this.nftsService.stopService(), this.abilitiesService.stopService(), this.notificationsService.stopService() ];
        await Promise.all(servicesToBeStopped);
        await super.internalStopService();
      }
      async initializeRedux() {
        this.connectIndexingService();
        this.connectInternalSignerService();
        this.connectNameService();
        this.connectInternalEthereumProviderService();
        this.connectProviderBridgeService();
        this.connectPreferenceService();
        this.connectEnrichmentService();
        this.connectSigningService();
        this.connectAbilitiesService();
        this.connectNFTsService();
        await this.connectChainService();
        this.store.dispatch(clearTransactionState(TransactionConstructionStatus.Idle));
      }
      async addAccount(addressNetwork) {
        await this.chainService.addAccountToTrack(addressNetwork);
      }
      addOrEditAddressName({address, network, name}) {
        this.preferenceService.addOrEditNameInAddressBook({
          address,
          network,
          name
        });
      }
      async removeAccount(address, signer, lastAddressInAccount) {
        this.store.dispatch(deleteAccount(address));
        if (signer.type !== AccountType.ReadOnly && lastAddressInAccount) {
          await this.preferenceService.deleteAccountSignerSettings(signer);
        }
        this.store.dispatch(removeActivities(address));
        this.store.dispatch(deleteNFTsForAddress(address));
        await this.nftsService.removeNFTsForAddress(address);
        if (signer.type !== AccountType.ReadOnly) {
          await this.abilitiesService.deleteAbilitiesForAccount(address);
        }
        this.store.dispatch(revokePermissionsForAddress(address));
        await this.providerBridgeService.revokePermissionsForAddress(address);
        await this.signingService.removeAccount(address, signer.type);
        this.nameService.removeAccount(address);
        this.indexingService.removeDiscoveryTxHash(address);
      }
      async getAccountEthBalanceUncached(addressNetwork) {
        const accountBalance = await this.chainService.getLatestBaseAccountBalance(addressNetwork);
        return accountBalance.assetAmount.amount;
      }
      async enrichActivitiesForSelectedAccount() {
        const addressNetwork = this.store.getState().ui.selectedAccount;
        if (addressNetwork) {
          await this.enrichActivities(addressNetwork);
        }
      }
      async enrichActivities(addressNetwork) {
        const accountsToTrack = await this.chainService.getAccountsToTrack();
        const activitiesToEnrich = selectActivitesHashesForEnrichment(this.store.getState());
        activitiesToEnrich.forEach((async txHash => {
          const transaction = await this.chainService.getTransaction(addressNetwork.network, txHash);
          const enrichedTransaction = await this.enrichmentService.enrichTransaction(transaction, 2);
          this.store.dispatch(addActivity({
            transaction: enrichedTransaction,
            forAccounts: getRelevantTransactionAddresses(enrichedTransaction, accountsToTrack)
          }));
        }));
      }
      async connectChainService() {
        this.chainService.emitter.on("initializeActivities", (async payload => {
          this.store.dispatch(initializeActivities(payload));
          await this.enrichActivitiesForSelectedAccount();
          this.chainService.emitter.on("initializeActivitiesForAccount", (async payloadForAccount => {
            this.store.dispatch(initializeActivitiesForAccount(payloadForAccount));
            await this.enrichActivitiesForSelectedAccount();
          }));
          const existingAccounts = await this.chainService.getAccountsToTrack();
          existingAccounts.forEach((addressNetwork => {
            this.store.dispatch(loadAccount(addressNetwork));
          }));
        }));
        this.chainService.emitter.on("accountsWithBalances", (accountWithBalance => {
          this.store.dispatch(updateAccountBalance(accountWithBalance));
        }));
        this.chainService.emitter.on("supportedNetworks", (supportedNetworks => {
          this.store.dispatch(setEVMNetworks(supportedNetworks));
        }));
        this.chainService.emitter.on("block", (block => {
          this.store.dispatch(blockSeen(block));
        }));
        this.chainService.emitter.on("transactionSend", (async () => {
          this.store.dispatch(setSnackbarMessage("Transaction signed, broadcasting..."));
          this.store.dispatch(clearTransactionState(TransactionConstructionStatus.Idle));
        }));
        this.chainService.emitter.on("transactionSendFailure", (async () => {
          this.store.dispatch(setSnackbarMessage("Transaction failed to broadcast."));
        }));
        transaction_construction_emitter.on("updateTransaction", (async transaction => {
          const {network} = transaction;
          const {values: {maxFeePerGas, maxPriorityFeePerGas}} = selectDefaultNetworkFeeSettings(this.store.getState());
          const {transactionRequest: populatedRequest, gasEstimationError} = await this.chainService.populatePartialTransactionRequest(network, {
            ...transaction
          }, {
            maxFeePerGas,
            maxPriorityFeePerGas
          });
          const getAnnotation = async () => {
            const {annotation} = await this.enrichmentService.enrichTransactionSignature(network, populatedRequest, 2);
            return annotation;
          };
          const maybeEnrichedAnnotation = await Promise.race([ getAnnotation(), wait(1e4) ]);
          if (maybeEnrichedAnnotation) {
            populatedRequest.annotation = maybeEnrichedAnnotation;
          }
          if (typeof gasEstimationError === "undefined") {
            this.store.dispatch(transactionRequest({
              transactionRequest: populatedRequest,
              transactionLikelyFails: false
            }));
          } else {
            this.store.dispatch(transactionRequest({
              transactionRequest: populatedRequest,
              transactionLikelyFails: true
            }));
          }
        }));
        transaction_construction_emitter.on("broadcastSignedTransaction", (async transaction => {
          this.chainService.broadcastSignedTransaction(transaction);
        }));
        transaction_construction_emitter.on("requestSignature", (async ({request, accountSigner}) => {
          try {
            const signedTransactionResult = await this.signingService.signTransaction(request, accountSigner);
            this.store.dispatch(transactionSigned(signedTransactionResult));
          } catch (exception) {
            lib_logger.error("Error signing transaction", exception);
            this.store.dispatch(clearTransactionState(TransactionConstructionStatus.Idle));
          }
        }));
        signingSliceEmitter.on("requestSignTypedData", (async ({typedData, account, accountSigner}) => {
          try {
            const signedData = await this.signingService.signTypedData({
              typedData,
              account,
              accountSigner
            });
            this.store.dispatch(signedTypedData(signedData));
          } catch (err) {
            lib_logger.error("Error signing typed data", typedData, "error: ", err);
            this.store.dispatch(clearSigningState);
          }
        }));
        signingSliceEmitter.on("requestSignData", (async ({rawSigningData, account, accountSigner}) => {
          const signedData = await this.signingService.signData(account, rawSigningData, accountSigner);
          this.store.dispatch(signing_signedData(signedData));
        }));
        this.chainService.emitter.on("blockPrices", (async ({blockPrices, network}) => {
          this.store.dispatch(estimatedFeesPerGas({
            estimatedFeesPerGas: blockPrices,
            network
          }));
        }));
        this.chainService.emitter.on("transaction", (async transactionInfo => {
          this.store.dispatch(addActivity(transactionInfo));
        }));
        emitter.on("userActivityEncountered", (addressOnNetwork => {
          this.abilitiesService.refreshAbilities();
          this.chainService.markAccountActivity(addressOnNetwork);
        }));
      }
      async connectNameService() {
        this.nameService.emitter.on("resolvedName", (async ({from: {addressOnNetwork}, resolved: {nameOnNetwork: {name}}}) => {
          this.store.dispatch(updateAccountName({
            ...addressOnNetwork,
            name
          }));
        }));
        this.nameService.emitter.on("resolvedAvatar", (async ({from: {addressOnNetwork}, resolved: {avatar}}) => {
          this.store.dispatch(updateENSAvatar({
            ...addressOnNetwork,
            avatar: avatar.toString()
          }));
        }));
      }
      async connectIndexingService() {
        this.indexingService.emitter.on("accountsWithBalances", (async ({balances, addressOnNetwork}) => {
          const assetsToTrack = await this.indexingService.getAssetsToTrack();
          const trackedAccounts = await this.chainService.getAccountsToTrack();
          const allTrackedAddresses = new Set(trackedAccounts.map((account => account.address)));
          if (!allTrackedAddresses.has(addressOnNetwork.address)) {
            return;
          }
          const filteredBalancesToDispatch = [];
          balances.filter((balance => !isBaseAssetForNetwork(balance.assetAmount.asset, balance.network))).forEach((balance => {
            const balanceHasAnAlreadyTrackedAsset = assetsToTrack.some((tracked => isSameAsset(tracked, balance.assetAmount.asset)));
            if (balance.assetAmount.amount > 0 || balanceHasAnAlreadyTrackedAsset) {
              filteredBalancesToDispatch.push(balance);
            }
          }));
          this.store.dispatch(updateAccountBalance({
            balances: filteredBalancesToDispatch,
            addressOnNetwork
          }));
        }));
        this.indexingService.emitter.on("assetsLoaded", (async ({assets, loadingScope}) => {
          this.store.dispatch(assetsLoaded({
            assets,
            loadingScope
          }));
          const smartContractAssets = assets.filter(isSmartContractFungibleAsset);
          if (smartContractAssets.length > 0) {
            this.store.dispatch(updateAccountAssetReferences(smartContractAssets));
            this.store.dispatch(updatePriceAssetReferences(smartContractAssets));
          }
        }));
        this.indexingService.emitter.on("prices", (pricePoints => {
          this.store.dispatch(newPricePoints(pricePoints));
        }));
        this.indexingService.emitter.on("refreshAsset", (asset => {
          this.store.dispatch(refreshAsset({
            asset
          }));
        }));
        this.indexingService.emitter.on("removeAssetData", (asset => {
          this.store.dispatch(removeAssetData({
            asset
          }));
        }));
      }
      async connectEnrichmentService() {
        this.enrichmentService.emitter.on("enrichedEVMTransaction", (transactionData => {
          this.indexingService.notifyEnrichedTransaction(transactionData.transaction);
          this.store.dispatch(addActivity(transactionData));
        }));
      }
      async connectSigningService() {
        this.internalSignerService.emitter.on("address", (address => this.signingService.addTrackedAddress(address, "keyPair")));
      }
      async connectInternalSignerService() {
        this.internalSignerService.emitter.on("internalSigners", (signers => {
          this.store.dispatch(updateInternalSigners(signers));
        }));
        this.internalSignerService.emitter.on("address", (async address => {
          const trackedNetworks = await this.chainService.getTrackedNetworks();
          trackedNetworks.forEach((network => {
            this.store.dispatch(loadAccount({
              address,
              network
            }));
            this.chainService.addAccountToTrack({
              address,
              network
            });
            this.abilitiesService.getNewAccountAbilities(address);
          }));
        }));
        this.internalSignerService.emitter.on("locked", (async isLocked => {
          if (isLocked) {
            this.store.dispatch(internalSignerLocked());
          } else {
            this.store.dispatch(internalSignerUnlocked());
          }
        }));
        internal_signer_emitter.on("createPassword", (async password => {
          await this.internalSignerService.unlock(password, true);
        }));
        internal_signer_emitter.on("lockInternalSigners", (async () => {
          await this.internalSignerService.lock();
        }));
        internal_signer_emitter.on("generateNewMnemonics", (async () => {
          const generated = this.internalSignerService.generateNewMnemonics();
          this.store.dispatch(setMnemonicsToVerify(generated));
        }));
      }
      async connectInternalEthereumProviderService() {
        this.internalEthereumProviderService.emitter.on("transactionSignatureRequest", (async ({payload, resolver, rejecter}) => {
          await this.signingService.prepareForSigningRequest();
          this.store.dispatch(clearTransactionState(TransactionConstructionStatus.Pending));
          this.store.dispatch(updateTransactionData(payload));
          const clear = () => {
            this.signingService.emitter.off("signingTxResponse", handleAndClear);
            transaction_construction_emitter.off("signatureRejected", rejectAndClear);
          };
          const handleAndClear = response => {
            clear();
            switch (response.type) {
             case "success-tx":
              resolver(response.signedTx);
              break;

             default:
              rejecter();
              break;
            }
          };
          const rejectAndClear = async () => {
            clear();
            rejecter();
          };
          this.signingService.emitter.on("signingTxResponse", handleAndClear);
          transaction_construction_emitter.on("signatureRejected", rejectAndClear);
        }));
        this.internalEthereumProviderService.emitter.on("signTypedDataRequest", (async ({payload, resolver, rejecter}) => {
          const [, enrichedSignTypedDataRequest] = await Promise.all([ this.signingService.prepareForSigningRequest(), this.enrichmentService.enrichSignTypedDataRequest(payload) ]);
          this.store.dispatch(typedDataRequest(enrichedSignTypedDataRequest));
          const clear = () => {
            this.signingService.emitter.off("signingDataResponse", handleAndClear);
            signingSliceEmitter.off("signatureRejected", rejectAndClear);
          };
          const handleAndClear = response => {
            clear();
            switch (response.type) {
             case "success-data":
              resolver(response.signedData);
              break;

             default:
              rejecter();
              break;
            }
          };
          const rejectAndClear = () => {
            clear();
            rejecter();
          };
          this.signingService.emitter.on("signingDataResponse", handleAndClear);
          signingSliceEmitter.on("signatureRejected", rejectAndClear);
        }));
        this.internalEthereumProviderService.emitter.on("signDataRequest", (async ({payload, resolver, rejecter}) => {
          await this.signingService.prepareForSigningRequest();
          this.chainService.pollBlockPricesForNetwork(payload.account.network.chainID);
          this.store.dispatch(signDataRequest(payload));
          const clear = () => {
            this.signingService.emitter.off("personalSigningResponse", handleAndClear);
            signingSliceEmitter.off("signatureRejected", rejectAndClear);
          };
          const handleAndClear = response => {
            clear();
            switch (response.type) {
             case "success-data":
              resolver(response.signedData);
              break;

             default:
              rejecter();
              break;
            }
          };
          const rejectAndClear = () => {
            clear();
            rejecter();
          };
          this.signingService.emitter.on("personalSigningResponse", handleAndClear);
          signingSliceEmitter.on("signatureRejected", rejectAndClear);
        }));
        this.internalEthereumProviderService.emitter.on("selectedNetwork", (network => {
          this.store.dispatch(setSelectedNetwork(network));
        }));
        emitter.on("newSelectedNetwork", (network => {
          this.internalEthereumProviderService.routeSafeRPCRequest("wallet_switchEthereumChain", [ {
            chainId: network.chainID
          } ], QWAL_INTERNAL_ORIGIN);
          this.chainService.pollBlockPricesForNetwork(network.chainID);
          this.store.dispatch(clearCustomGas());
        }));
        this.internalEthereumProviderService.emitter.on("watchAssetRequest", (async ({contractAddress, network}) => {
          const {address} = this.store.getState().ui.selectedAccount;
          const asset = await this.indexingService.addTokenToTrackByContract(network, contractAddress);
          if (asset) {
            await this.indexingService.retrieveTokenBalances({
              address,
              network
            }, [ asset ]);
          }
        }));
      }
      async connectProviderBridgeService() {
        emitter.on("addCustomNetworkResponse", (([requestId, success]) => this.providerBridgeService.handleAddNetworkRequest(requestId, success)));
        this.providerBridgeService.emitter.on("requestPermission", (permissionRequest => {
          this.store.dispatch(requestPermission(permissionRequest));
        }));
        this.providerBridgeService.emitter.on("initializeAllowedPages", (async allowedPages => {
          this.store.dispatch(initializePermissions(allowedPages));
        }));
        dapp_emitter.on("grantPermission", (async permission => {
          await Promise.all(this.chainService.supportedNetworks.map((async network => {
            await this.providerBridgeService.grantPermission({
              ...permission,
              chainID: network.chainID
            });
          })));
        }));
        dapp_emitter.on("denyOrRevokePermission", (async permission => {
          await Promise.all(this.chainService.supportedNetworks.map((async network => {
            await this.providerBridgeService.denyOrRevokePermission({
              ...permission,
              chainID: network.chainID
            });
          })));
        }));
      }
      async connectPreferenceService() {
        this.preferenceService.emitter.on("initializeDefaultWallet", (async isDefaultWallet => {
          this.store.dispatch(setDefaultWallet(isDefaultWallet));
        }));
        this.preferenceService.emitter.on("initializeSelectedAccount", (async dbAddressNetwork => {
          if (dbAddressNetwork) {
            this.store.dispatch(setSelectedAccount(dbAddressNetwork));
          } else {
            const addressNetwork = this.store.getState().ui.selectedAccount;
            if (addressNetwork) {
              await this.preferenceService.setSelectedAccount(addressNetwork);
            }
          }
        }));
        this.preferenceService.emitter.on("updatedSignerSettings", (accountSignerSettings => {
          this.store.dispatch(setAccountsSignerSettings(accountSignerSettings));
        }));
        this.preferenceService.emitter.on("updateAutoLockInterval", (async newTimerValue => {
          await this.internalSignerService.updateAutoLockInterval();
          this.store.dispatch(setAutoLockInterval(newTimerValue));
        }));
        this.preferenceService.emitter.on("initializeShownDismissableItems", (async dismissableItems => {
          this.store.dispatch(setShownDismissableItems(dismissableItems));
        }));
        this.preferenceService.emitter.on("initializeNotificationsPreferences", (async isPermissionGranted => {
          this.store.dispatch(toggleNotifications(isPermissionGranted));
        }));
        this.preferenceService.emitter.on("dismissableItemMarkedAsShown", (async dismissableItem => {
          this.store.dispatch(dismissableItemMarkedAsShown(dismissableItem));
        }));
        emitter.on("newSelectedAccount", (async addressNetwork => {
          await this.preferenceService.setSelectedAccount(addressNetwork);
          await this.chainService.markAccountActivity(addressNetwork);
          this.providerBridgeService.notifyContentScriptsAboutAddressChange(addressNetwork.address);
        }));
        emitter.on("newSelectedAccountSwitched", (async addressNetwork => {
          this.enrichActivities(addressNetwork);
        }));
        emitter.on("newDefaultWalletValue", (async newDefaultWalletValue => {
          await this.preferenceService.setDefaultWalletValue(newDefaultWalletValue);
          this.providerBridgeService.notifyContentScriptAboutConfigChange(newDefaultWalletValue);
        }));
        emitter.on("refreshBackgroundPage", (async () => {
          window.location.reload();
        }));
      }
      connectNFTsService() {
        this.nftsService.emitter.on("initializeNFTs", (collections => {
          this.store.dispatch(initializeNFTs(collections));
        }));
        this.nftsService.emitter.on("updateCollections", (collections => {
          this.store.dispatch(updateNFTsCollections(collections));
        }));
        this.nftsService.emitter.on("updateNFTs", (async payload => {
          this.store.dispatch(updateNFTs(payload));
        }));
        this.nftsService.emitter.on("removeTransferredNFTs", (async payload => {
          this.store.dispatch(deleteTransferredNFTs(payload));
        }));
        this.nftsService.emitter.on("isReloadingNFTs", (async payload => {
          this.store.dispatch(updateIsReloading(payload));
        }));
        nfts_emitter.on("fetchNFTs", (({collectionID, account}) => this.nftsService.fetchNFTsFromCollection(collectionID, account)));
        nfts_emitter.on("refetchNFTs", (({collectionID, account}) => this.nftsService.refreshNFTsFromCollection(collectionID, account)));
        nfts_emitter.on("fetchMoreNFTs", (({collectionID, account}) => this.nftsService.fetchNFTsFromNextPage(collectionID, account)));
        nfts_emitter.on("refetchCollections", (() => this.nftsService.refreshCollections()));
      }
      connectAbilitiesService() {
        this.abilitiesService.emitter.on("initAbilities", (address => {
          this.store.dispatch(initAbilities(address));
        }));
        this.abilitiesService.emitter.on("updatedAbilities", (({address, abilities}) => {
          this.store.dispatch(setAbilitiesForAddress({
            address,
            abilities
          }));
        }));
        this.abilitiesService.emitter.on("deleteAbilities", (address => {
          this.store.dispatch(deleteAbilitiesForAccount(address));
        }));
        this.abilitiesService.emitter.on("updatedAbility", (ability => {
          this.store.dispatch(updateAbility(ability));
        }));
        this.abilitiesService.emitter.on("newAccount", (address => {
          this.store.dispatch(addAccount(address));
        }));
        this.abilitiesService.emitter.on("deleteAccount", (address => {
          this.store.dispatch(abilities_deleteAccount(address));
        }));
      }
      async unlockInternalSigners(password) {
        return this.internalSignerService.unlock(password);
      }
      async validateSession() {
        return !this.internalSignerService.locked();
      }
      async exportMnemonic(address) {
        return this.internalSignerService.exportMnemonic(address);
      }
      async exportPrivateKey(address) {
        return this.internalSignerService.exportPrivateKey(address);
      }
      async importSigner(signerRaw) {
        return this.internalSignerService.importSigner(signerRaw);
      }
      async getActivityDetails(txHash) {
        const addressNetwork = this.store.getState().ui.selectedAccount;
        const transaction = await this.chainService.getTransaction(addressNetwork.network, txHash);
        const enrichedTransaction = await this.enrichmentService.enrichTransaction(transaction, 2);
        return getActivityDetails(enrichedTransaction);
      }
      async connectPreferenceListeners() {
        emitter.on("shouldShowNotifications", (async shouldShowNotifications => {
          const isPermissionGranted = await this.preferenceService.setShouldShowNotifications(shouldShowNotifications);
          this.store.dispatch(toggleNotifications(isPermissionGranted));
        }));
        emitter.on("updateAutoLockInterval", (async newTimerValue => {
          await this.preferenceService.updateAutoLockInterval(newTimerValue);
        }));
      }
      async updateAssetMetadata(asset, metadata) {
        await this.indexingService.updateAssetMetadata(asset, metadata);
      }
      async hideAsset(asset) {
        await this.indexingService.hideAsset(asset);
      }
      getAddNetworkRequestDetails(requestId) {
        return this.providerBridgeService.getNewCustomRPCDetails(requestId);
      }
      async updateSignerTitle(signer, title) {
        return this.preferenceService.updateAccountSignerTitle(signer, title);
      }
      async markDismissableItemAsShown(item) {
        return this.preferenceService.markDismissableItemAsShown(item);
      }
      async resolveNameOnNetwork(nameOnNetwork) {
        try {
          return (await this.nameService.lookUpEthereumAddress(nameOnNetwork))?.resolved?.addressOnNetwork;
        } catch (error) {
          lib_logger.info("Error looking up Ethereum address: ", error);
          return undefined;
        }
      }
      async pollForAbilities(address) {
        return this.abilitiesService.pollForAbilities(address);
      }
      async markAbilityAsCompleted(address, abilityId) {
        return this.abilitiesService.markAbilityAsCompleted(address, abilityId);
      }
      async markAbilityAsRemoved(address, abilityId) {
        return this.abilitiesService.markAbilityAsRemoved(address, abilityId);
      }
      async reportAndRemoveAbility(address, abilitySlug, abilityId, reason) {
        this.abilitiesService.reportAndRemoveAbility(address, abilitySlug, abilityId, reason);
      }
      async removeEVMNetwork(chainID) {
        await this.internalEthereumProviderService.removePreferencesForChain(chainID);
        await this.providerBridgeService.revokePermissionsForChain(chainID);
        await this.chainService.removeCustomChain(chainID);
      }
      async queryCustomTokenDetails(contractAddress, addressOnNetwork) {
        const {network} = addressOnNetwork;
        const cachedAsset = this.indexingService.getCachedAssets(network).find((asset => isSmartContractFungibleAsset(asset) && sameQEVMAddress(contractAddress, asset.contractAddress)));
        const assetData = await this.chainService.queryAccountTokenDetails(contractAddress, addressOnNetwork, cachedAsset);
        const priceData = await getTokenPrices([ contractAddress ], USD, network);
        const convertedAssetAmount = contractAddress in priceData ? convertAssetAmountViaPricePoint(assetData, getPricePoint(assetData.asset, priceData[contractAddress])) : undefined;
        const mainCurrencyAmount = convertedAssetAmount ? assetAmountToDesiredDecimals(convertedAssetAmount, 2) : undefined;
        return {
          ...assetData,
          balance: Number.parseFloat(qethers_lib.utils.formatUnits(assetData.amount, assetData.asset.decimals)),
          mainCurrencyAmount,
          exists: !!cachedAsset
        };
      }
      async importCustomToken(asset) {
        return this.indexingService.importCustomToken(asset);
      }
      async connectPort(port) {
        this.connectPopupMonitor(port);
        this.providerBridgeService.connectPort(port);
      }
      connectPopupMonitor(port) {
        if (port.name !== POPUP_MONITOR_PORT_NAME) return;
        port.onDisconnect.addListener((() => {
          this.onPopupDisconnected();
        }));
      }
      onPopupDisconnected() {
        this.store.dispatch(rejectTransactionSignature());
        this.store.dispatch(rejectDataSignature());
      }
    }
    var ProxyStore;
    var produce;
    var patchDeepDiff;
    var background_encodeJSON;
    var background_decodeJSON;
    async function newProxyStore() {
      const proxyStore = new ProxyStore({
        serializer: background_encodeJSON,
        deserializer: background_decodeJSON,
        patchStrategy: (oldObj, patchesWrapper) => {
          if (patchesWrapper.length === 0) {
            return oldObj;
          }
          const result = produce(oldObj, (draft => patchDeepDiff(draft, patchesWrapper[0])));
          return result;
        }
      });
      await proxyStore.ready();
      return proxyStore;
    }
    async function startRedux() {
      const reduxService = await ReduxService.create();
      reduxService.startService();
      return reduxService.started();
    }
    if (chrome && chrome.runtime && chrome.runtime.setUninstallURL) {
      chrome.runtime.setUninstallURL("https://quantumevm.com/wallet");
    }
    const BuildTimeFlag = {
      SWITCH_RUNTIME_FLAGS: "MISSING_ENV_VAR".SWITCH_RUNTIME_FLAGS === "true"
    };
    const RuntimeFlag = {
      SHOW_IMPORT_DERIVATION_PATH: "false" === "true",
      SUPPORT_MULTIPLE_LANGUAGES: "false" === "true",
      SHOW_TOKEN_FEATURES: "false" === "true",
      SUPPORT_ACHIEVEMENTS_BANNER: "false" === "true",
      SUPPORT_NFT_SEND: "false" === "true",
      SUPPORT_WALLET_CONNECT: "false" === "true",
      SUPPORT_CUSTOM_NETWORKS: "MISSING_ENV_VAR".SUPPORT_CUSTOM_NETWORKS === "true"
    };
    const FeatureFlags = Object.keys({
      ...BuildTimeFlag,
      ...RuntimeFlag
    }).reduce(((types, flagName) => ({
      ...types,
      [flagName]: flagName
    })), {});
    function isEnabled(flagName, checkBrowserStorage = BuildTimeFlag.SWITCH_RUNTIME_FLAGS) {
      const isBuildTimeFlag = flag => flag in BuildTimeFlag;
      if (isBuildTimeFlag(flagName)) {
        return BuildTimeFlag[flagName];
      }
      if (checkBrowserStorage) {
        const state = "";
        return state !== null ? state === "true" : RuntimeFlag[flagName];
      }
      return RuntimeFlag[flagName];
    }
    function isDisabled(flagName, checkBrowserStorage = BuildTimeFlag.SWITCH_RUNTIME_FLAGS) {
      return !isEnabled(flagName, checkBrowserStorage);
    }
    function wrapIfEnabled(flag, valueToWrap) {
      return isEnabled(flag) ? [ valueToWrap ] : [];
    }
    function wrapIfDisabled(flag, valueToWrap) {
      return isDisabled(flag) ? [ valueToWrap ] : [];
    }
    const ONBOARDING_ROOT = "/tab.html#onboarding";
    const OnboardingRoutes = {
      ONBOARDING_START: "/onboarding",
      ADD_WALLET: "/onboarding/add-wallet",
      SET_PASSWORD: "/onboarding/set-password",
      IMPORT_SEED: "/onboarding/import-seed",
      IMPORT_MNEMONICS: "/onboarding/import-private-key",
      NEW_SEED: "/onboarding/new-seed",
      VIEW_ONLY_WALLET: "/onboarding/view-only-wallet",
      ONBOARDING_COMPLETE: "/onboarding/done"
    };
    const Routes = null && OnboardingRoutes;
    browser_polyfill_default().runtime.onInstalled.addListener((obj => {
      if (obj.reason === "install") {
        const url = browser_polyfill_default().runtime.getURL(ONBOARDING_ROOT);
        browser_polyfill_default().tabs.create({
          url
        });
      }
      if (obj.reason === "update" && !isEnabled(FeatureFlags.SWITCH_RUNTIME_FLAGS)) {
        Object.keys(RuntimeFlag).forEach((flagName => ""));
      }
    }));
    let redux;
    browser_polyfill_default().runtime.onConnect.addListener((async port => {
      const reduxService = await redux;
      reduxService.connectPort(port);
    }));
    redux ??= startRedux().then((service => service));
  })();
})();
//# sourceMappingURL=background.js.map