diff --git a/dist/143.index.js b/dist/143.index.js new file mode 100644 index 0000000..ea0d252 --- /dev/null +++ b/dist/143.index.js @@ -0,0 +1,17 @@ +export const id = 143; +export const ids = [143]; +export const modules = { + +/***/ 9143: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"un tableau","boolean":"un booléen","bug-of-mc":"À cause d'un bug de Minecraft (%0%), %1%. S'il vous plaît Mojang, corrigez votre jeu","code-action.block-state-sort-keys":"Trier les états de bloc","code-action.command-replaceitem":"Mettre à jour cette commande sous la forme /item ... replace","code-action.fix-file":"Corriger tous les problèmes auto-corrigibles dans ce fichier","code-action.fix-workspace":"Corriger tous les problèmes auto-corrigibles dans l'espace de travail","code-action.id-attribute-datafix":"Mettre à jour ce nom d'attribut pour la 1.16","code-action.id-complete-default-namespace":"Compléter l'espace de nommage par défaut","code-action.id-create-file":"Créer %0% dans le même pack de données","code-action.id-omit-default-namespace":"Omettre l'espace de nommage par défaut","code-action.id-zombified-piglin-datafix":"Changer cet ID en celui du Piglin zombifié","code-action.nbt-compound-sort-keys":"Trier les clés du compound NBT","code-action.nbt-type-to-byte":"Convertir en octet NBT","code-action.nbt-type-to-double":"Convertir en double NBT","code-action.nbt-type-to-float":"Convertir en un flottant NBT","code-action.nbt-type-to-int":"Convertir en entier NBT","code-action.nbt-type-to-long":"Convertir en long NBT","code-action.nbt-type-to-short":"Convertir en short NBT","code-action.nbt-uuid-datafix":"Mettre à jour cet UUID pour la 1.16","code-action.selector-sort-keys":"Trier les arguments du sélecteur","code-action.string-double-quote":"Encadrer cette chaîne de caractères avec des guillemets","code-action.string-single-quote":"Encadrer cette chaîne de caractères avec des apostrophes","code-action.string-unquote":"Enlever les délimiteurs autour de cette chaîne de caractères","code-action.vector-align-0.0":"Aligner ce vecteur à l'origine du bloc","code-action.vector-align-0.5":"Aligner ce vecteur au centre du bloc","comment":"un commentaire commençant par %0%","conjunction.and_2":"et","conjunction.and_3+_1":",","conjunction.and_3+_2":", et","conjunction.or_2":"ou","conjunction.or_3+_1":",","conjunction.or_3+_2":", ou","datafix.error.command-replaceitem":"/replaceitem a été enlevé en 20w46a (la deuxième snapshot de la 1.17) en faveur de /item","duplicate-key":"Clé duplique %0%","ending-quote":"un guillemet de fermeture %0%","entity":"une entité","error.unparseable-content":"Rencontré du contenu non interprétable","expected":"%0% attendu","expected-got":"Attendu %0% mais obtenu %1%","float":"un flottant","float.between":"un flottant entre %0% et %1%","integer":"un integer","integer.between":"un integer entre %0% et %1%","json.checker.array.length-between":"%0% avec une longueur entre %1% et %2%","json.checker.item.duplicate":"Dupliquer la liste d'objets","json.checker.object.field.union-empty-members":"Propriété refusée","json.checker.property.deprecated":"La propriété %0% est obsolète","json.checker.property.missing":"Propriété %0% manquante","json.checker.property.unknown":"Propriété %0% inconnue","json.checker.string.hex-color":"un nombre hexadécimal à six chiffres","json.checker.tag-entry.duplicate":"Dupliquer la liste de tag","json.doc.advancement.display":"Paramètres d'affichages du progrès. Si présent, le progrès sera visible dans les onglets de progrès.","json.node.array":"un tableau","json.node.boolean":"un booléen","json.node.null":"un null","json.node.number":"un nombre","json.node.object":"un objet","json.node.string":"une chaîne de caractères","key-not-following-convention":"Clé invalide %0% qui ne suit pas la convention %1%","linter-config-validator.name-convention.type":"Attend un chaîne de caractères contenant une expression régulière qui décrit le nom","linter-config-validator.wrapper":"%0%. Lisez [la documentation](%1) pour plus d'informations","linter.diagnostic-message-wrapper":"%0% (règle : %1%)","linter.name-convention.illegal":"Le nom %0% ne correspond pas à %1%","linter.undeclared-symbol.message":"N'arrive pas à trouver %0% %1%","long":"un long","mcdoc.binder.dispatcher-statement.duplicated-key":"Cas de répartiteur dupliqué %0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% a déjà été envoyé ici","mcdoc.binder.duplicated-declaration":"Déclaration dupliquée pour %0%","mcdoc.binder.duplicated-declaration.related":"%0% est déjà déclaré ici","mcdoc.binder.out-of-root":"Le fichier %0% ne se trouve pas dans le répertoire racine d'un projet mcdoc ; la vérification sémantique sera ignorée","mcdoc.binder.path.super-from-root":"Impossible d'accéder au super de la racine du projet","mcdoc.binder.path.unknown-identifier":"L'identificateur %0% n'existe pas dans le module %1%","mcdoc.binder.path.unknown-module":"Le module %0% n'existe pas","mcdoc.checker.entry.empty-mod-seg":"Vous ne pouvez pas mettre \"mod.mcdoc\" à la racine","mcdoc.checker.inject-clause.unmatched-injection":"Impossible d'injecter %0% avec %1%","mcdoc.checker.type-not-assignable":"Le type %0% n'est pas assignable au type %1%","mcdoc.node.compound-definition":"une définition composée","mcdoc.node.enum-definition":"une définition énumérée","mcdoc.node.identifier":"un identifiant","mcdoc.parser.compound-definition.field-type":"un type de champ","mcdoc.parser.float.illegal":"Nombre flottant illégal rencontré","mcdoc.parser.identifier.illegal":"%0% ne respecte pas le format de %1%","mcdoc.parser.identifier.reserved-word":"%0% est un mot réservé et ne peut être utilisé comme nom d'identifiant","mcdoc.parser.index-body.dynamic-index-not-allowed":"L'indexation dynamique n'est pas autorisée","mcdoc.parser.inject-clause.definition-expected":"Attendu soit une injection énumérée, soit une injection composée","mcdoc.parser.keyword.separation":"une séparation","mcdoc.parser.resource-location.colon-expected":"Attendu les deux-points (%0 %) aux emplacements de ressources","mcdoc.parser.syntax.doc-comment-unexpected":"Les commentaires de documentation ne sont pas autorisés ici ; vous devrez peut-être remplacer les trois barres obliques par deux barres obliques","mcfunction.checker.command.data-modify-unapplicable-operation":"L'opération %0% ne peut être utilisé que sur %1%; le chemin cible a à la place un type %2%","mcfunction.completer.block.states.default-value":"Défaut : %0%","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% n'est pas applicable ici","mcfunction.parser.entity-selector.arguments.unknown":"Argument de sélecteur d'entité inconnu %0%","mcfunction.parser.entity-selector.entities-disallowed":"Le sélecteur contient des entités non joueur","mcfunction.parser.entity-selector.multiple-disallowed":"Le sélecteur contient plusieurs entités","mcfunction.parser.entity-selector.player-name.too-long":"Les noms de joueurs ne peuvent pas avoir plus de %0% caractères","mcfunction.parser.eoc-unexpected":"Plus d'arguments attendus","mcfunction.parser.leading-slash":"une barre oblique “/”","mcfunction.parser.leading-slash.unexpected":"Slash “/” inattendu","mcfunction.parser.no-permission":"Le niveau de permission %0% est requis, mais le niveau de permission défini en configuration est seulement %1%","mcfunction.parser.objective.too-long":"Les noms d'objectifs ne peuvent pas avoir plus que %0% caractères","mcfunction.parser.range.min>max":"La valeur minimale %0% est plus grande que la valeur maximale %1%","mcfunction.parser.score_holder.fake-name.too-long":"Les faux noms ne peuvent pas avoir plus que %0% caractères","mcfunction.parser.sep":"un espace (%0%)","mcfunction.parser.trailing":"Trouvé des données supplémentaires à la fin","mcfunction.parser.unknown-parser":"L'analyseur %0% n'est pas supporté pour le moment","mcfunction.parser.uuid.invalid":"Format d'UUID invalide","mcfunction.parser.vector.local-disallowed":"Coordonnées locales interdites","mcfunction.parser.vector.mixed":"Les coordonnées locales et absolues/relatives ne peuvent pas être mélangées","mcfunction.signature-help.command-documentation":"[Wiki Minecraft : commande `%0%`](https://minecraft.fandom.com/wiki/Commands/%0%)","missing-key":"Clé %0% manquante","nbt.checker.block-states.fake-boolean":"Les états de blocs booléens doivent être mises entre guillemets","nbt.checker.block-states.unexpected-value-type":"Les valeurs des états de blocs doivent être soit une chaîne de caractères soit un nombre entier","nbt.checker.block-states.unknown-state":"État de bloc %0% inconnu pour le(s) bloc(s) suivant(s) : %1%","nbt.checker.boolean.out-of-range":"Une valeur booléenne devrait être soit %0% soit %1%","nbt.checker.collection.length-between":"%0% de longueur comprise entre %1% et %2%","nbt.checker.compound.field.union-empty-members":"Propriété interdite","nbt.checker.path.index-out-of-bound":"L'indice %0% fourni est hors limite, car la collection ne peut contenir que %1% d'éléments maximum","nbt.checker.path.unexpected-filter":"Les filtres composés ne peuvent être utilisés que sur des étiquettes composées","nbt.checker.path.unexpected-index":"Les indices ne peuvent être utilisés que dans des tableaux ou des listes","nbt.checker.path.unexpected-key":"Les clés de type chaîne ne peuvent être spécifiées que pour les étiquettes composées","nbt.node":"un tag","nbt.node.byte":"un octet","nbt.node.byte_array":"un tableau d'octets","nbt.node.compound":"un tag composé","nbt.node.double":"un tag de nombre double","nbt.node.float":"un tag de nombre flottant","nbt.node.int":"un tag de nombre entier","nbt.node.int_array":"un tag de liste d'entier","nbt.node.list":"un tag de liste","nbt.node.long":"un tag d'entier long","nbt.node.long_array":"un tag de liste d'entier long","nbt.node.path.end":"La fin du chemin","nbt.node.path.filter":"un filtre composé","nbt.node.path.index":"un indice","nbt.node.path.key":"une clé","nbt.node.short":"une étiquette courte","nbt.node.string":"un tag à chaîne de caractères","nbt.parser.number.out-of-range":"Cela ressemble à %0%, mais c'est en fait %1% car la valeur du chiffre est hors de [%2%, %3%]","not-matching-any-child":"Type d'argument invalide","nothing":"rien","number":"un nombre","number-range":"un intervalle de valeur","number-range.missing-min-and-max":"Attendu une valeure minimale ou une valeure maximale","number.<=":"un nombre inférieur ou égal à %0%","number.>=":"un nombre supérieur ou égal à %0%","number.between":"un nombre entre %0% et %1%","object":"un objet","objective":"un objectif","objective-not-following-convention":"L'objectif %0% est invalide car elle ne respecte pas la convention %1%","parser.float.illegal":"Chiffre flottant illégal qui ne suit pas %0%","parser.integer.illegal":"Entier illégal qui ne suit pas %0%","parser.list.trailing-sep":"Séparation à la fin","parser.list.value":"une valeur","parser.record.key":"une clé","parser.record.trailing-end":"Séparation à la fin","parser.record.unexpected-char":"Caractère %0% inattendu","parser.record.value":"une valeur","parser.resource-location.illegal":"Caractère(s) inattendu(s) : %0%","parser.resource-location.namespace-expected":"Les espaces de noms ne peuvent pas être omis ici","parser.resource-location.tag-disallowed":"Les tags ne sont pas autorisés ici","parser.string.illegal-brigadier":"Des caractères autres que [0-9A-Za-z_.+-] ont été rencontrés dans %0%","parser.string.illegal-escape":"Caractère d'échappement inattendu %0%","parser.string.illegal-quote":"Seuls %0% peuvent être utilisés pour citer des chaînes de caractères","parser.string.illegal-unicode-escape":"Chiffre hexadécimal attendu","punc.period":".","punc.quote":"“%0%”","quote":"un guillemet (“\"”) ou une apostrophe (“'”)","quote_prefer_double":"Des guillemets (“\"”) sont préférables ici","quote_prefer_single":"Une apostrophe (“'”) est préférable ici","resource-location":"un emplacement de ressource","score-holder":"un score holder","scoreholder-not-following-convention":"Le score_holder %0% est invalide car il ne respecte pas la convention %1%","server.new-version":"Le Data-pack Language Server a été mis à jour vers une version plus récente : %0%","server.progress.fixing-workspace.begin":"Correction de tous les problèmes auto-corrigibles dans l'espace de travail","server.progress.fixing-workspace.report":"correction de %0%","server.progress.preparing.title":"Préparation des caractéristiques du langage Spyglass","server.remove-cache-file":"Le fichier de cache a été déplacé au chemin donné par VSCode. Vous pouvez supprimer sans risque le dossier “.datapack” du dossier racine de votre espace de travail.","server.show-release-notes":"Afficher les notes de version","string":"un string","tag":"un tag","tag-not-following-convention":"Le tag %0% est invalide car il ne respecte pas la convention %1%","team":"une équipe","team-not-following-convention":"L'équipe %0% est invalide car elle ne respecte pas la convention %1%","time-unit":"une unité de temps","too-many-block-affected":"Trop de blocs dans la zone spécifiée (%0% au maximum, %1% spécifiés)","too-many-chunk-affected":"Trop de tronçons dans la zone spécifiée (maximum %0%, spécifié %1%)","unexpected-character":"Trouvé un caractère(s) non-[a-z0-9/._-]","unexpected-datapack-tag":"Les tags ne sont pas admis ici","unexpected-default-namespace":"L'espace de nommage par défaut devrait être omis ici","unexpected-local-coordinate":"La coordonnée locale %0% n'est pas admise","unexpected-nbt":"Ce tag n’existe pas","unexpected-nbt-array-type":"Type de tableau invalide %0%. Devrait être “B”, “I”, ou “L”","unexpected-nbt-path-filter":"Les filtres de champs sont seulement utilisés pour les tags de champs","unexpected-nbt-path-index":"Les indices sont seulement utilisés pour les tags de listes/tableaux","unexpected-nbt-path-key":"Les clés sont seulement utilisées pour les tags de champs","unexpected-nbt-path-sub":"Ce tag n'a pas d'items supplémentaires","unexpected-omitted-default-namespace":"L'espace de nom par défaut ne peut être omis ici","unexpected-relative-coordinate":"La coordonnée relative %0% n'est pas admise","unexpected-scoreboard-sub-slot":"Seulement “sidebar” a des sous-emplacements","unknown-command":"Commande inconnue %0%","unknown-escape":"Caractère d'échappement %0% inattendu","unknown-key":"Clé inconnue %0%","unquoted-string":"une chaîne de caractères sans délimiteurs","unsorted-keys":"Clés non triées","uuid":"un UUID","vector":"un vecteur"}); + + +/***/ }) + +}; diff --git a/dist/379.index.js b/dist/379.index.js new file mode 100644 index 0000000..14ac627 --- /dev/null +++ b/dist/379.index.js @@ -0,0 +1,17 @@ +export const id = 379; +export const ids = [379]; +export const modules = { + +/***/ 9379: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"un array","boolean":"un booleano","bug-of-mc":"Debido a un error de Minecraft (%0%), %1%. Por favor Mojang, arreglen su juego","code-action.block-state-sort-keys":"Discriminar estado de bloque (block state)","code-action.command-replaceitem":"Actualizar este commando a /item ... replace","code-action.fix-file":"Arreglar todos los problemas auto-arreglables en este archivo","code-action.fix-workspace":"Arreglar todos los problemas auto-arreglables en este espacio de trabajo","code-action.id-attribute-datafix":"Actualizar este nombre de atributo a la 1.16","code-action.id-complete-default-namespace":"Completar el namespace por defecto","code-action.id-create-file":"Crear %0% en el mismo paquete de datos","code-action.id-omit-default-namespace":"Omitir namespace por defecto","code-action.id-zombified-piglin-datafix":"Cambiar este identificador por el del Piglin Zombificado","code-action.nbt-compound-sort-keys":"Discriminar etiqueta compuesta de NBT","code-action.nbt-type-to-byte":"Convertir a una etiqueta NBT de octeto (byte)","code-action.nbt-type-to-double":"Convertir a una etiqueta NBT de coma flotante doble (double)","code-action.nbt-type-to-float":"Convertir a una etiqueta NBT de coma flotante (float)","code-action.nbt-type-to-int":"Convertir a una etiqueta NBT de número entero (int)","code-action.nbt-type-to-long":"Convertir a una etiqueta NBT de número largo (long)","code-action.nbt-type-to-short":"Convertir a una etiqueta NBT de número corto (short)","code-action.nbt-uuid-datafix":"Actualizar este Identificador Único a la 1.16","code-action.selector-sort-keys":"Discriminar por argumentos de selector","code-action.string-double-quote":"Añadir comillas dobles (\") a esta cadena","code-action.string-single-quote":"Añadir comillas singular (\") a esta cadena","code-action.string-unquote":"Remover comillas de esta cadena","code-action.vector-align-0.0":"Alinear este vector al punto de origen del bloque","code-action.vector-align-0.5":"Alinear este vector al centro del bloque","comment":"un comentario comenzando con %0%","conjunction.and_2":" y ","conjunction.and_3+_1":", ","conjunction.and_3+_2":", y ","conjunction.or_2":" o ","conjunction.or_3+_1":", ","conjunction.or_3+_2":", o ","datafix.error.command-replaceitem":"/replaceitem fue removido en la 20w46a (segunda snapshot de la 1.17) en favor de /item","duplicate-key":"Llave duplicada %0%","ending-quote":"una comilla cerrando %0%","entity":"una entidad","error.unparseable-content":"Contenido no analizable encontrado","expected":"Esperado %0%","expected-got":"Esperado %0% pero se encontró %0%","float":"un número de coma flotante (float)","float.between":"un número de coma flotante (float) entre %0% y %1%","integer":"un número entero","integer.between":"un número entero entre %0% y %1%","json.checker.item.duplicate":"Lista de objetos duplicados","json.checker.property.deprecated":"Propiedad %0% es obsoleta","json.checker.property.missing":"Propiedad %0% faltante","json.checker.property.unknown":"Propiedad %0% desconocida","json.checker.string.hex-color":"un número hexademical de 6 dígitos","json.checker.tag-entry.duplicate":"Entrada de etiqueta duplicada","json.doc.advancement.display":"Configuración de visualización del avance. Si está presenta, el avance será visible en la pestaña de Progresos.","key-not-following-convention":"Llave %0% invalida por no seguir la convención %1%","linter-config-validator.name-convention.type":"Espera una cadena que contenga una expresión regular describiendo el nombre","linter-config-validator.wrapper":"%0%. Vea [la documentación](%1) para más información","linter.diagnostic-message-wrapper":"%0% (regla: %1%)","linter.name-convention.illegal":"El nombre %0% no coincide con %1%","linter.undeclared-symbol.message":"No se pudo encontrar %0% %1%","long":"un número largo (long)","mcdoc.binder.duplicated-declaration":"Declaración duplicada para %0%","mcdoc.binder.duplicated-declaration.related":"%0% ya ha sido declarado aquí","mcdoc.binder.out-of-root":"El archivo %0% no esta bajo el directorio raiz de ningún proyecto de mcdoc; se omitirá el revisado de semántica","mcdoc.binder.path.super-from-root":"No se puede acceder a la super de la raíz del proyecto","mcdoc.binder.path.unknown-identifier":"El identificador %0% no existe en el módulo %1%","mcdoc.binder.path.unknown-module":"El módulo %0% no existe","mcdoc.checker.entry.empty-mod-seg":"No puedes colocar “mod.mcdoc” bajo una raíz directamente","mcdoc.checker.inject-clause.unmatched-injection":"No se puede injectar %0% con %1%","mcdoc.checker.type-not-assignable":"Tipo %0% no es asignable a tipo %1%","mcdoc.node.compound-definition":"una definición compuesta","mcdoc.node.identifier":"un identificador","mcdoc.parser.float.illegal":"Se econtró un número de coma flotante (float) ilegal","mcdoc.parser.identifier.illegal":"%0% no sigue el formato de %1%","mcdoc.parser.identifier.reserved-word":"%0% es una palabra reservada y no puede ser usado como nombre identificador","mcdoc.parser.index-body.dynamic-index-not-allowed":"El índexado dinámico no está permitido","mcdoc.parser.keyword.separation":"una separación","mcfunction.checker.command.data-modify-unapplicable-operation":"Operación %0% sólo puede ser usada con %1%; el camino del objetivo tiene, en cambio, %2%","mcfunction.completer.block.states.default-value":"For defecto: %0%","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% no es aplicable aquí","mcfunction.parser.entity-selector.arguments.unknown":"Argumento de selector de entidades desconocido %0%","mcfunction.parser.entity-selector.entities-disallowed":"El selector contiene entidades que no son jugadores","mcfunction.parser.entity-selector.multiple-disallowed":"El selector contiene multiples entidades","mcfunction.parser.entity-selector.player-name.too-long":"Los nombres de jugadores no pueden tener más de %0% caracteres","mcfunction.parser.eoc-unexpected":"Más argumentos esperados","mcfunction.parser.no-permission":"Se requiere permiso de nivel %0%, el cual es mayor que el definido en configuración: %1%","mcfunction.parser.objective.too-long":"Los nombres de los objetivos no pueden tener más de %0% caracteres","mcfunction.parser.range.min>max":"El valor mínimo (%0%) es más largo que el valor máximo (%1%)","mcfunction.parser.score_holder.fake-name.too-long":"Nombres falsos no pueden tener más de %0% caracteres","mcfunction.parser.sep":"un espacio (%0%)","mcfunction.parser.unknown-parser":"El analizador %0% aún no es soportado","mcfunction.parser.uuid.invalid":"Formato de Identificador Único inválido","mcfunction.parser.vector.local-disallowed":"No están permitidas las coordenadas locales","mcfunction.parser.vector.mixed":"No se pueden mezclar juntas las coordenadas locales y coordenadas del mundo","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki: argumento `%0%` de Brigadier](https://minecraft.fandom.com/wiki/Argument_types#%0%)","mcfunction.signature-help.command-documentation":"[Minecraft Wiki: comando `%0%`](https://minecraft.fandom.com/wiki/Commands/%0%)","missing-key":"Llave faltante %0%","nbt.checker.block-states.fake-boolean":"Valores de estado de bloque binarios deberían estar marcados con comillas","nbt.checker.block-states.unexpected-value-type":"Los valores de estado de bloque deberían ser, ya sea, una cadena o un número entero (int)","nbt.checker.block-states.unknown-state":"Estado de bloque %0% desconocido para el(los) siguiente(s) bloque(s): %1%","nbt.checker.boolean.out-of-range":"Un valor booleano debería ser, ya sea, %0% o %1%","nbt.checker.collection.length-between":"%0% con una longitud de entre %1% y %2%","nbt.checker.compound.field.union-empty-members":"Propiedad no permitida","nbt.checker.path.index-out-of-bound":"El índice proporcionado (%0%) está fuera de los límites, ya que la colección sólo puede tener, al menos %1% elementos","nbt.checker.path.unexpected-filter":"Los filtros de datos compuestos sólo pueden ser usados en etiquetas compuestas","nbt.checker.path.unexpected-index":"Índices sólo pueden ser usados en arrays o en listas con etiquetas","nbt.checker.path.unexpected-key":"Sólo pueden especificarse llaves de cadena para etiquetas compuestas","nbt.node":"una etiqueta","nbt.node.byte":"una etiqueta de tipo octeto (byte)","nbt.node.byte_array":"una etiqueta de array de tipo octeto (byte)","nbt.node.compound":"una etiqueta compuesta","nbt.node.double":"una etiqueta de tipo coma flotante doble (double)","nbt.node.float":"una etiqueta de coma flotante (float)","nbt.node.int":"una etiqueta de número entero (int)","nbt.node.int_array":"una etiqueta de array de número entero (int)","nbt.node.list":"una etiqueta de lista","nbt.node.long":"una etiqueta de número largo (long)","nbt.node.long_array":"una etiqueta de array de número largo (long)","nbt.node.path.end":"el final del camino","nbt.node.path.filter":"un filtro compuesto","nbt.node.path.index":"un índice","nbt.node.path.key":"una llave","nbt.node.short":"una etiqueta de número corto (short)","nbt.node.string":"una etiqueta de cadena","nbt.parser.number.out-of-range":"Esto luce similar a %0%, pero de hecho es %1% debido al valor numérico estando fuera de [%2%, %3%]","not-matching-any-child":"Tipo de argumento inválido","nothing":"nada","number":"un número","number-range":"un rango numérico","number-range.missing-min-and-max":"Se esperaba, ya sea, un valor mínimo o un valor máximo","number.<=":"un número igual o menor a %0%","number.>=":"un número igual o mayor que %0%","number.between":"un número entre %0% y %1%","object":"un objeto","objective":"un objetivo","objective-not-following-convention":"Objetivo %0% inválido que no sigue la convención %1%","parser.float.illegal":"Número de coma flotante (float) illegal por no seguír %0%","parser.integer.illegal":"Número entero (int) illegal por no seguír %0%","parser.list.value":"un valor","parser.record.key":"una llave","parser.record.unexpected-char":"Caracter %0% inesperado","parser.string.illegal-brigadier":"Se encontraron caracteres que no entran entre los caracteres permitidos [0-9A-Za-z_.+-] en %0%","parser.string.illegal-escape":"Escape de caracter %0% inesperado","parser.string.illegal-quote":"Solo %0% pueden ser usados para marcar cardenas aquí","parser.string.illegal-unicode-escape":"Dígito hexadecimal esperado","punc.period":".","punc.quote":"“%0%”","quote":"comillas (“'” o “\"”)","quote_prefer_double":"Comillas dobles (“\"”) son preferidas aquí","quote_prefer_single":"Comillas singulares (“'”) son preferidas aquí","resource-location":"posición de recurso","score-holder":"una vacante de puntaje","scoreholder-not-following-convention":"Vacante de puntaje %0% inválida por no seguir la convención %1%","server.new-version":"El Servidor del Lenguaje Data-pack ha sido actualizado a una nueva versión: %0%","server.progress.fixing-workspace.begin":"Reparando todos los errors auto-reparables en el espacio de trabajo","server.progress.fixing-workspace.report":"arreglando %0%","server.progress.preparing.title":"Preparando funciones del lenguaje Spyglass","server.remove-cache-file":"El archivo caché de DHP fue movido a una localización provisionada por VSCode. Ahora puedes remover la fea carpeta “.datapack” en la raíz de tu espacio de trabajo.","server.show-release-notes":"Mostrar Notas de Lanzamientos","string":"una cadena","tag":"una etiqueta","tag-not-following-convention":"Etiqueta %0% inválido"}); + + +/***/ }) + +}; diff --git a/dist/576.index.js b/dist/576.index.js new file mode 100644 index 0000000..d5405b3 --- /dev/null +++ b/dist/576.index.js @@ -0,0 +1,17 @@ +export const id = 576; +export const ids = [576]; +export const modules = { + +/***/ 4576: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"ein Array","boolean":"einen Wahrheitswert","bug-of-mc":"Aufgrund eines Fehlers in Minecraft (%0%), %1%. Bitte beheben, Mojang danke","code-action.add-default-namespace":"Standardnamensraum hinzufügen","code-action.add-leading-slash":"Führenden Schrägstrich hinzufügen","code-action.block-state-sort-keys":"Blockzustände sortieren","code-action.command-replaceitem":"Aktualisiere diesen Befehl zu /item ... replace","code-action.create-undeclared-file":"%0% %1% im selben Paket erstellen","code-action.fix-file":"Alle automatisch behebbaren Probleme in dieser Datei beheben","code-action.fix-workspace":"Alle automatisch behebbaren Probleme im Arbeitsbereich beheben","code-action.id-attribute-datafix":"Den Namen dieses Attributs auf Version 1.16 aktualisieren","code-action.id-complete-default-namespace":"Standardnamensraum vervollständigen","code-action.id-create-file":"%0% im selben Datenpaket erstellen","code-action.id-omit-default-namespace":"Standardnamensraum auslassen","code-action.id-zombified-piglin-datafix":"ID zu zombified_piglin ändern","code-action.nbt-compound-sort-keys":"NBT-Compound-Eigenschaften sortieren","code-action.nbt-type-to-byte":"In ein NBT-Byte-Tag umwandeln","code-action.nbt-type-to-double":"In ein NBT-Double-Tag umwandeln","code-action.nbt-type-to-float":"In ein NBT-Float-Tag umwandeln","code-action.nbt-type-to-int":"In ein NBT-Int-Tag umwandeln","code-action.nbt-type-to-long":"In ein NBT-Long-Tag umwandeln","code-action.nbt-type-to-short":"In ein NBT-Short-Tag umwandeln","code-action.nbt-uuid-datafix":"Diese UUID auf Version 1.16 aktualisieren","code-action.remove-leading-slash":"Führenden Schrägstrich entfernen","code-action.remove-trailing-separation":"Nachlaufende Trennung entfernen","code-action.selector-sort-keys":"Selektor-Argumente sortieren","code-action.string-double-quote":"Diese Zeichenkette in doppelte Anführungszeichen setzen","code-action.string-single-quote":"Diese Zeichenkette in einfache Anführungszeichen setzen","code-action.string-unquote":"Anführungszeichen von dieser Zeichenkette entfernen","code-action.vector-align-0.0":"Diesen Vektor am Ursprung des Blocks ausrichten","code-action.vector-align-0.5":"Diesen Vektor am Zentrum des Blocks ausrichten","comment":"ein Kommentar, der mit %0% beginnt","conjunction.and_2":" und ","conjunction.and_3+_1":", ","conjunction.and_3+_2":", und ","conjunction.or_2":" oder ","conjunction.or_3+_1":", ","conjunction.or_3+_2":", oder ","datafix.error.command-replaceitem":"/replaceitem wurde in 20w46a (dem zweiten Snapshot von 1.17) zugunsten von /item entfernt","duplicate-key":"Doppelter Schlüssel %0%","ending-quote":"ein schließendes Anführungszeichen %0%","entity":"eine Entität","error.unparseable-content":"Nicht analysierbarer Inhalt gefunden","expected":"%0% erwartet","expected-got":"%0% erwartet, aber %1% erhalten","float":"eine Gleitkommazahl","float.between":"eine Gleitkommazahl zwischen %0% und %1%","integer":"eine Ganzzahl","integer.between":"eine Ganzzahl zwischen %0% und %1%","invalid-key-combination":"Ungültige Schlüsselkombination %0%","invalid-regex-pattern":"Ungültiges Regex-Muster: %0%","java-edition.binder.wrong-folder":"Dateien im Ordner %0% werden in der geladenen Version %1% nicht erkannt, wollten Sie den Ordner %2% verwenden?","java-edition.binder.wrong-version":"Dateien im Ordner %0% werden in der geladenen Version %1% nicht erkannt","java-edition.translation-value.percent-escape-hint":"%0%. Wenn Sie ein wörtliches Prozentzeichen anzeigen möchten, verwenden Sie stattdessen „%%“","json.checker.array.length-between":"%0% mit einer Länge zwischen %1% und %2%","json.checker.item.duplicate":"Gegenstand aus der Liste duplizieren","json.checker.property.missing":"Fehlende Eigenschaft %0%","json.checker.property.unknown":"Unbekannte Eigenschaft %0%","json.checker.string.hex-color":"eine sechstellige Hexadezimalzahl","json.doc.advancement.display":"Anzeigeeinstellungen für Fortschritte. Falls vorhanden, wird der Fortschritt in den Fortschrittsregisterkarten angezeigt.","key-not-following-convention":"Der Schlüssel %0% entspricht nicht der Namenskonvention %1%","linter.diagnostic-message-wrapper":"%0% (Regel: %1%)","linter.undeclared-symbol.message":"Kann %0% %1% nicht finden","long":"eine lange Ganzzahl","mcfunction.checker.command.data-modify-unapplicable-operation":"Operation %0% kann nur auf %1% angewendet werden; Zielpfad hat stattdessen Type %2%","mcfunction.completer.block.states.default-value":"Standard: %0%","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% kann hier nicht angewendet werden","mcfunction.parser.entity-selector.player-name.too-long":"Spielernamen können nicht länger als %0% Zeichen sein","mcfunction.parser.eoc-unexpected":"Mehr Argumente erwartet","mcfunction.parser.leading-slash":"einen führenden Schrägstrich „/“","mcfunction.parser.leading-slash.unexpected":"Unerwarteter führender Schrägstrich „/“","mcfunction.parser.objective.too-long":"Objektivnamen dürfen nicht länger als %0% Zeichen sein","mcfunction.parser.range.min>max":"Der Mindestwert %0% ist größer als Maximalwert %1%","mcfunction.parser.sep":"ein Leerzeichen (%0%)","mcfunction.parser.uuid.invalid":"Ungültiges UUID Format","mismatching-regex-pattern":"Wert stimmt nicht mit Regex überein: %0%","nbt.checker.collection.length-between":"%0% mit Länge zwischen %1% und %2%","nbt.checker.compound.field.union-empty-members":"Unerlaubte Eigenschaft","nbt.parser.number.out-of-range":"Dies sieht aus wie %0%, ist aber tatsächlich %1%, da der Zahlenwert außerhalb von [%2%, %3%] liegt","not-allowed-here":"Der Wert %0% ist hier nicht erlaubt","not-matching-any-child":"Ungültiger Argumenttyp","nothing":"nichts","number":"eine Zahl","number-range":"einen Wertebereich","number-range.missing-min-and-max":"Minimaler oder maximaler Wert erwartet","number.<=":"eine Zahl kleiner oder gleich %0%","number.>=":"eine Zahl größer oder gleich %0%","number.between":"eine Zahl zwischen %0% und %1%","object":"ein Objekt","objective":"ein Ziel","objective-not-following-convention":"Ungültiges Ziel %0%, das nicht der Konvention %1% entspricht","parser.float.illegal":"Unzulässige Gleitkommazahl, die nicht %0% folgt","parser.integer.illegal":"Unzulässige Ganzzahl, die nicht %0% folgt","parser.line-continuation-end-of-file":"Eine Zeilenfortsetzung darf nicht das Ende der Datei sein","parser.list.trailing-sep":"Nachlaufende Trennung","parser.list.value":"ein Wert","parser.long.illegal":"Unzulässige Long Zahl, die nicht %0% folgt","parser.record.key":"ein Schlüssel","parser.record.trailing-end":"Nachlaufende Trennung","parser.record.unexpected-char":"Unerwartetes Zeichen %0%","parser.record.value":"ein Wert","parser.resource-location.illegal":"Unzulässige(s) Zeichen: %0%","parser.resource-location.namespace-expected":"Namensräume dürfen hier nicht weggelassen werden","parser.resource-location.tag-disallowed":"Tags sind hier nicht erlaubt","parser.resource-location.tag-required":"Nur Tags sind hier erlaubt","parser.string.illegal-brigadier":"In %0% sind andere Zeichen als [0-9A-Za-z_.+-] aufgetreten","parser.string.illegal-escape":"Unerwartetes Escape-Zeichen %0%","parser.string.illegal-quote":"Nur %0% kann hier als Anführungszeichen für Zeichenketten verwendet werden","parser.string.illegal-unicode-escape":"Hexadezimalziffer erwartet","progress.initializing.title":"Spyglass wird initialisiert…","progress.reset-project-cache.title":"Projekt-Cache wird zurückgesetzt…","punc.period":".","punc.quote":"„%0%“","quote":"ein Anführungszeichen („'“ oder „'“)","quote_prefer_double":"Doppelte Anführungszeichen („\"“) sind hier zu bevorzugen","quote_prefer_single":"Einfache Anführungszeichen („'“) sind hier zu bevorzugen","resource-location":"einen Ressourcenstandort","score-holder":"einen Punktehalter","scoreholder-not-following-convention":"Ungültiger Punktehalter %0%, der nicht der Konvention %1% entspricht","selector":"einen Selektor","server.new-version":"Der Datapack Language Server wurde aktualisiert: %0%","server.progress.fixing-workspace.begin":"Behebe alle automatisch behebbaren Probleme im Arbeitsbereich","server.progress.fixing-workspace.report":"behebe %0%","server.progress.preparing.title":"Vorbereiten der Spyglass-Sprachfunktionen","server.remove-cache-file":"Der Cache von DHP wurde in ein Verzeichnis von VSCode verschoben. Der „.datapack“-Ordner im Arbeitsbereich kann nun gelöscht werden.","server.show-release-notes":"Versionsinformationen anzeigen","string":"eine Zeichenkette","tag":"einen Tag","tag-not-following-convention":"Ungültiger Tag %0%, der nicht der Konvention %1% entspricht","team":"ein Team","team-not-following-convention":"Ungültiges Team %0%, das nicht der Konvention %1% entspricht","text-component":"eine Textkomponente","time-unit":"eine Zeiteinheit","too-many-block-affected":"Zu viele Blöcke im angegebenen Bereich (maximal %0%, angegeben %1%)","too-many-chunk-affected":"Zu viele Chunks im angegebenen Bereich (maximal %0%, angegeben %1%)","unexpected-character":"Zeichen gefunden, die nicht [a-z0-9/._-] entsprechen","unexpected-datapack-tag":"Aliasse sind hier nicht erlaubt","unexpected-default-namespace":"Der Standardnamensraum sollte hier ausgelassen werden","unexpected-local-coordinate":"Lokale Koordinate %0% ist nicht erlaubt","unexpected-nbt":"Diese Eigenschaft existiert hier nicht","unexpected-nbt-array-type":"Ungültiger Array-Typ %0%. Sollte entweder „B“, „I“ oder „L“ sein","unexpected-nbt-path-filter":"Pfadfilter funktionieren nur mit Compound-Eigenschaften","unexpected-nbt-path-index":"Indizes funktionieren nur mit Listen oder Array-Eigenschaften","unexpected-nbt-path-key":"Schlüssel funktionieren nur mit Compound-Eigenschaften","unexpected-nbt-path-sub":"Die aktuelle Eigenschaft hat keine weiteren Elemente","unexpected-omitted-default-namespace":"Der Standardnamensraum kann hier nicht ausgelassen werden","unexpected-relative-coordinate":"Die relative Koordinate %0% ist nicht erlaubt","unexpected-scoreboard-sub-slot":"Nur „sidebar“ hat Unterkategorien","unknown-command":"Unbekannter Befehl %0%","unknown-escape":"Unerwartetes Escape-Zeichen %0%","unknown-key":"Unbekannter Schlüssel %0%","unquoted-string":"eine Zeichenkette ohne Anführungszeichen","unsorted-keys":"Unsortierte Schlüssel","uuid":"eine UUID","vector":"einen Vektor"}); + + +/***/ }) + +}; diff --git a/dist/611.index.js b/dist/611.index.js new file mode 100644 index 0000000..3ca6d49 --- /dev/null +++ b/dist/611.index.js @@ -0,0 +1,17 @@ +export const id = 611; +export const ids = [611]; +export const modules = { + +/***/ 9611: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"一個陣列","boolean":"一個布林值","bug-of-mc":"由於一個Minecraft的錯誤(%0%),%1%。Mojang,拜託修好你的遊戲","code-action.add-default-namespace":"增加預設命名空間","code-action.add-leading-slash":"增加開頭的斜線","code-action.block-state-sort-keys":"將方塊狀態按鍵排序","code-action.command-replaceitem":"將該指令升級到 /item ... replace","code-action.create-undeclared-file":"建立%0% %1%","code-action.fix-file":"修復當前檔案中所有可自動修復的問題","code-action.fix-workspace":"修復當前工作區中所有可自動修復的問題","code-action.id-attribute-datafix":"將該屬性名更新至 1.16","code-action.id-complete-default-namespace":"補完預設命名空間","code-action.id-create-file":"在同一個資料包中建立%0%","code-action.id-omit-default-namespace":"省略預設命名空間","code-action.id-zombified-piglin-datafix":"將該 ID 升級為殭屍化豬布林","code-action.nbt-compound-sort-keys":"將 NBT 複合標籤按鍵排序","code-action.nbt-type-to-byte":"轉換為 NBT 位元組(byte)標籤","code-action.nbt-type-to-double":"轉換為 NBT 倍精度浮點數(double)標籤","code-action.nbt-type-to-float":"轉換為 NBT 單精度浮點數(float)標籤","code-action.nbt-type-to-int":"轉換為 NBT 整數(int)標籤","code-action.nbt-type-to-long":"轉換為 NBT 長整數(long)標籤","code-action.nbt-type-to-short":"轉換為 NBT 短整數(short)標籤","code-action.nbt-uuid-datafix":"將該 UUID 更新至 1.16","code-action.remove-leading-slash":"移除開頭的斜線","code-action.remove-trailing-separation":"移除結尾的分隔符號","code-action.selector-sort-keys":"將選擇器引數按鍵排序","code-action.string-double-quote":"使用英文雙引號包裹該字串","code-action.string-single-quote":"使用英文單引號包裹該字串","code-action.string-unquote":"移除該字串的引號","code-action.vector-align-0.0":"將該向量對齊到方塊原點","code-action.vector-align-0.5":"將該向量對齊到方塊中心","comment":"以 %0% 開始的註解","conjunction.and_2":"和","conjunction.and_3+_1":"、","conjunction.and_3+_2":"和","conjunction.or_2":"或","conjunction.or_3+_1":"、 ","conjunction.or_3+_2":"或","datafix.error.command-replaceitem":"/replaceitem 在 20w46a(1.17 的第二個快照)中被 /item 取代","duplicate-key":"鍵%0%重複","ending-quote":"一個結尾引號%0%","entity":"一個實體","error.unparseable-content":"遇到了無法解析的內容","expected":"期望%0%","expected-got":"期望%0%,但得到了%1%","float":"一個單精度浮點數","float.between":"一個處於 %0% 與 %1% 之間的浮點型數字","integer":"一個整數","integer.between":"一個處於 %0% 與 %1% 之間的整數","invalid-key-combination":"無效的組合 %0%","invalid-regex-pattern":"無效的regex:%0%","java-edition.binder.wrong-folder":"在%0%資料夾中的檔案不屬於現在載入的遊戲版本(%1%),你需要的是%2%資料夾嗎?","java-edition.binder.wrong-version":"在%0%資料夾中的檔案不屬於現在載入的遊戲版本(%1%)","java-edition.pack-format.not-loaded":"資料包版本%0%不屬於現在載入的遊戲版本(%1%)。你可能需要重新載入Spyglass。","java-edition.pack-format.unsupported":"資料包版本%0%不屬於正式版本。快照版本不受支援。","java-edition.translation-value.percent-escape-hint":"%0%。使用「%%」顯示百分比符號","json.checker.array.length-between":"長度在%1%和%2%之間的%0%","json.checker.item.duplicate":"重複的清單內容","json.checker.object.field.union-empty-members":"不允許的屬性","json.checker.property.deprecated":"屬性 %0% 已被棄用","json.checker.property.missing":"缺失屬性 %0%","json.checker.property.unknown":"未知屬性 %0%","json.checker.string.hex-color":"一個 6 位的十六進位數字","json.checker.tag-entry.duplicate":"重複的值","json.checker.value":"一個值","json.doc.advancement.display":"進度的顯示設定。若存在,則此進度會在進度畫面中可見。","json.node.array":"一個陣列","json.node.boolean":"一個布林值","json.node.null":"null","json.node.number":"一個數字","json.node.object":"一個物件","json.node.string":"一個字串","key-not-following-convention":"無效的鍵%0%,因為沒有遵循%1%命名規範","linter-config-validator.name-convention.type":"期望一個描述名字的正規表示式字串","linter-config-validator.wrapper":"%0%。 閱讀[文件](%1)以獲取更多資訊","linter.diagnostic-message-wrapper":"%0%(規則:%1%)","linter.name-convention.illegal":"名稱 %0% 與組態的正規表示式 %1% 不相符","linter.undeclared-symbol.message":"找不到 %0% %1%","long":"一個長整數","long.between":"一個在%0%和%1%之間的長整數","mcdoc.binder.dispatcher-statement.duplicated-key":"重複的dispatcher:%0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0%已經在這裡定義過了","mcdoc.binder.duplicated-declaration":"重複的宣告 %0%","mcdoc.binder.duplicated-declaration.related":"%0% 已在這裡宣告過了","mcdoc.binder.out-of-root":"檔案 %0% 不在任何 mcdoc 專案中的根目錄;語意檢查將被跳過","mcdoc.binder.path.super-from-root":"不可訪問根目錄的父級目錄","mcdoc.binder.path.unknown-identifier":"標識符 %0% 不存在於模組 %1%","mcdoc.binder.path.unknown-module":"模組 %0% 不存在","mcdoc.checker.entry.empty-mod-seg":"您不能將「mod.mcdoc」直接放在根目錄下","mcdoc.checker.inject-clause.unmatched-injection":"不能用 %1% 注碼於 %0%","mcdoc.checker.type-not-assignable":"類型 %0% 不能分配給類型 %1%","mcdoc.node.compound-definition":"一個複合定義","mcdoc.node.enum-definition":"一個列舉定義","mcdoc.node.identifier":"一個標識符","mcdoc.parser.compound-definition.field-type":"一個欄位類型","mcdoc.parser.float.illegal":"遇到了無效的單精度浮點數","mcdoc.parser.identifier.illegal":"%0% 不遵循格式 %1%","mcdoc.parser.identifier.reserved-word":"%0% 是個反轉文字且不可被用於標識符名稱","mcdoc.parser.index-body.dynamic-index-not-allowed":"動態索引是不允許的","mcdoc.parser.inject-clause.definition-expected":"期望一個列舉注碼或複合注碼","mcdoc.parser.keyword.separation":"一個分隔符","mcdoc.parser.resource-location.colon-expected":"資源位置預期為冒號 (%0%)","mcdoc.parser.syntax.doc-comment-unexpected":"此處不允許文檔註解;您可能想用兩個斜線取代三個斜線","mcdoc.runtime.checker.key-value-pair":"一個鍵值對","mcdoc.runtime.checker.range.collection":"集合長度為 %0%","mcdoc.runtime.checker.range.concat":"%0% 和 %1%","mcdoc.runtime.checker.range.left-exclusive":"大於 %0%","mcdoc.runtime.checker.range.left-inclusive":"至少為 %0%","mcdoc.runtime.checker.range.number":"應為數值 %0%","mcdoc.runtime.checker.range.right-exclusive":"低於 %0%","mcdoc.runtime.checker.range.right-inclusive":"最多 %0%","mcdoc.runtime.checker.range.string":"字串長度應為 %0%","mcdoc.runtime.checker.some-missing-keys":"缺少 %0% 中的至少一個鍵","mcdoc.runtime.checker.trailing":"發現尾隨資料","mcdoc.runtime.checker.value":"一個值","mcdoc.type.boolean":"一個布林值","mcdoc.type.byte":"一個字節值","mcdoc.type.byte_array":"一個字節陣列","mcdoc.type.double":"一個倍精度浮點數值","mcdoc.type.float":"一個單精度浮點數值","mcdoc.type.int":"一個整數值","mcdoc.type.int_array":"一個整數陣列","mcdoc.type.list":"一個列表","mcdoc.type.long":"一個長整數值","mcdoc.type.long_array":"一個長整數陣列","mcdoc.type.short":"一個短整數值","mcdoc.type.string":"一個字串值","mcfunction.checker.command.data-modify-unapplicable-operation":"%0% 操作只能被用於 %1%;目標路徑類型則為 %2%","mcfunction.completer.block.states.default-value":"預設: %0%","mcfunction.parser.command-too-long":"指令長度 %0% 筆最大長度 %1% 長","mcfunction.parser.duplicate-components":"重複的組件","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% 不適用於此處","mcfunction.parser.entity-selector.arguments.unknown":"未知的實體選擇器引數 %0%","mcfunction.parser.entity-selector.entities-disallowed":"此選擇器包含非玩家實體","mcfunction.parser.entity-selector.invalid":"無效的目標選擇器:\"%0%\"","mcfunction.parser.entity-selector.multiple-disallowed":"此選擇器包含多個實體","mcfunction.parser.entity-selector.player-name.too-long":"玩家名稱長度不能多於 %0% 個字元","mcfunction.parser.eoc-unexpected":"期望更多引數","mcfunction.parser.leading-slash":"一個前置斜線 「/」","mcfunction.parser.leading-slash.unexpected":"不能以斜槓「/」開始指令","mcfunction.parser.macro.at-least-one":"至少一個巨集參數","mcfunction.parser.macro.disallowed":"巨集行只支援於 1.20.2 之後","mcfunction.parser.macro.illegal-key":"不正確的鍵字符:\"%0%\"","mcfunction.parser.macro.key":"一個巨集鍵","mcfunction.parser.no-permission":"需要權限等級 %0%,高於設定中定義的 %1%","mcfunction.parser.objective.too-long":"計分板目標名稱長度不能多於 %0% 個字元","mcfunction.parser.range.min>max":"最小值 %0% 大於最大值 %1%","mcfunction.parser.range.span-too-large":"範圍大小 %0% 大於最大值 %1%","mcfunction.parser.range.span-too-small":"範圍大小 %0% 小於最小值 %1%","mcfunction.parser.score_holder.fake-name.too-long":"實體假名長度不能多於 %0% 個字元","mcfunction.parser.sep":"一個空白字元(%0%)","mcfunction.parser.trailing":"遇到尾隨資料:%0%","mcfunction.parser.unknown-parser":"尚未支援解析器 %0%","mcfunction.parser.uuid.invalid":"無效的 UUID 格式","mcfunction.parser.vector.local-disallowed":"局部座標不允許在此處使用","mcfunction.parser.vector.mixed":"不能混用局部座標與世界座標","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki: `%0%` 參數類型](https://zh.minecraft.wiki/w/參數類型#%0%)","mcfunction.signature-help.command-documentation":"[Minecraft 維基: `%0%` 指令](https://minecraft.fandom.com/zh/wiki/命令/%0%)","mismatching-regex-pattern":"值不符合regex:%0%","missing-key":"缺失鍵 %0%","nbt.checker.block-states.fake-boolean":"應用引號包裹布林型方塊狀態值","nbt.checker.block-states.unexpected-value-type":"方塊狀態值應為字串或整數","nbt.checker.block-states.unknown-state":"以下方塊具有未知的方塊狀態 %0%:%1%","nbt.checker.boolean.out-of-range":"布林值應為 %0% 或 %1%","nbt.checker.collection.length-between":"%0% 的長度在 %1% 和 %2% 之間","nbt.checker.compound.field.union-empty-members":"不允許的屬性","nbt.checker.path.index-out-of-bound":"提供的索引 %0% 越界,因為集合最多只能擁有 %1% 個元素","nbt.checker.path.unexpected-filter":"複合標籤過濾器只能用於複合標籤","nbt.checker.path.unexpected-index":"索引只能用於陣列或串列標籤","nbt.checker.path.unexpected-key":"字串鍵只能為複合標籤指定","nbt.node":"一個標籤","nbt.node.byte":"一個字元組標籤","nbt.node.byte_array":"一個字元組陣列標籤","nbt.node.compound":"一個複合標籤","nbt.node.double":"一個倍精度浮點型標籤","nbt.node.float":"一個單精度浮點型標籤","nbt.node.int":"一個整數標籤","nbt.node.int_array":"一個整數陣列標籤","nbt.node.list":"一個串列標籤","nbt.node.long":"一個長整數標籤","nbt.node.long_array":"一個長整數陣列標籤","nbt.node.path.end":"路徑結尾","nbt.node.path.filter":"一個複合標籤過濾器","nbt.node.path.index":"一個索引","nbt.node.path.key":"一個鍵","nbt.node.short":"一個短整數標籤","nbt.node.string":"一個字串標籤","nbt.parser.number.out-of-range":"這看起來像 %0%,但實際上是 %1%,因為數值超出了 [%2%, %3%]","not-matching-any-child":"無效引數","nothing":"無","number":"一個數字","number-range":"一個數字範圍","number-range.missing-min-and-max":"期望一個最小值或一個最大值","number.<=":"一個小於等於 %0% 的數字","number.>=":"一個大於等於 %0% 的數字","number.between":"一個位於 %0% 和 %1% 之間的數字","object":"一個物件","objective":"一個計分板目標","objective-not-following-convention":"該計分板目標 %0% 沒有跟隨命名規則 %1%","parser.float.illegal":"無效的單精度浮點數不遵循 %0%","parser.integer.illegal":"無效的整數不遵循 %0%","parser.list.trailing-sep":"尾隨分隔符","parser.list.value":"一個值","parser.record.key":"一個鍵","parser.record.trailing-end":"尾隨分隔符","parser.record.unexpected-char":"預期外的字元 %0%","parser.record.value":"一個值","parser.resource-location.illegal":"無效字元:%0%","parser.resource-location.namespace-expected":"不可在此省略命名空間","parser.resource-location.tag-disallowed":"此處不允許使用標籤","parser.string.illegal-brigadier":"在 %0% 中遇到了非 [0-9A-Za-z_.+-] 字元","parser.string.illegal-escape":"預期外的跳脫字元 %0%","parser.string.illegal-quote":"此處只允許使用 %0% 包裹字串","parser.string.illegal-unicode-escape":"期望十六進位數字","punc.period":"。","punc.quote":"「%0%」","quote":"一個英文引號(「'」或「\"」)","quote_prefer_double":"此處請優先使用英文雙引號(「\"」)","quote_prefer_single":"此處請優先使用英文單引號(「'」)","resource-location":"一個資源位置","score-holder":"一個分數持有者","scoreholder-not-following-convention":"無效的分數持有者 %0% 不遵循 %1% 命名規則","server.new-version":"已更新資料包語言伺服器到新版本:%0%","server.progress.fixing-workspace.begin":"修復當前工作區中所有可自動修復的問題","server.progress.fixing-workspace.report":"正在修復%0%","server.remove-cache-file":"DHP 的快取檔案被移動到了一個由 VSCode 提供的快取目錄。您現在可以放心地刪除工作區根目錄下的「.datapack」檔案夾。","server.show-release-notes":"顯示更新日誌","string":"一個字串","tag":"一個標籤","tag-not-following-convention":"該標籤 %0% 沒有跟隨命名規則 %1%","team":"一個隊伍","team-not-following-convention":"該隊伍 %0% 沒有跟隨命名規則 %1%","time-unit":"一個時間單位","too-many-block-affected":"指定區域內的方塊太多(最大值為 %0%,指定為 %1%)","too-many-chunk-affected":"指定區域內的區塊太多(最大值為 %0%,指定值為 %1%)","unexpected-character":"遇到了非 [a-z0-9/._-] 字元","unexpected-datapack-tag":"此處不允許使用標籤","unexpected-default-namespace":"應當省略此處的預設命名空間","unexpected-local-coordinate":"不能使用局部座標%0%","unexpected-nbt":"此處不應使用 NBT 標籤","unexpected-nbt-array-type":"無效的陣列類型%0%。應為「B」、「I」、「L」中的一個","unexpected-nbt-path-filter":"複合標籤篩選器只能對複合標籤使用","unexpected-nbt-path-index":"索引只能對串列或陣列標籤使用","unexpected-nbt-path-key":"鍵只能對複合標籤使用","unexpected-nbt-path-sub":"當前的標籤並沒有更多子項目","unexpected-omitted-default-namespace":"此處不能省略預設命名空間","unexpected-relative-coordinate":"不能使用相對座標%0%","unexpected-scoreboard-sub-slot":"只有「sidebar」有子欄目","unknown-command":"未知的指令%0%","unknown-escape":"預期外的跳脫字元 %0%","unknown-key":"未知的鍵%0%","unquoted-string":"一個未被引號包裹的字串","unsorted-keys":"鍵未排序","uuid":"一個 UUID","vector":"一個向量"}); + + +/***/ }) + +}; diff --git a/dist/694.index.js b/dist/694.index.js new file mode 100644 index 0000000..e5a3719 --- /dev/null +++ b/dist/694.index.js @@ -0,0 +1,17 @@ +export const id = 694; +export const ids = [694]; +export const modules = { + +/***/ 3694: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"配列型","boolean":"boolean型","bug-of-mc":"Minecraft(%0%)のバグのせいで、%1%。どうかMojangさん、ゲームを修正してください","code-action.add-default-namespace":"デフォルトの名前空間を追加","code-action.add-leading-slash":"先頭にスラッシュを追加","code-action.block-state-sort-keys":"block stateをソートする","code-action.command-replaceitem":"このコマンドを/item ... replaceに更新します","code-action.create-undeclared-file":"同じパック内に %0% の %1% を作成する","code-action.fix-file":"このファイルの修正可能な問題を一括修正する","code-action.fix-workspace":"このワークスペース内のすべての修正可能な問題を一括修正する","code-action.id-attribute-datafix":"このattributeのnameを1.16に更新する","code-action.id-complete-default-namespace":"デフォルトの名前空間を補完する","code-action.id-create-file":"同じデータパック内に%0%を作成","code-action.id-omit-default-namespace":"デフォルトの名前空間を省略する","code-action.id-zombified-piglin-datafix":"このIDをzombified_piglinに変更します","code-action.nbt-compound-sort-keys":"NBT Compoundタグをソートする","code-action.nbt-type-to-byte":"byte型のNBTタグに変換する","code-action.nbt-type-to-double":"double型のNBTタグに変換する","code-action.nbt-type-to-float":"float型のNBTタグに変換する","code-action.nbt-type-to-int":"int型のNBTタグに変換する","code-action.nbt-type-to-long":"long型のNBTタグに変換する","code-action.nbt-type-to-short":"short型のNBTタグに変換する","code-action.nbt-uuid-datafix":"このUUIDを1.16に更新する","code-action.remove-leading-slash":"先頭のスラッシュを削除","code-action.remove-trailing-separation":"末尾の区切りを削除する","code-action.selector-sort-keys":"セレクターの引数をソートする","code-action.string-double-quote":"この文字列を二重引用符で囲む","code-action.string-single-quote":"この文字列を一重引用符で囲む","code-action.string-unquote":"この文字列の引用符を外す","code-action.vector-align-0.0":"座標の値をブロックの原点に揃える","code-action.vector-align-0.5":"座標の値をブロックの中心に揃える","comment":"コメントは%0%で始まります","conjunction.and_2":" と ","conjunction.and_3+_1":"と ","conjunction.and_3+_2":"と ","conjunction.or_2":" または ","conjunction.or_3+_1":"か ","conjunction.or_3+_2":"もしくは ","datafix.error.command-replaceitem":"/replaceitemは20w46a (1.17の2回目のスナップショット)で削除され、/itemに置き換わりました","duplicate-key":"キー %0% は重複してます","ending-quote":"文字列を閉じる引用符 %0%","entity":"エンティティ","error.unparseable-content":"解釈不能な内容が見つかりました","expected":"%0%が必要です","expected-got":"%0%が必要ですが%1%が確認されました","float":"float型","float.between":"float型は%0% ~ %1%の範囲です","integer":"int型","integer.between":"int型は%0% ~ %1%の範囲の値です","invalid-key-combination":"%0% というキーの組み合わせは無効です","invalid-regex-pattern":"無効な正規表現です: %0%","java-edition.binder.wrong-folder":"%0% フォルダ内のファイルは、読み込まれたバージョン %1% では認識されません。%2% フォルダを使用するつもりでしたか?","java-edition.binder.wrong-version":"%0% フォルダ内のファイルは、読み込まれたバージョン %1% では認識されません","java-edition.translation-value.percent-escape-hint":"%0%。パーセント記号を表示したい場合は、\"%%\"を使用する","json.checker.array.length-between":"%0%の要素数は%1%から%2%の間までです","json.checker.item.duplicate":"重複したリスト項目","json.checker.object.field.union-empty-members":"許可されていないプロパティです","json.checker.property.deprecated":"プロパティ %0% は非推奨です","json.checker.property.missing":"プロパティ %0% が見つかりません","json.checker.property.unknown":"不明なプロパティ %0%","json.checker.string.hex-color":"6桁の16進数","json.checker.tag-entry.duplicate":"重複したタグ項目","json.checker.value":"値","json.doc.advancement.display":"進捗の表示設定。設定した場合、進捗タブに進捗が表示されるようになる。","json.node.array":"配列型","json.node.boolean":"boolean型","json.node.null":"null型","json.node.number":"number型","json.node.object":"object型","json.node.string":"string型","key-not-following-convention":"キー%0%は命名規則に従い%1%である必要があります","linter-config-validator.name-convention.type":"名前を表し、正規表現を含む文字列が必要です","linter-config-validator.wrapper":"%0%。詳細はドキュメント(%1)を参照してください","linter.diagnostic-message-wrapper":"%0%(ルール: %1%)","linter.name-convention.illegal":"名前 %0% は %1% と一致しません","linter.undeclared-symbol.message":"%0% %1% が見つかりません","long":"long型","long.between":"long型は%0% ~ %1%の範囲です","mcdoc.binder.dispatcher-statement.duplicated-key":"%0% のディスパッチャーケースが重複しています","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% は、すでにディスパッチされています","mcdoc.binder.duplicated-declaration":"%0% の宣言が重複しています","mcdoc.binder.duplicated-declaration.related":"%0% はすでに宣言されています","mcdoc.binder.out-of-root":"ファイル%0%はどのmcdocプロジェクトのルートディレクトリにもありません。セマンティックチェックはスキップされます","mcdoc.binder.path.super-from-root":"プロジェクトのルートの super にアクセスできません","mcdoc.binder.path.unknown-identifier":"識別子 %0% はモジュール %1% に存在しません","mcdoc.binder.path.unknown-module":"モジュール %0% は存在しません","mcdoc.checker.entry.empty-mod-seg":"\"mod.mcdoc\" ファイルをルート直下に置くことはできません","mcdoc.checker.inject-clause.unmatched-injection":"%0% に %1% を入れることはできません","mcdoc.checker.type-not-assignable":"型 %0% は型 %1% に割り当てできません","mcdoc.node.compound-definition":"複合的な定義","mcdoc.node.enum-definition":"列挙型の定義","mcdoc.node.identifier":"識別子","mcdoc.parser.compound-definition.field-type":"フィールドタイプ","mcdoc.parser.float.illegal":"不正な浮動小数点数が検出されました","mcdoc.parser.identifier.illegal":"%0% は %1% の形式に従っていません","mcdoc.parser.identifier.reserved-word":"%0% は予約語であり、識別子名として使用できません","mcdoc.parser.index-body.dynamic-index-not-allowed":"動的インデックスの指定は許可されていません","mcdoc.parser.inject-clause.definition-expected":"列挙型か複合型が必要です","mcdoc.parser.keyword.separation":"区切り","mcdoc.parser.resource-location.colon-expected":"リソースの場所にコロン(%0%)が必要です","mcdoc.parser.syntax.doc-comment-unexpected":"ここではドキュメントコメントは許可されていません。三重スラッシュ(///)を二重スラッシュ(//)に置き換えるとよいでしょう","mcdoc.runtime.checker.key-value-pair":"キーと値のペア","mcdoc.runtime.checker.range.collection":"コレクションの長さが %0% であること","mcdoc.runtime.checker.range.concat":"%0% と %1%","mcdoc.runtime.checker.range.left-exclusive":"%0% より上","mcdoc.runtime.checker.range.left-inclusive":"少なくとも %0%","mcdoc.runtime.checker.range.number":"数値が %0% であること","mcdoc.runtime.checker.range.right-exclusive":"%0% 未満","mcdoc.runtime.checker.range.right-inclusive":"最大 %0%","mcdoc.runtime.checker.range.string":"文字列の長さが %0% であること","mcdoc.runtime.checker.some-missing-keys":"キー %0% のうち少なくとも1つが不足しています","mcdoc.runtime.checker.trailing":"末尾に余分なデータが見つかりました","mcdoc.runtime.checker.value":"値","mcdoc.type.boolean":"boolean型","mcdoc.type.byte":"byte型","mcdoc.type.byte_array":"byte配列型","mcdoc.type.double":"double型","mcdoc.type.float":"float型","mcdoc.type.int":"int型","mcdoc.type.int_array":"int配列型","mcdoc.type.list":"list型","mcdoc.type.long":"long型","mcdoc.type.long_array":"long配列型","mcdoc.type.short":"short型","mcdoc.type.string":"string型","mcdoc.type.struct":"構造型","mcfunction.parser.entity-selector.arguments.unknown":"%0% は不明なセレクター引数です","mcfunction.parser.entity-selector.entities-disallowed":"このセレクターはプレイヤーでないエンティティを含みます","mcfunction.parser.leading-slash.unexpected":"“/”は不明な先頭の文字です","mismatching-regex-pattern":"値が正規表現と一致しません: %0%","not-matching-any-child":"無効な引数の型です","nothing":"未記入の状況","number":"数値","number-range":"数値の範囲","number-range.missing-min-and-max":"少なくとも最小値または最大値のどちらかを記入する必要があります","number.<=":"%0%以下の数値","number.>=":"%0%以上の数値","number.between":"%0% ~ %1%の範囲の数値","objective":"オブジェクト名","objective-not-following-convention":"オブジェクト%0%は命名規則に従い%1%である必要があります","punc.period":"。","punc.quote":"「%0%」","quote":"引用符 (‘'’ か ‘\"’)","quote_prefer_double":"ここは二重引用符(“\"”)が最適です","quote_prefer_single":"ここは一重引用符(“'”)が最適です","score-holder":"スコア保持者","scoreholder-not-following-convention":"スコア保持者%0%は命名規則に従い%1%である必要があります","server.new-version":"Data-pack Language Serverが%0%に更新されました","server.progress.fixing-workspace.begin":"このワークスペース内のすべての修正可能な問題を一括修正する","server.progress.fixing-workspace.report":"次のファイルを修正中: %0%","server.remove-cache-file":"DHPのキャッシュファイルはVSCodeの提供するストレージに移動されました。ワークスペースルートの“.datapack”フォルダは安全に消去することが可能です。","server.show-release-notes":"リリースノートを見る","string":"文字列","tag":"tag","tag-not-following-convention":"tag%0%は命名規則に従い%1%である必要があります","team":"チーム","team-not-following-convention":"チーム%0%は命名規則に従い%1%である必要があります","time-unit":"時間の単位","too-many-block-affected":"指定した領域にあるブロックが多すぎます(最大 %0%、指定 %1%)","too-many-chunk-affected":"指定した領域にあるチャンクが多すぎます(最大 %0%、指定 %1%)","unexpected-character":"[a-z0-9/._-] 以外の文字が存在します","unexpected-datapack-tag":"ここにタグは使用できません","unexpected-default-namespace":"デフォルトの名前空間は省略してください","unexpected-local-coordinate":"ローカル座標 %0% は許可されていません","unexpected-nbt":"このタグは存在しません","unexpected-nbt-array-type":"%0%は無効な配列の型です。 “B”, “I”, “L”のどれかである必要があります","unexpected-nbt-path-filter":"CompoundフィルターはCompoundタグにのみ適用されます","unexpected-nbt-path-index":"インデックスはlistタグ/配列にのみ適用されます","unexpected-nbt-path-key":"キーはCompoundタグにのみ適用されます","unexpected-nbt-path-sub":"このタグにサブアイテムは存在しません","unexpected-omitted-default-namespace":"デフォルト名前空間はここでは省略できません","unexpected-relative-coordinate":"相対座標 %0% はここでは使用できません","unexpected-scoreboard-sub-slot":"サブスロットは“sidebar”でのみ使用できます","unknown-command":"%0%は不明なコマンドです","unknown-key":"%0%は不明なキーです","unquoted-string":"引用符で囲まれていない文字列","unsorted-keys":"ソートされていないキー","uuid":"UUID","vector":"座標の値"}); + + +/***/ }) + +}; diff --git a/dist/699.index.js b/dist/699.index.js new file mode 100644 index 0000000..b8fb334 --- /dev/null +++ b/dist/699.index.js @@ -0,0 +1,17 @@ +export const id = 699; +export const ids = [699]; +export const modules = { + +/***/ 699: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"一个数组","boolean":"一个布尔值","bug-of-mc":"由于一个Minecraft的漏洞(%0%),%1%。请报告Mojang以修复","code-action.add-default-namespace":"添加默认命名空间","code-action.add-leading-slash":"添加前导斜杠","code-action.block-state-sort-keys":"将方块状态按键排序","code-action.command-replaceitem":"将该命令升级为 /item ... replace","code-action.create-undeclared-file":"在同一个包中创建 %0% %1%","code-action.fix-file":"修复当前文件中所有可自动修复的问题","code-action.fix-workspace":"修复当前工作空间中所有可自动修复的问题","code-action.id-attribute-datafix":"将该属性名更新到 1.16","code-action.id-complete-default-namespace":"补全默认命名空间","code-action.id-create-file":"在同一个数据包中创建%0%","code-action.id-omit-default-namespace":"省略默认命名空间","code-action.id-zombified-piglin-datafix":"改为僵尸猪灵的ID","code-action.nbt-compound-sort-keys":"将 NBT 复合标签按键排序","code-action.nbt-type-to-byte":"转换为 NBT 字节型(byte)标签","code-action.nbt-type-to-double":"转换为 NBT 双精度浮点数(double)标签","code-action.nbt-type-to-float":"转换为 NBT 单精度浮点数(float)标签","code-action.nbt-type-to-int":"转换为 NBT 整型(int)标签","code-action.nbt-type-to-long":"转换为 NBT 长整型(long)标签","code-action.nbt-type-to-short":"转换为 NBT 短整型(short)标签","code-action.nbt-uuid-datafix":"将该 UUID 更新到 1.16","code-action.remove-leading-slash":"移除前导斜杠","code-action.remove-trailing-separation":"移除句尾分隔符","code-action.selector-sort-keys":"将选择器参数按键排序","code-action.string-double-quote":"使用半角双引号包裹该字符串","code-action.string-single-quote":"使用半角单引号包裹该字符串","code-action.string-unquote":"移除该字符串的引号","code-action.vector-align-0.0":"将该向量对齐至方块原点","code-action.vector-align-0.5":"将该向量对齐至方块中心","comment":"以 %0% 开始的注释","conjunction.and_2":"和","conjunction.and_3+_1":"、","conjunction.and_3+_2":"和","conjunction.or_2":"或","conjunction.or_3+_1":"、","conjunction.or_3+_2":"或","datafix.error.command-replaceitem":"/replaceitem 在 20w46a(1.17 的第二个快照)中被 /item 取代","duplicate-key":"键%0%重复","ending-quote":"一个结尾引号%0%","entity":"一个实体","error.unparseable-content":"遇到了无法解析的文件内容","expected":"期望%0%","expected-got":"期望%0%,但得到了%1%","float":"一个浮点数","float.between":"一个处于 %0% 与 %1% 之间的浮点型数字","integer":"一个整型数字","integer.between":"一个处于 %0% 与 %1% 之间的整型数字","invalid-key-combination":"键组合 %0% 无效","invalid-regex-pattern":"无效的正则模式串:%0%","java-edition.binder.wrong-folder":"已加载的版本 %1% 无法识别 %0% 文件夹中的文件,你想使用的是 %2% 文件夹吗?","java-edition.binder.wrong-version":"在已加载的版本 %1% 中无法识别 %0% 文件夹中的文件","java-edition.translation-value.percent-escape-hint":"%0%。如果你想要显示百分号符号,请改用“%%”","json.checker.array.length-between":"长度在 %1% 与 %2% 之间的%0%","json.checker.item.duplicate":"重复的列表条目","json.checker.object.field.union-empty-members":"禁用属性","json.checker.property.deprecated":"属性 %0% 已被弃用","json.checker.property.missing":"缺失属性 %0%","json.checker.property.unknown":"未知属性 %0%","json.checker.string.hex-color":"一个6位的十六进制数字","json.checker.tag-entry.duplicate":"重复的标签条目","json.checker.value":"一个值","json.doc.advancement.display":"进度的显示设置。如果存在,则该进度将在进度选项卡中可见。","json.node.array":"一个数组","json.node.boolean":"一个布尔值","json.node.null":"一个空值","json.node.number":"一个数字","json.node.object":"一个对象","json.node.string":"一个字符串","key-not-following-convention":"无效的键%0%,因为没有遵循%1%命名规范","linter-config-validator.name-convention.type":"期望一个正则表达式字符串用于描述命名规范","linter-config-validator.wrapper":"%0%。请参阅[文档](%1)获取更多信息","linter.diagnostic-message-wrapper":"%0%(规则:%1%)","linter.name-convention.illegal":"名称 %0% 不匹配配置的正则表达式 %1%","linter.undeclared-symbol.message":"找不到%0%%1%","long":"一个长整型数字","long.between":"在%0%和%1%之间的长整型","mcdoc.binder.dispatcher-statement.duplicated-key":"重复的调度器 %0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% 已经被调度到了这里","mcdoc.binder.duplicated-declaration":"重复声明 %0%","mcdoc.binder.duplicated-declaration.related":"%0% 已在这里被声明过了","mcdoc.binder.out-of-root":"文件 %0% 不在任何 mcdoc 项目的根目录下,因此将跳过语义检测","mcdoc.binder.path.super-from-root":"无法访问项目根目录的上一级目录(`super`)","mcdoc.binder.path.unknown-identifier":"模块 %1% 中不存在标识符 %0%","mcdoc.binder.path.unknown-module":"模块 %0% 不存在","mcdoc.checker.entry.empty-mod-seg":"你不能将“mod.mcdoc”直接放在根目录下","mcdoc.checker.inject-clause.unmatched-injection":"不能注入 %0% 以 %1%","mcdoc.checker.type-not-assignable":"类型 %0% 不能分配给类型 %1%","mcdoc.node.compound-definition":"一个复合定义","mcdoc.node.enum-definition":"一个枚举定义","mcdoc.node.identifier":"一个标识符","mcdoc.parser.compound-definition.field-type":"一个字段类型","mcdoc.parser.float.illegal":"遇到了无效的浮点数","mcdoc.parser.identifier.illegal":"%0% 不遵循格式 %1%","mcdoc.parser.identifier.reserved-word":"%0% 是保留字,无法被用作标识符","mcdoc.parser.index-body.dynamic-index-not-allowed":"不允许动态索引","mcdoc.parser.inject-clause.definition-expected":"期望一个枚举注入或复合注入","mcdoc.parser.keyword.separation":"一个分隔符","mcdoc.parser.resource-location.colon-expected":"期望资源路径中的冒号(%0%)","mcdoc.parser.syntax.doc-comment-unexpected":"此处不允许文档注释;你可能想将三个斜杠替换为两个斜杠","mcdoc.runtime.checker.key-value-pair":"一个键值对","mcdoc.runtime.checker.range.collection":"集合长度应为%0%","mcdoc.runtime.checker.range.concat":"%0%和%1%","mcdoc.runtime.checker.range.left-exclusive":"在%0%以上","mcdoc.runtime.checker.range.left-inclusive":"至少为%0%","mcdoc.runtime.checker.range.number":"应为数值%0%","mcdoc.runtime.checker.range.right-exclusive":"在%0%以下","mcdoc.runtime.checker.range.right-inclusive":"最大为%0%","mcdoc.runtime.checker.range.string":"字符串长度应为%0%","mcdoc.runtime.checker.some-missing-keys":"至少需要 %0% 中的一个键","mcdoc.runtime.checker.trailing":"突遇句尾数据","mcfunction.checker.command.data-modify-unapplicable-operation":"不能在 %1% 上使用 %0% 操作;目标路径的类型为 %2%","mcfunction.completer.block.states.default-value":"默认值:%0%","mcfunction.parser.command-too-long":"命令长度为 %0% ,不允许超过其长度上限 %1%","mcfunction.parser.duplicate-components":"组件重复","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% 不适用于此处","mcfunction.parser.entity-selector.arguments.unknown":"未知的实体选择器参数 %0%","mcfunction.parser.entity-selector.entities-disallowed":"该选择器包含非玩家实体","mcfunction.parser.entity-selector.invalid":"无效的选择器:“%0%”","mcfunction.parser.entity-selector.multiple-disallowed":"该选择器包含多个实体","mcfunction.parser.entity-selector.player-name.too-long":"玩家名称长度不能多于 %0% 个字符","mcfunction.parser.eoc-unexpected":"期望更多参数","mcfunction.parser.leading-slash":"一个前导斜杠 “/”","mcfunction.parser.leading-slash.unexpected":"不能以斜杠“/”开头","mcfunction.parser.macro.at-least-one":"应至少包含一个宏参数","mcfunction.parser.macro.disallowed":"宏行仅受1.20.2之后的版本支持","mcfunction.parser.macro.illegal-key":"键字符语法错误:“%0%”","mcfunction.parser.macro.key":"一个宏键","mcfunction.parser.no-permission":"需要权限等级 %0%,高于设置中定义的 %1%","mcfunction.parser.objective.too-long":"记分项名称长度不能多于 %0% 个字符","mcfunction.parser.range.min>max":"最小值 %0% 大于最大值 %1%","mcfunction.parser.range.span-too-large":"范围 %0% 比最大值 %1% 还大","mcfunction.parser.range.span-too-small":"范围 %0% 比最小值 %1% 还小","mcfunction.parser.score_holder.fake-name.too-long":"实体假名长度不能多于 %0% 个字符","mcfunction.parser.sep":"一个空格 (%0%)","mcfunction.parser.trailing":"遇到尾随的数据:%0%","mcfunction.parser.unknown-parser":"尚未支持解析器 %0%","mcfunction.parser.uuid.invalid":"无效的UUID格式","mcfunction.parser.vector.local-disallowed":"局部坐标不允许在此处使用","mcfunction.parser.vector.mixed":"不能将局部坐标与世界坐标混合使用","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki:`%0%` 参数解析器](https://minecraft.fandom.com/zh/wiki/参数类型#%0%)","mcfunction.signature-help.command-documentation":"[Minecraft Wiki:`%0%` 命令](https://minecraft.fandom.com/zh/wiki/Commands/%0%)","mismatching-regex-pattern":"值无法匹配正则表达式:%0%","missing-key":"缺失键 %0%","nbt.checker.block-states.fake-boolean":"应用引号包裹布尔型方块状态值","nbt.checker.block-states.unexpected-value-type":"方块状态值应为字符串或整数","nbt.checker.block-states.unknown-state":"以下方块具有未知方块状态 %0% :%1%","nbt.checker.boolean.out-of-range":"布尔值应为 %0% 或 %1%","nbt.checker.collection.length-between":"%0% 的长度在 %1% 和 %2% 之间","nbt.checker.compound.field.union-empty-members":"不允许的属性","nbt.checker.path.index-out-of-bound":"提供的索引 %0% 越界,因为集合最多只能拥有 %1% 个元素","nbt.checker.path.unexpected-filter":"复合标签过滤器只能用于复合标签","nbt.checker.path.unexpected-index":"索引只能用于数组或列表标签","nbt.checker.path.unexpected-key":"字符串键只能为复合标签指定","nbt.node":"一个标签","nbt.node.byte":"一个字节标签","nbt.node.byte_array":"一个字节数组标签","nbt.node.compound":"一个复合标签","nbt.node.double":"一个双精度浮点型标签","nbt.node.float":"一个浮点型标签","nbt.node.int":"一个整型标签","nbt.node.int_array":"一个整型数组标签","nbt.node.list":"一个列表标签","nbt.node.long":"一个长整型标签","nbt.node.long_array":"一个长整型数组标签","nbt.node.path.end":"路径结尾","nbt.node.path.filter":"一个复合标签过滤器","nbt.node.path.index":"一个索引","nbt.node.path.key":"一个键","nbt.node.short":"一个短整型标签","nbt.node.string":"一个字符串标签","nbt.parser.number.out-of-range":"这看起来像 %0%,但实际上是 %1%,由于数值超出了 [%2%, %3%]","nbt.path":"一个NBT路径","not-allowed-here":"值 %0% 不允许在这里出现","not-divisible-by":"值 %0% 不能被 %1% 整除","not-matching-any-child":"无效参数","nothing":"无","number":"一个数字","number-range":"一个数字范围","number-range.missing-min-and-max":"期望一个最小值或一个最大值","number.<=":"一个小于等于 %0% 的数字","number.>=":"一个大于等于 %0% 的数字","number.between":"一个位于 %0% 和 %1% 之间的数字","object":"一个对象","objective":"一个记分项","objective-not-following-convention":"该记分项%0%没有跟随命名规则%1%","parser.float.illegal":"浮点数由于未跟随 %0% 而无效","parser.integer.illegal":"无效的整数不遵循 %0%","parser.line-continuation-end-of-file":"行不能以文件结束符续接","parser.list.trailing-sep":"尾随分隔符","parser.list.value":"一个值","parser.long.illegal":"长整型数字因未跟随 %0% 而无效","parser.record.key":"一个键","parser.record.trailing-end":"尾随分隔符","parser.record.unexpected-char":"预期外的字符 %0%","parser.record.value":"一个值","parser.resource-location.illegal":"无效字符:%0%","parser.resource-location.namespace-expected":"不可在此省略命名空间","parser.resource-location.tag-disallowed":"此处不允许使用标签","parser.resource-location.tag-required":"这里只能为标签","parser.string.illegal-brigadier":"在 %0% 中遇到了非 [0-9A-Za-z_.+-] 字符","parser.string.illegal-escape":"预期外的转义字符 %0%","parser.string.illegal-quote":"此处只允许使用 %0% 包裹字符串","parser.string.illegal-unicode-escape":"期望十六进制数字","progress.initializing.title":"正在初始化Spyglass……","progress.reset-project-cache.title":"正在重置项目缓存…","punc.period":"。","punc.quote":"“%0%”","quote":"一个半角引号(“'”或“\"”)","quote_prefer_double":"此处请优先使用半角双引号(“\"”)","quote_prefer_single":"此处请优先使用半角单引号(“'”)","resource-location":"一个资源位置","score-holder":"一个分数持有者","scoreholder-not-following-convention":"无效的分数持有者 %0% 不遵循 %1% 命名规则","selector":"一个选择器","server.new-version":"已更新数据包语言服务器到新版本:%0%","server.progress.fixing-workspace.begin":"修复当前工作空间中所有可自动修复的问题","server.progress.fixing-workspace.report":"正在修复%0%","server.progress.preparing.title":"正在准备 Spyglass 语言特性","server.remove-cache-file":"DHP 的缓存文件被移动到了一个由 VS Code 提供的缓存位置。您现在可以放心地删除工作区根文件夹中的“.datapack”文件夹。","server.show-release-notes":"显示更新日志","string":"一个字符串","tag":"一个标签","tag-not-following-convention":"该标签%0%没有跟随命名规则%1%","team":"一个队伍","team-not-following-convention":"该队伍%0%没有跟随命名规则%1%","text-component":"一个文本组件","time-unit":"一个时间单位","too-many-block-affected":"指定区域内的方块太多(最大值为 %0%,指定值为 %1%)","too-many-chunk-affected":"指定区域内的区块太多(最大值为 %0%,指定值为 %1%)","unexpected-character":"遇到了非 [a-z0-9/._-] 字符","unexpected-datapack-tag":"此处不允许使用标签","unexpected-default-namespace":"应当省略此处的默认命名空间","unexpected-local-coordinate":"不能使用局部坐标%0%","unexpected-nbt":"此处不应使用该 NBT 标签","unexpected-nbt-array-type":"无效的数组类型%0%。应当为“B”“I”“L”中的一个","unexpected-nbt-path-filter":"复合标签筛选器只能对复合标签使用","unexpected-nbt-path-index":"索引只能对列表或数组标签使用","unexpected-nbt-path-key":"键只能对复合标签使用","unexpected-nbt-path-sub":"当前的标签并没有更多的子项","unexpected-omitted-default-namespace":"此处不能省略默认命名空间","unexpected-relative-coordinate":"不能使用相对坐标%0%","unexpected-scoreboard-sub-slot":"只有“sidebar”有子显示位置","unknown-command":"未知的命令%0%","unknown-escape":"预期外的转义字符 %0%","unknown-key":"未知的键%0%","unquoted-string":"一个未被引号包裹的字符串","unsorted-keys":"键未排序","uuid":"一个 UUID","vector":"一个向量"}); + + +/***/ }) + +}; diff --git a/dist/766.index.js b/dist/766.index.js new file mode 100644 index 0000000..05c752b --- /dev/null +++ b/dist/766.index.js @@ -0,0 +1,17 @@ +export const id = 766; +export const ids = [766]; +export const modules = { + +/***/ 1766: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"boolean":"un booleano","code-action.block-state-sort-keys":"Ordina stato blocco","code-action.fix-file":"Aggiusta tutti i problemi auto-aggiustabili in questo file","code-action.fix-workspace":"Aggiusta tutti i problemi auto-aggiustabili nel spazio di lavoro","code-action.id-attribute-datafix":"Aggiorna il nome di questo attributo a 1.16","code-action.id-complete-default-namespace":"Completa il namespace predefinito","code-action.id-omit-default-namespace":"Ommetti il namespace predefinito","code-action.id-zombified-piglin-datafix":"Cambia questo ID a quello di un Piglin Zombificato","code-action.nbt-compound-sort-keys":"Ordina i tag NBT composti","code-action.nbt-type-to-byte":"Converti in un tag NBT di byte","code-action.nbt-type-to-double":"Converti in un tag NBT double","code-action.nbt-type-to-float":"Converti in un tag NBT float","code-action.nbt-type-to-int":"Converti in un tag NBT int","code-action.nbt-type-to-long":"Converti in un tag NBT long","code-action.nbt-type-to-short":"Converti in un tag NBT short","code-action.nbt-uuid-datafix":"Aggiorna questo UUID a 1.16","code-action.selector-sort-keys":"Ordina gli argomenti di selettore","code-action.string-double-quote":"Quota questa stringa con doppie virgolette","code-action.string-single-quote":"Quota questa stringa con singole virgolette","code-action.string-unquote":"De-quota questa stringa","code-action.vector-align-0.0":"Allinea questo vettore all'origine del blocco","code-action.vector-align-0.5":"Allinea questo vettore al centro del blocco","conjunction.and_2":"e ","conjunction.and_3+_1":",","conjunction.and_3+_2":", e","conjunction.or_2":"o","conjunction.or_3+_1":",","conjunction.or_3+_2":", o","duplicate-key":"Chiave duplicate %0%","ending-quote":"quotazione finale %0%","entity":"un'entità","expected":"Previsto %0%","expected-got":"Aspettato %0% ma ricevuto %1%","integer":"un numero intero","integer.between":"un numero intero da %0% a %1%","key-not-following-convention":"Chiave invalida %0% che non segue il convegno %1%","long":"un long","mcfunction.parser.leading-slash.unexpected":"Barra '/' inaspettata","not-matching-any-child":"Fallito a combaciare con qualsiasi figli nell'albero del sintassi del commando","nothing":"niente","number":"un numero","number-range":"un intervallo di numeri","number-range.missing-min-and-max":"Aspettato un valore minimo o massimo","number.<=":"un numero meno o uguale a %0%","number.>=":"un numero maggiore o uguale a %0%","number.between":"un numero da %0% a %1%","objective":"un oggettivo","punc.period":".","punc.quote":"'%0%'","quote":"una quotazione ('\"o\"')","score-holder":"un contenitore di punteggio","server.new-version":"Il Server di Linguaggio Datapack é stato aggiornato a una nuova versione: %0%","server.remove-cache-file":"Il file del cache di DHP è stato spostato in un luogo in memoria da VSCose. Ora puoi tranquillamente cancellare il brutto file '.datapack' nel tuo spazio di lavoro.","server.show-release-notes":"Mostra appunti di pubblicazione","string":"uno string","tag":"un tag","team":"una squadra","time-unit":"un unità di tempo","too-many-block-affected":"Troppi blocchi nell'area (massimo: %0%, specificati: %1%)","unexpected-character":"Trovati caratteri che non sono da a-z, da 0-9 o [/._-]","unexpected-datapack-tag":"I tag non sono permessi qui","unexpected-default-namespace":"Namespace predefinito dovrebbe essere ommesso qui","unexpected-local-coordinate":"La coordinata locale %0% non è permessa","unexpected-nbt":"Questo tag non esiste qui","unexpected-nbt-array-type":"Tipo di array invalido %0%. Deve essere un tipo 'B', 'I' o 'L'","unexpected-nbt-path-filter":"Filtri composti sono esclusivamente usati per i tag composti","unexpected-nbt-path-index":"Gli indici sono solo usati per le liste, gli tag e gli array","unexpected-nbt-path-key":"Le chiavi sono solo usati per i tag composti","unexpected-nbt-path-sub":"Il tag corrente non ha elementi extra","unexpected-omitted-default-namespace":"Il namespace predefinito non può essere omesso qui","unexpected-relative-coordinate":"Coordinata %0% non è permessa","unexpected-scoreboard-sub-slot":"Solo il 'sidebar' ha sub-posti","unknown-command":"Commando sconosciuto","unknown-key":"Chiave sconisciuta","unquoted-string":"una stringa non quotata","unsorted-keys":"Chiavi non ordinati","uuid":"un UUID","vector":"Un vettore"}); + + +/***/ }) + +}; diff --git a/dist/944.index.js b/dist/944.index.js new file mode 100644 index 0000000..6c067ae --- /dev/null +++ b/dist/944.index.js @@ -0,0 +1,17 @@ +export const id = 944; +export const ids = [944]; +export const modules = { + +/***/ 8944: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"uma matriz","boolean":"um boolean","bug-of-mc":"Devido a um bug do Minecraft (%0%), %1%. Por favor, Mojang, conserte o seu jogo","code-action.block-state-sort-keys":"Classificar estado do bloco","code-action.command-replaceitem":"Comando atualizado para /item … replace","code-action.fix-file":"Corrija todos os problemas auto corrigíveis neste arquivo","code-action.fix-workspace":"Corrija todos os problemas auto corrigíveis nesta área de trabalho","code-action.id-attribute-datafix":"Nome de atributo atualizado para a 1.16","code-action.id-complete-default-namespace":"Espaço do nome completo por padrão","code-action.id-create-file":"Criar %0% no mesmo data pack","code-action.id-omit-default-namespace":"Omita o espaço de nome por padrão","code-action.id-zombified-piglin-datafix":"Altere este ID para Piglin Zumbificado","code-action.nbt-compound-sort-keys":"Classificar NBT da tag composta","code-action.nbt-type-to-byte":"Converter para uma tag de NBT byte","code-action.nbt-type-to-double":"Converter para uma tag de NBT double","code-action.nbt-type-to-float":"Converter para uma tag de NBT float","code-action.nbt-type-to-int":"Converter para uma tag de NBT int","code-action.nbt-type-to-long":"Converter para uma tag de NBT long","code-action.nbt-type-to-short":"Converter para uma tag de NBT short","code-action.nbt-uuid-datafix":"Atualizar este UUID para 1.16","code-action.selector-sort-keys":"Classificar argumento do seletor","code-action.string-double-quote":"Cite esta string com aspas duplas","code-action.string-single-quote":"Cite esta string com aspas simples","code-action.string-unquote":"Retire as aspas desta string","code-action.vector-align-0.0":"Alinhar este vetor para bloquear a origem","code-action.vector-align-0.5":"Alinhar este vetor para bloquear o centro","comment":"um comentário começando com %0%","conjunction.and_2":" e ","conjunction.and_3+_1":", ","conjunction.and_3+_2":", e ","conjunction.or_2":" ou ","conjunction.or_3+_1":", ","conjunction.or_3+_2":", ou ","datafix.error.command-replaceitem":"/replaceitem foi removida na 20w46a (a segunda snapshot da 1.17) a favor de /item","duplicate-key":"Duplicar chave %0%","ending-quote":"uma citação final %0%","entity":"uma entidade","error.unparseable-content":"Conteúdo não analisável encontrado","expected":"Esperado %0%","expected-got":"Esperado %0% mas obteve %1%","float":"um float","float.between":"um float entre %0% e %1%","integer":"um inteiro","integer.between":"um inteiro entre %0% e %1%","json.checker.item.duplicate":"Duplicar lista de itens","json.checker.property.deprecated":"A propriedade %0% está descontinuada","json.checker.property.missing":"Falta da propriedade %0%","json.checker.property.unknown":"Propriedade desconhecida %0%","json.checker.string.hex-color":"um número hexadecimal de 6-dígitos","json.checker.tag-entry.duplicate":"Duplicar tag de entrada","json.doc.advancement.display":"Configurações de exibição de progressos. Se estiver presente, o progressos será visível nas guias de progressos.","key-not-following-convention":"Chave inválida %0% que não segue a convenção %1%","linter-config-validator.name-convention.type":"Espera uma string que contém uma expressão regular descrevendo o nome","linter-config-validator.wrapper":"%0%. Veja [a documentação](%1) para mais informações","linter.diagnostic-message-wrapper":"%0% (regras: %1%)","linter.name-convention.illegal":"Nome %0% não corresponde %1%","linter.undeclared-symbol.message":"Não consigo encontrar %0% %1%","long":"uma long","mcdoc.binder.dispatcher-statement.duplicated-key":"Caso de despachante duplicado %0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% já foi despachado aqui","mcdoc.binder.duplicated-declaration":"Declaração duplicada para %0%","mcdoc.binder.duplicated-declaration.related":"%0% já está declarado aqui","mcdoc.binder.out-of-root":"O arquivo %0% não está no diretório raiz de nenhum projeto mcdoc; a verificação semântica será ignorada","mcdoc.binder.path.super-from-root":"Não é possível acessar super da raiz do projeto","mcdoc.binder.path.unknown-identifier":"O identificador %0% não existe no módulo %1%","mcdoc.binder.path.unknown-module":"Módulo %0% não existe","mcdoc.checker.entry.empty-mod-seg":"Você não pode colocar “mod.mcdoc” em uma raiz diretamente","mcdoc.checker.inject-clause.unmatched-injection":"Não é possível injetar %0% com %1%","mcdoc.checker.type-not-assignable":"O tipo %0% não pode ser atribuído ao tipo %1%","mcdoc.node.compound-definition":"uma definição composta","mcdoc.node.enum-definition":"uma definição de enumeração","mcdoc.node.identifier":"um identificador","mcdoc.parser.compound-definition.field-type":"um tipo de campo","mcdoc.parser.float.illegal":"Número float ilegal encontrado","mcdoc.parser.identifier.illegal":"%0% não segue o formato de %1%","mcdoc.parser.identifier.reserved-word":"%0% é uma palavra reservada e não pode ser usada como um nome identificador","mcdoc.parser.index-body.dynamic-index-not-allowed":"A indexação dinâmica não é permitida","mcdoc.parser.inject-clause.definition-expected":"Esperado um enum injeção ou um compound injeção","mcdoc.parser.keyword.separation":"uma separação","mcdoc.parser.resource-location.colon-expected":"Esperado os dois pontos (%0%) dos locais de recursos","mcdoc.parser.syntax.doc-comment-unexpected":"Comentários de documentos não são permitidos aqui; você pode querer substituir as três barras por duas barras","mcfunction.checker.command.data-modify-unapplicable-operation":"A operação %0% só pode ser usada em %1%; o caminho de destino tem o tipo %2% em vez disso","mcfunction.completer.block.states.default-value":"Padrão: %0%","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% não é aplicável aqui","mcfunction.parser.entity-selector.arguments.unknown":"Argumento do seletor de entidade desconhecido %0%","mcfunction.parser.entity-selector.entities-disallowed":"O seletor contém entidades não-player","mcfunction.parser.entity-selector.multiple-disallowed":"O seletor contém várias entidades","mcfunction.parser.entity-selector.player-name.too-long":"Os nomes dos jogadores não podem ter mais de %0% caracteres","mcfunction.parser.eoc-unexpected":"Esperava-se mais argumentos","mcfunction.parser.leading-slash":"uma barra inicial “/”","mcfunction.parser.leading-slash.unexpected":"Barra inicial inesperada “/”","mcfunction.parser.no-permission":"Nível de permissão %0% é necessário, que é superior a %1% definido na configuração","mcfunction.parser.objective.too-long":"Os nomes dos objetivos não podem ter mais de %0% caracteres","mcfunction.parser.range.min>max":"O valor mínimo %0% é maior que o valor máximo %1%","mcfunction.parser.score_holder.fake-name.too-long":"Nomes falsos não podem ter mais de %0% caracteres","mcfunction.parser.sep":"um espaço (%0%)","mcfunction.parser.trailing":"Dados finais encontrados","mcfunction.parser.unknown-parser":"O analisador %0% ainda não foi suportado","mcfunction.parser.uuid.invalid":"Formato UUID inválido","mcfunction.parser.vector.local-disallowed":"Coordenadas locais não permitidas","mcfunction.parser.vector.mixed":"Não é possível misturar coordenadas locais e coordenadas mundiais juntas","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki: analisador de argumentos `%0%`](https://minecraft.fandom.com/wiki/Argument_types#%0%)","mcfunction.signature-help.command-documentation":"[Minecraft Wiki: comando `%0%`](https://minecraft.fandom.com/wiki/Commands/%0%)","missing-key":"Falta a chave %0%","nbt.checker.block-states.fake-boolean":"Os valores do estado do bloco boolean devem ser citados","nbt.checker.block-states.unexpected-value-type":"Os valores do estado do bloco devem ser uma string ou um int","nbt.checker.block-states.unknown-state":"Estado de bloco desconhecido %0% para o(s) seguinte(s) bloco(s): %1%","nbt.checker.boolean.out-of-range":"Um valor boolean deve ser %0% ou %1%","nbt.checker.collection.length-between":"%0% com comprimento entre %1% e %2%","nbt.checker.compound.field.union-empty-members":"Propriedade proibida","nbt.checker.path.index-out-of-bound":"O índice fornecido %0% está fora do limite, pois a coleção só pode ter no máximo %1% elementos","nbt.checker.path.unexpected-filter":"Filtros compostos só podem ser usados em tags compostas","nbt.checker.path.unexpected-index":"Os índices só podem ser usados em array ou lista de tags","nbt.checker.path.unexpected-key":"As chaves de string só podem ser especificadas para tags compostas","nbt.node":"uma tag","nbt.node.byte":"uma byte tag","nbt.node.byte_array":"uma byte array tag","nbt.node.compound":"uma tag composta","nbt.node.double":"uma double tag","nbt.node.float":"uma float tag","nbt.node.int":"uma int tag","nbt.node.int_array":"uma int array tag","nbt.node.list":"uma lista de tag","nbt.node.long":"uma long tag","nbt.node.long_array":"uma long array tag","nbt.node.path.end":"fim do path","nbt.node.path.filter":"um filtro composto","nbt.node.path.index":"um índice","nbt.node.path.key":"uma chave","nbt.node.short":"uma short tag","nbt.node.string":"uma string tag","nbt.parser.number.out-of-range":"Parece que %0%, mas na verdade é %1% devido ao valor numeral estar fora de [%2%, %3%]","not-matching-any-child":"Tipo de argumento inválido","nothing":"nada","number":"um número","number-range":"uma gama de números","number-range.missing-min-and-max":"Esperado um valor mínimo ou um valor máximo","number.<=":"um número menor ou igual a %0%","number.>=":"um número maior ou igual a %0%","number.between":"um número entre %0% e %1%","object":"um objeto","objective":"um objetivo","objective-not-following-convention":"Objetivo inválido %0% que não segue a convenção %1%","parser.float.illegal":"Numeral float ilegal que não segue %0%","parser.integer.illegal":"Inteiro ilegal que não segue %0%","parser.list.trailing-sep":"Separação final","parser.list.value":"um valor","parser.record.key":"uma chave","parser.record.trailing-end":"Separação final","parser.record.unexpected-char":"Caractere inesperado %0%","parser.record.value":"um valor","parser.resource-location.illegal":"Caráter(s) ilegal(is): %0%","parser.resource-location.namespace-expected":"EspaçoDeNome não podem ser omitidos aqui","parser.resource-location.tag-disallowed":"Tags não são permitidas aqui","parser.string.illegal-brigadier":"Encontrou não-[0-9A-Za-z_.+-] caracteres em %0%","parser.string.illegal-escape":"Caráter de escape inesperado %0%","parser.string.illegal-quote":"Apenas %0% pode ser usado para citar strings aqui","parser.string.illegal-unicode-escape":"Espera-se um dígito hexadecimal","punc.period":".","punc.quote":"“%0%”","quote":"uma citação (“'” ou “\"”)","quote_prefer_double":"Aspas duplas (“\"”) são preferíveis aqui","quote_prefer_single":"Aspas simples (“'”) são preferíveis aqui","resource-location":"um local de recurso","score-holder":"um marcador de pontos","scoreholder-not-following-convention":"Score_holder %0% inválido que não segue a convenção %1%","server.new-version":"O idioma do servidor do Data-pack foi atualizado para uma versão mais recente: %0%","server.progress.fixing-workspace.begin":"Corrigindo todos os problemas auto corrigíveis na mesa de trabalho","server.progress.fixing-workspace.report":"corrigindo %0%","server.progress.preparing.title":"Preparando recursos de linguagem do Spyglass","server.remove-cache-file":"O arquivo de cache do DHP foi movido para um local de armazenamento fornecido pelo VSCode. Você pode excluir com segurança a pasta “.datapack” desagradável na raiz do seu espaço de trabalho.","server.show-release-notes":"Mostrar Notas de Lançamento","string":"uma string","tag":"uma tag","tag-not-following-convention":"Tag inválida %0% que não segue a convenção %1%","team":"um equipe","team-not-following-convention":"Equipe invalida %0% que não segue a convenção %1%","time-unit":"uma unidade de tempo","too-many-block-affected":"Muitos blocos na área especificada (máximo %0%, especificado %1%)","too-many-chunk-affected":"Muitos pedaços na área especificada (máximo %0%, especificado %1%)","unexpected-character":"Não foram encontrados caracteres [a-z0-9/._-]","unexpected-datapack-tag":"Tags não são permitidas aqui","unexpected-default-namespace":"O espaço-de-nome padrão deve ser omitido aqui","unexpected-local-coordinate":"Coordenada local %0% não é permitida","unexpected-nbt":"Esta tag não existe aqui","unexpected-nbt-array-type":"Tipo de array inválida %0%. Deve ser um de “B”, “I” e “L”","unexpected-nbt-path-filter":"Filtros compostos são usados apenas para tags compostas","unexpected-nbt-path-index":"Os índices são usados apenas para listas de tags/arrays tags","unexpected-nbt-path-key":"As chaves são usadas apenas para tags compostas","unexpected-nbt-path-sub":"A tag atual não tem itens extras","unexpected-omitted-default-namespace":"O espaço-de-nome padrão não deve ser omitido aqui","unexpected-relative-coordinate":"Coordenada relativa %0% não é permitida","unexpected-scoreboard-sub-slot":"Apenas a “sidebar” tem sub slots","unknown-command":"Comando desconhecido %0%","unknown-escape":"Caráter de escape inesperado %0%","unknown-key":"Chave desconhecida %0%","unquoted-string":"uma string não citada","unsorted-keys":"Chaves não classificadas","uuid":"um UUID","vector":"um vetor"}); + + +/***/ }) + +}; diff --git a/dist/check_datapack.d.ts b/dist/check_datapack.d.ts index d81dc06..7a4df42 100644 --- a/dist/check_datapack.d.ts +++ b/dist/check_datapack.d.ts @@ -1 +1,25 @@ -export declare function checkDatapack(rootDir: String, version: String): Promise; +import * as core from '@spyglassmc/core'; +export interface ActionOptions { + /** + * If set to true, all errors are reported. If set to false, only the first error is reported + */ + reportAllErrors: boolean; + /** + * If set to true, each error is described, indicating the exact issue. If set to false, only the number of errors in each file is reported + */ + verbose: boolean; +} +export declare class CustomService extends core.Service { + rootDir: string; + options: ActionOptions; + constructor(rootDir: string, version: string, options: ActionOptions); + shutdown(): Promise; + private listFilesByExtension; + private makeFileUrl; + private getFileContent; + private getLineAndColumn; + private getErrorProperties; + checkFile(path: string, lang: string): Promise; + checkAllFiles(): Promise; +} +export declare function checkDatapack(rootDir: string, version: string, reportAll: boolean, verbose: boolean): Promise; diff --git a/dist/check_datapack.d.ts.map b/dist/check_datapack.d.ts.map index 99f3a5f..6afd80e 100644 --- a/dist/check_datapack.d.ts.map +++ b/dist/check_datapack.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"","sourceRoot":"","sources":["file:///home/louis/Documents/spyglassmc-action/src/check_datapack.ts"],"names":[],"mappings":"AAAA,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnF"} \ No newline at end of file +{"version":3,"file":"","sourceRoot":"","sources":["file:///home/louis/Documents/spyglassmc-action/src/check_datapack.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAA;AAQxC,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,eAAe,EAAE,OAAO,CAAA;IAExB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;CACnB;AAkBD,qBAAa,aAAc,SAAQ,IAAI,CAAC,OAAO;IAC3C,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,aAAa,CAAA;gBAEV,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa;IAiD9D,QAAQ;IAMd,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,kBAAkB;IAUpB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IA+BvD,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;CA2B1C;AAED,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzH"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index b0ee9c3..82f639a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,6 +1,66 @@ import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module"; /******/ var __webpack_modules__ = ({ +/***/ 3161: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var map = { + "./de.js": [ + 4576, + 576 + ], + "./en.js": [ + 9272 + ], + "./es.js": [ + 9379, + 379 + ], + "./fr.js": [ + 9143, + 143 + ], + "./it.js": [ + 1766, + 766 + ], + "./ja.js": [ + 3694, + 694 + ], + "./pt-br.js": [ + 8944, + 944 + ], + "./zh-cn.js": [ + 699, + 699 + ], + "./zh-tw.js": [ + 9611, + 611 + ] +}; +function webpackAsyncContext(req) { + if(!__nccwpck_require__.o(map, req)) { + return Promise.resolve().then(() => { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; + }); + } + + var ids = map[req], id = ids[0]; + return Promise.all(ids.slice(1).map(__nccwpck_require__.e)).then(() => { + return __nccwpck_require__(id); + }); +} +webpackAsyncContext.keys = () => (Object.keys(map)); +webpackAsyncContext.id = 3161; +module.exports = webpackAsyncContext; + +/***/ }), + /***/ 4914: /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { @@ -3178,6 +3238,24141 @@ function copyFile(srcFile, destFile, force) { } //# sourceMappingURL=io.js.map +/***/ }), + +/***/ 2739: +/***/ ((module, exports, __nccwpck_require__) => { + + + +Object.defineProperty(exports, "__esModule", ({ value: true })); + +const picomatch = __nccwpck_require__(4639); +const normalizePath = __nccwpck_require__(6133); + +/** + * @typedef {(testString: string) => boolean} AnymatchFn + * @typedef {string|RegExp|AnymatchFn} AnymatchPattern + * @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher + */ +const BANG = '!'; +const DEFAULT_OPTIONS = {returnIndex: false}; +const arrify = (item) => Array.isArray(item) ? item : [item]; + +/** + * @param {AnymatchPattern} matcher + * @param {object} options + * @returns {AnymatchFn} + */ +const createPattern = (matcher, options) => { + if (typeof matcher === 'function') { + return matcher; + } + if (typeof matcher === 'string') { + const glob = picomatch(matcher, options); + return (string) => matcher === string || glob(string); + } + if (matcher instanceof RegExp) { + return (string) => matcher.test(string); + } + return (string) => false; +}; + +/** + * @param {Array} patterns + * @param {Array} negPatterns + * @param {String|Array} args + * @param {Boolean} returnIndex + * @returns {boolean|number} + */ +const matchPatterns = (patterns, negPatterns, args, returnIndex) => { + const isList = Array.isArray(args); + const _path = isList ? args[0] : args; + if (!isList && typeof _path !== 'string') { + throw new TypeError('anymatch: second argument must be a string: got ' + + Object.prototype.toString.call(_path)) + } + const path = normalizePath(_path, false); + + for (let index = 0; index < negPatterns.length; index++) { + const nglob = negPatterns[index]; + if (nglob(path)) { + return returnIndex ? -1 : false; + } + } + + const applied = isList && [path].concat(args.slice(1)); + for (let index = 0; index < patterns.length; index++) { + const pattern = patterns[index]; + if (isList ? pattern(...applied) : pattern(path)) { + return returnIndex ? index : true; + } + } + + return returnIndex ? -1 : false; +}; + +/** + * @param {AnymatchMatcher} matchers + * @param {Array|string} testString + * @param {object} options + * @returns {boolean|number|Function} + */ +const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => { + if (matchers == null) { + throw new TypeError('anymatch: specify first argument'); + } + const opts = typeof options === 'boolean' ? {returnIndex: options} : options; + const returnIndex = opts.returnIndex || false; + + // Early cache for matchers. + const mtchers = arrify(matchers); + const negatedGlobs = mtchers + .filter(item => typeof item === 'string' && item.charAt(0) === BANG) + .map(item => item.slice(1)) + .map(item => picomatch(item, opts)); + const patterns = mtchers + .filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG)) + .map(matcher => createPattern(matcher, opts)); + + if (testString == null) { + return (testString, ri = false) => { + const returnIndex = typeof ri === 'boolean' ? ri : false; + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); + } + } + + return matchPatterns(patterns, negatedGlobs, testString, returnIndex); +}; + +anymatch.default = anymatch; +module.exports = anymatch; + + +/***/ }), + +/***/ 4639: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +module.exports = __nccwpck_require__(3053); + + +/***/ }), + +/***/ 9314: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const path = __nccwpck_require__(6928); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + + +/***/ }), + +/***/ 1592: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const constants = __nccwpck_require__(9314); +const utils = __nccwpck_require__(4842); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; + + +/***/ }), + +/***/ 3053: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const path = __nccwpck_require__(6928); +const scan = __nccwpck_require__(7921); +const parse = __nccwpck_require__(1592); +const utils = __nccwpck_require__(4842); +const constants = __nccwpck_require__(9314); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; + + +/***/ }), + +/***/ 7921: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const utils = __nccwpck_require__(4842); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = __nccwpck_require__(9314); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; + + +/***/ }), + +/***/ 4842: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const path = __nccwpck_require__(6928); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = __nccwpck_require__(9314); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; + +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; + + +/***/ }), + +/***/ 3242: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(6548); + + +/***/ }), + +/***/ 896: +/***/ ((module) => { + +module.exports = function(haystack, needle, comparator, low, high) { + var mid, cmp; + + if(low === undefined) + low = 0; + + else { + low = low|0; + if(low < 0 || low >= haystack.length) + throw new RangeError("invalid lower bound"); + } + + if(high === undefined) + high = haystack.length - 1; + + else { + high = high|0; + if(high < low || high >= haystack.length) + throw new RangeError("invalid upper bound"); + } + + while(low <= high) { + // The naive `low + high >>> 1` could fail for array lengths > 2**31 + // because `>>>` converts its operands to int32. `low + (high - low >>> 1)` + // works for array lengths <= 2**32-1 which is also Javascript's max array + // length. + mid = low + ((high - low) >>> 1); + cmp = +comparator(haystack[mid], needle, mid, haystack); + + // Too low. + if(cmp < 0.0) + low = mid + 1; + + // Too high. + else if(cmp > 0.0) + high = mid - 1; + + // Key found. + else + return mid; + } + + // Key not found. + return ~low; +} + + +/***/ }), + +/***/ 794: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var DuplexStream = __nccwpck_require__(6141) + , util = __nccwpck_require__(9023) + , Buffer = (__nccwpck_require__(3058).Buffer) + + +function BufferList (callback) { + if (!(this instanceof BufferList)) + return new BufferList(callback) + + this._bufs = [] + this.length = 0 + + if (typeof callback == 'function') { + this._callback = callback + + var piper = function piper (err) { + if (this._callback) { + this._callback(err) + this._callback = null + } + }.bind(this) + + this.on('pipe', function onPipe (src) { + src.on('error', piper) + }) + this.on('unpipe', function onUnpipe (src) { + src.removeListener('error', piper) + }) + } else { + this.append(callback) + } + + DuplexStream.call(this) +} + + +util.inherits(BufferList, DuplexStream) + + +BufferList.prototype._offset = function _offset (offset) { + var tot = 0, i = 0, _t + if (offset === 0) return [ 0, 0 ] + for (; i < this._bufs.length; i++) { + _t = tot + this._bufs[i].length + if (offset < _t || i == this._bufs.length - 1) + return [ i, offset - tot ] + tot = _t + } +} + + +BufferList.prototype.append = function append (buf) { + var i = 0 + + if (Buffer.isBuffer(buf)) { + this._appendBuffer(buf); + } else if (Array.isArray(buf)) { + for (; i < buf.length; i++) + this.append(buf[i]) + } else if (buf instanceof BufferList) { + // unwrap argument into individual BufferLists + for (; i < buf._bufs.length; i++) + this.append(buf._bufs[i]) + } else if (buf != null) { + // coerce number arguments to strings, since Buffer(number) does + // uninitialized memory allocation + if (typeof buf == 'number') + buf = buf.toString() + + this._appendBuffer(Buffer.from(buf)); + } + + return this +} + + +BufferList.prototype._appendBuffer = function appendBuffer (buf) { + this._bufs.push(buf) + this.length += buf.length +} + + +BufferList.prototype._write = function _write (buf, encoding, callback) { + this._appendBuffer(buf) + + if (typeof callback == 'function') + callback() +} + + +BufferList.prototype._read = function _read (size) { + if (!this.length) + return this.push(null) + + size = Math.min(size, this.length) + this.push(this.slice(0, size)) + this.consume(size) +} + + +BufferList.prototype.end = function end (chunk) { + DuplexStream.prototype.end.call(this, chunk) + + if (this._callback) { + this._callback(null, this.slice()) + this._callback = null + } +} + + +BufferList.prototype.get = function get (index) { + return this.slice(index, index + 1)[0] +} + + +BufferList.prototype.slice = function slice (start, end) { + if (typeof start == 'number' && start < 0) + start += this.length + if (typeof end == 'number' && end < 0) + end += this.length + return this.copy(null, 0, start, end) +} + + +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) { + if (typeof srcStart != 'number' || srcStart < 0) + srcStart = 0 + if (typeof srcEnd != 'number' || srcEnd > this.length) + srcEnd = this.length + if (srcStart >= this.length) + return dst || Buffer.alloc(0) + if (srcEnd <= 0) + return dst || Buffer.alloc(0) + + var copy = !!dst + , off = this._offset(srcStart) + , len = srcEnd - srcStart + , bytes = len + , bufoff = (copy && dstStart) || 0 + , start = off[1] + , l + , i + + // copy/slice everything + if (srcStart === 0 && srcEnd == this.length) { + if (!copy) { // slice, but full concat if multiple buffers + return this._bufs.length === 1 + ? this._bufs[0] + : Buffer.concat(this._bufs, this.length) + } + + // copy, need to copy individual buffers + for (i = 0; i < this._bufs.length; i++) { + this._bufs[i].copy(dst, bufoff) + bufoff += this._bufs[i].length + } + + return dst + } + + // easy, cheap case where it's a subset of one of the buffers + if (bytes <= this._bufs[off[0]].length - start) { + return copy + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) + : this._bufs[off[0]].slice(start, start + bytes) + } + + if (!copy) // a slice, we need something to copy in to + dst = Buffer.allocUnsafe(len) + + for (i = off[0]; i < this._bufs.length; i++) { + l = this._bufs[i].length - start + + if (bytes > l) { + this._bufs[i].copy(dst, bufoff, start) + bufoff += l + } else { + this._bufs[i].copy(dst, bufoff, start, start + bytes) + bufoff += l + break + } + + bytes -= l + + if (start) + start = 0 + } + + // safeguard so that we don't return uninitialized memory + if (dst.length > bufoff) return dst.slice(0, bufoff) + + return dst +} + +BufferList.prototype.shallowSlice = function shallowSlice (start, end) { + start = start || 0 + end = end || this.length + + if (start < 0) + start += this.length + if (end < 0) + end += this.length + + var startOffset = this._offset(start) + , endOffset = this._offset(end) + , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1) + + if (endOffset[1] == 0) + buffers.pop() + else + buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1]) + + if (startOffset[1] != 0) + buffers[0] = buffers[0].slice(startOffset[1]) + + return new BufferList(buffers) +} + +BufferList.prototype.toString = function toString (encoding, start, end) { + return this.slice(start, end).toString(encoding) +} + +BufferList.prototype.consume = function consume (bytes) { + // first, normalize the argument, in accordance with how Buffer does it + bytes = Math.trunc(bytes) + // do nothing if not a positive number + if (Number.isNaN(bytes) || bytes <= 0) return this + + while (this._bufs.length) { + if (bytes >= this._bufs[0].length) { + bytes -= this._bufs[0].length + this.length -= this._bufs[0].length + this._bufs.shift() + } else { + this._bufs[0] = this._bufs[0].slice(bytes) + this.length -= bytes + break + } + } + return this +} + + +BufferList.prototype.duplicate = function duplicate () { + var i = 0 + , copy = new BufferList() + + for (; i < this._bufs.length; i++) + copy.append(this._bufs[i]) + + return copy +} + + +BufferList.prototype.destroy = function destroy () { + this._bufs.length = 0 + this.length = 0 + this.push(null) +} + + +;(function () { + var methods = { + 'readDoubleBE' : 8 + , 'readDoubleLE' : 8 + , 'readFloatBE' : 4 + , 'readFloatLE' : 4 + , 'readInt32BE' : 4 + , 'readInt32LE' : 4 + , 'readUInt32BE' : 4 + , 'readUInt32LE' : 4 + , 'readInt16BE' : 2 + , 'readInt16LE' : 2 + , 'readUInt16BE' : 2 + , 'readUInt16LE' : 2 + , 'readInt8' : 1 + , 'readUInt8' : 1 + } + + for (var m in methods) { + (function (m) { + BufferList.prototype[m] = function (offset) { + return this.slice(offset, offset + methods[m])[m](0) + } + }(m)) + } +}()) + + +module.exports = BufferList + + +/***/ }), + +/***/ 748: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const stringify = __nccwpck_require__(3317); +const compile = __nccwpck_require__(1113); +const expand = __nccwpck_require__(5290); +const parse = __nccwpck_require__(507); + +/** + * Expand the given pattern or create a regex-compatible string. + * + * ```js + * const braces = require('braces'); + * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)'] + * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c'] + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {String} + * @api public + */ + +const braces = (input, options = {}) => { + let output = []; + + if (Array.isArray(input)) { + for (const pattern of input) { + const result = braces.create(pattern, options); + if (Array.isArray(result)) { + output.push(...result); + } else { + output.push(result); + } + } + } else { + output = [].concat(braces.create(input, options)); + } + + if (options && options.expand === true && options.nodupes === true) { + output = [...new Set(output)]; + } + return output; +}; + +/** + * Parse the given `str` with the given `options`. + * + * ```js + * // braces.parse(pattern, [, options]); + * const ast = braces.parse('a/{b,c}/d'); + * console.log(ast); + * ``` + * @param {String} pattern Brace pattern to parse + * @param {Object} options + * @return {Object} Returns an AST + * @api public + */ + +braces.parse = (input, options = {}) => parse(input, options); + +/** + * Creates a braces string from an AST, or an AST node. + * + * ```js + * const braces = require('braces'); + * let ast = braces.parse('foo/{a,b}/bar'); + * console.log(stringify(ast.nodes[2])); //=> '{a,b}' + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.stringify = (input, options = {}) => { + if (typeof input === 'string') { + return stringify(braces.parse(input, options), options); + } + return stringify(input, options); +}; + +/** + * Compiles a brace pattern into a regex-compatible, optimized string. + * This method is called by the main [braces](#braces) function by default. + * + * ```js + * const braces = require('braces'); + * console.log(braces.compile('a/{b,c}/d')); + * //=> ['a/(b|c)/d'] + * ``` + * @param {String} `input` Brace pattern or AST. + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.compile = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + return compile(input, options); +}; + +/** + * Expands a brace pattern into an array. This method is called by the + * main [braces](#braces) function when `options.expand` is true. Before + * using this method it's recommended that you read the [performance notes](#performance)) + * and advantages of using [.compile](#compile) instead. + * + * ```js + * const braces = require('braces'); + * console.log(braces.expand('a/{b,c}/d')); + * //=> ['a/b/d', 'a/c/d']; + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.expand = (input, options = {}) => { + if (typeof input === 'string') { + input = braces.parse(input, options); + } + + let result = expand(input, options); + + // filter out empty strings if specified + if (options.noempty === true) { + result = result.filter(Boolean); + } + + // filter out duplicates if specified + if (options.nodupes === true) { + result = [...new Set(result)]; + } + + return result; +}; + +/** + * Processes a brace pattern and returns either an expanded array + * (if `options.expand` is true), a highly optimized regex-compatible string. + * This method is called by the main [braces](#braces) function. + * + * ```js + * const braces = require('braces'); + * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}')) + * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)' + * ``` + * @param {String} `pattern` Brace pattern + * @param {Object} `options` + * @return {Array} Returns an array of expanded values. + * @api public + */ + +braces.create = (input, options = {}) => { + if (input === '' || input.length < 3) { + return [input]; + } + + return options.expand !== true + ? braces.compile(input, options) + : braces.expand(input, options); +}; + +/** + * Expose "braces" + */ + +module.exports = braces; + + +/***/ }), + +/***/ 1113: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const fill = __nccwpck_require__(877); +const utils = __nccwpck_require__(2257); + +const compile = (ast, options = {}) => { + const walk = (node, parent = {}) => { + const invalidBlock = utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + const invalid = invalidBlock === true || invalidNode === true; + const prefix = options.escapeInvalid === true ? '\\' : ''; + let output = ''; + + if (node.isOpen === true) { + return prefix + node.value; + } + + if (node.isClose === true) { + console.log('node.isClose', prefix, node.value); + return prefix + node.value; + } + + if (node.type === 'open') { + return invalid ? prefix + node.value : '('; + } + + if (node.type === 'close') { + return invalid ? prefix + node.value : ')'; + } + + if (node.type === 'comma') { + return node.prev.type === 'comma' ? '' : invalid ? node.value : '|'; + } + + if (node.value) { + return node.value; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true }); + + if (range.length !== 0) { + return args.length > 1 && range.length > 1 ? `(${range})` : range; + } + } + + if (node.nodes) { + for (const child of node.nodes) { + output += walk(child, node); + } + } + + return output; + }; + + return walk(ast); +}; + +module.exports = compile; + + +/***/ }), + +/***/ 2477: +/***/ ((module) => { + + + +module.exports = { + MAX_LENGTH: 10000, + + // Digits + CHAR_0: '0', /* 0 */ + CHAR_9: '9', /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 'A', /* A */ + CHAR_LOWERCASE_A: 'a', /* a */ + CHAR_UPPERCASE_Z: 'Z', /* Z */ + CHAR_LOWERCASE_Z: 'z', /* z */ + + CHAR_LEFT_PARENTHESES: '(', /* ( */ + CHAR_RIGHT_PARENTHESES: ')', /* ) */ + + CHAR_ASTERISK: '*', /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: '&', /* & */ + CHAR_AT: '@', /* @ */ + CHAR_BACKSLASH: '\\', /* \ */ + CHAR_BACKTICK: '`', /* ` */ + CHAR_CARRIAGE_RETURN: '\r', /* \r */ + CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */ + CHAR_COLON: ':', /* : */ + CHAR_COMMA: ',', /* , */ + CHAR_DOLLAR: '$', /* . */ + CHAR_DOT: '.', /* . */ + CHAR_DOUBLE_QUOTE: '"', /* " */ + CHAR_EQUAL: '=', /* = */ + CHAR_EXCLAMATION_MARK: '!', /* ! */ + CHAR_FORM_FEED: '\f', /* \f */ + CHAR_FORWARD_SLASH: '/', /* / */ + CHAR_HASH: '#', /* # */ + CHAR_HYPHEN_MINUS: '-', /* - */ + CHAR_LEFT_ANGLE_BRACKET: '<', /* < */ + CHAR_LEFT_CURLY_BRACE: '{', /* { */ + CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */ + CHAR_LINE_FEED: '\n', /* \n */ + CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */ + CHAR_PERCENT: '%', /* % */ + CHAR_PLUS: '+', /* + */ + CHAR_QUESTION_MARK: '?', /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */ + CHAR_RIGHT_CURLY_BRACE: '}', /* } */ + CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */ + CHAR_SEMICOLON: ';', /* ; */ + CHAR_SINGLE_QUOTE: '\'', /* ' */ + CHAR_SPACE: ' ', /* */ + CHAR_TAB: '\t', /* \t */ + CHAR_UNDERSCORE: '_', /* _ */ + CHAR_VERTICAL_LINE: '|', /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */ +}; + + +/***/ }), + +/***/ 5290: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const fill = __nccwpck_require__(877); +const stringify = __nccwpck_require__(3317); +const utils = __nccwpck_require__(2257); + +const append = (queue = '', stash = '', enclose = false) => { + const result = []; + + queue = [].concat(queue); + stash = [].concat(stash); + + if (!stash.length) return queue; + if (!queue.length) { + return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash; + } + + for (const item of queue) { + if (Array.isArray(item)) { + for (const value of item) { + result.push(append(value, stash, enclose)); + } + } else { + for (let ele of stash) { + if (enclose === true && typeof ele === 'string') ele = `{${ele}}`; + result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele); + } + } + } + return utils.flatten(result); +}; + +const expand = (ast, options = {}) => { + const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit; + + const walk = (node, parent = {}) => { + node.queue = []; + + let p = parent; + let q = parent.queue; + + while (p.type !== 'brace' && p.type !== 'root' && p.parent) { + p = p.parent; + q = p.queue; + } + + if (node.invalid || node.dollar) { + q.push(append(q.pop(), stringify(node, options))); + return; + } + + if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) { + q.push(append(q.pop(), ['{}'])); + return; + } + + if (node.nodes && node.ranges > 0) { + const args = utils.reduce(node.nodes); + + if (utils.exceedsLimit(...args, options.step, rangeLimit)) { + throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.'); + } + + let range = fill(...args, options); + if (range.length === 0) { + range = stringify(node, options); + } + + q.push(append(q.pop(), range)); + node.nodes = []; + return; + } + + const enclose = utils.encloseBrace(node); + let queue = node.queue; + let block = node; + + while (block.type !== 'brace' && block.type !== 'root' && block.parent) { + block = block.parent; + queue = block.queue; + } + + for (let i = 0; i < node.nodes.length; i++) { + const child = node.nodes[i]; + + if (child.type === 'comma' && node.type === 'brace') { + if (i === 1) queue.push(''); + queue.push(''); + continue; + } + + if (child.type === 'close') { + q.push(append(q.pop(), queue, enclose)); + continue; + } + + if (child.value && child.type !== 'open') { + queue.push(append(queue.pop(), child.value)); + continue; + } + + if (child.nodes) { + walk(child, node); + } + } + + return queue; + }; + + return utils.flatten(walk(ast)); +}; + +module.exports = expand; + + +/***/ }), + +/***/ 507: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const stringify = __nccwpck_require__(3317); + +/** + * Constants + */ + +const { + MAX_LENGTH, + CHAR_BACKSLASH, /* \ */ + CHAR_BACKTICK, /* ` */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_RIGHT_SQUARE_BRACKET, /* ] */ + CHAR_DOUBLE_QUOTE, /* " */ + CHAR_SINGLE_QUOTE, /* ' */ + CHAR_NO_BREAK_SPACE, + CHAR_ZERO_WIDTH_NOBREAK_SPACE +} = __nccwpck_require__(2477); + +/** + * parse + */ + +const parse = (input, options = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + const opts = options || {}; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + if (input.length > max) { + throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`); + } + + const ast = { type: 'root', input, nodes: [] }; + const stack = [ast]; + let block = ast; + let prev = ast; + let brackets = 0; + const length = input.length; + let index = 0; + let depth = 0; + let value; + + /** + * Helpers + */ + + const advance = () => input[index++]; + const push = node => { + if (node.type === 'text' && prev.type === 'dot') { + prev.type = 'text'; + } + + if (prev && prev.type === 'text' && node.type === 'text') { + prev.value += node.value; + return; + } + + block.nodes.push(node); + node.parent = block; + node.prev = prev; + prev = node; + return node; + }; + + push({ type: 'bos' }); + + while (index < length) { + block = stack[stack.length - 1]; + value = advance(); + + /** + * Invalid chars + */ + + if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) { + continue; + } + + /** + * Escaped chars + */ + + if (value === CHAR_BACKSLASH) { + push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() }); + continue; + } + + /** + * Right square bracket (literal): ']' + */ + + if (value === CHAR_RIGHT_SQUARE_BRACKET) { + push({ type: 'text', value: '\\' + value }); + continue; + } + + /** + * Left square bracket: '[' + */ + + if (value === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + + let next; + + while (index < length && (next = advance())) { + value += next; + + if (next === CHAR_LEFT_SQUARE_BRACKET) { + brackets++; + continue; + } + + if (next === CHAR_BACKSLASH) { + value += advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + brackets--; + + if (brackets === 0) { + break; + } + } + } + + push({ type: 'text', value }); + continue; + } + + /** + * Parentheses + */ + + if (value === CHAR_LEFT_PARENTHESES) { + block = push({ type: 'paren', nodes: [] }); + stack.push(block); + push({ type: 'text', value }); + continue; + } + + if (value === CHAR_RIGHT_PARENTHESES) { + if (block.type !== 'paren') { + push({ type: 'text', value }); + continue; + } + block = stack.pop(); + push({ type: 'text', value }); + block = stack[stack.length - 1]; + continue; + } + + /** + * Quotes: '|"|` + */ + + if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) { + const open = value; + let next; + + if (options.keepQuotes !== true) { + value = ''; + } + + while (index < length && (next = advance())) { + if (next === CHAR_BACKSLASH) { + value += next + advance(); + continue; + } + + if (next === open) { + if (options.keepQuotes === true) value += next; + break; + } + + value += next; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Left curly brace: '{' + */ + + if (value === CHAR_LEFT_CURLY_BRACE) { + depth++; + + const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true; + const brace = { + type: 'brace', + open: true, + close: false, + dollar, + depth, + commas: 0, + ranges: 0, + nodes: [] + }; + + block = push(brace); + stack.push(block); + push({ type: 'open', value }); + continue; + } + + /** + * Right curly brace: '}' + */ + + if (value === CHAR_RIGHT_CURLY_BRACE) { + if (block.type !== 'brace') { + push({ type: 'text', value }); + continue; + } + + const type = 'close'; + block = stack.pop(); + block.close = true; + + push({ type, value }); + depth--; + + block = stack[stack.length - 1]; + continue; + } + + /** + * Comma: ',' + */ + + if (value === CHAR_COMMA && depth > 0) { + if (block.ranges > 0) { + block.ranges = 0; + const open = block.nodes.shift(); + block.nodes = [open, { type: 'text', value: stringify(block) }]; + } + + push({ type: 'comma', value }); + block.commas++; + continue; + } + + /** + * Dot: '.' + */ + + if (value === CHAR_DOT && depth > 0 && block.commas === 0) { + const siblings = block.nodes; + + if (depth === 0 || siblings.length === 0) { + push({ type: 'text', value }); + continue; + } + + if (prev.type === 'dot') { + block.range = []; + prev.value += value; + prev.type = 'range'; + + if (block.nodes.length !== 3 && block.nodes.length !== 5) { + block.invalid = true; + block.ranges = 0; + prev.type = 'text'; + continue; + } + + block.ranges++; + block.args = []; + continue; + } + + if (prev.type === 'range') { + siblings.pop(); + + const before = siblings[siblings.length - 1]; + before.value += prev.value + value; + prev = before; + block.ranges--; + continue; + } + + push({ type: 'dot', value }); + continue; + } + + /** + * Text + */ + + push({ type: 'text', value }); + } + + // Mark imbalanced braces and brackets as invalid + do { + block = stack.pop(); + + if (block.type !== 'root') { + block.nodes.forEach(node => { + if (!node.nodes) { + if (node.type === 'open') node.isOpen = true; + if (node.type === 'close') node.isClose = true; + if (!node.nodes) node.type = 'text'; + node.invalid = true; + } + }); + + // get the location of the block on parent.nodes (block's siblings) + const parent = stack[stack.length - 1]; + const index = parent.nodes.indexOf(block); + // replace the (invalid) block with it's nodes + parent.nodes.splice(index, 1, ...block.nodes); + } + } while (stack.length > 0); + + push({ type: 'eos' }); + return ast; +}; + +module.exports = parse; + + +/***/ }), + +/***/ 3317: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const utils = __nccwpck_require__(2257); + +module.exports = (ast, options = {}) => { + const stringify = (node, parent = {}) => { + const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent); + const invalidNode = node.invalid === true && options.escapeInvalid === true; + let output = ''; + + if (node.value) { + if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) { + return '\\' + node.value; + } + return node.value; + } + + if (node.value) { + return node.value; + } + + if (node.nodes) { + for (const child of node.nodes) { + output += stringify(child); + } + } + return output; + }; + + return stringify(ast); +}; + + + +/***/ }), + +/***/ 2257: +/***/ ((__unused_webpack_module, exports) => { + + + +exports.isInteger = num => { + if (typeof num === 'number') { + return Number.isInteger(num); + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isInteger(Number(num)); + } + return false; +}; + +/** + * Find a node of the given type + */ + +exports.find = (node, type) => node.nodes.find(node => node.type === type); + +/** + * Find a node of the given type + */ + +exports.exceedsLimit = (min, max, step = 1, limit) => { + if (limit === false) return false; + if (!exports.isInteger(min) || !exports.isInteger(max)) return false; + return ((Number(max) - Number(min)) / Number(step)) >= limit; +}; + +/** + * Escape the given node with '\\' before node.value + */ + +exports.escapeNode = (block, n = 0, type) => { + const node = block.nodes[n]; + if (!node) return; + + if ((type && node.type === type) || node.type === 'open' || node.type === 'close') { + if (node.escaped !== true) { + node.value = '\\' + node.value; + node.escaped = true; + } + } +}; + +/** + * Returns true if the given brace node should be enclosed in literal braces + */ + +exports.encloseBrace = node => { + if (node.type !== 'brace') return false; + if ((node.commas >> 0 + node.ranges >> 0) === 0) { + node.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a brace node is invalid. + */ + +exports.isInvalidBrace = block => { + if (block.type !== 'brace') return false; + if (block.invalid === true || block.dollar) return true; + if ((block.commas >> 0 + block.ranges >> 0) === 0) { + block.invalid = true; + return true; + } + if (block.open !== true || block.close !== true) { + block.invalid = true; + return true; + } + return false; +}; + +/** + * Returns true if a node is an open or close node + */ + +exports.isOpenOrClose = node => { + if (node.type === 'open' || node.type === 'close') { + return true; + } + return node.open === true || node.close === true; +}; + +/** + * Reduce an array of text nodes. + */ + +exports.reduce = nodes => nodes.reduce((acc, node) => { + if (node.type === 'text') acc.push(node.value); + if (node.type === 'range') node.type = 'text'; + return acc; +}, []); + +/** + * Flatten an array + */ + +exports.flatten = (...args) => { + const result = []; + + const flat = arr => { + for (let i = 0; i < arr.length; i++) { + const ele = arr[i]; + + if (Array.isArray(ele)) { + flat(ele); + continue; + } + + if (ele !== undefined) { + result.push(ele); + } + } + return result; + }; + + flat(args); + return result; +}; + + +/***/ }), + +/***/ 3723: +/***/ ((module) => { + +function allocUnsafe (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } + + if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } + + if (Buffer.allocUnsafe) { + return Buffer.allocUnsafe(size) + } else { + return new Buffer(size) + } +} + +module.exports = allocUnsafe + + +/***/ }), + +/***/ 8950: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var bufferFill = __nccwpck_require__(4764) +var allocUnsafe = __nccwpck_require__(3723) + +module.exports = function alloc (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be a number') + } + + if (size < 0) { + throw new RangeError('"size" argument must not be negative') + } + + if (Buffer.alloc) { + return Buffer.alloc(size, fill, encoding) + } + + var buffer = allocUnsafe(size) + + if (size === 0) { + return buffer + } + + if (fill === undefined) { + return bufferFill(buffer, 0) + } + + if (typeof encoding !== 'string') { + encoding = undefined + } + + return bufferFill(buffer, fill, encoding) +} + + +/***/ }), + +/***/ 9776: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Buffer = (__nccwpck_require__(181).Buffer); + +var CRC_TABLE = [ + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d +]; + +if (typeof Int32Array !== 'undefined') { + CRC_TABLE = new Int32Array(CRC_TABLE); +} + +function ensureBuffer(input) { + if (Buffer.isBuffer(input)) { + return input; + } + + var hasNewBufferAPI = + typeof Buffer.alloc === "function" && + typeof Buffer.from === "function"; + + if (typeof input === "number") { + return hasNewBufferAPI ? Buffer.alloc(input) : new Buffer(input); + } + else if (typeof input === "string") { + return hasNewBufferAPI ? Buffer.from(input) : new Buffer(input); + } + else { + throw new Error("input must be buffer, number, or string, received " + + typeof input); + } +} + +function bufferizeInt(num) { + var tmp = ensureBuffer(4); + tmp.writeInt32BE(num, 0); + return tmp; +} + +function _crc32(buf, previous) { + buf = ensureBuffer(buf); + if (Buffer.isBuffer(previous)) { + previous = previous.readUInt32BE(0); + } + var crc = ~~previous ^ -1; + for (var n = 0; n < buf.length; n++) { + crc = CRC_TABLE[(crc ^ buf[n]) & 0xff] ^ (crc >>> 8); + } + return (crc ^ -1); +} + +function crc32() { + return bufferizeInt(_crc32.apply(null, arguments)); +} +crc32.signed = function () { + return _crc32.apply(null, arguments); +}; +crc32.unsigned = function () { + return _crc32.apply(null, arguments) >>> 0; +}; + +module.exports = crc32; + + +/***/ }), + +/***/ 4764: +/***/ ((module) => { + +/* Node.js 6.4.0 and up has full support */ +var hasFullSupport = (function () { + try { + if (!Buffer.isEncoding('latin1')) { + return false + } + + var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4) + + buf.fill('ab', 'ucs2') + + return (buf.toString('hex') === '61006200') + } catch (_) { + return false + } +}()) + +function isSingleByte (val) { + return (val.length === 1 && val.charCodeAt(0) < 256) +} + +function fillWithNumber (buffer, val, start, end) { + if (start < 0 || end > buffer.length) { + throw new RangeError('Out of range index') + } + + start = start >>> 0 + end = end === undefined ? buffer.length : end >>> 0 + + if (end > start) { + buffer.fill(val, start, end) + } + + return buffer +} + +function fillWithBuffer (buffer, val, start, end) { + if (start < 0 || end > buffer.length) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return buffer + } + + start = start >>> 0 + end = end === undefined ? buffer.length : end >>> 0 + + var pos = start + var len = val.length + while (pos <= (end - len)) { + val.copy(buffer, pos) + pos += len + } + + if (pos !== end) { + val.copy(buffer, pos, 0, end - pos) + } + + return buffer +} + +function fill (buffer, val, start, end, encoding) { + if (hasFullSupport) { + return buffer.fill(val, start, end, encoding) + } + + if (typeof val === 'number') { + return fillWithNumber(buffer, val, start, end) + } + + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = buffer.length + } else if (typeof end === 'string') { + encoding = end + end = buffer.length + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + + if (encoding === 'latin1') { + encoding = 'binary' + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + if (val === '') { + return fillWithNumber(buffer, 0, start, end) + } + + if (isSingleByte(val)) { + return fillWithNumber(buffer, val.charCodeAt(0), start, end) + } + + val = new Buffer(val, encoding) + } + + if (Buffer.isBuffer(val)) { + return fillWithBuffer(buffer, val, start, end) + } + + // Other values (e.g. undefined, boolean, object) results in zero-fill + return fillWithNumber(buffer, 0, start, end) +} + +module.exports = fill + + +/***/ }), + +/***/ 2639: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var bind = __nccwpck_require__(7564); + +var $apply = __nccwpck_require__(3945); +var $call = __nccwpck_require__(8093); +var $reflectApply = __nccwpck_require__(1330); + +/** @type {import('./actualApply')} */ +module.exports = $reflectApply || bind.call($call, $apply); + + +/***/ }), + +/***/ 6002: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var bind = __nccwpck_require__(7564); +var $apply = __nccwpck_require__(3945); +var actualApply = __nccwpck_require__(2639); + +/** @type {import('./applyBind')} */ +module.exports = function applyBind() { + return actualApply(bind, $apply, arguments); +}; + + +/***/ }), + +/***/ 3945: +/***/ ((module) => { + + + +/** @type {import('./functionApply')} */ +module.exports = Function.prototype.apply; + + +/***/ }), + +/***/ 8093: +/***/ ((module) => { + + + +/** @type {import('./functionCall')} */ +module.exports = Function.prototype.call; + + +/***/ }), + +/***/ 8705: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var bind = __nccwpck_require__(7564); +var $TypeError = __nccwpck_require__(3314); + +var $call = __nccwpck_require__(8093); +var $actualApply = __nccwpck_require__(2639); + +/** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */ +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); +}; + + +/***/ }), + +/***/ 1330: +/***/ ((module) => { + + + +/** @type {import('./reflectApply')} */ +module.exports = typeof Reflect !== 'undefined' && Reflect && Reflect.apply; + + +/***/ }), + +/***/ 3844: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var setFunctionLength = __nccwpck_require__(9346); + +var $defineProperty = __nccwpck_require__(9094); + +var callBindBasic = __nccwpck_require__(8705); +var applyBind = __nccwpck_require__(6002); + +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; +} + + +/***/ }), + +/***/ 3105: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var GetIntrinsic = __nccwpck_require__(470); + +var callBindBasic = __nccwpck_require__(8705); + +/** @type {(thisArg: string, searchString: string, position?: number) => number} */ +var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]); + +/** @type {import('.')} */ +module.exports = function callBoundIntrinsic(name, allowMissing) { + /* eslint no-extra-parens: 0 */ + + var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing)); + if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) { + return callBindBasic(/** @type {const} */ ([intrinsic])); + } + return intrinsic; +}; + + +/***/ }), + +/***/ 5315: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const { EventEmitter } = __nccwpck_require__(4434); +const fs = __nccwpck_require__(9896); +const sysPath = __nccwpck_require__(6928); +const { promisify } = __nccwpck_require__(9023); +const readdirp = __nccwpck_require__(7525); +const anymatch = (__nccwpck_require__(2739)["default"]); +const globParent = __nccwpck_require__(8505); +const isGlob = __nccwpck_require__(1925); +const braces = __nccwpck_require__(748); +const normalizePath = __nccwpck_require__(6133); + +const NodeFsHandler = __nccwpck_require__(3897); +const FsEventsHandler = __nccwpck_require__(8748); +const { + EV_ALL, + EV_READY, + EV_ADD, + EV_CHANGE, + EV_UNLINK, + EV_ADD_DIR, + EV_UNLINK_DIR, + EV_RAW, + EV_ERROR, + + STR_CLOSE, + STR_END, + + BACK_SLASH_RE, + DOUBLE_SLASH_RE, + SLASH_OR_BACK_SLASH_RE, + DOT_RE, + REPLACER_RE, + + SLASH, + SLASH_SLASH, + BRACE_START, + BANG, + ONE_DOT, + TWO_DOTS, + GLOBSTAR, + SLASH_GLOBSTAR, + ANYMATCH_OPTS, + STRING_TYPE, + FUNCTION_TYPE, + EMPTY_STR, + EMPTY_FN, + + isWindows, + isMacos, + isIBMi +} = __nccwpck_require__(6169); + +const stat = promisify(fs.stat); +const readdir = promisify(fs.readdir); + +/** + * @typedef {String} Path + * @typedef {'all'|'add'|'addDir'|'change'|'unlink'|'unlinkDir'|'raw'|'error'|'ready'} EventName + * @typedef {'readdir'|'watch'|'add'|'remove'|'change'} ThrottleType + */ + +/** + * + * @typedef {Object} WatchHelpers + * @property {Boolean} followSymlinks + * @property {'stat'|'lstat'} statMethod + * @property {Path} path + * @property {Path} watchPath + * @property {Function} entryPath + * @property {Boolean} hasGlob + * @property {Object} globFilter + * @property {Function} filterPath + * @property {Function} filterDir + */ + +const arrify = (value = []) => Array.isArray(value) ? value : [value]; +const flatten = (list, result = []) => { + list.forEach(item => { + if (Array.isArray(item)) { + flatten(item, result); + } else { + result.push(item); + } + }); + return result; +}; + +const unifyPaths = (paths_) => { + /** + * @type {Array} + */ + const paths = flatten(arrify(paths_)); + if (!paths.every(p => typeof p === STRING_TYPE)) { + throw new TypeError(`Non-string provided as watch path: ${paths}`); + } + return paths.map(normalizePathToUnix); +}; + +// If SLASH_SLASH occurs at the beginning of path, it is not replaced +// because "//StoragePC/DrivePool/Movies" is a valid network path +const toUnix = (string) => { + let str = string.replace(BACK_SLASH_RE, SLASH); + let prepend = false; + if (str.startsWith(SLASH_SLASH)) { + prepend = true; + } + while (str.match(DOUBLE_SLASH_RE)) { + str = str.replace(DOUBLE_SLASH_RE, SLASH); + } + if (prepend) { + str = SLASH + str; + } + return str; +}; + +// Our version of upath.normalize +// TODO: this is not equal to path-normalize module - investigate why +const normalizePathToUnix = (path) => toUnix(sysPath.normalize(toUnix(path))); + +const normalizeIgnored = (cwd = EMPTY_STR) => (path) => { + if (typeof path !== STRING_TYPE) return path; + return normalizePathToUnix(sysPath.isAbsolute(path) ? path : sysPath.join(cwd, path)); +}; + +const getAbsolutePath = (path, cwd) => { + if (sysPath.isAbsolute(path)) { + return path; + } + if (path.startsWith(BANG)) { + return BANG + sysPath.join(cwd, path.slice(1)); + } + return sysPath.join(cwd, path); +}; + +const undef = (opts, key) => opts[key] === undefined; + +/** + * Directory entry. + * @property {Path} path + * @property {Set} items + */ +class DirEntry { + /** + * @param {Path} dir + * @param {Function} removeWatcher + */ + constructor(dir, removeWatcher) { + this.path = dir; + this._removeWatcher = removeWatcher; + /** @type {Set} */ + this.items = new Set(); + } + + add(item) { + const {items} = this; + if (!items) return; + if (item !== ONE_DOT && item !== TWO_DOTS) items.add(item); + } + + async remove(item) { + const {items} = this; + if (!items) return; + items.delete(item); + if (items.size > 0) return; + + const dir = this.path; + try { + await readdir(dir); + } catch (err) { + if (this._removeWatcher) { + this._removeWatcher(sysPath.dirname(dir), sysPath.basename(dir)); + } + } + } + + has(item) { + const {items} = this; + if (!items) return; + return items.has(item); + } + + /** + * @returns {Array} + */ + getChildren() { + const {items} = this; + if (!items) return; + return [...items.values()]; + } + + dispose() { + this.items.clear(); + delete this.path; + delete this._removeWatcher; + delete this.items; + Object.freeze(this); + } +} + +const STAT_METHOD_F = 'stat'; +const STAT_METHOD_L = 'lstat'; +class WatchHelper { + constructor(path, watchPath, follow, fsw) { + this.fsw = fsw; + this.path = path = path.replace(REPLACER_RE, EMPTY_STR); + this.watchPath = watchPath; + this.fullWatchPath = sysPath.resolve(watchPath); + this.hasGlob = watchPath !== path; + /** @type {object|boolean} */ + if (path === EMPTY_STR) this.hasGlob = false; + this.globSymlink = this.hasGlob && follow ? undefined : false; + this.globFilter = this.hasGlob ? anymatch(path, undefined, ANYMATCH_OPTS) : false; + this.dirParts = this.getDirParts(path); + this.dirParts.forEach((parts) => { + if (parts.length > 1) parts.pop(); + }); + this.followSymlinks = follow; + this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L; + } + + checkGlobSymlink(entry) { + // only need to resolve once + // first entry should always have entry.parentDir === EMPTY_STR + if (this.globSymlink === undefined) { + this.globSymlink = entry.fullParentDir === this.fullWatchPath ? + false : {realPath: entry.fullParentDir, linkPath: this.fullWatchPath}; + } + + if (this.globSymlink) { + return entry.fullPath.replace(this.globSymlink.realPath, this.globSymlink.linkPath); + } + + return entry.fullPath; + } + + entryPath(entry) { + return sysPath.join(this.watchPath, + sysPath.relative(this.watchPath, this.checkGlobSymlink(entry)) + ); + } + + filterPath(entry) { + const {stats} = entry; + if (stats && stats.isSymbolicLink()) return this.filterDir(entry); + const resolvedPath = this.entryPath(entry); + const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? + this.globFilter(resolvedPath) : true; + return matchesGlob && + this.fsw._isntIgnored(resolvedPath, stats) && + this.fsw._hasReadPermissions(stats); + } + + getDirParts(path) { + if (!this.hasGlob) return []; + const parts = []; + const expandedPath = path.includes(BRACE_START) ? braces.expand(path) : [path]; + expandedPath.forEach((path) => { + parts.push(sysPath.relative(this.watchPath, path).split(SLASH_OR_BACK_SLASH_RE)); + }); + return parts; + } + + filterDir(entry) { + if (this.hasGlob) { + const entryParts = this.getDirParts(this.checkGlobSymlink(entry)); + let globstar = false; + this.unmatchedGlob = !this.dirParts.some((parts) => { + return parts.every((part, i) => { + if (part === GLOBSTAR) globstar = true; + return globstar || !entryParts[0][i] || anymatch(part, entryParts[0][i], ANYMATCH_OPTS); + }); + }); + } + return !this.unmatchedGlob && this.fsw._isntIgnored(this.entryPath(entry), entry.stats); + } +} + +/** + * Watches files & directories for changes. Emitted events: + * `add`, `addDir`, `change`, `unlink`, `unlinkDir`, `all`, `error` + * + * new FSWatcher() + * .add(directories) + * .on('add', path => log('File', path, 'was added')) + */ +class FSWatcher extends EventEmitter { +// Not indenting methods for history sake; for now. +constructor(_opts) { + super(); + + const opts = {}; + if (_opts) Object.assign(opts, _opts); // for frozen objects + + /** @type {Map} */ + this._watched = new Map(); + /** @type {Map} */ + this._closers = new Map(); + /** @type {Set} */ + this._ignoredPaths = new Set(); + + /** @type {Map} */ + this._throttled = new Map(); + + /** @type {Map} */ + this._symlinkPaths = new Map(); + + this._streams = new Set(); + this.closed = false; + + // Set up default options. + if (undef(opts, 'persistent')) opts.persistent = true; + if (undef(opts, 'ignoreInitial')) opts.ignoreInitial = false; + if (undef(opts, 'ignorePermissionErrors')) opts.ignorePermissionErrors = false; + if (undef(opts, 'interval')) opts.interval = 100; + if (undef(opts, 'binaryInterval')) opts.binaryInterval = 300; + if (undef(opts, 'disableGlobbing')) opts.disableGlobbing = false; + opts.enableBinaryInterval = opts.binaryInterval !== opts.interval; + + // Enable fsevents on OS X when polling isn't explicitly enabled. + if (undef(opts, 'useFsEvents')) opts.useFsEvents = !opts.usePolling; + + // If we can't use fsevents, ensure the options reflect it's disabled. + const canUseFsEvents = FsEventsHandler.canUse(); + if (!canUseFsEvents) opts.useFsEvents = false; + + // Use polling on Mac if not using fsevents. + // Other platforms use non-polling fs_watch. + if (undef(opts, 'usePolling') && !opts.useFsEvents) { + opts.usePolling = isMacos; + } + + // Always default to polling on IBM i because fs.watch() is not available on IBM i. + if(isIBMi) { + opts.usePolling = true; + } + + // Global override (useful for end-developers that need to force polling for all + // instances of chokidar, regardless of usage/dependency depth) + const envPoll = process.env.CHOKIDAR_USEPOLLING; + if (envPoll !== undefined) { + const envLower = envPoll.toLowerCase(); + + if (envLower === 'false' || envLower === '0') { + opts.usePolling = false; + } else if (envLower === 'true' || envLower === '1') { + opts.usePolling = true; + } else { + opts.usePolling = !!envLower; + } + } + const envInterval = process.env.CHOKIDAR_INTERVAL; + if (envInterval) { + opts.interval = Number.parseInt(envInterval, 10); + } + + // Editor atomic write normalization enabled by default with fs.watch + if (undef(opts, 'atomic')) opts.atomic = !opts.usePolling && !opts.useFsEvents; + if (opts.atomic) this._pendingUnlinks = new Map(); + + if (undef(opts, 'followSymlinks')) opts.followSymlinks = true; + + if (undef(opts, 'awaitWriteFinish')) opts.awaitWriteFinish = false; + if (opts.awaitWriteFinish === true) opts.awaitWriteFinish = {}; + const awf = opts.awaitWriteFinish; + if (awf) { + if (!awf.stabilityThreshold) awf.stabilityThreshold = 2000; + if (!awf.pollInterval) awf.pollInterval = 100; + this._pendingWrites = new Map(); + } + if (opts.ignored) opts.ignored = arrify(opts.ignored); + + let readyCalls = 0; + this._emitReady = () => { + readyCalls++; + if (readyCalls >= this._readyCount) { + this._emitReady = EMPTY_FN; + this._readyEmitted = true; + // use process.nextTick to allow time for listener to be bound + process.nextTick(() => this.emit(EV_READY)); + } + }; + this._emitRaw = (...args) => this.emit(EV_RAW, ...args); + this._readyEmitted = false; + this.options = opts; + + // Initialize with proper watcher. + if (opts.useFsEvents) { + this._fsEventsHandler = new FsEventsHandler(this); + } else { + this._nodeFsHandler = new NodeFsHandler(this); + } + + // You’re frozen when your heart’s not open. + Object.freeze(opts); +} + +// Public methods + +/** + * Adds paths to be watched on an existing FSWatcher instance + * @param {Path|Array} paths_ + * @param {String=} _origAdd private; for handling non-existent paths to be watched + * @param {Boolean=} _internal private; indicates a non-user add + * @returns {FSWatcher} for chaining + */ +add(paths_, _origAdd, _internal) { + const {cwd, disableGlobbing} = this.options; + this.closed = false; + let paths = unifyPaths(paths_); + if (cwd) { + paths = paths.map((path) => { + const absPath = getAbsolutePath(path, cwd); + + // Check `path` instead of `absPath` because the cwd portion can't be a glob + if (disableGlobbing || !isGlob(path)) { + return absPath; + } + return normalizePath(absPath); + }); + } + + // set aside negated glob strings + paths = paths.filter((path) => { + if (path.startsWith(BANG)) { + this._ignoredPaths.add(path.slice(1)); + return false; + } + + // if a path is being added that was previously ignored, stop ignoring it + this._ignoredPaths.delete(path); + this._ignoredPaths.delete(path + SLASH_GLOBSTAR); + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + + return true; + }); + + if (this.options.useFsEvents && this._fsEventsHandler) { + if (!this._readyCount) this._readyCount = paths.length; + if (this.options.persistent) this._readyCount += paths.length; + paths.forEach((path) => this._fsEventsHandler._addToFsEvents(path)); + } else { + if (!this._readyCount) this._readyCount = 0; + this._readyCount += paths.length; + Promise.all( + paths.map(async path => { + const res = await this._nodeFsHandler._addToNodeFs(path, !_internal, 0, 0, _origAdd); + if (res) this._emitReady(); + return res; + }) + ).then(results => { + if (this.closed) return; + results.filter(item => item).forEach(item => { + this.add(sysPath.dirname(item), sysPath.basename(_origAdd || item)); + }); + }); + } + + return this; +} + +/** + * Close watchers or start ignoring events from specified paths. + * @param {Path|Array} paths_ - string or array of strings, file/directory paths and/or globs + * @returns {FSWatcher} for chaining +*/ +unwatch(paths_) { + if (this.closed) return this; + const paths = unifyPaths(paths_); + const {cwd} = this.options; + + paths.forEach((path) => { + // convert to absolute path unless relative path already matches + if (!sysPath.isAbsolute(path) && !this._closers.has(path)) { + if (cwd) path = sysPath.join(cwd, path); + path = sysPath.resolve(path); + } + + this._closePath(path); + + this._ignoredPaths.add(path); + if (this._watched.has(path)) { + this._ignoredPaths.add(path + SLASH_GLOBSTAR); + } + + // reset the cached userIgnored anymatch fn + // to make ignoredPaths changes effective + this._userIgnored = undefined; + }); + + return this; +} + +/** + * Close watchers and remove all listeners from watched paths. + * @returns {Promise}. +*/ +close() { + if (this.closed) return this._closePromise; + this.closed = true; + + // Memory management. + this.removeAllListeners(); + const closers = []; + this._closers.forEach(closerList => closerList.forEach(closer => { + const promise = closer(); + if (promise instanceof Promise) closers.push(promise); + })); + this._streams.forEach(stream => stream.destroy()); + this._userIgnored = undefined; + this._readyCount = 0; + this._readyEmitted = false; + this._watched.forEach(dirent => dirent.dispose()); + ['closers', 'watched', 'streams', 'symlinkPaths', 'throttled'].forEach(key => { + this[`_${key}`].clear(); + }); + + this._closePromise = closers.length ? Promise.all(closers).then(() => undefined) : Promise.resolve(); + return this._closePromise; +} + +/** + * Expose list of watched paths + * @returns {Object} for chaining +*/ +getWatched() { + const watchList = {}; + this._watched.forEach((entry, dir) => { + const key = this.options.cwd ? sysPath.relative(this.options.cwd, dir) : dir; + watchList[key || ONE_DOT] = entry.getChildren().sort(); + }); + return watchList; +} + +emitWithAll(event, args) { + this.emit(...args); + if (event !== EV_ERROR) this.emit(EV_ALL, ...args); +} + +// Common helpers +// -------------- + +/** + * Normalize and emit events. + * Calling _emit DOES NOT MEAN emit() would be called! + * @param {EventName} event Type of event + * @param {Path} path File or directory path + * @param {*=} val1 arguments to be passed with event + * @param {*=} val2 + * @param {*=} val3 + * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ +async _emit(event, path, val1, val2, val3) { + if (this.closed) return; + + const opts = this.options; + if (isWindows) path = sysPath.normalize(path); + if (opts.cwd) path = sysPath.relative(opts.cwd, path); + /** @type Array */ + const args = [event, path]; + if (val3 !== undefined) args.push(val1, val2, val3); + else if (val2 !== undefined) args.push(val1, val2); + else if (val1 !== undefined) args.push(val1); + + const awf = opts.awaitWriteFinish; + let pw; + if (awf && (pw = this._pendingWrites.get(path))) { + pw.lastChange = new Date(); + return this; + } + + if (opts.atomic) { + if (event === EV_UNLINK) { + this._pendingUnlinks.set(path, args); + setTimeout(() => { + this._pendingUnlinks.forEach((entry, path) => { + this.emit(...entry); + this.emit(EV_ALL, ...entry); + this._pendingUnlinks.delete(path); + }); + }, typeof opts.atomic === 'number' ? opts.atomic : 100); + return this; + } + if (event === EV_ADD && this._pendingUnlinks.has(path)) { + event = args[0] = EV_CHANGE; + this._pendingUnlinks.delete(path); + } + } + + if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) { + const awfEmit = (err, stats) => { + if (err) { + event = args[0] = EV_ERROR; + args[1] = err; + this.emitWithAll(event, args); + } else if (stats) { + // if stats doesn't exist the file must have been deleted + if (args.length > 2) { + args[2] = stats; + } else { + args.push(stats); + } + this.emitWithAll(event, args); + } + }; + + this._awaitWriteFinish(path, awf.stabilityThreshold, event, awfEmit); + return this; + } + + if (event === EV_CHANGE) { + const isThrottled = !this._throttle(EV_CHANGE, path, 50); + if (isThrottled) return this; + } + + if (opts.alwaysStat && val1 === undefined && + (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE) + ) { + const fullPath = opts.cwd ? sysPath.join(opts.cwd, path) : path; + let stats; + try { + stats = await stat(fullPath); + } catch (err) {} + // Suppress event when fs_stat fails, to avoid sending undefined 'stat' + if (!stats || this.closed) return; + args.push(stats); + } + this.emitWithAll(event, args); + + return this; +} + +/** + * Common handler for errors + * @param {Error} error + * @returns {Error|Boolean} The error if defined, otherwise the value of the FSWatcher instance's `closed` flag + */ +_handleError(error) { + const code = error && error.code; + if (error && code !== 'ENOENT' && code !== 'ENOTDIR' && + (!this.options.ignorePermissionErrors || (code !== 'EPERM' && code !== 'EACCES')) + ) { + this.emit(EV_ERROR, error); + } + return error || this.closed; +} + +/** + * Helper utility for throttling + * @param {ThrottleType} actionType type being throttled + * @param {Path} path being acted upon + * @param {Number} timeout duration of time to suppress duplicate actions + * @returns {Object|false} tracking object or false if action should be suppressed + */ +_throttle(actionType, path, timeout) { + if (!this._throttled.has(actionType)) { + this._throttled.set(actionType, new Map()); + } + + /** @type {Map} */ + const action = this._throttled.get(actionType); + /** @type {Object} */ + const actionPath = action.get(path); + + if (actionPath) { + actionPath.count++; + return false; + } + + let timeoutObject; + const clear = () => { + const item = action.get(path); + const count = item ? item.count : 0; + action.delete(path); + clearTimeout(timeoutObject); + if (item) clearTimeout(item.timeoutObject); + return count; + }; + timeoutObject = setTimeout(clear, timeout); + const thr = {timeoutObject, clear, count: 0}; + action.set(path, thr); + return thr; +} + +_incrReadyCount() { + return this._readyCount++; +} + +/** + * Awaits write operation to finish. + * Polls a newly created file for size variations. When files size does not change for 'threshold' milliseconds calls callback. + * @param {Path} path being acted upon + * @param {Number} threshold Time in milliseconds a file size must be fixed before acknowledging write OP is finished + * @param {EventName} event + * @param {Function} awfEmit Callback to be called when ready for event to be emitted. + */ +_awaitWriteFinish(path, threshold, event, awfEmit) { + let timeoutHandler; + + let fullPath = path; + if (this.options.cwd && !sysPath.isAbsolute(path)) { + fullPath = sysPath.join(this.options.cwd, path); + } + + const now = new Date(); + + const awaitWriteFinish = (prevStat) => { + fs.stat(fullPath, (err, curStat) => { + if (err || !this._pendingWrites.has(path)) { + if (err && err.code !== 'ENOENT') awfEmit(err); + return; + } + + const now = Number(new Date()); + + if (prevStat && curStat.size !== prevStat.size) { + this._pendingWrites.get(path).lastChange = now; + } + const pw = this._pendingWrites.get(path); + const df = now - pw.lastChange; + + if (df >= threshold) { + this._pendingWrites.delete(path); + awfEmit(undefined, curStat); + } else { + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval, + curStat + ); + } + }); + }; + + if (!this._pendingWrites.has(path)) { + this._pendingWrites.set(path, { + lastChange: now, + cancelWait: () => { + this._pendingWrites.delete(path); + clearTimeout(timeoutHandler); + return event; + } + }); + timeoutHandler = setTimeout( + awaitWriteFinish, + this.options.awaitWriteFinish.pollInterval + ); + } +} + +_getGlobIgnored() { + return [...this._ignoredPaths.values()]; +} + +/** + * Determines whether user has asked to ignore this path. + * @param {Path} path filepath or dir + * @param {fs.Stats=} stats result of fs.stat + * @returns {Boolean} + */ +_isIgnored(path, stats) { + if (this.options.atomic && DOT_RE.test(path)) return true; + if (!this._userIgnored) { + const {cwd} = this.options; + const ign = this.options.ignored; + + const ignored = ign && ign.map(normalizeIgnored(cwd)); + const paths = arrify(ignored) + .filter((path) => typeof path === STRING_TYPE && !isGlob(path)) + .map((path) => path + SLASH_GLOBSTAR); + const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths); + this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS); + } + + return this._userIgnored([path, stats]); +} + +_isntIgnored(path, stat) { + return !this._isIgnored(path, stat); +} + +/** + * Provides a set of common helpers and properties relating to symlink and glob handling. + * @param {Path} path file, directory, or glob pattern being watched + * @param {Number=} depth at any depth > 0, this isn't a glob + * @returns {WatchHelper} object containing helpers for this path + */ +_getWatchHelpers(path, depth) { + const watchPath = depth || this.options.disableGlobbing || !isGlob(path) ? path : globParent(path); + const follow = this.options.followSymlinks; + + return new WatchHelper(path, watchPath, follow, this); +} + +// Directory helpers +// ----------------- + +/** + * Provides directory tracking objects + * @param {String} directory path of the directory + * @returns {DirEntry} the directory's tracking object + */ +_getWatchedDir(directory) { + if (!this._boundRemove) this._boundRemove = this._remove.bind(this); + const dir = sysPath.resolve(directory); + if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove)); + return this._watched.get(dir); +} + +// File helpers +// ------------ + +/** + * Check for read permissions. + * Based on this answer on SO: https://stackoverflow.com/a/11781404/1358405 + * @param {fs.Stats} stats - object, result of fs_stat + * @returns {Boolean} indicates whether the file can be read +*/ +_hasReadPermissions(stats) { + if (this.options.ignorePermissionErrors) return true; + + // stats.mode may be bigint + const md = stats && Number.parseInt(stats.mode, 10); + const st = md & 0o777; + const it = Number.parseInt(st.toString(8)[0], 10); + return Boolean(4 & it); +} + +/** + * Handles emitting unlink events for + * files and directories, and via recursion, for + * files and directories within directories that are unlinked + * @param {String} directory within which the following item is located + * @param {String} item base path of item/directory + * @returns {void} +*/ +_remove(directory, item, isDirectory) { + // if what is being deleted is a directory, get that directory's paths + // for recursive deleting and cleaning of watched object + // if it is not a directory, nestedDirectoryChildren will be empty array + const path = sysPath.join(directory, item); + const fullPath = sysPath.resolve(path); + isDirectory = isDirectory != null + ? isDirectory + : this._watched.has(path) || this._watched.has(fullPath); + + // prevent duplicate handling in case of arriving here nearly simultaneously + // via multiple paths (such as _handleFile and _handleDir) + if (!this._throttle('remove', path, 100)) return; + + // if the only watched file is removed, watch for its return + if (!isDirectory && !this.options.useFsEvents && this._watched.size === 1) { + this.add(directory, item, true); + } + + // This will create a new entry in the watched object in either case + // so we got to do the directory check beforehand + const wp = this._getWatchedDir(path); + const nestedDirectoryChildren = wp.getChildren(); + + // Recursively remove children directories / files. + nestedDirectoryChildren.forEach(nested => this._remove(path, nested)); + + // Check if item was on the watched list and remove it + const parent = this._getWatchedDir(directory); + const wasTracked = parent.has(item); + parent.remove(item); + + // Fixes issue #1042 -> Relative paths were detected and added as symlinks + // (https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L612), + // but never removed from the map in case the path was deleted. + // This leads to an incorrect state if the path was recreated: + // https://github.com/paulmillr/chokidar/blob/e1753ddbc9571bdc33b4a4af172d52cb6e611c10/lib/nodefs-handler.js#L553 + if (this._symlinkPaths.has(fullPath)) { + this._symlinkPaths.delete(fullPath); + } + + // If we wait for this file to be fully written, cancel the wait. + let relPath = path; + if (this.options.cwd) relPath = sysPath.relative(this.options.cwd, path); + if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) { + const event = this._pendingWrites.get(relPath).cancelWait(); + if (event === EV_ADD) return; + } + + // The Entry will either be a directory that just got removed + // or a bogus entry to a file, in either case we have to remove it + this._watched.delete(path); + this._watched.delete(fullPath); + const eventName = isDirectory ? EV_UNLINK_DIR : EV_UNLINK; + if (wasTracked && !this._isIgnored(path)) this._emit(eventName, path); + + // Avoid conflicts if we later create another file with the same name + if (!this.options.useFsEvents) { + this._closePath(path); + } +} + +/** + * Closes all watchers for a path + * @param {Path} path + */ +_closePath(path) { + this._closeFile(path) + const dir = sysPath.dirname(path); + this._getWatchedDir(dir).remove(sysPath.basename(path)); +} + +/** + * Closes only file-specific watchers + * @param {Path} path + */ +_closeFile(path) { + const closers = this._closers.get(path); + if (!closers) return; + closers.forEach(closer => closer()); + this._closers.delete(path); +} + +/** + * + * @param {Path} path + * @param {Function} closer + */ +_addPathCloser(path, closer) { + if (!closer) return; + let list = this._closers.get(path); + if (!list) { + list = []; + this._closers.set(path, list); + } + list.push(closer); +} + +_readdirp(root, opts) { + if (this.closed) return; + const options = {type: EV_ALL, alwaysStat: true, lstat: true, ...opts}; + let stream = readdirp(root, options); + this._streams.add(stream); + stream.once(STR_CLOSE, () => { + stream = undefined; + }); + stream.once(STR_END, () => { + if (stream) { + this._streams.delete(stream); + stream = undefined; + } + }); + return stream; +} + +} + +// Export FSWatcher class +exports.FSWatcher = FSWatcher; + +/** + * Instantiates watcher with paths to be tracked. + * @param {String|Array} paths file/directory paths and/or globs + * @param {Object=} options chokidar opts + * @returns an instance of FSWatcher for chaining. + */ +const watch = (paths, options) => { + const watcher = new FSWatcher(options); + watcher.add(paths); + return watcher; +}; + +exports.watch = watch; + + +/***/ }), + +/***/ 6169: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const {sep} = __nccwpck_require__(6928); +const {platform} = process; +const os = __nccwpck_require__(857); + +exports.EV_ALL = 'all'; +exports.EV_READY = 'ready'; +exports.EV_ADD = 'add'; +exports.EV_CHANGE = 'change'; +exports.EV_ADD_DIR = 'addDir'; +exports.EV_UNLINK = 'unlink'; +exports.EV_UNLINK_DIR = 'unlinkDir'; +exports.EV_RAW = 'raw'; +exports.EV_ERROR = 'error'; + +exports.STR_DATA = 'data'; +exports.STR_END = 'end'; +exports.STR_CLOSE = 'close'; + +exports.FSEVENT_CREATED = 'created'; +exports.FSEVENT_MODIFIED = 'modified'; +exports.FSEVENT_DELETED = 'deleted'; +exports.FSEVENT_MOVED = 'moved'; +exports.FSEVENT_CLONED = 'cloned'; +exports.FSEVENT_UNKNOWN = 'unknown'; +exports.FSEVENT_FLAG_MUST_SCAN_SUBDIRS = 1; +exports.FSEVENT_TYPE_FILE = 'file'; +exports.FSEVENT_TYPE_DIRECTORY = 'directory'; +exports.FSEVENT_TYPE_SYMLINK = 'symlink'; + +exports.KEY_LISTENERS = 'listeners'; +exports.KEY_ERR = 'errHandlers'; +exports.KEY_RAW = 'rawEmitters'; +exports.HANDLER_KEYS = [exports.KEY_LISTENERS, exports.KEY_ERR, exports.KEY_RAW]; + +exports.DOT_SLASH = `.${sep}`; + +exports.BACK_SLASH_RE = /\\/g; +exports.DOUBLE_SLASH_RE = /\/\//; +exports.SLASH_OR_BACK_SLASH_RE = /[/\\]/; +exports.DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/; +exports.REPLACER_RE = /^\.[/\\]/; + +exports.SLASH = '/'; +exports.SLASH_SLASH = '//'; +exports.BRACE_START = '{'; +exports.BANG = '!'; +exports.ONE_DOT = '.'; +exports.TWO_DOTS = '..'; +exports.STAR = '*'; +exports.GLOBSTAR = '**'; +exports.ROOT_GLOBSTAR = '/**/*'; +exports.SLASH_GLOBSTAR = '/**'; +exports.DIR_SUFFIX = 'Dir'; +exports.ANYMATCH_OPTS = {dot: true}; +exports.STRING_TYPE = 'string'; +exports.FUNCTION_TYPE = 'function'; +exports.EMPTY_STR = ''; +exports.EMPTY_FN = () => {}; +exports.IDENTITY_FN = val => val; + +exports.isWindows = platform === 'win32'; +exports.isMacos = platform === 'darwin'; +exports.isLinux = platform === 'linux'; +exports.isIBMi = os.type() === 'OS400'; + + +/***/ }), + +/***/ 8748: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const fs = __nccwpck_require__(9896); +const sysPath = __nccwpck_require__(6928); +const { promisify } = __nccwpck_require__(9023); + +let fsevents; +try { + fsevents = __nccwpck_require__(8383); +} catch (error) { + if (process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR) console.error(error); +} + +if (fsevents) { + // TODO: real check + const mtch = process.version.match(/v(\d+)\.(\d+)/); + if (mtch && mtch[1] && mtch[2]) { + const maj = Number.parseInt(mtch[1], 10); + const min = Number.parseInt(mtch[2], 10); + if (maj === 8 && min < 16) { + fsevents = undefined; + } + } +} + +const { + EV_ADD, + EV_CHANGE, + EV_ADD_DIR, + EV_UNLINK, + EV_ERROR, + STR_DATA, + STR_END, + FSEVENT_CREATED, + FSEVENT_MODIFIED, + FSEVENT_DELETED, + FSEVENT_MOVED, + // FSEVENT_CLONED, + FSEVENT_UNKNOWN, + FSEVENT_FLAG_MUST_SCAN_SUBDIRS, + FSEVENT_TYPE_FILE, + FSEVENT_TYPE_DIRECTORY, + FSEVENT_TYPE_SYMLINK, + + ROOT_GLOBSTAR, + DIR_SUFFIX, + DOT_SLASH, + FUNCTION_TYPE, + EMPTY_FN, + IDENTITY_FN +} = __nccwpck_require__(6169); + +const Depth = (value) => isNaN(value) ? {} : {depth: value}; + +const stat = promisify(fs.stat); +const lstat = promisify(fs.lstat); +const realpath = promisify(fs.realpath); + +const statMethods = { stat, lstat }; + +/** + * @typedef {String} Path + */ + +/** + * @typedef {Object} FsEventsWatchContainer + * @property {Set} listeners + * @property {Function} rawEmitter + * @property {{stop: Function}} watcher + */ + +// fsevents instance helper functions +/** + * Object to hold per-process fsevents instances (may be shared across chokidar FSWatcher instances) + * @type {Map} + */ +const FSEventsWatchers = new Map(); + +// Threshold of duplicate path prefixes at which to start +// consolidating going forward +const consolidateThreshhold = 10; + +const wrongEventFlags = new Set([ + 69888, 70400, 71424, 72704, 73472, 131328, 131840, 262912 +]); + +/** + * Instantiates the fsevents interface + * @param {Path} path path to be watched + * @param {Function} callback called when fsevents is bound and ready + * @returns {{stop: Function}} new fsevents instance + */ +const createFSEventsInstance = (path, callback) => { + const stop = fsevents.watch(path, callback); + return {stop}; +}; + +/** + * Instantiates the fsevents interface or binds listeners to an existing one covering + * the same file tree. + * @param {Path} path - to be watched + * @param {Path} realPath - real path for symlinks + * @param {Function} listener - called when fsevents emits events + * @param {Function} rawEmitter - passes data to listeners of the 'raw' event + * @returns {Function} closer + */ +function setFSEventsListener(path, realPath, listener, rawEmitter) { + let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath; + + const parentPath = sysPath.dirname(watchPath); + let cont = FSEventsWatchers.get(watchPath); + + // If we've accumulated a substantial number of paths that + // could have been consolidated by watching one directory + // above the current one, create a watcher on the parent + // path instead, so that we do consolidate going forward. + if (couldConsolidate(parentPath)) { + watchPath = parentPath; + } + + const resolvedPath = sysPath.resolve(path); + const hasSymlink = resolvedPath !== realPath; + + const filteredListener = (fullPath, flags, info) => { + if (hasSymlink) fullPath = fullPath.replace(realPath, resolvedPath); + if ( + fullPath === resolvedPath || + !fullPath.indexOf(resolvedPath + sysPath.sep) + ) listener(fullPath, flags, info); + }; + + // check if there is already a watcher on a parent path + // modifies `watchPath` to the parent path when it finds a match + let watchedParent = false; + for (const watchedPath of FSEventsWatchers.keys()) { + if (realPath.indexOf(sysPath.resolve(watchedPath) + sysPath.sep) === 0) { + watchPath = watchedPath; + cont = FSEventsWatchers.get(watchPath); + watchedParent = true; + break; + } + } + + if (cont || watchedParent) { + cont.listeners.add(filteredListener); + } else { + cont = { + listeners: new Set([filteredListener]), + rawEmitter, + watcher: createFSEventsInstance(watchPath, (fullPath, flags) => { + if (!cont.listeners.size) return; + if (flags & FSEVENT_FLAG_MUST_SCAN_SUBDIRS) return; + const info = fsevents.getInfo(fullPath, flags); + cont.listeners.forEach(list => { + list(fullPath, flags, info); + }); + + cont.rawEmitter(info.event, fullPath, info); + }) + }; + FSEventsWatchers.set(watchPath, cont); + } + + // removes this instance's listeners and closes the underlying fsevents + // instance if there are no more listeners left + return () => { + const lst = cont.listeners; + + lst.delete(filteredListener); + if (!lst.size) { + FSEventsWatchers.delete(watchPath); + if (cont.watcher) return cont.watcher.stop().then(() => { + cont.rawEmitter = cont.watcher = undefined; + Object.freeze(cont); + }); + } + }; +} + +// Decide whether or not we should start a new higher-level +// parent watcher +const couldConsolidate = (path) => { + let count = 0; + for (const watchPath of FSEventsWatchers.keys()) { + if (watchPath.indexOf(path) === 0) { + count++; + if (count >= consolidateThreshhold) { + return true; + } + } + } + + return false; +}; + +// returns boolean indicating whether fsevents can be used +const canUse = () => fsevents && FSEventsWatchers.size < 128; + +// determines subdirectory traversal levels from root to path +const calcDepth = (path, root) => { + let i = 0; + while (!path.indexOf(root) && (path = sysPath.dirname(path)) !== root) i++; + return i; +}; + +// returns boolean indicating whether the fsevents' event info has the same type +// as the one returned by fs.stat +const sameTypes = (info, stats) => ( + info.type === FSEVENT_TYPE_DIRECTORY && stats.isDirectory() || + info.type === FSEVENT_TYPE_SYMLINK && stats.isSymbolicLink() || + info.type === FSEVENT_TYPE_FILE && stats.isFile() +) + +/** + * @mixin + */ +class FsEventsHandler { + +/** + * @param {import('../index').FSWatcher} fsw + */ +constructor(fsw) { + this.fsw = fsw; +} +checkIgnored(path, stats) { + const ipaths = this.fsw._ignoredPaths; + if (this.fsw._isIgnored(path, stats)) { + ipaths.add(path); + if (stats && stats.isDirectory()) { + ipaths.add(path + ROOT_GLOBSTAR); + } + return true; + } + + ipaths.delete(path); + ipaths.delete(path + ROOT_GLOBSTAR); +} + +addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD; + this.handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts); +} + +async checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts) { + try { + const stats = await stat(path) + if (this.fsw.closed) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } catch (error) { + if (error.code === 'EACCES') { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } +} + +handleEvent(event, path, fullPath, realPath, parent, watchedDir, item, info, opts) { + if (this.fsw.closed || this.checkIgnored(path)) return; + + if (event === EV_UNLINK) { + const isDirectory = info.type === FSEVENT_TYPE_DIRECTORY + // suppress unlink events on never before seen files + if (isDirectory || watchedDir.has(item)) { + this.fsw._remove(parent, item, isDirectory); + } + } else { + if (event === EV_ADD) { + // track new directories + if (info.type === FSEVENT_TYPE_DIRECTORY) this.fsw._getWatchedDir(path); + + if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) { + // push symlinks back to the top of the stack to get handled + const curDepth = opts.depth === undefined ? + undefined : calcDepth(fullPath, realPath) + 1; + return this._addToFsEvents(path, false, true, curDepth); + } + + // track new paths + // (other than symlinks being followed, which will be tracked soon) + this.fsw._getWatchedDir(parent).add(item); + } + /** + * @type {'add'|'addDir'|'unlink'|'unlinkDir'} + */ + const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event; + this.fsw._emit(eventName, path); + if (eventName === EV_ADD_DIR) this._addToFsEvents(path, false, true); + } +} + +/** + * Handle symlinks encountered during directory scan + * @param {String} watchPath - file/dir path to be watched with fsevents + * @param {String} realPath - real path (in case of symlinks) + * @param {Function} transform - path transformer + * @param {Function} globFilter - path filter in case a glob pattern was provided + * @returns {Function} closer for the watcher instance +*/ +_watchWithFsEvents(watchPath, realPath, transform, globFilter) { + if (this.fsw.closed || this.fsw._isIgnored(watchPath)) return; + const opts = this.fsw.options; + const watchCallback = async (fullPath, flags, info) => { + if (this.fsw.closed) return; + if ( + opts.depth !== undefined && + calcDepth(fullPath, realPath) > opts.depth + ) return; + const path = transform(sysPath.join( + watchPath, sysPath.relative(watchPath, fullPath) + )); + if (globFilter && !globFilter(path)) return; + // ensure directories are tracked + const parent = sysPath.dirname(path); + const item = sysPath.basename(path); + const watchedDir = this.fsw._getWatchedDir( + info.type === FSEVENT_TYPE_DIRECTORY ? path : parent + ); + + // correct for wrong events emitted + if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) { + if (typeof opts.ignored === FUNCTION_TYPE) { + let stats; + try { + stats = await stat(path); + } catch (error) {} + if (this.fsw.closed) return; + if (this.checkIgnored(path, stats)) return; + if (sameTypes(info, stats)) { + this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } else { + this.handleEvent(EV_UNLINK, path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } else { + switch (info.event) { + case FSEVENT_CREATED: + case FSEVENT_MODIFIED: + return this.addOrChange(path, fullPath, realPath, parent, watchedDir, item, info, opts); + case FSEVENT_DELETED: + case FSEVENT_MOVED: + return this.checkExists(path, fullPath, realPath, parent, watchedDir, item, info, opts); + } + } + }; + + const closer = setFSEventsListener( + watchPath, + realPath, + watchCallback, + this.fsw._emitRaw + ); + + this.fsw._emitReady(); + return closer; +} + +/** + * Handle symlinks encountered during directory scan + * @param {String} linkPath path to symlink + * @param {String} fullPath absolute path to the symlink + * @param {Function} transform pre-existing path transformer + * @param {Number} curDepth level of subdirectories traversed to where symlink is + * @returns {Promise} + */ +async _handleFsEventsSymlink(linkPath, fullPath, transform, curDepth) { + // don't follow the same symlink more than once + if (this.fsw.closed || this.fsw._symlinkPaths.has(fullPath)) return; + + this.fsw._symlinkPaths.set(fullPath, true); + this.fsw._incrReadyCount(); + + try { + const linkTarget = await realpath(linkPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(linkTarget)) { + return this.fsw._emitReady(); + } + + this.fsw._incrReadyCount(); + + // add the linkTarget for watching with a wrapper for transform + // that causes emitted paths to incorporate the link's path + this._addToFsEvents(linkTarget || linkPath, (path) => { + let aliasedPath = linkPath; + if (linkTarget && linkTarget !== DOT_SLASH) { + aliasedPath = path.replace(linkTarget, linkPath); + } else if (path !== DOT_SLASH) { + aliasedPath = sysPath.join(linkPath, path); + } + return transform(aliasedPath); + }, false, curDepth); + } catch(error) { + if (this.fsw._handleError(error)) { + return this.fsw._emitReady(); + } + } +} + +/** + * + * @param {Path} newPath + * @param {fs.Stats} stats + */ +emitAdd(newPath, stats, processPath, opts, forceAdd) { + const pp = processPath(newPath); + const isDir = stats.isDirectory(); + const dirObj = this.fsw._getWatchedDir(sysPath.dirname(pp)); + const base = sysPath.basename(pp); + + // ensure empty dirs get tracked + if (isDir) this.fsw._getWatchedDir(pp); + if (dirObj.has(base)) return; + dirObj.add(base); + + if (!opts.ignoreInitial || forceAdd === true) { + this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats); + } +} + +initWatch(realPath, path, wh, processPath) { + if (this.fsw.closed) return; + const closer = this._watchWithFsEvents( + wh.watchPath, + sysPath.resolve(realPath || wh.watchPath), + processPath, + wh.globFilter + ); + this.fsw._addPathCloser(path, closer); +} + +/** + * Handle added path with fsevents + * @param {String} path file/dir path or glob pattern + * @param {Function|Boolean=} transform converts working path to what the user expects + * @param {Boolean=} forceAdd ensure add is emitted + * @param {Number=} priorDepth Level of subdirectories already traversed. + * @returns {Promise} + */ +async _addToFsEvents(path, transform, forceAdd, priorDepth) { + if (this.fsw.closed) { + return; + } + const opts = this.fsw.options; + const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN; + + const wh = this.fsw._getWatchHelpers(path); + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + throw null; + } + if (stats.isDirectory()) { + // emit addDir unless this is a glob parent + if (!wh.globFilter) this.emitAdd(processPath(path), stats, processPath, opts, forceAdd); + + // don't recurse further if it would exceed depth setting + if (priorDepth && priorDepth > opts.depth) return; + + // scan the contents of the dir + this.fsw._readdirp(wh.watchPath, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + ...Depth(opts.depth - (priorDepth || 0)) + }).on(STR_DATA, (entry) => { + // need to check filterPath on dirs b/c filterDir is less restrictive + if (this.fsw.closed) { + return; + } + if (entry.stats.isDirectory() && !wh.filterPath(entry)) return; + + const joinedPath = sysPath.join(wh.watchPath, entry.path); + const {fullPath} = entry; + + if (wh.followSymlinks && entry.stats.isSymbolicLink()) { + // preserve the current depth here since it can't be derived from + // real paths past the symlink + const curDepth = opts.depth === undefined ? + undefined : calcDepth(joinedPath, sysPath.resolve(wh.watchPath)) + 1; + + this._handleFsEventsSymlink(joinedPath, fullPath, processPath, curDepth); + } else { + this.emitAdd(joinedPath, entry.stats, processPath, opts, forceAdd); + } + }).on(EV_ERROR, EMPTY_FN).on(STR_END, () => { + this.fsw._emitReady(); + }); + } else { + this.emitAdd(wh.watchPath, stats, processPath, opts, forceAdd); + this.fsw._emitReady(); + } + } catch (error) { + if (!error || this.fsw._handleError(error)) { + // TODO: Strange thing: "should not choke on an ignored watch path" will be failed without 2 ready calls -__- + this.fsw._emitReady(); + this.fsw._emitReady(); + } + } + + if (opts.persistent && forceAdd !== true) { + if (typeof transform === FUNCTION_TYPE) { + // realpath has already been resolved + this.initWatch(undefined, path, wh, processPath); + } else { + let realPath; + try { + realPath = await realpath(wh.watchPath); + } catch (e) {} + this.initWatch(realPath, path, wh, processPath); + } + } +} + +} + +module.exports = FsEventsHandler; +module.exports.canUse = canUse; + + +/***/ }), + +/***/ 3897: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const fs = __nccwpck_require__(9896); +const sysPath = __nccwpck_require__(6928); +const { promisify } = __nccwpck_require__(9023); +const isBinaryPath = __nccwpck_require__(3950); +const { + isWindows, + isLinux, + EMPTY_FN, + EMPTY_STR, + KEY_LISTENERS, + KEY_ERR, + KEY_RAW, + HANDLER_KEYS, + EV_CHANGE, + EV_ADD, + EV_ADD_DIR, + EV_ERROR, + STR_DATA, + STR_END, + BRACE_START, + STAR +} = __nccwpck_require__(6169); + +const THROTTLE_MODE_WATCH = 'watch'; + +const open = promisify(fs.open); +const stat = promisify(fs.stat); +const lstat = promisify(fs.lstat); +const close = promisify(fs.close); +const fsrealpath = promisify(fs.realpath); + +const statMethods = { lstat, stat }; + +// TODO: emit errors properly. Example: EMFILE on Macos. +const foreach = (val, fn) => { + if (val instanceof Set) { + val.forEach(fn); + } else { + fn(val); + } +}; + +const addAndConvert = (main, prop, item) => { + let container = main[prop]; + if (!(container instanceof Set)) { + main[prop] = container = new Set([container]); + } + container.add(item); +}; + +const clearItem = cont => key => { + const set = cont[key]; + if (set instanceof Set) { + set.clear(); + } else { + delete cont[key]; + } +}; + +const delFromSet = (main, prop, item) => { + const container = main[prop]; + if (container instanceof Set) { + container.delete(item); + } else if (container === item) { + delete main[prop]; + } +}; + +const isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val; + +/** + * @typedef {String} Path + */ + +// fs_watch helpers + +// object to hold per-process fs_watch instances +// (may be shared across chokidar FSWatcher instances) + +/** + * @typedef {Object} FsWatchContainer + * @property {Set} listeners + * @property {Set} errHandlers + * @property {Set} rawEmitters + * @property {fs.FSWatcher=} watcher + * @property {Boolean=} watcherUnusable + */ + +/** + * @type {Map} + */ +const FsWatchInstances = new Map(); + +/** + * Instantiates the fs_watch interface + * @param {String} path to be watched + * @param {Object} options to be passed to fs_watch + * @param {Function} listener main event handler + * @param {Function} errHandler emits info about errors + * @param {Function} emitRaw emits raw event data + * @returns {fs.FSWatcher} new fsevents instance + */ +function createFsWatchInstance(path, options, listener, errHandler, emitRaw) { + const handleEvent = (rawEvent, evPath) => { + listener(path); + emitRaw(rawEvent, evPath, {watchedPath: path}); + + // emit based on events occurring for files from a directory's watcher in + // case the file's watcher misses it (and rely on throttling to de-dupe) + if (evPath && path !== evPath) { + fsWatchBroadcast( + sysPath.resolve(path, evPath), KEY_LISTENERS, sysPath.join(path, evPath) + ); + } + }; + try { + return fs.watch(path, options, handleEvent); + } catch (error) { + errHandler(error); + } +} + +/** + * Helper for passing fs_watch event data to a collection of listeners + * @param {Path} fullPath absolute path bound to fs_watch instance + * @param {String} type listener type + * @param {*=} val1 arguments to be passed to listeners + * @param {*=} val2 + * @param {*=} val3 + */ +const fsWatchBroadcast = (fullPath, type, val1, val2, val3) => { + const cont = FsWatchInstances.get(fullPath); + if (!cont) return; + foreach(cont[type], (listener) => { + listener(val1, val2, val3); + }); +}; + +/** + * Instantiates the fs_watch interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path + * @param {String} fullPath absolute path + * @param {Object} options to be passed to fs_watch + * @param {Object} handlers container for event listener functions + */ +const setFsWatchListener = (path, fullPath, options, handlers) => { + const {listener, errHandler, rawEmitter} = handlers; + let cont = FsWatchInstances.get(fullPath); + + /** @type {fs.FSWatcher=} */ + let watcher; + if (!options.persistent) { + watcher = createFsWatchInstance( + path, options, listener, errHandler, rawEmitter + ); + return watcher.close.bind(watcher); + } + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_ERR, errHandler); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + watcher = createFsWatchInstance( + path, + options, + fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), + errHandler, // no need to use broadcast here + fsWatchBroadcast.bind(null, fullPath, KEY_RAW) + ); + if (!watcher) return; + watcher.on(EV_ERROR, async (error) => { + const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR); + cont.watcherUnusable = true; // documented since Node 10.4.1 + // Workaround for https://github.com/joyent/node/issues/4337 + if (isWindows && error.code === 'EPERM') { + try { + const fd = await open(path, 'r'); + await close(fd); + broadcastErr(error); + } catch (err) {} + } else { + broadcastErr(error); + } + }); + cont = { + listeners: listener, + errHandlers: errHandler, + rawEmitters: rawEmitter, + watcher + }; + FsWatchInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // removes this instance's listeners and closes the underlying fs_watch + // instance if there are no more listeners left + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_ERR, errHandler); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + // Check to protect against issue gh-730. + // if (cont.watcherUnusable) { + cont.watcher.close(); + // } + FsWatchInstances.delete(fullPath); + HANDLER_KEYS.forEach(clearItem(cont)); + cont.watcher = undefined; + Object.freeze(cont); + } + }; +}; + +// fs_watchFile helpers + +// object to hold per-process fs_watchFile instances +// (may be shared across chokidar FSWatcher instances) +const FsWatchFileInstances = new Map(); + +/** + * Instantiates the fs_watchFile interface or binds listeners + * to an existing one covering the same file system entry + * @param {String} path to be watched + * @param {String} fullPath absolute path + * @param {Object} options options to be passed to fs_watchFile + * @param {Object} handlers container for event listener functions + * @returns {Function} closer + */ +const setFsWatchFileListener = (path, fullPath, options, handlers) => { + const {listener, rawEmitter} = handlers; + let cont = FsWatchFileInstances.get(fullPath); + + /* eslint-disable no-unused-vars, prefer-destructuring */ + let listeners = new Set(); + let rawEmitters = new Set(); + + const copts = cont && cont.options; + if (copts && (copts.persistent < options.persistent || copts.interval > options.interval)) { + // "Upgrade" the watcher to persistence or a quicker interval. + // This creates some unlikely edge case issues if the user mixes + // settings in a very weird way, but solving for those cases + // doesn't seem worthwhile for the added complexity. + listeners = cont.listeners; + rawEmitters = cont.rawEmitters; + fs.unwatchFile(fullPath); + cont = undefined; + } + + /* eslint-enable no-unused-vars, prefer-destructuring */ + + if (cont) { + addAndConvert(cont, KEY_LISTENERS, listener); + addAndConvert(cont, KEY_RAW, rawEmitter); + } else { + // TODO + // listeners.add(listener); + // rawEmitters.add(rawEmitter); + cont = { + listeners: listener, + rawEmitters: rawEmitter, + options, + watcher: fs.watchFile(fullPath, options, (curr, prev) => { + foreach(cont.rawEmitters, (rawEmitter) => { + rawEmitter(EV_CHANGE, fullPath, {curr, prev}); + }); + const currmtime = curr.mtimeMs; + if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) { + foreach(cont.listeners, (listener) => listener(path, curr)); + } + }) + }; + FsWatchFileInstances.set(fullPath, cont); + } + // const index = cont.listeners.indexOf(listener); + + // Removes this instance's listeners and closes the underlying fs_watchFile + // instance if there are no more listeners left. + return () => { + delFromSet(cont, KEY_LISTENERS, listener); + delFromSet(cont, KEY_RAW, rawEmitter); + if (isEmptySet(cont.listeners)) { + FsWatchFileInstances.delete(fullPath); + fs.unwatchFile(fullPath); + cont.options = cont.watcher = undefined; + Object.freeze(cont); + } + }; +}; + +/** + * @mixin + */ +class NodeFsHandler { + +/** + * @param {import("../index").FSWatcher} fsW + */ +constructor(fsW) { + this.fsw = fsW; + this._boundHandleError = (error) => fsW._handleError(error); +} + +/** + * Watch file for changes with fs_watchFile or fs_watch. + * @param {String} path to file or dir + * @param {Function} listener on fs change + * @returns {Function} closer for the watcher instance + */ +_watchWithNodeFs(path, listener) { + const opts = this.fsw.options; + const directory = sysPath.dirname(path); + const basename = sysPath.basename(path); + const parent = this.fsw._getWatchedDir(directory); + parent.add(basename); + const absolutePath = sysPath.resolve(path); + const options = {persistent: opts.persistent}; + if (!listener) listener = EMPTY_FN; + + let closer; + if (opts.usePolling) { + options.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? + opts.binaryInterval : opts.interval; + closer = setFsWatchFileListener(path, absolutePath, options, { + listener, + rawEmitter: this.fsw._emitRaw + }); + } else { + closer = setFsWatchListener(path, absolutePath, options, { + listener, + errHandler: this._boundHandleError, + rawEmitter: this.fsw._emitRaw + }); + } + return closer; +} + +/** + * Watch a file and emit add event if warranted. + * @param {Path} file Path + * @param {fs.Stats} stats result of fs_stat + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @returns {Function} closer for the watcher instance + */ +_handleFile(file, stats, initialAdd) { + if (this.fsw.closed) { + return; + } + const dirname = sysPath.dirname(file); + const basename = sysPath.basename(file); + const parent = this.fsw._getWatchedDir(dirname); + // stats is always present + let prevStats = stats; + + // if the file is already being watched, do nothing + if (parent.has(basename)) return; + + const listener = async (path, newStats) => { + if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5)) return; + if (!newStats || newStats.mtimeMs === 0) { + try { + const newStats = await stat(file); + if (this.fsw.closed) return; + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE, file, newStats); + } + if (isLinux && prevStats.ino !== newStats.ino) { + this.fsw._closeFile(path) + prevStats = newStats; + this.fsw._addPathCloser(path, this._watchWithNodeFs(file, listener)); + } else { + prevStats = newStats; + } + } catch (error) { + // Fix issues where mtime is null but file is still present + this.fsw._remove(dirname, basename); + } + // add is about to be emitted if file not already tracked in parent + } else if (parent.has(basename)) { + // Check that change event was not fired because of changed only accessTime. + const at = newStats.atimeMs; + const mt = newStats.mtimeMs; + if (!at || at <= mt || mt !== prevStats.mtimeMs) { + this.fsw._emit(EV_CHANGE, file, newStats); + } + prevStats = newStats; + } + } + // kick off the watcher + const closer = this._watchWithNodeFs(file, listener); + + // emit an add event if we're supposed to + if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file)) { + if (!this.fsw._throttle(EV_ADD, file, 0)) return; + this.fsw._emit(EV_ADD, file, stats); + } + + return closer; +} + +/** + * Handle symlinks encountered while reading a dir. + * @param {Object} entry returned by readdirp + * @param {String} directory path of dir being read + * @param {String} path of this item + * @param {String} item basename of this item + * @returns {Promise} true if no more processing is needed for this entry. + */ +async _handleSymlink(entry, directory, path, item) { + if (this.fsw.closed) { + return; + } + const full = entry.fullPath; + const dir = this.fsw._getWatchedDir(directory); + + if (!this.fsw.options.followSymlinks) { + // watch symlink directly (don't follow) and detect changes + this.fsw._incrReadyCount(); + + let linkPath; + try { + linkPath = await fsrealpath(path); + } catch (e) { + this.fsw._emitReady(); + return true; + } + + if (this.fsw.closed) return; + if (dir.has(item)) { + if (this.fsw._symlinkPaths.get(full) !== linkPath) { + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_CHANGE, path, entry.stats); + } + } else { + dir.add(item); + this.fsw._symlinkPaths.set(full, linkPath); + this.fsw._emit(EV_ADD, path, entry.stats); + } + this.fsw._emitReady(); + return true; + } + + // don't follow the same symlink more than once + if (this.fsw._symlinkPaths.has(full)) { + return true; + } + + this.fsw._symlinkPaths.set(full, true); +} + +_handleRead(directory, initialAdd, wh, target, dir, depth, throttler) { + // Normalize the directory name on Windows + directory = sysPath.join(directory, EMPTY_STR); + + if (!wh.hasGlob) { + throttler = this.fsw._throttle('readdir', directory, 1000); + if (!throttler) return; + } + + const previous = this.fsw._getWatchedDir(wh.path); + const current = new Set(); + + let stream = this.fsw._readdirp(directory, { + fileFilter: entry => wh.filterPath(entry), + directoryFilter: entry => wh.filterDir(entry), + depth: 0 + }).on(STR_DATA, async (entry) => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const item = entry.path; + let path = sysPath.join(directory, item); + current.add(item); + + if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) { + return; + } + + if (this.fsw.closed) { + stream = undefined; + return; + } + // Files that present in current directory snapshot + // but absent in previous are added to watch list and + // emit `add` event. + if (item === target || !target && !previous.has(item)) { + this.fsw._incrReadyCount(); + + // ensure relativeness of path is preserved in case of watcher reuse + path = sysPath.join(dir, sysPath.relative(dir, path)); + + this._addToNodeFs(path, initialAdd, wh, depth + 1); + } + }).on(EV_ERROR, this._boundHandleError); + + return new Promise(resolve => + stream.once(STR_END, () => { + if (this.fsw.closed) { + stream = undefined; + return; + } + const wasThrottled = throttler ? throttler.clear() : false; + + resolve(); + + // Files that absent in current directory snapshot + // but present in previous emit `remove` event + // and are removed from @watched[directory]. + previous.getChildren().filter((item) => { + return item !== directory && + !current.has(item) && + // in case of intersecting globs; + // a path may have been filtered out of this readdir, but + // shouldn't be removed because it matches a different glob + (!wh.hasGlob || wh.filterPath({ + fullPath: sysPath.resolve(directory, item) + })); + }).forEach((item) => { + this.fsw._remove(directory, item); + }); + + stream = undefined; + + // one more time for any missed in case changes came in extremely quickly + if (wasThrottled) this._handleRead(directory, false, wh, target, dir, depth, throttler); + }) + ); +} + +/** + * Read directory to add / remove files from `@watched` list and re-read it on change. + * @param {String} dir fs path + * @param {fs.Stats} stats + * @param {Boolean} initialAdd + * @param {Number} depth relative to user-supplied path + * @param {String} target child path targeted for watch + * @param {Object} wh Common watch helpers for this path + * @param {String} realpath + * @returns {Promise} closer for the watcher instance. + */ +async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) { + const parentDir = this.fsw._getWatchedDir(sysPath.dirname(dir)); + const tracked = parentDir.has(sysPath.basename(dir)); + if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) { + if (!wh.hasGlob || wh.globFilter(dir)) this.fsw._emit(EV_ADD_DIR, dir, stats); + } + + // ensure dir is tracked (harmless if redundant) + parentDir.add(sysPath.basename(dir)); + this.fsw._getWatchedDir(dir); + let throttler; + let closer; + + const oDepth = this.fsw.options.depth; + if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath)) { + if (!target) { + await this._handleRead(dir, initialAdd, wh, target, dir, depth, throttler); + if (this.fsw.closed) return; + } + + closer = this._watchWithNodeFs(dir, (dirPath, stats) => { + // if current directory is removed, do nothing + if (stats && stats.mtimeMs === 0) return; + + this._handleRead(dirPath, false, wh, target, dir, depth, throttler); + }); + } + return closer; +} + +/** + * Handle added file, directory, or glob pattern. + * Delegates call to _handleFile / _handleDir after checks. + * @param {String} path to file or ir + * @param {Boolean} initialAdd was the file added at watch instantiation? + * @param {Object} priorWh depth relative to user-supplied path + * @param {Number} depth Child path actually targeted for watch + * @param {String=} target Child path actually targeted for watch + * @returns {Promise} + */ +async _addToNodeFs(path, initialAdd, priorWh, depth, target) { + const ready = this.fsw._emitReady; + if (this.fsw._isIgnored(path) || this.fsw.closed) { + ready(); + return false; + } + + const wh = this.fsw._getWatchHelpers(path, depth); + if (!wh.hasGlob && priorWh) { + wh.hasGlob = priorWh.hasGlob; + wh.globFilter = priorWh.globFilter; + wh.filterPath = entry => priorWh.filterPath(entry); + wh.filterDir = entry => priorWh.filterDir(entry); + } + + // evaluate what is at the path we're being asked to watch + try { + const stats = await statMethods[wh.statMethod](wh.watchPath); + if (this.fsw.closed) return; + if (this.fsw._isIgnored(wh.watchPath, stats)) { + ready(); + return false; + } + + const follow = this.fsw.options.followSymlinks && !path.includes(STAR) && !path.includes(BRACE_START); + let closer; + if (stats.isDirectory()) { + const absPath = sysPath.resolve(path); + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath); + if (this.fsw.closed) return; + // preserve this symlink's target path + if (absPath !== targetPath && targetPath !== undefined) { + this.fsw._symlinkPaths.set(absPath, targetPath); + } + } else if (stats.isSymbolicLink()) { + const targetPath = follow ? await fsrealpath(path) : path; + if (this.fsw.closed) return; + const parent = sysPath.dirname(wh.watchPath); + this.fsw._getWatchedDir(parent).add(wh.watchPath); + this.fsw._emit(EV_ADD, wh.watchPath, stats); + closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath); + if (this.fsw.closed) return; + + // preserve this symlink's target path + if (targetPath !== undefined) { + this.fsw._symlinkPaths.set(sysPath.resolve(path), targetPath); + } + } else { + closer = this._handleFile(wh.watchPath, stats, initialAdd); + } + ready(); + + this.fsw._addPathCloser(path, closer); + return false; + + } catch (error) { + if (this.fsw._handleError(error)) { + ready(); + return path; + } + } +} + +} + +module.exports = NodeFsHandler; + + +/***/ }), + +/***/ 5481: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. + +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' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = __nccwpck_require__(181).Buffer.isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +/***/ }), + +/***/ 2657: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const fileType = __nccwpck_require__(8989); +const isStream = __nccwpck_require__(6543); +const tarStream = __nccwpck_require__(6118); + +module.exports = () => input => { + if (!Buffer.isBuffer(input) && !isStream(input)) { + return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`)); + } + + if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'tar')) { + return Promise.resolve([]); + } + + const extract = tarStream.extract(); + const files = []; + + extract.on('entry', (header, stream, cb) => { + const chunk = []; + + stream.on('data', data => chunk.push(data)); + stream.on('end', () => { + const file = { + data: Buffer.concat(chunk), + mode: header.mode, + mtime: header.mtime, + path: header.name, + type: header.type + }; + + if (header.type === 'symlink' || header.type === 'link') { + file.linkname = header.linkname; + } + + files.push(file); + cb(); + }); + }); + + const promise = new Promise((resolve, reject) => { + if (!Buffer.isBuffer(input)) { + input.on('error', reject); + } + + extract.on('finish', () => resolve(files)); + extract.on('error', reject); + }); + + extract.then = promise.then.bind(promise); + extract.catch = promise.catch.bind(promise); + + if (Buffer.isBuffer(input)) { + extract.end(input); + } else { + input.pipe(extract); + } + + return extract; +}; + + +/***/ }), + +/***/ 2681: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const decompressTar = __nccwpck_require__(2657); +const fileType = __nccwpck_require__(7818); +const isStream = __nccwpck_require__(6543); +const seekBzip = __nccwpck_require__(9634); +const unbzip2Stream = __nccwpck_require__(8183); + +module.exports = () => input => { + if (!Buffer.isBuffer(input) && !isStream(input)) { + return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`)); + } + + if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'bz2')) { + return Promise.resolve([]); + } + + if (Buffer.isBuffer(input)) { + return decompressTar()(seekBzip.decode(input)); + } + + return decompressTar()(input.pipe(unbzip2Stream())); +}; + + +/***/ }), + +/***/ 7818: +/***/ ((module) => { + + +const toBytes = s => Array.from(s).map(c => c.charCodeAt(0)); +const xpiZipFilename = toBytes('META-INF/mozilla.rsa'); +const oxmlContentTypes = toBytes('[Content_Types].xml'); +const oxmlRels = toBytes('_rels/.rels'); + +module.exports = input => { + const buf = new Uint8Array(input); + + if (!(buf && buf.length > 1)) { + return null; + } + + const check = (header, opts) => { + opts = Object.assign({ + offset: 0 + }, opts); + + for (let i = 0; i < header.length; i++) { + // If a bitmask is set + if (opts.mask) { + // If header doesn't equal `buf` with bits masked off + if (header[i] !== (opts.mask[i] & buf[i + opts.offset])) { + return false; + } + } else if (header[i] !== buf[i + opts.offset]) { + return false; + } + } + + return true; + }; + + if (check([0xFF, 0xD8, 0xFF])) { + return { + ext: 'jpg', + mime: 'image/jpeg' + }; + } + + if (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) { + return { + ext: 'png', + mime: 'image/png' + }; + } + + if (check([0x47, 0x49, 0x46])) { + return { + ext: 'gif', + mime: 'image/gif' + }; + } + + if (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) { + return { + ext: 'webp', + mime: 'image/webp' + }; + } + + if (check([0x46, 0x4C, 0x49, 0x46])) { + return { + ext: 'flif', + mime: 'image/flif' + }; + } + + // Needs to be before `tif` check + if ( + (check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) && + check([0x43, 0x52], {offset: 8}) + ) { + return { + ext: 'cr2', + mime: 'image/x-canon-cr2' + }; + } + + if ( + check([0x49, 0x49, 0x2A, 0x0]) || + check([0x4D, 0x4D, 0x0, 0x2A]) + ) { + return { + ext: 'tif', + mime: 'image/tiff' + }; + } + + if (check([0x42, 0x4D])) { + return { + ext: 'bmp', + mime: 'image/bmp' + }; + } + + if (check([0x49, 0x49, 0xBC])) { + return { + ext: 'jxr', + mime: 'image/vnd.ms-photo' + }; + } + + if (check([0x38, 0x42, 0x50, 0x53])) { + return { + ext: 'psd', + mime: 'image/vnd.adobe.photoshop' + }; + } + + // Zip-based file formats + // Need to be before the `zip` check + if (check([0x50, 0x4B, 0x3, 0x4])) { + if ( + check([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30}) + ) { + return { + ext: 'epub', + mime: 'application/epub+zip' + }; + } + + // Assumes signed `.xpi` from addons.mozilla.org + if (check(xpiZipFilename, {offset: 30})) { + return { + ext: 'xpi', + mime: 'application/x-xpinstall' + }; + } + + // https://github.com/file/file/blob/master/magic/Magdir/msooxml + if (check(oxmlContentTypes, {offset: 30}) || check(oxmlRels, {offset: 30})) { + const sliced = buf.subarray(4, 4 + 2000); + const nextZipHeaderIndex = arr => arr.findIndex((el, i, arr) => arr[i] === 0x50 && arr[i + 1] === 0x4B && arr[i + 2] === 0x3 && arr[i + 3] === 0x4); + const header2Pos = nextZipHeaderIndex(sliced); + + if (header2Pos !== -1) { + const slicedAgain = buf.subarray(header2Pos + 8, header2Pos + 8 + 1000); + const header3Pos = nextZipHeaderIndex(slicedAgain); + + if (header3Pos !== -1) { + const offset = 8 + header2Pos + header3Pos + 30; + + if (check(toBytes('word/'), {offset})) { + return { + ext: 'docx', + mime: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' + }; + } + + if (check(toBytes('ppt/'), {offset})) { + return { + ext: 'pptx', + mime: 'application/vnd.openxmlformats-officedocument.presentationml.presentation' + }; + } + + if (check(toBytes('xl/'), {offset})) { + return { + ext: 'xlsx', + mime: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + }; + } + } + } + } + } + + if ( + check([0x50, 0x4B]) && + (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && + (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8) + ) { + return { + ext: 'zip', + mime: 'application/zip' + }; + } + + if (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) { + return { + ext: 'tar', + mime: 'application/x-tar' + }; + } + + if ( + check([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) && + (buf[6] === 0x0 || buf[6] === 0x1) + ) { + return { + ext: 'rar', + mime: 'application/x-rar-compressed' + }; + } + + if (check([0x1F, 0x8B, 0x8])) { + return { + ext: 'gz', + mime: 'application/gzip' + }; + } + + if (check([0x42, 0x5A, 0x68])) { + return { + ext: 'bz2', + mime: 'application/x-bzip2' + }; + } + + if (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) { + return { + ext: '7z', + mime: 'application/x-7z-compressed' + }; + } + + if (check([0x78, 0x01])) { + return { + ext: 'dmg', + mime: 'application/x-apple-diskimage' + }; + } + + if (check([0x33, 0x67, 0x70, 0x35]) || // 3gp5 + ( + check([0x0, 0x0, 0x0]) && check([0x66, 0x74, 0x79, 0x70], {offset: 4}) && + ( + check([0x6D, 0x70, 0x34, 0x31], {offset: 8}) || // MP41 + check([0x6D, 0x70, 0x34, 0x32], {offset: 8}) || // MP42 + check([0x69, 0x73, 0x6F, 0x6D], {offset: 8}) || // ISOM + check([0x69, 0x73, 0x6F, 0x32], {offset: 8}) || // ISO2 + check([0x6D, 0x6D, 0x70, 0x34], {offset: 8}) || // MMP4 + check([0x4D, 0x34, 0x56], {offset: 8}) || // M4V + check([0x64, 0x61, 0x73, 0x68], {offset: 8}) // DASH + ) + )) { + return { + ext: 'mp4', + mime: 'video/mp4' + }; + } + + if (check([0x4D, 0x54, 0x68, 0x64])) { + return { + ext: 'mid', + mime: 'audio/midi' + }; + } + + // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska + if (check([0x1A, 0x45, 0xDF, 0xA3])) { + const sliced = buf.subarray(4, 4 + 4096); + const idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82); + + if (idPos !== -1) { + const docTypePos = idPos + 3; + const findDocType = type => Array.from(type).every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); + + if (findDocType('matroska')) { + return { + ext: 'mkv', + mime: 'video/x-matroska' + }; + } + + if (findDocType('webm')) { + return { + ext: 'webm', + mime: 'video/webm' + }; + } + } + } + + if (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) || + check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || + check([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) || + check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG + check([0x77, 0x69, 0x64, 0x65], {offset: 4})) { + return { + ext: 'mov', + mime: 'video/quicktime' + }; + } + + if ( + check([0x52, 0x49, 0x46, 0x46]) && + check([0x41, 0x56, 0x49], {offset: 8}) + ) { + return { + ext: 'avi', + mime: 'video/x-msvideo' + }; + } + + if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) { + return { + ext: 'wmv', + mime: 'video/x-ms-wmv' + }; + } + + if (check([0x0, 0x0, 0x1, 0xBA])) { + return { + ext: 'mpg', + mime: 'video/mpeg' + }; + } + + // Check for MP3 header at different starting offsets + for (let start = 0; start < 2 && start < (buf.length - 16); start++) { + if ( + check([0x49, 0x44, 0x33], {offset: start}) || // ID3 header + check([0xFF, 0xE2], {offset: start, mask: [0xFF, 0xE2]}) // MPEG 1 or 2 Layer 3 header + ) { + return { + ext: 'mp3', + mime: 'audio/mpeg' + }; + } + } + + if ( + check([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4}) || + check([0x4D, 0x34, 0x41, 0x20]) + ) { + return { + ext: 'm4a', + mime: 'audio/m4a' + }; + } + + // Needs to be before `ogg` check + if (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) { + return { + ext: 'opus', + mime: 'audio/opus' + }; + } + + if (check([0x4F, 0x67, 0x67, 0x53])) { + return { + ext: 'ogg', + mime: 'audio/ogg' + }; + } + + if (check([0x66, 0x4C, 0x61, 0x43])) { + return { + ext: 'flac', + mime: 'audio/x-flac' + }; + } + + if ( + check([0x52, 0x49, 0x46, 0x46]) && + check([0x57, 0x41, 0x56, 0x45], {offset: 8}) + ) { + return { + ext: 'wav', + mime: 'audio/x-wav' + }; + } + + if (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) { + return { + ext: 'amr', + mime: 'audio/amr' + }; + } + + if (check([0x25, 0x50, 0x44, 0x46])) { + return { + ext: 'pdf', + mime: 'application/pdf' + }; + } + + if (check([0x4D, 0x5A])) { + return { + ext: 'exe', + mime: 'application/x-msdownload' + }; + } + + if ( + (buf[0] === 0x43 || buf[0] === 0x46) && + check([0x57, 0x53], {offset: 1}) + ) { + return { + ext: 'swf', + mime: 'application/x-shockwave-flash' + }; + } + + if (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) { + return { + ext: 'rtf', + mime: 'application/rtf' + }; + } + + if (check([0x00, 0x61, 0x73, 0x6D])) { + return { + ext: 'wasm', + mime: 'application/wasm' + }; + } + + if ( + check([0x77, 0x4F, 0x46, 0x46]) && + ( + check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || + check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) + ) + ) { + return { + ext: 'woff', + mime: 'font/woff' + }; + } + + if ( + check([0x77, 0x4F, 0x46, 0x32]) && + ( + check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || + check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) + ) + ) { + return { + ext: 'woff2', + mime: 'font/woff2' + }; + } + + if ( + check([0x4C, 0x50], {offset: 34}) && + ( + check([0x00, 0x00, 0x01], {offset: 8}) || + check([0x01, 0x00, 0x02], {offset: 8}) || + check([0x02, 0x00, 0x02], {offset: 8}) + ) + ) { + return { + ext: 'eot', + mime: 'application/octet-stream' + }; + } + + if (check([0x00, 0x01, 0x00, 0x00, 0x00])) { + return { + ext: 'ttf', + mime: 'font/ttf' + }; + } + + if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) { + return { + ext: 'otf', + mime: 'font/otf' + }; + } + + if (check([0x00, 0x00, 0x01, 0x00])) { + return { + ext: 'ico', + mime: 'image/x-icon' + }; + } + + if (check([0x46, 0x4C, 0x56, 0x01])) { + return { + ext: 'flv', + mime: 'video/x-flv' + }; + } + + if (check([0x25, 0x21])) { + return { + ext: 'ps', + mime: 'application/postscript' + }; + } + + if (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) { + return { + ext: 'xz', + mime: 'application/x-xz' + }; + } + + if (check([0x53, 0x51, 0x4C, 0x69])) { + return { + ext: 'sqlite', + mime: 'application/x-sqlite3' + }; + } + + if (check([0x4E, 0x45, 0x53, 0x1A])) { + return { + ext: 'nes', + mime: 'application/x-nintendo-nes-rom' + }; + } + + if (check([0x43, 0x72, 0x32, 0x34])) { + return { + ext: 'crx', + mime: 'application/x-google-chrome-extension' + }; + } + + if ( + check([0x4D, 0x53, 0x43, 0x46]) || + check([0x49, 0x53, 0x63, 0x28]) + ) { + return { + ext: 'cab', + mime: 'application/vnd.ms-cab-compressed' + }; + } + + // Needs to be before `ar` check + if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) { + return { + ext: 'deb', + mime: 'application/x-deb' + }; + } + + if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) { + return { + ext: 'ar', + mime: 'application/x-unix-archive' + }; + } + + if (check([0xED, 0xAB, 0xEE, 0xDB])) { + return { + ext: 'rpm', + mime: 'application/x-rpm' + }; + } + + if ( + check([0x1F, 0xA0]) || + check([0x1F, 0x9D]) + ) { + return { + ext: 'Z', + mime: 'application/x-compress' + }; + } + + if (check([0x4C, 0x5A, 0x49, 0x50])) { + return { + ext: 'lz', + mime: 'application/x-lzip' + }; + } + + if (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) { + return { + ext: 'msi', + mime: 'application/x-msi' + }; + } + + if (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) { + return { + ext: 'mxf', + mime: 'application/mxf' + }; + } + + if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) { + return { + ext: 'mts', + mime: 'video/mp2t' + }; + } + + if (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) { + return { + ext: 'blend', + mime: 'application/x-blender' + }; + } + + if (check([0x42, 0x50, 0x47, 0xFB])) { + return { + ext: 'bpg', + mime: 'image/bpg' + }; + } + + return null; +}; + + +/***/ }), + +/***/ 8848: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const zlib = __nccwpck_require__(3106); +const decompressTar = __nccwpck_require__(2657); +const fileType = __nccwpck_require__(8989); +const isStream = __nccwpck_require__(6543); + +module.exports = () => input => { + if (!Buffer.isBuffer(input) && !isStream(input)) { + return Promise.reject(new TypeError(`Expected a Buffer or Stream, got ${typeof input}`)); + } + + if (Buffer.isBuffer(input) && (!fileType(input) || fileType(input).ext !== 'gz')) { + return Promise.resolve([]); + } + + const unzip = zlib.createGunzip(); + const result = decompressTar()(unzip); + + if (Buffer.isBuffer(input)) { + unzip.end(input); + } else { + input.pipe(unzip); + } + + return result; +}; + + +/***/ }), + +/***/ 1296: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const fileType = __nccwpck_require__(3061); +const getStream = __nccwpck_require__(6771); +const pify = __nccwpck_require__(2946); +const yauzl = __nccwpck_require__(663); + +const getType = (entry, mode) => { + const IFMT = 61440; + const IFDIR = 16384; + const IFLNK = 40960; + const madeBy = entry.versionMadeBy >> 8; + + if ((mode & IFMT) === IFLNK) { + return 'symlink'; + } + + if ((mode & IFMT) === IFDIR || (madeBy === 0 && entry.externalFileAttributes === 16)) { + return 'directory'; + } + + return 'file'; +}; + +const extractEntry = (entry, zip) => { + const file = { + mode: (entry.externalFileAttributes >> 16) & 0xFFFF, + mtime: entry.getLastModDate(), + path: entry.fileName + }; + + file.type = getType(entry, file.mode); + + if (file.mode === 0 && file.type === 'directory') { + file.mode = 493; + } + + if (file.mode === 0) { + file.mode = 420; + } + + return pify(zip.openReadStream.bind(zip))(entry) + .then(getStream.buffer) + .then(buf => { + file.data = buf; + + if (file.type === 'symlink') { + file.linkname = buf.toString(); + } + + return file; + }) + .catch(err => { + zip.close(); + throw err; + }); +}; + +const extractFile = zip => new Promise((resolve, reject) => { + const files = []; + + zip.readEntry(); + + zip.on('entry', entry => { + extractEntry(entry, zip) + .catch(reject) + .then(file => { + files.push(file); + zip.readEntry(); + }); + }); + + zip.on('error', reject); + zip.on('end', () => resolve(files)); +}); + +module.exports = () => buf => { + if (!Buffer.isBuffer(buf)) { + return Promise.reject(new TypeError(`Expected a Buffer, got ${typeof buf}`)); + } + + if (!fileType(buf) || fileType(buf).ext !== 'zip') { + return Promise.resolve([]); + } + + return pify(yauzl.fromBuffer)(buf, {lazyEntries: true}).then(extractFile); +}; + + +/***/ }), + +/***/ 3061: +/***/ ((module) => { + + +module.exports = function (buf) { + if (!(buf && buf.length > 1)) { + return null; + } + + if (buf[0] === 0xFF && buf[1] === 0xD8 && buf[2] === 0xFF) { + return { + ext: 'jpg', + mime: 'image/jpeg' + }; + } + + if (buf[0] === 0x89 && buf[1] === 0x50 && buf[2] === 0x4E && buf[3] === 0x47) { + return { + ext: 'png', + mime: 'image/png' + }; + } + + if (buf[0] === 0x47 && buf[1] === 0x49 && buf[2] === 0x46) { + return { + ext: 'gif', + mime: 'image/gif' + }; + } + + if (buf[8] === 0x57 && buf[9] === 0x45 && buf[10] === 0x42 && buf[11] === 0x50) { + return { + ext: 'webp', + mime: 'image/webp' + }; + } + + if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x49 && buf[3] === 0x46) { + return { + ext: 'flif', + mime: 'image/flif' + }; + } + + // needs to be before `tif` check + if (((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) && buf[8] === 0x43 && buf[9] === 0x52) { + return { + ext: 'cr2', + mime: 'image/x-canon-cr2' + }; + } + + if ((buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0x2A && buf[3] === 0x0) || (buf[0] === 0x4D && buf[1] === 0x4D && buf[2] === 0x0 && buf[3] === 0x2A)) { + return { + ext: 'tif', + mime: 'image/tiff' + }; + } + + if (buf[0] === 0x42 && buf[1] === 0x4D) { + return { + ext: 'bmp', + mime: 'image/bmp' + }; + } + + if (buf[0] === 0x49 && buf[1] === 0x49 && buf[2] === 0xBC) { + return { + ext: 'jxr', + mime: 'image/vnd.ms-photo' + }; + } + + if (buf[0] === 0x38 && buf[1] === 0x42 && buf[2] === 0x50 && buf[3] === 0x53) { + return { + ext: 'psd', + mime: 'image/vnd.adobe.photoshop' + }; + } + + // needs to be before `zip` check + if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x6D && buf[31] === 0x69 && buf[32] === 0x6D && buf[33] === 0x65 && buf[34] === 0x74 && buf[35] === 0x79 && buf[36] === 0x70 && buf[37] === 0x65 && buf[38] === 0x61 && buf[39] === 0x70 && buf[40] === 0x70 && buf[41] === 0x6C && buf[42] === 0x69 && buf[43] === 0x63 && buf[44] === 0x61 && buf[45] === 0x74 && buf[46] === 0x69 && buf[47] === 0x6F && buf[48] === 0x6E && buf[49] === 0x2F && buf[50] === 0x65 && buf[51] === 0x70 && buf[52] === 0x75 && buf[53] === 0x62 && buf[54] === 0x2B && buf[55] === 0x7A && buf[56] === 0x69 && buf[57] === 0x70) { + return { + ext: 'epub', + mime: 'application/epub+zip' + }; + } + + // needs to be before `zip` check + // assumes signed .xpi from addons.mozilla.org + if (buf[0] === 0x50 && buf[1] === 0x4B && buf[2] === 0x3 && buf[3] === 0x4 && buf[30] === 0x4D && buf[31] === 0x45 && buf[32] === 0x54 && buf[33] === 0x41 && buf[34] === 0x2D && buf[35] === 0x49 && buf[36] === 0x4E && buf[37] === 0x46 && buf[38] === 0x2F && buf[39] === 0x6D && buf[40] === 0x6F && buf[41] === 0x7A && buf[42] === 0x69 && buf[43] === 0x6C && buf[44] === 0x6C && buf[45] === 0x61 && buf[46] === 0x2E && buf[47] === 0x72 && buf[48] === 0x73 && buf[49] === 0x61) { + return { + ext: 'xpi', + mime: 'application/x-xpinstall' + }; + } + + if (buf[0] === 0x50 && buf[1] === 0x4B && (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8)) { + return { + ext: 'zip', + mime: 'application/zip' + }; + } + + if (buf[257] === 0x75 && buf[258] === 0x73 && buf[259] === 0x74 && buf[260] === 0x61 && buf[261] === 0x72) { + return { + ext: 'tar', + mime: 'application/x-tar' + }; + } + + if (buf[0] === 0x52 && buf[1] === 0x61 && buf[2] === 0x72 && buf[3] === 0x21 && buf[4] === 0x1A && buf[5] === 0x7 && (buf[6] === 0x0 || buf[6] === 0x1)) { + return { + ext: 'rar', + mime: 'application/x-rar-compressed' + }; + } + + if (buf[0] === 0x1F && buf[1] === 0x8B && buf[2] === 0x8) { + return { + ext: 'gz', + mime: 'application/gzip' + }; + } + + if (buf[0] === 0x42 && buf[1] === 0x5A && buf[2] === 0x68) { + return { + ext: 'bz2', + mime: 'application/x-bzip2' + }; + } + + if (buf[0] === 0x37 && buf[1] === 0x7A && buf[2] === 0xBC && buf[3] === 0xAF && buf[4] === 0x27 && buf[5] === 0x1C) { + return { + ext: '7z', + mime: 'application/x-7z-compressed' + }; + } + + if (buf[0] === 0x78 && buf[1] === 0x01) { + return { + ext: 'dmg', + mime: 'application/x-apple-diskimage' + }; + } + + if ( + (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && (buf[3] === 0x18 || buf[3] === 0x20) && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) || + (buf[0] === 0x33 && buf[1] === 0x67 && buf[2] === 0x70 && buf[3] === 0x35) || + (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[16] === 0x6D && buf[17] === 0x70 && buf[18] === 0x34 && buf[19] === 0x31 && buf[20] === 0x6D && buf[21] === 0x70 && buf[22] === 0x34 && buf[23] === 0x32 && buf[24] === 0x69 && buf[25] === 0x73 && buf[26] === 0x6F && buf[27] === 0x6D) || + (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x69 && buf[9] === 0x73 && buf[10] === 0x6F && buf[11] === 0x6D) || + (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1c && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x6D && buf[9] === 0x70 && buf[10] === 0x34 && buf[11] === 0x32 && buf[12] === 0x0 && buf[13] === 0x0 && buf[14] === 0x0 && buf[15] === 0x0) + ) { + return { + ext: 'mp4', + mime: 'video/mp4' + }; + } + + if ((buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x1C && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x56)) { + return { + ext: 'm4v', + mime: 'video/x-m4v' + }; + } + + if (buf[0] === 0x4D && buf[1] === 0x54 && buf[2] === 0x68 && buf[3] === 0x64) { + return { + ext: 'mid', + mime: 'audio/midi' + }; + } + + // needs to be before the `webm` check + if (buf[31] === 0x6D && buf[32] === 0x61 && buf[33] === 0x74 && buf[34] === 0x72 && buf[35] === 0x6f && buf[36] === 0x73 && buf[37] === 0x6B && buf[38] === 0x61) { + return { + ext: 'mkv', + mime: 'video/x-matroska' + }; + } + + if (buf[0] === 0x1A && buf[1] === 0x45 && buf[2] === 0xDF && buf[3] === 0xA3) { + return { + ext: 'webm', + mime: 'video/webm' + }; + } + + if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x0 && buf[3] === 0x14 && buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70) { + return { + ext: 'mov', + mime: 'video/quicktime' + }; + } + + if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x41 && buf[9] === 0x56 && buf[10] === 0x49) { + return { + ext: 'avi', + mime: 'video/x-msvideo' + }; + } + + if (buf[0] === 0x30 && buf[1] === 0x26 && buf[2] === 0xB2 && buf[3] === 0x75 && buf[4] === 0x8E && buf[5] === 0x66 && buf[6] === 0xCF && buf[7] === 0x11 && buf[8] === 0xA6 && buf[9] === 0xD9) { + return { + ext: 'wmv', + mime: 'video/x-ms-wmv' + }; + } + + if (buf[0] === 0x0 && buf[1] === 0x0 && buf[2] === 0x1 && buf[3].toString(16)[0] === 'b') { + return { + ext: 'mpg', + mime: 'video/mpeg' + }; + } + + if ((buf[0] === 0x49 && buf[1] === 0x44 && buf[2] === 0x33) || (buf[0] === 0xFF && buf[1] === 0xfb)) { + return { + ext: 'mp3', + mime: 'audio/mpeg' + }; + } + + if ((buf[4] === 0x66 && buf[5] === 0x74 && buf[6] === 0x79 && buf[7] === 0x70 && buf[8] === 0x4D && buf[9] === 0x34 && buf[10] === 0x41) || (buf[0] === 0x4D && buf[1] === 0x34 && buf[2] === 0x41 && buf[3] === 0x20)) { + return { + ext: 'm4a', + mime: 'audio/m4a' + }; + } + + // needs to be before `ogg` check + if (buf[28] === 0x4F && buf[29] === 0x70 && buf[30] === 0x75 && buf[31] === 0x73 && buf[32] === 0x48 && buf[33] === 0x65 && buf[34] === 0x61 && buf[35] === 0x64) { + return { + ext: 'opus', + mime: 'audio/opus' + }; + } + + if (buf[0] === 0x4F && buf[1] === 0x67 && buf[2] === 0x67 && buf[3] === 0x53) { + return { + ext: 'ogg', + mime: 'audio/ogg' + }; + } + + if (buf[0] === 0x66 && buf[1] === 0x4C && buf[2] === 0x61 && buf[3] === 0x43) { + return { + ext: 'flac', + mime: 'audio/x-flac' + }; + } + + if (buf[0] === 0x52 && buf[1] === 0x49 && buf[2] === 0x46 && buf[3] === 0x46 && buf[8] === 0x57 && buf[9] === 0x41 && buf[10] === 0x56 && buf[11] === 0x45) { + return { + ext: 'wav', + mime: 'audio/x-wav' + }; + } + + if (buf[0] === 0x23 && buf[1] === 0x21 && buf[2] === 0x41 && buf[3] === 0x4D && buf[4] === 0x52 && buf[5] === 0x0A) { + return { + ext: 'amr', + mime: 'audio/amr' + }; + } + + if (buf[0] === 0x25 && buf[1] === 0x50 && buf[2] === 0x44 && buf[3] === 0x46) { + return { + ext: 'pdf', + mime: 'application/pdf' + }; + } + + if (buf[0] === 0x4D && buf[1] === 0x5A) { + return { + ext: 'exe', + mime: 'application/x-msdownload' + }; + } + + if ((buf[0] === 0x43 || buf[0] === 0x46) && buf[1] === 0x57 && buf[2] === 0x53) { + return { + ext: 'swf', + mime: 'application/x-shockwave-flash' + }; + } + + if (buf[0] === 0x7B && buf[1] === 0x5C && buf[2] === 0x72 && buf[3] === 0x74 && buf[4] === 0x66) { + return { + ext: 'rtf', + mime: 'application/rtf' + }; + } + + if ( + (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x46) && + ( + (buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) || + (buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F) + ) + ) { + return { + ext: 'woff', + mime: 'application/font-woff' + }; + } + + if ( + (buf[0] === 0x77 && buf[1] === 0x4F && buf[2] === 0x46 && buf[3] === 0x32) && + ( + (buf[4] === 0x00 && buf[5] === 0x01 && buf[6] === 0x00 && buf[7] === 0x00) || + (buf[4] === 0x4F && buf[5] === 0x54 && buf[6] === 0x54 && buf[7] === 0x4F) + ) + ) { + return { + ext: 'woff2', + mime: 'application/font-woff' + }; + } + + if ( + (buf[34] === 0x4C && buf[35] === 0x50) && + ( + (buf[8] === 0x00 && buf[9] === 0x00 && buf[10] === 0x01) || + (buf[8] === 0x01 && buf[9] === 0x00 && buf[10] === 0x02) || + (buf[8] === 0x02 && buf[9] === 0x00 && buf[10] === 0x02) + ) + ) { + return { + ext: 'eot', + mime: 'application/octet-stream' + }; + } + + if (buf[0] === 0x00 && buf[1] === 0x01 && buf[2] === 0x00 && buf[3] === 0x00 && buf[4] === 0x00) { + return { + ext: 'ttf', + mime: 'application/font-sfnt' + }; + } + + if (buf[0] === 0x4F && buf[1] === 0x54 && buf[2] === 0x54 && buf[3] === 0x4F && buf[4] === 0x00) { + return { + ext: 'otf', + mime: 'application/font-sfnt' + }; + } + + if (buf[0] === 0x00 && buf[1] === 0x00 && buf[2] === 0x01 && buf[3] === 0x00) { + return { + ext: 'ico', + mime: 'image/x-icon' + }; + } + + if (buf[0] === 0x46 && buf[1] === 0x4C && buf[2] === 0x56 && buf[3] === 0x01) { + return { + ext: 'flv', + mime: 'video/x-flv' + }; + } + + if (buf[0] === 0x25 && buf[1] === 0x21) { + return { + ext: 'ps', + mime: 'application/postscript' + }; + } + + if (buf[0] === 0xFD && buf[1] === 0x37 && buf[2] === 0x7A && buf[3] === 0x58 && buf[4] === 0x5A && buf[5] === 0x00) { + return { + ext: 'xz', + mime: 'application/x-xz' + }; + } + + if (buf[0] === 0x53 && buf[1] === 0x51 && buf[2] === 0x4C && buf[3] === 0x69) { + return { + ext: 'sqlite', + mime: 'application/x-sqlite3' + }; + } + + if (buf[0] === 0x4E && buf[1] === 0x45 && buf[2] === 0x53 && buf[3] === 0x1A) { + return { + ext: 'nes', + mime: 'application/x-nintendo-nes-rom' + }; + } + + if (buf[0] === 0x43 && buf[1] === 0x72 && buf[2] === 0x32 && buf[3] === 0x34) { + return { + ext: 'crx', + mime: 'application/x-google-chrome-extension' + }; + } + + if ( + (buf[0] === 0x4D && buf[1] === 0x53 && buf[2] === 0x43 && buf[3] === 0x46) || + (buf[0] === 0x49 && buf[1] === 0x53 && buf[2] === 0x63 && buf[3] === 0x28) + ) { + return { + ext: 'cab', + mime: 'application/vnd.ms-cab-compressed' + }; + } + + // needs to be before `ar` check + if (buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && buf[6] === 0x3E && buf[7] === 0x0A && buf[8] === 0x64 && buf[9] === 0x65 && buf[10] === 0x62 && buf[11] === 0x69 && buf[12] === 0x61 && buf[13] === 0x6E && buf[14] === 0x2D && buf[15] === 0x62 && buf[16] === 0x69 && buf[17] === 0x6E && buf[18] === 0x61 && buf[19] === 0x72 && buf[20] === 0x79) { + return { + ext: 'deb', + mime: 'application/x-deb' + }; + } + + if (buf[0] === 0x21 && buf[1] === 0x3C && buf[2] === 0x61 && buf[3] === 0x72 && buf[4] === 0x63 && buf[5] === 0x68 && buf[6] === 0x3E) { + return { + ext: 'ar', + mime: 'application/x-unix-archive' + }; + } + + if (buf[0] === 0xED && buf[1] === 0xAB && buf[2] === 0xEE && buf[3] === 0xDB) { + return { + ext: 'rpm', + mime: 'application/x-rpm' + }; + } + + if ( + (buf[0] === 0x1F && buf[1] === 0xA0) || + (buf[0] === 0x1F && buf[1] === 0x9D) + ) { + return { + ext: 'Z', + mime: 'application/x-compress' + }; + } + + if (buf[0] === 0x4C && buf[1] === 0x5A && buf[2] === 0x49 && buf[3] === 0x50) { + return { + ext: 'lz', + mime: 'application/x-lzip' + }; + } + + if (buf[0] === 0xD0 && buf[1] === 0xCF && buf[2] === 0x11 && buf[3] === 0xE0 && buf[4] === 0xA1 && buf[5] === 0xB1 && buf[6] === 0x1A && buf[7] === 0xE1) { + return { + ext: 'msi', + mime: 'application/x-msi' + }; + } + + return null; +}; + + +/***/ }), + +/***/ 6591: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const path = __nccwpck_require__(6928); +const fs = __nccwpck_require__(5744); +const decompressTar = __nccwpck_require__(2657); +const decompressTarbz2 = __nccwpck_require__(2681); +const decompressTargz = __nccwpck_require__(8848); +const decompressUnzip = __nccwpck_require__(1296); +const makeDir = __nccwpck_require__(6512); +const pify = __nccwpck_require__(2946); +const stripDirs = __nccwpck_require__(5245); + +const fsP = pify(fs); + +const runPlugins = (input, opts) => { + if (opts.plugins.length === 0) { + return Promise.resolve([]); + } + + return Promise.all(opts.plugins.map(x => x(input, opts))).then(files => files.reduce((a, b) => a.concat(b))); +}; + +const safeMakeDir = (dir, realOutputPath) => { + return fsP.realpath(dir) + .catch(_ => { + const parent = path.dirname(dir); + return safeMakeDir(parent, realOutputPath); + }) + .then(realParentPath => { + if (realParentPath.indexOf(realOutputPath) !== 0) { + throw (new Error('Refusing to create a directory outside the output path.')); + } + + return makeDir(dir).then(fsP.realpath); + }); +}; + +const preventWritingThroughSymlink = (destination, realOutputPath) => { + return fsP.readlink(destination) + .catch(_ => { + // Either no file exists, or it's not a symlink. In either case, this is + // not an escape we need to worry about in this phase. + return null; + }) + .then(symlinkPointsTo => { + if (symlinkPointsTo) { + throw new Error('Refusing to write into a symlink'); + } + + // No symlink exists at `destination`, so we can continue + return realOutputPath; + }); +}; + +const extractFile = (input, output, opts) => runPlugins(input, opts).then(files => { + if (opts.strip > 0) { + files = files + .map(x => { + x.path = stripDirs(x.path, opts.strip); + return x; + }) + .filter(x => x.path !== '.'); + } + + if (typeof opts.filter === 'function') { + files = files.filter(opts.filter); + } + + if (typeof opts.map === 'function') { + files = files.map(opts.map); + } + + if (!output) { + return files; + } + + return Promise.all(files.map(x => { + const dest = path.join(output, x.path); + const mode = x.mode & ~process.umask(); + const now = new Date(); + + if (x.type === 'directory') { + return makeDir(output) + .then(outputPath => fsP.realpath(outputPath)) + .then(realOutputPath => safeMakeDir(dest, realOutputPath)) + .then(() => fsP.utimes(dest, now, x.mtime)) + .then(() => x); + } + + return makeDir(output) + .then(outputPath => fsP.realpath(outputPath)) + .then(realOutputPath => { + // Attempt to ensure parent directory exists (failing if it's outside the output dir) + return safeMakeDir(path.dirname(dest), realOutputPath) + .then(() => realOutputPath); + }) + .then(realOutputPath => { + if (x.type === 'file') { + return preventWritingThroughSymlink(dest, realOutputPath); + } + + return realOutputPath; + }) + .then(realOutputPath => { + return fsP.realpath(path.dirname(dest)) + .then(realDestinationDir => { + if (realDestinationDir.indexOf(realOutputPath) !== 0) { + throw (new Error('Refusing to write outside output directory: ' + realDestinationDir)); + } + }); + }) + .then(() => { + if (x.type === 'link') { + return fsP.link(x.linkname, dest); + } + + if (x.type === 'symlink' && process.platform === 'win32') { + return fsP.link(x.linkname, dest); + } + + if (x.type === 'symlink') { + return fsP.symlink(x.linkname, dest); + } + + return fsP.writeFile(dest, x.data, {mode}); + }) + .then(() => x.type === 'file' && fsP.utimes(dest, now, x.mtime)) + .then(() => x); + })); +}); + +module.exports = (input, output, opts) => { + if (typeof input !== 'string' && !Buffer.isBuffer(input)) { + return Promise.reject(new TypeError('Input file required')); + } + + if (typeof output === 'object') { + opts = output; + output = null; + } + + opts = Object.assign({plugins: [ + decompressTar(), + decompressTarbz2(), + decompressTargz(), + decompressUnzip() + ]}, opts); + + const read = typeof input === 'string' ? fsP.readFile(input) : Promise.resolve(input); + + return read.then(buf => extractFile(buf, output, opts)); +}; + + +/***/ }), + +/***/ 1316: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var $defineProperty = __nccwpck_require__(9094); + +var $SyntaxError = __nccwpck_require__(105); +var $TypeError = __nccwpck_require__(3314); + +var gopd = __nccwpck_require__(3170); + +/** @type {import('.')} */ +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; + + /* @type {false | TypedPropertyDescriptor} */ + 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: value, + writable: nonWritable === null && desc ? desc.writable : !nonWritable + }); + } else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) { + // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable + obj[property] = value; // eslint-disable-line no-param-reassign + } else { + throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); + } +}; + + +/***/ }), + +/***/ 6669: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var callBind = __nccwpck_require__(8705); +var gOPD = __nccwpck_require__(3170); + +var hasProtoAccessor; +try { + // eslint-disable-next-line no-extra-parens, no-proto + hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype; +} catch (e) { + if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') { + throw e; + } +} + +// eslint-disable-next-line no-extra-parens +var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__')); + +var $Object = Object; +var $getPrototypeOf = $Object.getPrototypeOf; + +/** @type {import('./get')} */ +module.exports = desc && typeof desc.get === 'function' + ? callBind([desc.get]) + : typeof $getPrototypeOf === 'function' + ? /** @type {import('./get')} */ function getDunder(value) { + // eslint-disable-next-line eqeqeq + return $getPrototypeOf(value == null ? value : $Object(value)); + } + : false; + + +/***/ }), + +/***/ 1424: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var once = __nccwpck_require__(5560); + +var noop = function() {}; + +var qnt = global.Bare ? queueMicrotask : process.nextTick.bind(process); + +var isRequest = function(stream) { + return stream.setHeader && typeof stream.abort === 'function'; +}; + +var isChildProcess = function(stream) { + return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3 +}; + +var eos = function(stream, opts, callback) { + if (typeof opts === 'function') return eos(stream, null, opts); + if (!opts) opts = {}; + + callback = once(callback || noop); + + var ws = stream._writableState; + var rs = stream._readableState; + var readable = opts.readable || (opts.readable !== false && stream.readable); + var writable = opts.writable || (opts.writable !== false && stream.writable); + var cancelled = false; + + var onlegacyfinish = function() { + if (!stream.writable) onfinish(); + }; + + var onfinish = function() { + writable = false; + if (!readable) callback.call(stream); + }; + + var onend = function() { + readable = false; + if (!writable) callback.call(stream); + }; + + var onexit = function(exitCode) { + callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null); + }; + + var onerror = function(err) { + callback.call(stream, err); + }; + + var onclose = function() { + qnt(onclosenexttick); + }; + + var onclosenexttick = function() { + if (cancelled) return; + if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close')); + if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close')); + }; + + var onrequest = function() { + 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 && !ws) { // legacy streams + stream.on('end', onlegacyfinish); + stream.on('close', onlegacyfinish); + } + + if (isChildProcess(stream)) stream.on('exit', onexit); + + stream.on('end', onend); + stream.on('finish', onfinish); + if (opts.error !== false) stream.on('error', onerror); + stream.on('close', onclose); + + return function() { + cancelled = true; + 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('exit', onexit); + stream.removeListener('end', onend); + stream.removeListener('error', onerror); + stream.removeListener('close', onclose); + }; +}; + +module.exports = eos; + + +/***/ }), + +/***/ 9094: +/***/ ((module) => { + + + +/** @type {import('.')} */ +var $defineProperty = Object.defineProperty || false; +if ($defineProperty) { + try { + $defineProperty({}, 'a', { value: 1 }); + } catch (e) { + // IE 8 has a broken defineProperty + $defineProperty = false; + } +} + +module.exports = $defineProperty; + + +/***/ }), + +/***/ 3056: +/***/ ((module) => { + + + +/** @type {import('./eval')} */ +module.exports = EvalError; + + +/***/ }), + +/***/ 1620: +/***/ ((module) => { + + + +/** @type {import('.')} */ +module.exports = Error; + + +/***/ }), + +/***/ 4585: +/***/ ((module) => { + + + +/** @type {import('./range')} */ +module.exports = RangeError; + + +/***/ }), + +/***/ 6905: +/***/ ((module) => { + + + +/** @type {import('./ref')} */ +module.exports = ReferenceError; + + +/***/ }), + +/***/ 105: +/***/ ((module) => { + + + +/** @type {import('./syntax')} */ +module.exports = SyntaxError; + + +/***/ }), + +/***/ 3314: +/***/ ((module) => { + + + +/** @type {import('./type')} */ +module.exports = TypeError; + + +/***/ }), + +/***/ 2578: +/***/ ((module) => { + + + +/** @type {import('./uri')} */ +module.exports = URIError; + + +/***/ }), + +/***/ 5399: +/***/ ((module) => { + + + +/** @type {import('.')} */ +module.exports = Object; + + +/***/ }), + +/***/ 3045: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(9896); +var util = __nccwpck_require__(9023); +var stream = __nccwpck_require__(2203); +var Readable = stream.Readable; +var Writable = stream.Writable; +var PassThrough = stream.PassThrough; +var Pend = __nccwpck_require__(3313); +var EventEmitter = (__nccwpck_require__(4434).EventEmitter); + +exports.createFromBuffer = createFromBuffer; +exports.createFromFd = createFromFd; +exports.BufferSlicer = BufferSlicer; +exports.FdSlicer = FdSlicer; + +util.inherits(FdSlicer, EventEmitter); +function FdSlicer(fd, options) { + options = options || {}; + EventEmitter.call(this); + + this.fd = fd; + this.pend = new Pend(); + this.pend.max = 1; + this.refCount = 0; + this.autoClose = !!options.autoClose; +} + +FdSlicer.prototype.read = function(buffer, offset, length, position, callback) { + var self = this; + self.pend.go(function(cb) { + fs.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) { + cb(); + callback(err, bytesRead, buffer); + }); + }); +}; + +FdSlicer.prototype.write = function(buffer, offset, length, position, callback) { + var self = this; + self.pend.go(function(cb) { + fs.write(self.fd, buffer, offset, length, position, function(err, written, buffer) { + cb(); + callback(err, written, buffer); + }); + }); +}; + +FdSlicer.prototype.createReadStream = function(options) { + return new ReadStream(this, options); +}; + +FdSlicer.prototype.createWriteStream = function(options) { + return new WriteStream(this, options); +}; + +FdSlicer.prototype.ref = function() { + this.refCount += 1; +}; + +FdSlicer.prototype.unref = function() { + var self = this; + self.refCount -= 1; + + if (self.refCount > 0) return; + if (self.refCount < 0) throw new Error("invalid unref"); + + if (self.autoClose) { + fs.close(self.fd, onCloseDone); + } + + function onCloseDone(err) { + if (err) { + self.emit('error', err); + } else { + self.emit('close'); + } + } +}; + +util.inherits(ReadStream, Readable); +function ReadStream(context, options) { + options = options || {}; + Readable.call(this, options); + + this.context = context; + this.context.ref(); + + this.start = options.start || 0; + this.endOffset = options.end; + this.pos = this.start; + this.destroyed = false; +} + +ReadStream.prototype._read = function(n) { + var self = this; + if (self.destroyed) return; + + var toRead = Math.min(self._readableState.highWaterMark, n); + if (self.endOffset != null) { + toRead = Math.min(toRead, self.endOffset - self.pos); + } + if (toRead <= 0) { + self.destroyed = true; + self.push(null); + self.context.unref(); + return; + } + self.context.pend.go(function(cb) { + if (self.destroyed) return cb(); + var buffer = new Buffer(toRead); + fs.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) { + if (err) { + self.destroy(err); + } else if (bytesRead === 0) { + self.destroyed = true; + self.push(null); + self.context.unref(); + } else { + self.pos += bytesRead; + self.push(buffer.slice(0, bytesRead)); + } + cb(); + }); + }); +}; + +ReadStream.prototype.destroy = function(err) { + if (this.destroyed) return; + err = err || new Error("stream destroyed"); + this.destroyed = true; + this.emit('error', err); + this.context.unref(); +}; + +util.inherits(WriteStream, Writable); +function WriteStream(context, options) { + options = options || {}; + Writable.call(this, options); + + this.context = context; + this.context.ref(); + + this.start = options.start || 0; + this.endOffset = (options.end == null) ? Infinity : +options.end; + this.bytesWritten = 0; + this.pos = this.start; + this.destroyed = false; + + this.on('finish', this.destroy.bind(this)); +} + +WriteStream.prototype._write = function(buffer, encoding, callback) { + var self = this; + if (self.destroyed) return; + + if (self.pos + buffer.length > self.endOffset) { + var err = new Error("maximum file length exceeded"); + err.code = 'ETOOBIG'; + self.destroy(); + callback(err); + return; + } + self.context.pend.go(function(cb) { + if (self.destroyed) return cb(); + fs.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) { + if (err) { + self.destroy(); + cb(); + callback(err); + } else { + self.bytesWritten += bytes; + self.pos += bytes; + self.emit('progress'); + cb(); + callback(); + } + }); + }); +}; + +WriteStream.prototype.destroy = function() { + if (this.destroyed) return; + this.destroyed = true; + this.context.unref(); +}; + +util.inherits(BufferSlicer, EventEmitter); +function BufferSlicer(buffer, options) { + EventEmitter.call(this); + + options = options || {}; + this.refCount = 0; + this.buffer = buffer; + this.maxChunkSize = options.maxChunkSize || Number.MAX_SAFE_INTEGER; +} + +BufferSlicer.prototype.read = function(buffer, offset, length, position, callback) { + var end = position + length; + var delta = end - this.buffer.length; + var written = (delta > 0) ? delta : length; + this.buffer.copy(buffer, offset, position, end); + setImmediate(function() { + callback(null, written); + }); +}; + +BufferSlicer.prototype.write = function(buffer, offset, length, position, callback) { + buffer.copy(this.buffer, position, offset, offset + length); + setImmediate(function() { + callback(null, length, buffer); + }); +}; + +BufferSlicer.prototype.createReadStream = function(options) { + options = options || {}; + var readStream = new PassThrough(options); + readStream.destroyed = false; + readStream.start = options.start || 0; + readStream.endOffset = options.end; + // by the time this function returns, we'll be done. + readStream.pos = readStream.endOffset || this.buffer.length; + + // respect the maxChunkSize option to slice up the chunk into smaller pieces. + var entireSlice = this.buffer.slice(readStream.start, readStream.pos); + var offset = 0; + while (true) { + var nextOffset = offset + this.maxChunkSize; + if (nextOffset >= entireSlice.length) { + // last chunk + if (offset < entireSlice.length) { + readStream.write(entireSlice.slice(offset, entireSlice.length)); + } + break; + } + readStream.write(entireSlice.slice(offset, nextOffset)); + offset = nextOffset; + } + + readStream.end(); + readStream.destroy = function() { + readStream.destroyed = true; + }; + return readStream; +}; + +BufferSlicer.prototype.createWriteStream = function(options) { + var bufferSlicer = this; + options = options || {}; + var writeStream = new Writable(options); + writeStream.start = options.start || 0; + writeStream.endOffset = (options.end == null) ? this.buffer.length : +options.end; + writeStream.bytesWritten = 0; + writeStream.pos = writeStream.start; + writeStream.destroyed = false; + writeStream._write = function(buffer, encoding, callback) { + if (writeStream.destroyed) return; + + var end = writeStream.pos + buffer.length; + if (end > writeStream.endOffset) { + var err = new Error("maximum file length exceeded"); + err.code = 'ETOOBIG'; + writeStream.destroyed = true; + callback(err); + return; + } + buffer.copy(bufferSlicer.buffer, writeStream.pos, 0, buffer.length); + + writeStream.bytesWritten += buffer.length; + writeStream.pos = end; + writeStream.emit('progress'); + callback(); + }; + writeStream.destroy = function() { + writeStream.destroyed = true; + }; + return writeStream; +}; + +BufferSlicer.prototype.ref = function() { + this.refCount += 1; +}; + +BufferSlicer.prototype.unref = function() { + this.refCount -= 1; + + if (this.refCount < 0) { + throw new Error("invalid unref"); + } +}; + +function createFromBuffer(buffer, options) { + return new BufferSlicer(buffer, options); +} + +function createFromFd(fd, options) { + return new FdSlicer(fd, options); +} + + +/***/ }), + +/***/ 8989: +/***/ ((module) => { + + + +module.exports = input => { + const buf = new Uint8Array(input); + + if (!(buf && buf.length > 1)) { + return null; + } + + const check = (header, opts) => { + opts = Object.assign({ + offset: 0 + }, opts); + + for (let i = 0; i < header.length; i++) { + if (header[i] !== buf[i + opts.offset]) { + return false; + } + } + + return true; + }; + + if (check([0xFF, 0xD8, 0xFF])) { + return { + ext: 'jpg', + mime: 'image/jpeg' + }; + } + + if (check([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])) { + return { + ext: 'png', + mime: 'image/png' + }; + } + + if (check([0x47, 0x49, 0x46])) { + return { + ext: 'gif', + mime: 'image/gif' + }; + } + + if (check([0x57, 0x45, 0x42, 0x50], {offset: 8})) { + return { + ext: 'webp', + mime: 'image/webp' + }; + } + + if (check([0x46, 0x4C, 0x49, 0x46])) { + return { + ext: 'flif', + mime: 'image/flif' + }; + } + + // Needs to be before `tif` check + if ( + (check([0x49, 0x49, 0x2A, 0x0]) || check([0x4D, 0x4D, 0x0, 0x2A])) && + check([0x43, 0x52], {offset: 8}) + ) { + return { + ext: 'cr2', + mime: 'image/x-canon-cr2' + }; + } + + if ( + check([0x49, 0x49, 0x2A, 0x0]) || + check([0x4D, 0x4D, 0x0, 0x2A]) + ) { + return { + ext: 'tif', + mime: 'image/tiff' + }; + } + + if (check([0x42, 0x4D])) { + return { + ext: 'bmp', + mime: 'image/bmp' + }; + } + + if (check([0x49, 0x49, 0xBC])) { + return { + ext: 'jxr', + mime: 'image/vnd.ms-photo' + }; + } + + if (check([0x38, 0x42, 0x50, 0x53])) { + return { + ext: 'psd', + mime: 'image/vnd.adobe.photoshop' + }; + } + + // Needs to be before the `zip` check + if ( + check([0x50, 0x4B, 0x3, 0x4]) && + check([0x6D, 0x69, 0x6D, 0x65, 0x74, 0x79, 0x70, 0x65, 0x61, 0x70, 0x70, 0x6C, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x2F, 0x65, 0x70, 0x75, 0x62, 0x2B, 0x7A, 0x69, 0x70], {offset: 30}) + ) { + return { + ext: 'epub', + mime: 'application/epub+zip' + }; + } + + // Needs to be before `zip` check + // Assumes signed `.xpi` from addons.mozilla.org + if ( + check([0x50, 0x4B, 0x3, 0x4]) && + check([0x4D, 0x45, 0x54, 0x41, 0x2D, 0x49, 0x4E, 0x46, 0x2F, 0x6D, 0x6F, 0x7A, 0x69, 0x6C, 0x6C, 0x61, 0x2E, 0x72, 0x73, 0x61], {offset: 30}) + ) { + return { + ext: 'xpi', + mime: 'application/x-xpinstall' + }; + } + + if ( + check([0x50, 0x4B]) && + (buf[2] === 0x3 || buf[2] === 0x5 || buf[2] === 0x7) && + (buf[3] === 0x4 || buf[3] === 0x6 || buf[3] === 0x8) + ) { + return { + ext: 'zip', + mime: 'application/zip' + }; + } + + if (check([0x75, 0x73, 0x74, 0x61, 0x72], {offset: 257})) { + return { + ext: 'tar', + mime: 'application/x-tar' + }; + } + + if ( + check([0x52, 0x61, 0x72, 0x21, 0x1A, 0x7]) && + (buf[6] === 0x0 || buf[6] === 0x1) + ) { + return { + ext: 'rar', + mime: 'application/x-rar-compressed' + }; + } + + if (check([0x1F, 0x8B, 0x8])) { + return { + ext: 'gz', + mime: 'application/gzip' + }; + } + + if (check([0x42, 0x5A, 0x68])) { + return { + ext: 'bz2', + mime: 'application/x-bzip2' + }; + } + + if (check([0x37, 0x7A, 0xBC, 0xAF, 0x27, 0x1C])) { + return { + ext: '7z', + mime: 'application/x-7z-compressed' + }; + } + + if (check([0x78, 0x01])) { + return { + ext: 'dmg', + mime: 'application/x-apple-diskimage' + }; + } + + if ( + ( + check([0x0, 0x0, 0x0]) && + (buf[3] === 0x18 || buf[3] === 0x20) && + check([0x66, 0x74, 0x79, 0x70], {offset: 4}) + ) || + check([0x33, 0x67, 0x70, 0x35]) || + ( + check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34, 0x32]) && + check([0x6D, 0x70, 0x34, 0x31, 0x6D, 0x70, 0x34, 0x32, 0x69, 0x73, 0x6F, 0x6D], {offset: 16}) + ) || + check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x69, 0x73, 0x6F, 0x6D]) || + check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x6D, 0x70, 0x34, 0x32, 0x0, 0x0, 0x0, 0x0]) + ) { + return { + ext: 'mp4', + mime: 'video/mp4' + }; + } + + if (check([0x0, 0x0, 0x0, 0x1C, 0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x56])) { + return { + ext: 'm4v', + mime: 'video/x-m4v' + }; + } + + if (check([0x4D, 0x54, 0x68, 0x64])) { + return { + ext: 'mid', + mime: 'audio/midi' + }; + } + + // https://github.com/threatstack/libmagic/blob/master/magic/Magdir/matroska + if (check([0x1A, 0x45, 0xDF, 0xA3])) { + const sliced = buf.subarray(4, 4 + 4096); + const idPos = sliced.findIndex((el, i, arr) => arr[i] === 0x42 && arr[i + 1] === 0x82); + + if (idPos >= 0) { + const docTypePos = idPos + 3; + const findDocType = type => Array.from(type).every((c, i) => sliced[docTypePos + i] === c.charCodeAt(0)); + + if (findDocType('matroska')) { + return { + ext: 'mkv', + mime: 'video/x-matroska' + }; + } + + if (findDocType('webm')) { + return { + ext: 'webm', + mime: 'video/webm' + }; + } + } + } + + if (check([0x0, 0x0, 0x0, 0x14, 0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20]) || + check([0x66, 0x72, 0x65, 0x65], {offset: 4}) || + check([0x66, 0x74, 0x79, 0x70, 0x71, 0x74, 0x20, 0x20], {offset: 4}) || + check([0x6D, 0x64, 0x61, 0x74], {offset: 4}) || // MJPEG + check([0x77, 0x69, 0x64, 0x65], {offset: 4})) { + return { + ext: 'mov', + mime: 'video/quicktime' + }; + } + + if ( + check([0x52, 0x49, 0x46, 0x46]) && + check([0x41, 0x56, 0x49], {offset: 8}) + ) { + return { + ext: 'avi', + mime: 'video/x-msvideo' + }; + } + + if (check([0x30, 0x26, 0xB2, 0x75, 0x8E, 0x66, 0xCF, 0x11, 0xA6, 0xD9])) { + return { + ext: 'wmv', + mime: 'video/x-ms-wmv' + }; + } + + if (check([0x0, 0x0, 0x1, 0xBA])) { + return { + ext: 'mpg', + mime: 'video/mpeg' + }; + } + + if ( + check([0x49, 0x44, 0x33]) || + check([0xFF, 0xFB]) + ) { + return { + ext: 'mp3', + mime: 'audio/mpeg' + }; + } + + if ( + check([0x66, 0x74, 0x79, 0x70, 0x4D, 0x34, 0x41], {offset: 4}) || + check([0x4D, 0x34, 0x41, 0x20]) + ) { + return { + ext: 'm4a', + mime: 'audio/m4a' + }; + } + + // Needs to be before `ogg` check + if (check([0x4F, 0x70, 0x75, 0x73, 0x48, 0x65, 0x61, 0x64], {offset: 28})) { + return { + ext: 'opus', + mime: 'audio/opus' + }; + } + + if (check([0x4F, 0x67, 0x67, 0x53])) { + return { + ext: 'ogg', + mime: 'audio/ogg' + }; + } + + if (check([0x66, 0x4C, 0x61, 0x43])) { + return { + ext: 'flac', + mime: 'audio/x-flac' + }; + } + + if ( + check([0x52, 0x49, 0x46, 0x46]) && + check([0x57, 0x41, 0x56, 0x45], {offset: 8}) + ) { + return { + ext: 'wav', + mime: 'audio/x-wav' + }; + } + + if (check([0x23, 0x21, 0x41, 0x4D, 0x52, 0x0A])) { + return { + ext: 'amr', + mime: 'audio/amr' + }; + } + + if (check([0x25, 0x50, 0x44, 0x46])) { + return { + ext: 'pdf', + mime: 'application/pdf' + }; + } + + if (check([0x4D, 0x5A])) { + return { + ext: 'exe', + mime: 'application/x-msdownload' + }; + } + + if ( + (buf[0] === 0x43 || buf[0] === 0x46) && + check([0x57, 0x53], {offset: 1}) + ) { + return { + ext: 'swf', + mime: 'application/x-shockwave-flash' + }; + } + + if (check([0x7B, 0x5C, 0x72, 0x74, 0x66])) { + return { + ext: 'rtf', + mime: 'application/rtf' + }; + } + + if (check([0x00, 0x61, 0x73, 0x6D])) { + return { + ext: 'wasm', + mime: 'application/wasm' + }; + } + + if ( + check([0x77, 0x4F, 0x46, 0x46]) && + ( + check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || + check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) + ) + ) { + return { + ext: 'woff', + mime: 'font/woff' + }; + } + + if ( + check([0x77, 0x4F, 0x46, 0x32]) && + ( + check([0x00, 0x01, 0x00, 0x00], {offset: 4}) || + check([0x4F, 0x54, 0x54, 0x4F], {offset: 4}) + ) + ) { + return { + ext: 'woff2', + mime: 'font/woff2' + }; + } + + if ( + check([0x4C, 0x50], {offset: 34}) && + ( + check([0x00, 0x00, 0x01], {offset: 8}) || + check([0x01, 0x00, 0x02], {offset: 8}) || + check([0x02, 0x00, 0x02], {offset: 8}) + ) + ) { + return { + ext: 'eot', + mime: 'application/octet-stream' + }; + } + + if (check([0x00, 0x01, 0x00, 0x00, 0x00])) { + return { + ext: 'ttf', + mime: 'font/ttf' + }; + } + + if (check([0x4F, 0x54, 0x54, 0x4F, 0x00])) { + return { + ext: 'otf', + mime: 'font/otf' + }; + } + + if (check([0x00, 0x00, 0x01, 0x00])) { + return { + ext: 'ico', + mime: 'image/x-icon' + }; + } + + if (check([0x46, 0x4C, 0x56, 0x01])) { + return { + ext: 'flv', + mime: 'video/x-flv' + }; + } + + if (check([0x25, 0x21])) { + return { + ext: 'ps', + mime: 'application/postscript' + }; + } + + if (check([0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00])) { + return { + ext: 'xz', + mime: 'application/x-xz' + }; + } + + if (check([0x53, 0x51, 0x4C, 0x69])) { + return { + ext: 'sqlite', + mime: 'application/x-sqlite3' + }; + } + + if (check([0x4E, 0x45, 0x53, 0x1A])) { + return { + ext: 'nes', + mime: 'application/x-nintendo-nes-rom' + }; + } + + if (check([0x43, 0x72, 0x32, 0x34])) { + return { + ext: 'crx', + mime: 'application/x-google-chrome-extension' + }; + } + + if ( + check([0x4D, 0x53, 0x43, 0x46]) || + check([0x49, 0x53, 0x63, 0x28]) + ) { + return { + ext: 'cab', + mime: 'application/vnd.ms-cab-compressed' + }; + } + + // Needs to be before `ar` check + if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])) { + return { + ext: 'deb', + mime: 'application/x-deb' + }; + } + + if (check([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E])) { + return { + ext: 'ar', + mime: 'application/x-unix-archive' + }; + } + + if (check([0xED, 0xAB, 0xEE, 0xDB])) { + return { + ext: 'rpm', + mime: 'application/x-rpm' + }; + } + + if ( + check([0x1F, 0xA0]) || + check([0x1F, 0x9D]) + ) { + return { + ext: 'Z', + mime: 'application/x-compress' + }; + } + + if (check([0x4C, 0x5A, 0x49, 0x50])) { + return { + ext: 'lz', + mime: 'application/x-lzip' + }; + } + + if (check([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1])) { + return { + ext: 'msi', + mime: 'application/x-msi' + }; + } + + if (check([0x06, 0x0E, 0x2B, 0x34, 0x02, 0x05, 0x01, 0x01, 0x0D, 0x01, 0x02, 0x01, 0x01, 0x02])) { + return { + ext: 'mxf', + mime: 'application/mxf' + }; + } + + if (check([0x47], {offset: 4}) && (check([0x47], {offset: 192}) || check([0x47], {offset: 196}))) { + return { + ext: 'mts', + mime: 'video/mp2t' + }; + } + + if (check([0x42, 0x4C, 0x45, 0x4E, 0x44, 0x45, 0x52])) { + return { + ext: 'blend', + mime: 'application/x-blender' + }; + } + + if (check([0x42, 0x50, 0x47, 0xFB])) { + return { + ext: 'bpg', + mime: 'image/bpg' + }; + } + + return null; +}; + + +/***/ }), + +/***/ 877: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/*! + * fill-range + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Licensed under the MIT License. + */ + + + +const util = __nccwpck_require__(9023); +const toRegexRange = __nccwpck_require__(7551); + +const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + +const transform = toNumber => { + return value => toNumber === true ? Number(value) : String(value); +}; + +const isValidValue = value => { + return typeof value === 'number' || (typeof value === 'string' && value !== ''); +}; + +const isNumber = num => Number.isInteger(+num); + +const zeros = input => { + let value = `${input}`; + let index = -1; + if (value[0] === '-') value = value.slice(1); + if (value === '0') return false; + while (value[++index] === '0'); + return index > 0; +}; + +const stringify = (start, end, options) => { + if (typeof start === 'string' || typeof end === 'string') { + return true; + } + return options.stringify === true; +}; + +const pad = (input, maxLength, toNumber) => { + if (maxLength > 0) { + let dash = input[0] === '-' ? '-' : ''; + if (dash) input = input.slice(1); + input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0')); + } + if (toNumber === false) { + return String(input); + } + return input; +}; + +const toMaxLen = (input, maxLength) => { + let negative = input[0] === '-' ? '-' : ''; + if (negative) { + input = input.slice(1); + maxLength--; + } + while (input.length < maxLength) input = '0' + input; + return negative ? ('-' + input) : input; +}; + +const toSequence = (parts, options, maxLen) => { + parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0); + + let prefix = options.capture ? '' : '?:'; + let positives = ''; + let negatives = ''; + let result; + + if (parts.positives.length) { + positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|'); + } + + if (parts.negatives.length) { + negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`; + } + + if (positives && negatives) { + result = `${positives}|${negatives}`; + } else { + result = positives || negatives; + } + + if (options.wrap) { + return `(${prefix}${result})`; + } + + return result; +}; + +const toRange = (a, b, isNumbers, options) => { + if (isNumbers) { + return toRegexRange(a, b, { wrap: false, ...options }); + } + + let start = String.fromCharCode(a); + if (a === b) return start; + + let stop = String.fromCharCode(b); + return `[${start}-${stop}]`; +}; + +const toRegex = (start, end, options) => { + if (Array.isArray(start)) { + let wrap = options.wrap === true; + let prefix = options.capture ? '' : '?:'; + return wrap ? `(${prefix}${start.join('|')})` : start.join('|'); + } + return toRegexRange(start, end, options); +}; + +const rangeError = (...args) => { + return new RangeError('Invalid range arguments: ' + util.inspect(...args)); +}; + +const invalidRange = (start, end, options) => { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; +}; + +const invalidStep = (step, options) => { + if (options.strictRanges === true) { + throw new TypeError(`Expected step "${step}" to be a number`); + } + return []; +}; + +const fillNumbers = (start, end, step = 1, options = {}) => { + let a = Number(start); + let b = Number(end); + + if (!Number.isInteger(a) || !Number.isInteger(b)) { + if (options.strictRanges === true) throw rangeError([start, end]); + return []; + } + + // fix negative zero + if (a === 0) a = 0; + if (b === 0) b = 0; + + let descending = a > b; + let startString = String(start); + let endString = String(end); + let stepString = String(step); + step = Math.max(Math.abs(step), 1); + + let padded = zeros(startString) || zeros(endString) || zeros(stepString); + let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0; + let toNumber = padded === false && stringify(start, end, options) === false; + let format = options.transform || transform(toNumber); + + if (options.toRegex && step === 1) { + return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options); + } + + let parts = { negatives: [], positives: [] }; + let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num)); + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + if (options.toRegex === true && step > 1) { + push(a); + } else { + range.push(pad(format(a, index), maxLen, toNumber)); + } + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return step > 1 + ? toSequence(parts, options, maxLen) + : toRegex(range, null, { wrap: false, ...options }); + } + + return range; +}; + +const fillLetters = (start, end, step = 1, options = {}) => { + if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) { + return invalidRange(start, end, options); + } + + let format = options.transform || (val => String.fromCharCode(val)); + let a = `${start}`.charCodeAt(0); + let b = `${end}`.charCodeAt(0); + + let descending = a > b; + let min = Math.min(a, b); + let max = Math.max(a, b); + + if (options.toRegex && step === 1) { + return toRange(min, max, false, options); + } + + let range = []; + let index = 0; + + while (descending ? a >= b : a <= b) { + range.push(format(a, index)); + a = descending ? a - step : a + step; + index++; + } + + if (options.toRegex === true) { + return toRegex(range, null, { wrap: false, options }); + } + + return range; +}; + +const fill = (start, end, step, options = {}) => { + if (end == null && isValidValue(start)) { + return [start]; + } + + if (!isValidValue(start) || !isValidValue(end)) { + return invalidRange(start, end, options); + } + + if (typeof step === 'function') { + return fill(start, end, 1, { transform: step }); + } + + if (isObject(step)) { + return fill(start, end, 0, step); + } + + let opts = { ...options }; + if (opts.capture === true) opts.wrap = true; + step = step || opts.step || 1; + + if (!isNumber(step)) { + if (step != null && !isObject(step)) return invalidStep(step, opts); + return fill(start, end, 1, step); + } + + if (isNumber(start) && isNumber(end)) { + return fillNumbers(start, end, step, opts); + } + + return fillLetters(start, end, Math.max(Math.abs(step), 1), opts); +}; + +module.exports = fill; + + +/***/ }), + +/***/ 4778: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var debug; + +module.exports = function () { + if (!debug) { + try { + /* eslint global-require: off */ + debug = __nccwpck_require__(983)("follow-redirects"); + } + catch (error) { /* */ } + if (typeof debug !== "function") { + debug = function () { /* */ }; + } + } + debug.apply(null, arguments); +}; + + +/***/ }), + +/***/ 1573: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var url = __nccwpck_require__(7016); +var URL = url.URL; +var http = __nccwpck_require__(8611); +var https = __nccwpck_require__(5692); +var Writable = (__nccwpck_require__(2203).Writable); +var assert = __nccwpck_require__(2613); +var debug = __nccwpck_require__(4778); + +// Preventive platform detection +// istanbul ignore next +(function detectUnsupportedEnvironment() { + var looksLikeNode = typeof process !== "undefined"; + var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var looksLikeV8 = isFunction(Error.captureStackTrace); + if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) { + console.warn("The follow-redirects package should be excluded from browser builds."); + } +}()); + +// Whether to use the native URL object or the legacy url module +var useNativeURL = false; +try { + assert(new URL("")); +} +catch (error) { + useNativeURL = error.code === "ERR_INVALID_URL"; +} + +// URL fields to preserve in copy operations +var preservedUrlFields = [ + "auth", + "host", + "hostname", + "href", + "path", + "pathname", + "port", + "protocol", + "query", + "search", + "hash", +]; + +// Create handlers that pass events from native requests +var events = ["abort", "aborted", "connect", "error", "socket", "timeout"]; +var eventHandlers = Object.create(null); +events.forEach(function (event) { + eventHandlers[event] = function (arg1, arg2, arg3) { + this._redirectable.emit(event, arg1, arg2, arg3); + }; +}); + +// Error types with codes +var InvalidUrlError = createErrorType( + "ERR_INVALID_URL", + "Invalid URL", + TypeError +); +var RedirectionError = createErrorType( + "ERR_FR_REDIRECTION_FAILURE", + "Redirected request failed" +); +var TooManyRedirectsError = createErrorType( + "ERR_FR_TOO_MANY_REDIRECTS", + "Maximum number of redirects exceeded", + RedirectionError +); +var MaxBodyLengthExceededError = createErrorType( + "ERR_FR_MAX_BODY_LENGTH_EXCEEDED", + "Request body larger than maxBodyLength limit" +); +var WriteAfterEndError = createErrorType( + "ERR_STREAM_WRITE_AFTER_END", + "write after end" +); + +// istanbul ignore next +var destroy = Writable.prototype.destroy || noop; + +// An HTTP(S) request that can be redirected +function RedirectableRequest(options, responseCallback) { + // Initialize the request + Writable.call(this); + this._sanitizeOptions(options); + this._options = options; + this._ended = false; + this._ending = false; + this._redirectCount = 0; + this._redirects = []; + this._requestBodyLength = 0; + this._requestBodyBuffers = []; + + // Attach a callback if passed + if (responseCallback) { + this.on("response", responseCallback); + } + + // React to responses of native requests + var self = this; + this._onNativeResponse = function (response) { + try { + self._processResponse(response); + } + catch (cause) { + self.emit("error", cause instanceof RedirectionError ? + cause : new RedirectionError({ cause: cause })); + } + }; + + // Perform the first request + this._performRequest(); +} +RedirectableRequest.prototype = Object.create(Writable.prototype); + +RedirectableRequest.prototype.abort = function () { + destroyRequest(this._currentRequest); + this._currentRequest.abort(); + this.emit("abort"); +}; + +RedirectableRequest.prototype.destroy = function (error) { + destroyRequest(this._currentRequest, error); + destroy.call(this, error); + return this; +}; + +// Writes buffered data to the current native request +RedirectableRequest.prototype.write = function (data, encoding, callback) { + // Writing is not allowed if end has been called + if (this._ending) { + throw new WriteAfterEndError(); + } + + // Validate input and shift parameters if necessary + if (!isString(data) && !isBuffer(data)) { + throw new TypeError("data should be a string, Buffer or Uint8Array"); + } + if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + + // Ignore empty buffers, since writing them doesn't invoke the callback + // https://github.com/nodejs/node/issues/22066 + if (data.length === 0) { + if (callback) { + callback(); + } + return; + } + // Only write when we don't exceed the maximum body length + if (this._requestBodyLength + data.length <= this._options.maxBodyLength) { + this._requestBodyLength += data.length; + this._requestBodyBuffers.push({ data: data, encoding: encoding }); + this._currentRequest.write(data, encoding, callback); + } + // Error when we exceed the maximum body length + else { + this.emit("error", new MaxBodyLengthExceededError()); + this.abort(); + } +}; + +// Ends the current native request +RedirectableRequest.prototype.end = function (data, encoding, callback) { + // Shift parameters if necessary + if (isFunction(data)) { + callback = data; + data = encoding = null; + } + else if (isFunction(encoding)) { + callback = encoding; + encoding = null; + } + + // Write data if needed and end + if (!data) { + this._ended = this._ending = true; + this._currentRequest.end(null, null, callback); + } + else { + var self = this; + var currentRequest = this._currentRequest; + this.write(data, encoding, function () { + self._ended = true; + currentRequest.end(null, null, callback); + }); + this._ending = true; + } +}; + +// Sets a header value on the current native request +RedirectableRequest.prototype.setHeader = function (name, value) { + this._options.headers[name] = value; + this._currentRequest.setHeader(name, value); +}; + +// Clears a header value on the current native request +RedirectableRequest.prototype.removeHeader = function (name) { + delete this._options.headers[name]; + this._currentRequest.removeHeader(name); +}; + +// Global timeout for all underlying requests +RedirectableRequest.prototype.setTimeout = function (msecs, callback) { + var self = this; + + // Destroys the socket on timeout + function destroyOnTimeout(socket) { + socket.setTimeout(msecs); + socket.removeListener("timeout", socket.destroy); + socket.addListener("timeout", socket.destroy); + } + + // Sets up a timer to trigger a timeout event + function startTimer(socket) { + if (self._timeout) { + clearTimeout(self._timeout); + } + self._timeout = setTimeout(function () { + self.emit("timeout"); + clearTimer(); + }, msecs); + destroyOnTimeout(socket); + } + + // Stops a timeout from triggering + function clearTimer() { + // Clear the timeout + if (self._timeout) { + clearTimeout(self._timeout); + self._timeout = null; + } + + // Clean up all attached listeners + self.removeListener("abort", clearTimer); + self.removeListener("error", clearTimer); + self.removeListener("response", clearTimer); + self.removeListener("close", clearTimer); + if (callback) { + self.removeListener("timeout", callback); + } + if (!self.socket) { + self._currentRequest.removeListener("socket", startTimer); + } + } + + // Attach callback if passed + if (callback) { + this.on("timeout", callback); + } + + // Start the timer if or when the socket is opened + if (this.socket) { + startTimer(this.socket); + } + else { + this._currentRequest.once("socket", startTimer); + } + + // Clean up on events + this.on("socket", destroyOnTimeout); + this.on("abort", clearTimer); + this.on("error", clearTimer); + this.on("response", clearTimer); + this.on("close", clearTimer); + + return this; +}; + +// Proxy all other public ClientRequest methods +[ + "flushHeaders", "getHeader", + "setNoDelay", "setSocketKeepAlive", +].forEach(function (method) { + RedirectableRequest.prototype[method] = function (a, b) { + return this._currentRequest[method](a, b); + }; +}); + +// Proxy all public ClientRequest properties +["aborted", "connection", "socket"].forEach(function (property) { + Object.defineProperty(RedirectableRequest.prototype, property, { + get: function () { return this._currentRequest[property]; }, + }); +}); + +RedirectableRequest.prototype._sanitizeOptions = function (options) { + // Ensure headers are always present + if (!options.headers) { + options.headers = {}; + } + + // Since http.request treats host as an alias of hostname, + // but the url module interprets host as hostname plus port, + // eliminate the host property to avoid confusion. + if (options.host) { + // Use hostname if set, because it has precedence + if (!options.hostname) { + options.hostname = options.host; + } + delete options.host; + } + + // Complete the URL object when necessary + if (!options.pathname && options.path) { + var searchPos = options.path.indexOf("?"); + if (searchPos < 0) { + options.pathname = options.path; + } + else { + options.pathname = options.path.substring(0, searchPos); + options.search = options.path.substring(searchPos); + } + } +}; + + +// Executes the next native request (initial or redirect) +RedirectableRequest.prototype._performRequest = function () { + // Load the native protocol + var protocol = this._options.protocol; + var nativeProtocol = this._options.nativeProtocols[protocol]; + if (!nativeProtocol) { + throw new TypeError("Unsupported protocol " + protocol); + } + + // If specified, use the agent corresponding to the protocol + // (HTTP and HTTPS use different types of agents) + if (this._options.agents) { + var scheme = protocol.slice(0, -1); + this._options.agent = this._options.agents[scheme]; + } + + // Create the native request and set up its event handlers + var request = this._currentRequest = + nativeProtocol.request(this._options, this._onNativeResponse); + request._redirectable = this; + for (var event of events) { + request.on(event, eventHandlers[event]); + } + + // RFC7230§5.3.1: When making a request directly to an origin server, […] + // a client MUST send only the absolute path […] as the request-target. + this._currentUrl = /^\//.test(this._options.path) ? + url.format(this._options) : + // When making a request to a proxy, […] + // a client MUST send the target URI in absolute-form […]. + this._options.path; + + // End a redirected request + // (The first request must be ended explicitly with RedirectableRequest#end) + if (this._isRedirect) { + // Write the request entity and end + var i = 0; + var self = this; + var buffers = this._requestBodyBuffers; + (function writeNext(error) { + // Only write if this request has not been redirected yet + // istanbul ignore else + if (request === self._currentRequest) { + // Report any write errors + // istanbul ignore if + if (error) { + self.emit("error", error); + } + // Write the next buffer if there are still left + else if (i < buffers.length) { + var buffer = buffers[i++]; + // istanbul ignore else + if (!request.finished) { + request.write(buffer.data, buffer.encoding, writeNext); + } + } + // End the request if `end` has been called on us + else if (self._ended) { + request.end(); + } + } + }()); + } +}; + +// Processes a response from the current native request +RedirectableRequest.prototype._processResponse = function (response) { + // Store the redirected response + var statusCode = response.statusCode; + if (this._options.trackRedirects) { + this._redirects.push({ + url: this._currentUrl, + headers: response.headers, + statusCode: statusCode, + }); + } + + // RFC7231§6.4: The 3xx (Redirection) class of status code indicates + // that further action needs to be taken by the user agent in order to + // fulfill the request. If a Location header field is provided, + // the user agent MAY automatically redirect its request to the URI + // referenced by the Location field value, + // even if the specific status code is not understood. + + // If the response is not a redirect; return it as-is + var location = response.headers.location; + if (!location || this._options.followRedirects === false || + statusCode < 300 || statusCode >= 400) { + response.responseUrl = this._currentUrl; + response.redirects = this._redirects; + this.emit("response", response); + + // Clean up + this._requestBodyBuffers = []; + return; + } + + // The response is a redirect, so abort the current request + destroyRequest(this._currentRequest); + // Discard the remainder of the response to avoid waiting for data + response.destroy(); + + // RFC7231§6.4: A client SHOULD detect and intervene + // in cyclical redirections (i.e., "infinite" redirection loops). + if (++this._redirectCount > this._options.maxRedirects) { + throw new TooManyRedirectsError(); + } + + // Store the request headers if applicable + var requestHeaders; + var beforeRedirect = this._options.beforeRedirect; + if (beforeRedirect) { + requestHeaders = Object.assign({ + // The Host header was set by nativeProtocol.request + Host: response.req.getHeader("host"), + }, this._options.headers); + } + + // RFC7231§6.4: Automatic redirection needs to done with + // care for methods not known to be safe, […] + // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change + // the request method from POST to GET for the subsequent request. + var method = this._options.method; + if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || + // RFC7231§6.4.4: The 303 (See Other) status code indicates that + // the server is redirecting the user agent to a different resource […] + // A user agent can perform a retrieval request targeting that URI + // (a GET or HEAD request if using HTTP) […] + (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) { + this._options.method = "GET"; + // Drop a possible entity and headers related to it + this._requestBodyBuffers = []; + removeMatchingHeaders(/^content-/i, this._options.headers); + } + + // Drop the Host header, as the redirect might lead to a different host + var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers); + + // If the redirect is relative, carry over the host of the last request + var currentUrlParts = parseUrl(this._currentUrl); + var currentHost = currentHostHeader || currentUrlParts.host; + var currentUrl = /^\w+:/.test(location) ? this._currentUrl : + url.format(Object.assign(currentUrlParts, { host: currentHost })); + + // Create the redirected request + var redirectUrl = resolveUrl(location, currentUrl); + debug("redirecting to", redirectUrl.href); + this._isRedirect = true; + spreadUrlObject(redirectUrl, this._options); + + // Drop confidential headers when redirecting to a less secure protocol + // or to a different domain that is not a superdomain + if (redirectUrl.protocol !== currentUrlParts.protocol && + redirectUrl.protocol !== "https:" || + redirectUrl.host !== currentHost && + !isSubdomain(redirectUrl.host, currentHost)) { + removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers); + } + + // Evaluate the beforeRedirect callback + if (isFunction(beforeRedirect)) { + var responseDetails = { + headers: response.headers, + statusCode: statusCode, + }; + var requestDetails = { + url: currentUrl, + method: method, + headers: requestHeaders, + }; + beforeRedirect(this._options, responseDetails, requestDetails); + this._sanitizeOptions(this._options); + } + + // Perform the redirected request + this._performRequest(); +}; + +// Wraps the key/value object of protocols with redirect functionality +function wrap(protocols) { + // Default settings + var exports = { + maxRedirects: 21, + maxBodyLength: 10 * 1024 * 1024, + }; + + // Wrap each protocol + var nativeProtocols = {}; + Object.keys(protocols).forEach(function (scheme) { + var protocol = scheme + ":"; + var nativeProtocol = nativeProtocols[protocol] = protocols[scheme]; + var wrappedProtocol = exports[scheme] = Object.create(nativeProtocol); + + // Executes a request, following redirects + function request(input, options, callback) { + // Parse parameters, ensuring that input is an object + if (isURL(input)) { + input = spreadUrlObject(input); + } + else if (isString(input)) { + input = spreadUrlObject(parseUrl(input)); + } + else { + callback = options; + options = validateUrl(input); + input = { protocol: protocol }; + } + if (isFunction(options)) { + callback = options; + options = null; + } + + // Set defaults + options = Object.assign({ + maxRedirects: exports.maxRedirects, + maxBodyLength: exports.maxBodyLength, + }, input, options); + options.nativeProtocols = nativeProtocols; + if (!isString(options.host) && !isString(options.hostname)) { + options.hostname = "::1"; + } + + assert.equal(options.protocol, protocol, "protocol mismatch"); + debug("options", options); + return new RedirectableRequest(options, callback); + } + + // Executes a GET request, following redirects + function get(input, options, callback) { + var wrappedRequest = wrappedProtocol.request(input, options, callback); + wrappedRequest.end(); + return wrappedRequest; + } + + // Expose the properties on the wrapped protocol + Object.defineProperties(wrappedProtocol, { + request: { value: request, configurable: true, enumerable: true, writable: true }, + get: { value: get, configurable: true, enumerable: true, writable: true }, + }); + }); + return exports; +} + +function noop() { /* empty */ } + +function parseUrl(input) { + var parsed; + // istanbul ignore else + if (useNativeURL) { + parsed = new URL(input); + } + else { + // Ensure the URL is valid and absolute + parsed = validateUrl(url.parse(input)); + if (!isString(parsed.protocol)) { + throw new InvalidUrlError({ input }); + } + } + return parsed; +} + +function resolveUrl(relative, base) { + // istanbul ignore next + return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative)); +} + +function validateUrl(input) { + if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) { + throw new InvalidUrlError({ input: input.href || input }); + } + if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) { + throw new InvalidUrlError({ input: input.href || input }); + } + return input; +} + +function spreadUrlObject(urlObject, target) { + var spread = target || {}; + for (var key of preservedUrlFields) { + spread[key] = urlObject[key]; + } + + // Fix IPv6 hostname + if (spread.hostname.startsWith("[")) { + spread.hostname = spread.hostname.slice(1, -1); + } + // Ensure port is a number + if (spread.port !== "") { + spread.port = Number(spread.port); + } + // Concatenate path + spread.path = spread.search ? spread.pathname + spread.search : spread.pathname; + + return spread; +} + +function removeMatchingHeaders(regex, headers) { + var lastValue; + for (var header in headers) { + if (regex.test(header)) { + lastValue = headers[header]; + delete headers[header]; + } + } + return (lastValue === null || typeof lastValue === "undefined") ? + undefined : String(lastValue).trim(); +} + +function createErrorType(code, message, baseClass) { + // Create constructor + function CustomError(properties) { + // istanbul ignore else + if (isFunction(Error.captureStackTrace)) { + Error.captureStackTrace(this, this.constructor); + } + Object.assign(this, properties || {}); + this.code = code; + this.message = this.cause ? message + ": " + this.cause.message : message; + } + + // Attach constructor and set default properties + CustomError.prototype = new (baseClass || Error)(); + Object.defineProperties(CustomError.prototype, { + constructor: { + value: CustomError, + enumerable: false, + }, + name: { + value: "Error [" + code + "]", + enumerable: false, + }, + }); + return CustomError; +} + +function destroyRequest(request, error) { + for (var event of events) { + request.removeListener(event, eventHandlers[event]); + } + request.on("error", noop); + request.destroy(error); +} + +function isSubdomain(subdomain, domain) { + assert(isString(subdomain) && isString(domain)); + var dot = subdomain.length - domain.length - 1; + return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain); +} + +function isString(value) { + return typeof value === "string" || value instanceof String; +} + +function isFunction(value) { + return typeof value === "function"; +} + +function isBuffer(value) { + return typeof value === "object" && ("length" in value); +} + +function isURL(value) { + return URL && value instanceof URL; +} + +// Exports +module.exports = wrap({ http: http, https: https }); +module.exports.wrap = wrap; + + +/***/ }), + +/***/ 4963: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var isCallable = __nccwpck_require__(9203); + +var toStr = Object.prototype.toString; +var hasOwnProperty = Object.prototype.hasOwnProperty; + +/** @type {(arr: A, iterator: (this: This | void, value: A[number], index: number, arr: A) => void, receiver: This | undefined) => void} */ +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); + } + } + } +}; + +/** @type {(string: S, iterator: (this: This | void, value: S[number], index: number, string: S) => void, receiver: This | undefined) => void} */ +var forEachString = function forEachString(string, iterator, receiver) { + for (var i = 0, len = string.length; i < len; i++) { + // no such thing as a sparse string. + if (receiver == null) { + iterator(string.charAt(i), i, string); + } else { + iterator.call(receiver, string.charAt(i), i, string); + } + } +}; + +/** @type {(obj: O, iterator: (this: This | void, value: O[keyof O], index: keyof O, obj: O) => void, receiver: This | undefined) => void} */ +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); + } + } + } +}; + +/** @type {(x: unknown) => x is readonly unknown[]} */ +function isArray(x) { + return toStr.call(x) === '[object Array]'; +} + +/** @type {import('.')._internal} */ +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); + } +}; + + +/***/ }), + +/***/ 2147: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = (__nccwpck_require__(9896).constants) || __nccwpck_require__(9140) + + +/***/ }), + +/***/ 9808: +/***/ ((module) => { + + + +/* eslint no-invalid-this: 1 */ + +var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible '; +var toStr = Object.prototype.toString; +var max = Math.max; +var funcType = '[object Function]'; + +var concatty = function 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; +}; + + +/***/ }), + +/***/ 7564: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var implementation = __nccwpck_require__(9808); + +module.exports = Function.prototype.bind || implementation; + + +/***/ }), + +/***/ 470: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var undefined; + +var $Object = __nccwpck_require__(5399); + +var $Error = __nccwpck_require__(1620); +var $EvalError = __nccwpck_require__(3056); +var $RangeError = __nccwpck_require__(4585); +var $ReferenceError = __nccwpck_require__(6905); +var $SyntaxError = __nccwpck_require__(105); +var $TypeError = __nccwpck_require__(3314); +var $URIError = __nccwpck_require__(2578); + +var abs = __nccwpck_require__(5641); +var floor = __nccwpck_require__(6171); +var max = __nccwpck_require__(7147); +var min = __nccwpck_require__(1017); +var pow = __nccwpck_require__(6947); +var round = __nccwpck_require__(2621); +var sign = __nccwpck_require__(156); + +var $Function = Function; + +// eslint-disable-next-line consistent-return +var getEvalledConstructor = function (expressionSyntax) { + try { + return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); + } catch (e) {} +}; + +var $gOPD = __nccwpck_require__(3170); +var $defineProperty = __nccwpck_require__(9094); + +var throwTypeError = function () { + throw new $TypeError(); +}; +var ThrowTypeError = $gOPD + ? (function () { + try { + // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties + arguments.callee; // IE 8 does not throw here + return throwTypeError; + } catch (calleeThrows) { + try { + // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') + return $gOPD(arguments, 'callee').get; + } catch (gOPDthrows) { + return throwTypeError; + } + } + }()) + : throwTypeError; + +var hasSymbols = __nccwpck_require__(3336)(); + +var getProto = __nccwpck_require__(1967); +var $ObjectGPO = __nccwpck_require__(1311); +var $ReflectGPO = __nccwpck_require__(8681); + +var $apply = __nccwpck_require__(3945); +var $call = __nccwpck_require__(8093); + +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, // eslint-disable-line no-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; // eslint-disable-line no-unused-expressions + } catch (e) { + // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229 + 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 = __nccwpck_require__(7564); +var hasOwn = __nccwpck_require__(4076); +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); + +/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ +var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; +var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ +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; +}; +/* end adaptation */ + +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: alias, + name: intrinsicName, + value: 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; + + // By convention, when a data property is converted to an accessor + // property to emulate a data property that does not suffer from + // the override mistake, that accessor's getter is marked with + // an `originalValue` property. Here, when we detect this, we + // uphold the illusion by pretending to see that original data + // property, i.e., returning the value rather than the getter + // itself. + 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; +}; + + +/***/ }), + +/***/ 1311: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var $Object = __nccwpck_require__(5399); + +/** @type {import('./Object.getPrototypeOf')} */ +module.exports = $Object.getPrototypeOf || null; + + +/***/ }), + +/***/ 8681: +/***/ ((module) => { + + + +/** @type {import('./Reflect.getPrototypeOf')} */ +module.exports = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null; + + +/***/ }), + +/***/ 1967: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var reflectGetProto = __nccwpck_require__(8681); +var originalGetProto = __nccwpck_require__(1311); + +var getDunderProto = __nccwpck_require__(6669); + +/** @type {import('.')} */ +module.exports = reflectGetProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return reflectGetProto(O); + } + : originalGetProto + ? function getProto(O) { + if (!O || (typeof O !== 'object' && typeof O !== 'function')) { + throw new TypeError('getProto: not an object'); + } + // @ts-expect-error TS can't narrow inside a closure, for some reason + return originalGetProto(O); + } + : getDunderProto + ? function getProto(O) { + // @ts-expect-error TS can't narrow inside a closure, for some reason + return getDunderProto(O); + } + : null; + + +/***/ }), + +/***/ 7070: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var PassThrough = (__nccwpck_require__(2203).PassThrough); +var objectAssign = __nccwpck_require__(4615); + +module.exports = function (opts) { + opts = objectAssign({}, opts); + + var array = opts.array; + var encoding = opts.encoding; + + var buffer = encoding === 'buffer'; + var objectMode = false; + + if (array) { + objectMode = !(encoding || buffer); + } else { + encoding = encoding || 'utf8'; + } + + if (buffer) { + encoding = null; + } + + var len = 0; + var ret = []; + + var stream = new PassThrough({objectMode: objectMode}); + + if (encoding) { + stream.setEncoding(encoding); + } + + stream.on('data', function (chunk) { + ret.push(chunk); + + if (objectMode) { + len = ret.length; + } else { + len += chunk.length; + } + }); + + stream.getBufferedValue = function () { + if (array) { + return ret; + } + return buffer ? Buffer.concat(ret, len) : ret.join(''); + }; + + stream.getBufferedLength = function () { + return len; + }; + + return stream; +}; + + +/***/ }), + +/***/ 6771: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +var Promise = __nccwpck_require__(3590); +var objectAssign = __nccwpck_require__(4615); +var bufferStream = __nccwpck_require__(7070); + +function getStream(inputStream, opts) { + if (!inputStream) { + return Promise.reject(new Error('Expected a stream')); + } + + opts = objectAssign({maxBuffer: Infinity}, opts); + var maxBuffer = opts.maxBuffer; + var stream; + var clean; + + var p = new Promise(function (resolve, reject) { + stream = bufferStream(opts); + inputStream.once('error', error); + inputStream.pipe(stream); + + stream.on('data', function () { + if (stream.getBufferedLength() > maxBuffer) { + reject(new Error('maxBuffer exceeded')); + } + }); + stream.once('error', error); + stream.on('end', resolve); + + clean = function () { + // some streams doesn't implement the stream.Readable interface correctly + if (inputStream.unpipe) { + inputStream.unpipe(stream); + } + }; + + function error(err) { + if (err) { // null check + err.bufferedData = stream.getBufferedValue(); + } + reject(err); + } + }); + + p.then(clean, clean); + + return p.then(function () { + return stream.getBufferedValue(); + }); +} + +module.exports = getStream; + +module.exports.buffer = function (stream, opts) { + return getStream(stream, objectAssign({}, opts, {encoding: 'buffer'})); +}; + +module.exports.array = function (stream, opts) { + return getStream(stream, objectAssign({}, opts, {array: true})); +}; + + +/***/ }), + +/***/ 8505: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var isGlob = __nccwpck_require__(1925); +var pathPosixDirname = (__nccwpck_require__(6928).posix).dirname; +var isWin32 = (__nccwpck_require__(857).platform)() === 'win32'; + +var slash = '/'; +var backslash = /\\/g; +var enclosure = /[\{\[].*[\}\]]$/; +var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/; +var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g; + +/** + * @param {string} str + * @param {Object} opts + * @param {boolean} [opts.flipBackslashes=true] + * @returns {string} + */ +module.exports = function globParent(str, opts) { + var options = Object.assign({ flipBackslashes: true }, opts); + + // flip windows path separators + if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) { + str = str.replace(backslash, slash); + } + + // special case for strings ending in enclosure containing path separator + if (enclosure.test(str)) { + str += slash; + } + + // preserves full path in case of trailing path separator + str += 'a'; + + // remove path parts that are globby + do { + str = pathPosixDirname(str); + } while (isGlob(str) || globby.test(str)); + + // remove escape chars and return result + return str.replace(escaped, '$1'); +}; + + +/***/ }), + +/***/ 1174: +/***/ ((module) => { + + + +/** @type {import('./gOPD')} */ +module.exports = Object.getOwnPropertyDescriptor; + + +/***/ }), + +/***/ 3170: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +/** @type {import('.')} */ +var $gOPD = __nccwpck_require__(1174); + +if ($gOPD) { + try { + $gOPD([], 'length'); + } catch (e) { + // IE 8 has a broken gOPD + $gOPD = null; + } +} + +module.exports = $gOPD; + + +/***/ }), + +/***/ 3964: +/***/ ((module) => { + + + +module.exports = clone + +var getPrototypeOf = Object.getPrototypeOf || function (obj) { + return obj.__proto__ +} + +function clone (obj) { + if (obj === null || typeof obj !== 'object') + return obj + + if (obj instanceof Object) + var copy = { __proto__: getPrototypeOf(obj) } + else + var copy = Object.create(null) + + Object.getOwnPropertyNames(obj).forEach(function (key) { + Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key)) + }) + + return copy +} + + +/***/ }), + +/***/ 5744: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(9896) +var polyfills = __nccwpck_require__(3501) +var legacy = __nccwpck_require__(2270) +var clone = __nccwpck_require__(3964) + +var util = __nccwpck_require__(9023) + +/* istanbul ignore next - node 0.x polyfill */ +var gracefulQueue +var previousSymbol + +/* istanbul ignore else - node 0.x polyfill */ +if (typeof Symbol === 'function' && typeof Symbol.for === 'function') { + gracefulQueue = Symbol.for('graceful-fs.queue') + // This is used in testing by future versions + previousSymbol = Symbol.for('graceful-fs.previous') +} else { + gracefulQueue = '___graceful-fs.queue' + previousSymbol = '___graceful-fs.previous' +} + +function noop () {} + +function publishQueue(context, queue) { + Object.defineProperty(context, gracefulQueue, { + get: function() { + return queue + } + }) +} + +var debug = noop +if (util.debuglog) + debug = util.debuglog('gfs4') +else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) + debug = function() { + var m = util.format.apply(util, arguments) + m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ') + console.error(m) + } + +// Once time initialization +if (!fs[gracefulQueue]) { + // This queue can be shared by multiple loaded instances + var queue = global[gracefulQueue] || [] + publishQueue(fs, queue) + + // Patch fs.close/closeSync to shared queue version, because we need + // to retry() whenever a close happens *anywhere* in the program. + // This is essential when multiple graceful-fs instances are + // in play at the same time. + fs.close = (function (fs$close) { + function close (fd, cb) { + return fs$close.call(fs, fd, function (err) { + // This function uses the graceful-fs shared queue + if (!err) { + resetQueue() + } + + if (typeof cb === 'function') + cb.apply(this, arguments) + }) + } + + Object.defineProperty(close, previousSymbol, { + value: fs$close + }) + return close + })(fs.close) + + fs.closeSync = (function (fs$closeSync) { + function closeSync (fd) { + // This function uses the graceful-fs shared queue + fs$closeSync.apply(fs, arguments) + resetQueue() + } + + Object.defineProperty(closeSync, previousSymbol, { + value: fs$closeSync + }) + return closeSync + })(fs.closeSync) + + if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { + process.on('exit', function() { + debug(fs[gracefulQueue]) + __nccwpck_require__(2613).equal(fs[gracefulQueue].length, 0) + }) + } +} + +if (!global[gracefulQueue]) { + publishQueue(global, fs[gracefulQueue]); +} + +module.exports = patch(clone(fs)) +if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) { + module.exports = patch(fs) + fs.__patched = true; +} + +function patch (fs) { + // Everything that references the open() function needs to be in here + polyfills(fs) + fs.gracefulify = patch + + fs.createReadStream = createReadStream + fs.createWriteStream = createWriteStream + var fs$readFile = fs.readFile + fs.readFile = readFile + function readFile (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$readFile(path, options, cb) + + function go$readFile (path, options, cb, startTime) { + return fs$readFile(path, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$readFile, [path, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$writeFile = fs.writeFile + fs.writeFile = writeFile + function writeFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$writeFile(path, data, options, cb) + + function go$writeFile (path, data, options, cb, startTime) { + return fs$writeFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$writeFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$appendFile = fs.appendFile + if (fs$appendFile) + fs.appendFile = appendFile + function appendFile (path, data, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + return go$appendFile(path, data, options, cb) + + function go$appendFile (path, data, options, cb, startTime) { + return fs$appendFile(path, data, options, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$appendFile, [path, data, options, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$copyFile = fs.copyFile + if (fs$copyFile) + fs.copyFile = copyFile + function copyFile (src, dest, flags, cb) { + if (typeof flags === 'function') { + cb = flags + flags = 0 + } + return go$copyFile(src, dest, flags, cb) + + function go$copyFile (src, dest, flags, cb, startTime) { + return fs$copyFile(src, dest, flags, function (err) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + var fs$readdir = fs.readdir + fs.readdir = readdir + var noReaddirOptionVersions = /^v[0-5]\./ + function readdir (path, options, cb) { + if (typeof options === 'function') + cb = options, options = null + + var go$readdir = noReaddirOptionVersions.test(process.version) + ? function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, fs$readdirCallback( + path, options, cb, startTime + )) + } + : function go$readdir (path, options, cb, startTime) { + return fs$readdir(path, options, fs$readdirCallback( + path, options, cb, startTime + )) + } + + return go$readdir(path, options, cb) + + function fs$readdirCallback (path, options, cb, startTime) { + return function (err, files) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([ + go$readdir, + [path, options, cb], + err, + startTime || Date.now(), + Date.now() + ]) + else { + if (files && files.sort) + files.sort() + + if (typeof cb === 'function') + cb.call(this, err, files) + } + } + } + } + + if (process.version.substr(0, 4) === 'v0.8') { + var legStreams = legacy(fs) + ReadStream = legStreams.ReadStream + WriteStream = legStreams.WriteStream + } + + var fs$ReadStream = fs.ReadStream + if (fs$ReadStream) { + ReadStream.prototype = Object.create(fs$ReadStream.prototype) + ReadStream.prototype.open = ReadStream$open + } + + var fs$WriteStream = fs.WriteStream + if (fs$WriteStream) { + WriteStream.prototype = Object.create(fs$WriteStream.prototype) + WriteStream.prototype.open = WriteStream$open + } + + Object.defineProperty(fs, 'ReadStream', { + get: function () { + return ReadStream + }, + set: function (val) { + ReadStream = val + }, + enumerable: true, + configurable: true + }) + Object.defineProperty(fs, 'WriteStream', { + get: function () { + return WriteStream + }, + set: function (val) { + WriteStream = val + }, + enumerable: true, + configurable: true + }) + + // legacy names + var FileReadStream = ReadStream + Object.defineProperty(fs, 'FileReadStream', { + get: function () { + return FileReadStream + }, + set: function (val) { + FileReadStream = val + }, + enumerable: true, + configurable: true + }) + var FileWriteStream = WriteStream + Object.defineProperty(fs, 'FileWriteStream', { + get: function () { + return FileWriteStream + }, + set: function (val) { + FileWriteStream = val + }, + enumerable: true, + configurable: true + }) + + function ReadStream (path, options) { + if (this instanceof ReadStream) + return fs$ReadStream.apply(this, arguments), this + else + return ReadStream.apply(Object.create(ReadStream.prototype), arguments) + } + + function ReadStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + if (that.autoClose) + that.destroy() + + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + that.read() + } + }) + } + + function WriteStream (path, options) { + if (this instanceof WriteStream) + return fs$WriteStream.apply(this, arguments), this + else + return WriteStream.apply(Object.create(WriteStream.prototype), arguments) + } + + function WriteStream$open () { + var that = this + open(that.path, that.flags, that.mode, function (err, fd) { + if (err) { + that.destroy() + that.emit('error', err) + } else { + that.fd = fd + that.emit('open', fd) + } + }) + } + + function createReadStream (path, options) { + return new fs.ReadStream(path, options) + } + + function createWriteStream (path, options) { + return new fs.WriteStream(path, options) + } + + var fs$open = fs.open + fs.open = open + function open (path, flags, mode, cb) { + if (typeof mode === 'function') + cb = mode, mode = null + + return go$open(path, flags, mode, cb) + + function go$open (path, flags, mode, cb, startTime) { + return fs$open(path, flags, mode, function (err, fd) { + if (err && (err.code === 'EMFILE' || err.code === 'ENFILE')) + enqueue([go$open, [path, flags, mode, cb], err, startTime || Date.now(), Date.now()]) + else { + if (typeof cb === 'function') + cb.apply(this, arguments) + } + }) + } + } + + return fs +} + +function enqueue (elem) { + debug('ENQUEUE', elem[0].name, elem[1]) + fs[gracefulQueue].push(elem) + retry() +} + +// keep track of the timeout between retry() calls +var retryTimer + +// reset the startTime and lastTime to now +// this resets the start of the 60 second overall timeout as well as the +// delay between attempts so that we'll retry these jobs sooner +function resetQueue () { + var now = Date.now() + for (var i = 0; i < fs[gracefulQueue].length; ++i) { + // entries that are only a length of 2 are from an older version, don't + // bother modifying those since they'll be retried anyway. + if (fs[gracefulQueue][i].length > 2) { + fs[gracefulQueue][i][3] = now // startTime + fs[gracefulQueue][i][4] = now // lastTime + } + } + // call retry to make sure we're actively processing the queue + retry() +} + +function retry () { + // clear the timer and remove it to help prevent unintended concurrency + clearTimeout(retryTimer) + retryTimer = undefined + + if (fs[gracefulQueue].length === 0) + return + + var elem = fs[gracefulQueue].shift() + var fn = elem[0] + var args = elem[1] + // these items may be unset if they were added by an older graceful-fs + var err = elem[2] + var startTime = elem[3] + var lastTime = elem[4] + + // if we don't have a startTime we have no way of knowing if we've waited + // long enough, so go ahead and retry this item now + if (startTime === undefined) { + debug('RETRY', fn.name, args) + fn.apply(null, args) + } else if (Date.now() - startTime >= 60000) { + // it's been more than 60 seconds total, bail now + debug('TIMEOUT', fn.name, args) + var cb = args.pop() + if (typeof cb === 'function') + cb.call(null, err) + } else { + // the amount of time between the last attempt and right now + var sinceAttempt = Date.now() - lastTime + // the amount of time between when we first tried, and when we last tried + // rounded up to at least 1 + var sinceStart = Math.max(lastTime - startTime, 1) + // backoff. wait longer than the total time we've been retrying, but only + // up to a maximum of 100ms + var desiredDelay = Math.min(sinceStart * 1.2, 100) + // it's been long enough since the last retry, do it again + if (sinceAttempt >= desiredDelay) { + debug('RETRY', fn.name, args) + fn.apply(null, args.concat([startTime])) + } else { + // if we can't do this job yet, push it to the end of the queue + // and let the next iteration check again + fs[gracefulQueue].push(elem) + } + } + + // schedule our next run if one isn't already scheduled + if (retryTimer === undefined) { + retryTimer = setTimeout(retry, 0) + } +} + + +/***/ }), + +/***/ 2270: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var Stream = (__nccwpck_require__(2203).Stream) + +module.exports = legacy + +function legacy (fs) { + return { + ReadStream: ReadStream, + WriteStream: WriteStream + } + + function ReadStream (path, options) { + if (!(this instanceof ReadStream)) return new ReadStream(path, options); + + Stream.call(this); + + var self = this; + + this.path = path; + this.fd = null; + this.readable = true; + this.paused = false; + + this.flags = 'r'; + this.mode = 438; /*=0666*/ + this.bufferSize = 64 * 1024; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.encoding) this.setEncoding(this.encoding); + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.end === undefined) { + this.end = Infinity; + } else if ('number' !== typeof this.end) { + throw TypeError('end must be a Number'); + } + + if (this.start > this.end) { + throw new Error('start must be <= end'); + } + + this.pos = this.start; + } + + if (this.fd !== null) { + process.nextTick(function() { + self._read(); + }); + return; + } + + fs.open(this.path, this.flags, this.mode, function (err, fd) { + if (err) { + self.emit('error', err); + self.readable = false; + return; + } + + self.fd = fd; + self.emit('open', fd); + self._read(); + }) + } + + function WriteStream (path, options) { + if (!(this instanceof WriteStream)) return new WriteStream(path, options); + + Stream.call(this); + + this.path = path; + this.fd = null; + this.writable = true; + + this.flags = 'w'; + this.encoding = 'binary'; + this.mode = 438; /*=0666*/ + this.bytesWritten = 0; + + options = options || {}; + + // Mixin options into this + var keys = Object.keys(options); + for (var index = 0, length = keys.length; index < length; index++) { + var key = keys[index]; + this[key] = options[key]; + } + + if (this.start !== undefined) { + if ('number' !== typeof this.start) { + throw TypeError('start must be a Number'); + } + if (this.start < 0) { + throw new Error('start must be >= zero'); + } + + this.pos = this.start; + } + + this.busy = false; + this._queue = []; + + if (this.fd === null) { + this._open = fs.open; + this._queue.push([this._open, this.path, this.flags, this.mode, undefined]); + this.flush(); + } + } +} + + +/***/ }), + +/***/ 3501: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var constants = __nccwpck_require__(9140) + +var origCwd = process.cwd +var cwd = null + +var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform + +process.cwd = function() { + if (!cwd) + cwd = origCwd.call(process) + return cwd +} +try { + process.cwd() +} catch (er) {} + +// This check is needed until node.js 12 is required +if (typeof process.chdir === 'function') { + var chdir = process.chdir + process.chdir = function (d) { + cwd = null + chdir.call(process, d) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir) +} + +module.exports = patch + +function patch (fs) { + // (re-)implement some things that are known busted or missing. + + // lchmod, broken prior to 0.6.2 + // back-port the fix here. + if (constants.hasOwnProperty('O_SYMLINK') && + process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) { + patchLchmod(fs) + } + + // lutimes implementation, or no-op + if (!fs.lutimes) { + patchLutimes(fs) + } + + // https://github.com/isaacs/node-graceful-fs/issues/4 + // Chown should not fail on einval or eperm if non-root. + // It should not fail on enosys ever, as this just indicates + // that a fs doesn't support the intended operation. + + fs.chown = chownFix(fs.chown) + fs.fchown = chownFix(fs.fchown) + fs.lchown = chownFix(fs.lchown) + + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) + + fs.chownSync = chownFixSync(fs.chownSync) + fs.fchownSync = chownFixSync(fs.fchownSync) + fs.lchownSync = chownFixSync(fs.lchownSync) + + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) + + fs.stat = statFix(fs.stat) + fs.fstat = statFix(fs.fstat) + fs.lstat = statFix(fs.lstat) + + fs.statSync = statFixSync(fs.statSync) + fs.fstatSync = statFixSync(fs.fstatSync) + fs.lstatSync = statFixSync(fs.lstatSync) + + // if lchmod/lchown do not exist, then make them no-ops + if (fs.chmod && !fs.lchmod) { + fs.lchmod = function (path, mode, cb) { + if (cb) process.nextTick(cb) + } + fs.lchmodSync = function () {} + } + if (fs.chown && !fs.lchown) { + fs.lchown = function (path, uid, gid, cb) { + if (cb) process.nextTick(cb) + } + fs.lchownSync = function () {} + } + + // on Windows, A/V software can lock the directory, causing this + // to fail with an EACCES or EPERM if the directory contains newly + // created files. Try again on failure, for up to 60 seconds. + + // Set the timeout this long because some Windows Anti-Virus, such as Parity + // bit9, may lock files for up to a minute, causing npm package install + // failures. Also, take care to yield the scheduler. Windows scheduling gives + // CPU to a busy looping process, which can cause the program causing the lock + // contention to be starved of CPU by node, so the contention doesn't resolve. + if (platform === "win32") { + fs.rename = typeof fs.rename !== 'function' ? fs.rename + : (function (fs$rename) { + function rename (from, to, cb) { + var start = Date.now() + var backoff = 0; + fs$rename(from, to, function CB (er) { + if (er + && (er.code === "EACCES" || er.code === "EPERM" || er.code === "EBUSY") + && Date.now() - start < 60000) { + setTimeout(function() { + fs.stat(to, function (stater, st) { + if (stater && stater.code === "ENOENT") + fs$rename(from, to, CB); + else + cb(er) + }) + }, backoff) + if (backoff < 100) + backoff += 10; + return; + } + if (cb) cb(er) + }) + } + if (Object.setPrototypeOf) Object.setPrototypeOf(rename, fs$rename) + return rename + })(fs.rename) + } + + // if read() returns EAGAIN, then just try it again. + fs.read = typeof fs.read !== 'function' ? fs.read + : (function (fs$read) { + function read (fd, buffer, offset, length, position, callback_) { + var callback + if (callback_ && typeof callback_ === 'function') { + var eagCounter = 0 + callback = function (er, _, __) { + if (er && er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + callback_.apply(this, arguments) + } + } + return fs$read.call(fs, fd, buffer, offset, length, position, callback) + } + + // This ensures `util.promisify` works as it does for native `fs.read`. + if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read) + return read + })(fs.read) + + fs.readSync = typeof fs.readSync !== 'function' ? fs.readSync + : (function (fs$readSync) { return function (fd, buffer, offset, length, position) { + var eagCounter = 0 + while (true) { + try { + return fs$readSync.call(fs, fd, buffer, offset, length, position) + } catch (er) { + if (er.code === 'EAGAIN' && eagCounter < 10) { + eagCounter ++ + continue + } + throw er + } + } + }})(fs.readSync) + + function patchLchmod (fs) { + fs.lchmod = function (path, mode, callback) { + fs.open( path + , constants.O_WRONLY | constants.O_SYMLINK + , mode + , function (err, fd) { + if (err) { + if (callback) callback(err) + return + } + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + fs.fchmod(fd, mode, function (err) { + fs.close(fd, function(err2) { + if (callback) callback(err || err2) + }) + }) + }) + } + + fs.lchmodSync = function (path, mode) { + var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode) + + // prefer to return the chmod error, if one occurs, + // but still try to close, and report closing errors if they occur. + var threw = true + var ret + try { + ret = fs.fchmodSync(fd, mode) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + } + + function patchLutimes (fs) { + if (constants.hasOwnProperty("O_SYMLINK") && fs.futimes) { + fs.lutimes = function (path, at, mt, cb) { + fs.open(path, constants.O_SYMLINK, function (er, fd) { + if (er) { + if (cb) cb(er) + return + } + fs.futimes(fd, at, mt, function (er) { + fs.close(fd, function (er2) { + if (cb) cb(er || er2) + }) + }) + }) + } + + fs.lutimesSync = function (path, at, mt) { + var fd = fs.openSync(path, constants.O_SYMLINK) + var ret + var threw = true + try { + ret = fs.futimesSync(fd, at, mt) + threw = false + } finally { + if (threw) { + try { + fs.closeSync(fd) + } catch (er) {} + } else { + fs.closeSync(fd) + } + } + return ret + } + + } else if (fs.futimes) { + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } + fs.lutimesSync = function () {} + } + } + + function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + + function chownFix (orig) { + if (!orig) return orig + return function (target, uid, gid, cb) { + return orig.call(fs, target, uid, gid, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } + } + + function chownFixSync (orig) { + if (!orig) return orig + return function (target, uid, gid) { + try { + return orig.call(fs, target, uid, gid) + } catch (er) { + if (!chownErOk(er)) throw er + } + } + } + + function statFix (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options, cb) { + if (typeof options === 'function') { + cb = options + options = null + } + function callback (er, stats) { + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + if (cb) cb.apply(this, arguments) + } + return options ? orig.call(fs, target, options, callback) + : orig.call(fs, target, callback) + } + } + + function statFixSync (orig) { + if (!orig) return orig + // Older versions of Node erroneously returned signed integers for + // uid + gid. + return function (target, options) { + var stats = options ? orig.call(fs, target, options) + : orig.call(fs, target) + if (stats) { + if (stats.uid < 0) stats.uid += 0x100000000 + if (stats.gid < 0) stats.gid += 0x100000000 + } + return stats; + } + } + + // ENOSYS means that the fs doesn't support the op. Just ignore + // that, because it doesn't matter. + // + // if there's no getuid, or if getuid() is something other + // than 0, and the error is EINVAL or EPERM, then just ignore + // it. + // + // This specific case is a silent failure in cp, install, tar, + // and most other unix tools that manage permissions. + // + // When running as root, or if other types of errors are + // encountered, then it's strict. + function chownErOk (er) { + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false + } +} + + +/***/ }), + +/***/ 497: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var $defineProperty = __nccwpck_require__(9094); + +var hasPropertyDescriptors = function hasPropertyDescriptors() { + return !!$defineProperty; +}; + +hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { + // node v0.6 has a bug where array lengths can be Set but not Defined + if (!$defineProperty) { + return null; + } + try { + return $defineProperty([], 'length', { value: 1 }).length !== 1; + } catch (e) { + // In Firefox 4-22, defining length on an array throws an exception. + return true; + } +}; + +module.exports = hasPropertyDescriptors; + + +/***/ }), + +/***/ 3336: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var origSymbol = typeof Symbol !== 'undefined' && Symbol; +var hasSymbolSham = __nccwpck_require__(1114); + +/** @type {import('.')} */ +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(); +}; + + +/***/ }), + +/***/ 1114: +/***/ ((module) => { + + + +/** @type {import('./shams')} */ +/* eslint complexity: [2, 18], max-statements: [2, 33] */ +module.exports = function hasSymbols() { + if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } + if (typeof Symbol.iterator === 'symbol') { return true; } + + /** @type {{ [k in symbol]?: unknown }} */ + 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; } + + // temp disabled per https://github.com/ljharb/object.assign/issues/17 + // if (sym instanceof Symbol) { return false; } + // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 + // if (!(symObj instanceof Symbol)) { return false; } + + // if (typeof Symbol.prototype.toString !== 'function') { return false; } + // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } + + var symVal = 42; + obj[sym] = symVal; + for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop + 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') { + // eslint-disable-next-line no-extra-parens + var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym)); + if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } + } + + return true; +}; + + +/***/ }), + +/***/ 5479: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var hasSymbols = __nccwpck_require__(1114); + +/** @type {import('.')} */ +module.exports = function hasToStringTagShams() { + return hasSymbols() && !!Symbol.toStringTag; +}; + + +/***/ }), + +/***/ 4076: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var call = Function.prototype.call; +var $hasOwn = Object.prototype.hasOwnProperty; +var bind = __nccwpck_require__(7564); + +/** @type {import('.')} */ +module.exports = bind.call(call, $hasOwn); + + +/***/ }), + +/***/ 9598: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +try { + var util = __nccwpck_require__(9023); + /* istanbul ignore next */ + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + /* istanbul ignore next */ + module.exports = __nccwpck_require__(6589); +} + + +/***/ }), + +/***/ 6589: +/***/ ((module) => { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + 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 { + // old school shim for old browsers + 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 + } + } +} + + +/***/ }), + +/***/ 3950: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const path = __nccwpck_require__(6928); +const binaryExtensions = __nccwpck_require__(3242); + +const extensions = new Set(binaryExtensions); + +module.exports = filePath => extensions.has(path.extname(filePath).slice(1).toLowerCase()); + + +/***/ }), + +/***/ 9203: +/***/ ((module) => { + + + +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 = {}; + // eslint-disable-next-line no-throw-literal + 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; // not a function + } +}; + +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]'; // IE 11 +var ddaClass2 = '[object HTML document.all class]'; +var ddaClass3 = '[object HTMLCollection]'; // IE 9-10 +var hasToStringTag = typeof Symbol === 'function' && !!Symbol.toStringTag; // better: use `has-tostringtag` + +var isIE68 = !(0 in [,]); // eslint-disable-line no-sparse-arrays, comma-spacing + +var isDDA = function isDocumentDotAll() { return false; }; +if (typeof document === 'object') { + // Firefox 3 canonicalizes DDA to undefined when it's not accessed directly + var all = document.all; + if (toStr.call(all) === toStr.call(document.all)) { + isDDA = function isDocumentDotAll(value) { + /* globals document: false */ + // in IE 6-8, typeof document.all is "object" and it's truthy + if ((isIE68 || !value) && (typeof value === 'undefined' || typeof value === 'object')) { + try { + var str = toStr.call(value); + return ( + str === ddaClass + || str === ddaClass2 + || str === ddaClass3 // opera 12.16 + || str === objectClass // IE 6-8 + ) && value('') == null; // eslint-disable-line eqeqeq + } 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); + }; + + +/***/ }), + +/***/ 5540: +/***/ ((module) => { + +/*! + * is-extglob + * + * Copyright (c) 2014-2016, Jon Schlinkert. + * Licensed under the MIT License. + */ + +module.exports = function isExtglob(str) { + if (typeof str !== 'string' || str === '') { + return false; + } + + var match; + while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) { + if (match[2]) return true; + str = str.slice(match.index + match[0].length); + } + + return false; +}; + + +/***/ }), + +/***/ 1925: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/*! + * is-glob + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ + +var isExtglob = __nccwpck_require__(5540); +var chars = { '{': '}', '(': ')', '[': ']'}; +var strictCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + var pipeIndex = -2; + var closeSquareIndex = -2; + var closeCurlyIndex = -2; + var closeParenIndex = -2; + var backSlashIndex = -2; + while (index < str.length) { + if (str[index] === '*') { + return true; + } + + if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) { + return true; + } + + if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') { + if (closeSquareIndex < index) { + closeSquareIndex = str.indexOf(']', index); + } + if (closeSquareIndex > index) { + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) { + return true; + } + } + } + + if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') { + closeCurlyIndex = str.indexOf('}', index); + if (closeCurlyIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) { + return true; + } + } + } + + if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') { + closeParenIndex = str.indexOf(')', index); + if (closeParenIndex > index) { + backSlashIndex = str.indexOf('\\', index); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + + if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') { + if (pipeIndex < index) { + pipeIndex = str.indexOf('|', index); + } + if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') { + closeParenIndex = str.indexOf(')', pipeIndex); + if (closeParenIndex > pipeIndex) { + backSlashIndex = str.indexOf('\\', pipeIndex); + if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) { + return true; + } + } + } + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +var relaxedCheck = function(str) { + if (str[0] === '!') { + return true; + } + var index = 0; + while (index < str.length) { + if (/[*?{}()[\]]/.test(str[index])) { + return true; + } + + if (str[index] === '\\') { + var open = str[index + 1]; + index += 2; + var close = chars[open]; + + if (close) { + var n = str.indexOf(close, index); + if (n !== -1) { + index = n + 1; + } + } + + if (str[index] === '!') { + return true; + } + } else { + index++; + } + } + return false; +}; + +module.exports = function isGlob(str, options) { + if (typeof str !== 'string' || str === '') { + return false; + } + + if (isExtglob(str)) { + return true; + } + + var check = strictCheck; + + // optionally relax check + if (options && options.strict === false) { + check = relaxedCheck; + } + + return check(str); +}; + + +/***/ }), + +/***/ 6834: +/***/ ((module) => { + +/*! + * is-natural-number.js | MIT (c) Shinnosuke Watanabe + * https://github.com/shinnn/is-natural-number.js +*/ + + +module.exports = function isNaturalNumber(val, option) { + if (option) { + if (typeof option !== 'object') { + throw new TypeError( + String(option) + + ' is not an object. Expected an object that has boolean `includeZero` property.' + ); + } + + if ('includeZero' in option) { + if (typeof option.includeZero !== 'boolean') { + throw new TypeError( + String(option.includeZero) + + ' is neither true nor false. `includeZero` option must be a Boolean value.' + ); + } + + if (option.includeZero && val === 0) { + return true; + } + } + } + + return Number.isSafeInteger(val) && val >= 1; +}; + + +/***/ }), + +/***/ 721: +/***/ ((module) => { + +/*! + * is-number + * + * Copyright (c) 2014-present, Jon Schlinkert. + * Released under the MIT License. + */ + + + +module.exports = function(num) { + if (typeof num === 'number') { + return num - num === 0; + } + if (typeof num === 'string' && num.trim() !== '') { + return Number.isFinite ? Number.isFinite(+num) : isFinite(+num); + } + return false; +}; + + +/***/ }), + +/***/ 6543: +/***/ ((module) => { + + + +var isStream = module.exports = function (stream) { + return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function'; +}; + +isStream.writable = function (stream) { + return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object'; +}; + +isStream.readable = function (stream) { + return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object'; +}; + +isStream.duplex = function (stream) { + return isStream.writable(stream) && isStream.readable(stream); +}; + +isStream.transform = function (stream) { + return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object'; +}; + + +/***/ }), + +/***/ 6405: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var whichTypedArray = __nccwpck_require__(4768); + +/** @type {import('.')} */ +module.exports = function isTypedArray(value) { + return !!whichTypedArray(value); +}; + + +/***/ }), + +/***/ 2513: +/***/ ((module) => { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + +/***/ }), + +/***/ 6512: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const fs = __nccwpck_require__(9896); +const path = __nccwpck_require__(6928); +const pify = __nccwpck_require__(3610); + +const defaults = { + mode: 0o777 & (~process.umask()), + fs +}; + +// https://github.com/nodejs/node/issues/8987 +// https://github.com/libuv/libuv/pull/1088 +const checkPath = pth => { + if (process.platform === 'win32') { + const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, '')); + + if (pathHasInvalidWinCharacters) { + const err = new Error(`Path contains invalid characters: ${pth}`); + err.code = 'EINVAL'; + throw err; + } + } +}; + +module.exports = (input, opts) => Promise.resolve().then(() => { + checkPath(input); + opts = Object.assign({}, defaults, opts); + + const mkdir = pify(opts.fs.mkdir); + const stat = pify(opts.fs.stat); + + const make = pth => { + return mkdir(pth, opts.mode) + .then(() => pth) + .catch(err => { + if (err.code === 'ENOENT') { + if (err.message.includes('null bytes') || path.dirname(pth) === pth) { + throw err; + } + + return make(path.dirname(pth)).then(() => make(pth)); + } + + return stat(pth) + .then(stats => stats.isDirectory() ? pth : Promise.reject()) + .catch(() => { + throw err; + }); + }); + }; + + return make(path.resolve(input)); +}); + +module.exports.sync = (input, opts) => { + checkPath(input); + opts = Object.assign({}, defaults, opts); + + const make = pth => { + try { + opts.fs.mkdirSync(pth, opts.mode); + } catch (err) { + if (err.code === 'ENOENT') { + if (err.message.includes('null bytes') || path.dirname(pth) === pth) { + throw err; + } + + make(path.dirname(pth)); + return make(pth); + } + + try { + if (!opts.fs.statSync(pth).isDirectory()) { + throw new Error('The path is not a directory'); + } + } catch (_) { + throw err; + } + } + + return pth; + }; + + return make(path.resolve(input)); +}; + + +/***/ }), + +/***/ 3610: +/***/ ((module) => { + + + +const processFn = (fn, opts) => function () { + const P = opts.promiseModule; + const args = new Array(arguments.length); + + for (let i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P((resolve, reject) => { + if (opts.errorFirst) { + args.push(function (err, result) { + if (opts.multiArgs) { + const results = new Array(arguments.length - 1); + + for (let i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + if (err) { + results.unshift(err); + reject(results); + } else { + resolve(results); + } + } else if (err) { + reject(err); + } else { + resolve(result); + } + }); + } else { + args.push(function (result) { + if (opts.multiArgs) { + const results = new Array(arguments.length - 1); + + for (let i = 0; i < arguments.length; i++) { + results[i] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + } + + fn.apply(this, args); + }); +}; + +module.exports = (obj, opts) => { + opts = Object.assign({ + exclude: [/.+(Sync|Stream)$/], + errorFirst: true, + promiseModule: Promise + }, opts); + + const filter = key => { + const match = pattern => typeof pattern === 'string' ? key === pattern : pattern.test(key); + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + let ret; + if (typeof obj === 'function') { + ret = function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, opts).apply(this, arguments); + }; + } else { + ret = Object.create(Object.getPrototypeOf(obj)); + } + + for (const key in obj) { // eslint-disable-line guard-for-in + const x = obj[key]; + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, opts) : x; + } + + return ret; +}; + + +/***/ }), + +/***/ 5641: +/***/ ((module) => { + + + +/** @type {import('./abs')} */ +module.exports = Math.abs; + + +/***/ }), + +/***/ 6171: +/***/ ((module) => { + + + +/** @type {import('./floor')} */ +module.exports = Math.floor; + + +/***/ }), + +/***/ 7044: +/***/ ((module) => { + + + +/** @type {import('./isNaN')} */ +module.exports = Number.isNaN || function isNaN(a) { + return a !== a; +}; + + +/***/ }), + +/***/ 7147: +/***/ ((module) => { + + + +/** @type {import('./max')} */ +module.exports = Math.max; + + +/***/ }), + +/***/ 1017: +/***/ ((module) => { + + + +/** @type {import('./min')} */ +module.exports = Math.min; + + +/***/ }), + +/***/ 6947: +/***/ ((module) => { + + + +/** @type {import('./pow')} */ +module.exports = Math.pow; + + +/***/ }), + +/***/ 2621: +/***/ ((module) => { + + + +/** @type {import('./round')} */ +module.exports = Math.round; + + +/***/ }), + +/***/ 156: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var $isNaN = __nccwpck_require__(7044); + +/** @type {import('./sign')} */ +module.exports = function sign(number) { + if ($isNaN(number) || number === 0) { + return number; + } + return number < 0 ? -1 : +1; +}; + + +/***/ }), + +/***/ 6133: +/***/ ((module) => { + +/*! + * normalize-path + * + * Copyright (c) 2014-2018, Jon Schlinkert. + * Released under the MIT License. + */ + +module.exports = function(path, stripTrailing) { + if (typeof path !== 'string') { + throw new TypeError('expected path to be a string'); + } + + if (path === '\\' || path === '/') return '/'; + + var len = path.length; + if (len <= 1) return path; + + // ensure that win32 namespaces has two leading slashes, so that the path is + // handled properly by the win32 version of path.parse() after being normalized + // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces + var prefix = ''; + if (len > 4 && path[3] === '\\') { + var ch = path[2]; + if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\') { + path = path.slice(2); + prefix = '//'; + } + } + + var segs = path.split(/[/\\]+/); + if (stripTrailing !== false && segs[segs.length - 1] === '') { + segs.pop(); + } + return prefix + segs.join('/'); +}; + + +/***/ }), + +/***/ 4615: +/***/ ((module) => { + +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ + + +/* eslint-disable no-unused-vars */ +var getOwnPropertySymbols = Object.getOwnPropertySymbols; +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; + + +/***/ }), + +/***/ 5560: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var wrappy = __nccwpck_require__(8264) +module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) + +once.proto = once(function () { + Object.defineProperty(Function.prototype, 'once', { + value: function () { + return once(this) + }, + configurable: true + }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) +}) + +function once (fn) { + var f = function () { + if (f.called) return f.value + f.called = true + return f.value = fn.apply(this, arguments) + } + f.called = false + return f +} + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} + + +/***/ }), + +/***/ 3313: +/***/ ((module) => { + +module.exports = Pend; + +function Pend() { + this.pending = 0; + this.max = Infinity; + this.listeners = []; + this.waiting = []; + this.error = null; +} + +Pend.prototype.go = function(fn) { + if (this.pending < this.max) { + pendGo(this, fn); + } else { + this.waiting.push(fn); + } +}; + +Pend.prototype.wait = function(cb) { + if (this.pending === 0) { + cb(this.error); + } else { + this.listeners.push(cb); + } +}; + +Pend.prototype.hold = function() { + return pendHold(this); +}; + +function pendHold(self) { + self.pending += 1; + var called = false; + return onCb; + function onCb(err) { + if (called) throw new Error("callback called twice"); + called = true; + self.error = self.error || err; + self.pending -= 1; + if (self.waiting.length > 0 && self.pending < self.max) { + pendGo(self, self.waiting.shift()); + } else if (self.pending === 0) { + var listeners = self.listeners; + self.listeners = []; + listeners.forEach(cbListener); + } + } + function cbListener(listener) { + listener(self.error); + } +} + +function pendGo(self, fn) { + fn(pendHold(self)); +} + + +/***/ }), + +/***/ 4006: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const pico = __nccwpck_require__(8016); +const utils = __nccwpck_require__(4059); + +function picomatch(glob, options, returnState = false) { + // default to os.platform() + if (options && (options.windows === null || options.windows === undefined)) { + // don't mutate the original options object + options = { ...options, windows: utils.isWindows() }; + } + + return pico(glob, options, returnState); +} + +Object.assign(picomatch, pico); +module.exports = picomatch; + + +/***/ }), + +/***/ 5595: +/***/ ((module) => { + + + +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; +const SEP = '/'; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR, + SEP +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)`, + SEP: '\\' +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + __proto__: null, + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + + +/***/ }), + +/***/ 8265: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const constants = __nccwpck_require__(5595); +const utils = __nccwpck_require__(4059); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(opts.windows); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.output = (prev.output || prev.value) + tok.value; + prev.value += tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(opts.windows); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; + + +/***/ }), + +/***/ 8016: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const scan = __nccwpck_require__(1781); +const parse = __nccwpck_require__(8265); +const utils = __nccwpck_require__(4059); +const constants = __nccwpck_require__(5595); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = opts.windows; + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(utils.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; + + +/***/ }), + +/***/ 1781: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const utils = __nccwpck_require__(4059); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = __nccwpck_require__(5595); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; + + +/***/ }), + +/***/ 4059: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +/*global navigator*/ + + +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = __nccwpck_require__(5595); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.isWindows = () => { + if (typeof navigator !== 'undefined' && navigator.platform) { + const platform = navigator.platform.toLowerCase(); + return platform === 'win32' || platform === 'windows'; + } + + if (typeof process !== 'undefined' && process.platform) { + return process.platform === 'win32'; + } + + return false; +}; + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; + +exports.basename = (path, { windows } = {}) => { + const segs = path.split(windows ? /[\\/]/ : '/'); + const last = segs[segs.length - 1]; + + if (last === '') { + return segs[segs.length - 2]; + } + + return last; +}; + + +/***/ }), + +/***/ 2946: +/***/ ((module) => { + + + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify = module.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify.all = pify; + + +/***/ }), + +/***/ 3590: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +module.exports = typeof Promise === 'function' ? Promise : __nccwpck_require__(4206); + + +/***/ }), + +/***/ 4206: +/***/ ((module) => { + + + +var PENDING = 'pending'; +var SETTLED = 'settled'; +var FULFILLED = 'fulfilled'; +var REJECTED = 'rejected'; +var NOOP = function () {}; +var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function'; + +var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate; +var asyncQueue = []; +var asyncTimer; + +function asyncFlush() { + // run promise callbacks + for (var i = 0; i < asyncQueue.length; i++) { + asyncQueue[i][0](asyncQueue[i][1]); + } + + // reset async asyncQueue + asyncQueue = []; + asyncTimer = false; +} + +function asyncCall(callback, arg) { + asyncQueue.push([callback, arg]); + + if (!asyncTimer) { + asyncTimer = true; + asyncSetTimer(asyncFlush, 0); + } +} + +function invokeResolver(resolver, promise) { + function resolvePromise(value) { + resolve(promise, value); + } + + function rejectPromise(reason) { + reject(promise, reason); + } + + try { + resolver(resolvePromise, rejectPromise); + } catch (e) { + rejectPromise(e); + } +} + +function invokeCallback(subscriber) { + var owner = subscriber.owner; + var settled = owner._state; + var value = owner._data; + var callback = subscriber[settled]; + var promise = subscriber.then; + + if (typeof callback === 'function') { + settled = FULFILLED; + try { + value = callback(value); + } catch (e) { + reject(promise, e); + } + } + + if (!handleThenable(promise, value)) { + if (settled === FULFILLED) { + resolve(promise, value); + } + + if (settled === REJECTED) { + reject(promise, value); + } + } +} + +function handleThenable(promise, value) { + var resolved; + + try { + if (promise === value) { + throw new TypeError('A promises callback cannot return that same promise.'); + } + + if (value && (typeof value === 'function' || typeof value === 'object')) { + // then should be retrieved only once + var then = value.then; + + if (typeof then === 'function') { + then.call(value, function (val) { + if (!resolved) { + resolved = true; + + if (value === val) { + fulfill(promise, val); + } else { + resolve(promise, val); + } + } + }, function (reason) { + if (!resolved) { + resolved = true; + + reject(promise, reason); + } + }); + + return true; + } + } + } catch (e) { + if (!resolved) { + reject(promise, e); + } + + return true; + } + + return false; +} + +function resolve(promise, value) { + if (promise === value || !handleThenable(promise, value)) { + fulfill(promise, value); + } +} + +function fulfill(promise, value) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = value; + + asyncCall(publishFulfillment, promise); + } +} + +function reject(promise, reason) { + if (promise._state === PENDING) { + promise._state = SETTLED; + promise._data = reason; + + asyncCall(publishRejection, promise); + } +} + +function publish(promise) { + promise._then = promise._then.forEach(invokeCallback); +} + +function publishFulfillment(promise) { + promise._state = FULFILLED; + publish(promise); +} + +function publishRejection(promise) { + promise._state = REJECTED; + publish(promise); + if (!promise._handled && isNode) { + global.process.emit('unhandledRejection', promise._data, promise); + } +} + +function notifyRejectionHandled(promise) { + global.process.emit('rejectionHandled', promise); +} + +/** + * @class + */ +function Promise(resolver) { + if (typeof resolver !== 'function') { + throw new TypeError('Promise resolver ' + resolver + ' is not a function'); + } + + if (this instanceof Promise === false) { + throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); + } + + this._then = []; + + invokeResolver(resolver, this); +} + +Promise.prototype = { + constructor: Promise, + + _state: PENDING, + _then: null, + _data: undefined, + _handled: false, + + then: function (onFulfillment, onRejection) { + var subscriber = { + owner: this, + then: new this.constructor(NOOP), + fulfilled: onFulfillment, + rejected: onRejection + }; + + if ((onRejection || onFulfillment) && !this._handled) { + this._handled = true; + if (this._state === REJECTED && isNode) { + asyncCall(notifyRejectionHandled, this); + } + } + + if (this._state === FULFILLED || this._state === REJECTED) { + // already resolved, call callback async + asyncCall(invokeCallback, subscriber); + } else { + // subscribe + this._then.push(subscriber); + } + + return subscriber.then; + }, + + catch: function (onRejection) { + return this.then(null, onRejection); + } +}; + +Promise.all = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.all().'); + } + + return new Promise(function (resolve, reject) { + var results = []; + var remaining = 0; + + function resolver(index) { + remaining++; + return function (value) { + results[index] = value; + if (!--remaining) { + resolve(results); + } + }; + } + + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolver(i), reject); + } else { + results[i] = promise; + } + } + + if (!remaining) { + resolve(results); + } + }); +}; + +Promise.race = function (promises) { + if (!Array.isArray(promises)) { + throw new TypeError('You must pass an array to Promise.race().'); + } + + return new Promise(function (resolve, reject) { + for (var i = 0, promise; i < promises.length; i++) { + promise = promises[i]; + + if (promise && typeof promise.then === 'function') { + promise.then(resolve, reject); + } else { + resolve(promise); + } + } + }); +}; + +Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + + return new Promise(function (resolve) { + resolve(value); + }); +}; + +Promise.reject = function (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); +}; + +module.exports = Promise; + + +/***/ }), + +/***/ 8879: +/***/ ((module) => { + + + +/** @type {import('.')} */ +module.exports = [ + 'Float16Array', + 'Float32Array', + 'Float64Array', + 'Int8Array', + 'Int16Array', + 'Int32Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Uint16Array', + 'Uint32Array', + 'BigInt64Array', + 'BigUint64Array' +]; + + +/***/ }), + +/***/ 1564: +/***/ ((module) => { + + + +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: 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); + }); + } +} + + + +/***/ }), + +/***/ 8328: +/***/ ((module) => { + + + +/** Highest positive signed 32-bit float value */ +const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +const base = 36; +const tMin = 1; +const tMax = 26; +const skew = 38; +const damp = 700; +const initialBias = 72; +const initialN = 128; // 0x80 +const delimiter = '-'; // '\x2D' + +/** Regular expressions */ +const regexPunycode = /^xn--/; +const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too. +const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +const errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +const baseMinusTMin = base - tMin; +const floor = Math.floor; +const stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, callback) { + const result = []; + let length = array.length; + while (length--) { + result[length] = callback(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {String} A new string of characters returned by the callback + * function. + */ +function mapDomain(domain, callback) { + const parts = domain.split('@'); + let result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + domain = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + domain = domain.replace(regexSeparators, '\x2E'); + const labels = domain.split('.'); + const encoded = map(labels, callback).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + const output = []; + let counter = 0; + const length = string.length; + while (counter < length) { + const value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + const extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +const ucs2encode = codePoints => String.fromCodePoint(...codePoints); + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +const basicToDigit = function(codePoint) { + if (codePoint >= 0x30 && codePoint < 0x3A) { + return 26 + (codePoint - 0x30); + } + if (codePoint >= 0x41 && codePoint < 0x5B) { + return codePoint - 0x41; + } + if (codePoint >= 0x61 && codePoint < 0x7B) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +const digitToBasic = function(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +const adapt = function(delta, numPoints, firstTime) { + let k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +const decode = function(input) { + // Don't use UCS-2. + const output = []; + const inputLength = input.length; + let i = 0; + let n = initialN; + let bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + let basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (let j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + const oldi = i; + for (let w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + const digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base) { + error('invalid-input'); + } + if (digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + const baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + const out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + + } + + return String.fromCodePoint(...output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +const encode = function(input) { + const output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + const inputLength = input.length; + + // Initialize the state. + let n = initialN; + let delta = 0; + let bias = initialBias; + + // Handle the basic code points. + for (const currentValue of input) { + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + const basicLength = output.length; + let handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + let m = maxInt; + for (const currentValue of input) { + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + const handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (const currentValue of input) { + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + if (currentValue === n) { + // Represent delta as a generalized variable-length integer. + let q = delta; + for (let k = base; /* no condition */; k += base) { + const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + const qMinusT = q - t; + const baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +const toUnicode = function(input) { + return mapDomain(input, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +const toASCII = function(input) { + return mapDomain(input, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +const punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.3.1', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +module.exports = punycode; + + +/***/ }), + +/***/ 6141: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(6131).Duplex + + +/***/ }), + +/***/ 2063: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + + + +/**/ + +var pna = __nccwpck_require__(1564); +/**/ + +/**/ +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(__nccwpck_require__(5481)); +util.inherits = __nccwpck_require__(9598); +/**/ + +var Readable = __nccwpck_require__(6893); +var Writable = __nccwpck_require__(8797); + +util.inherits(Duplex, Readable); + +{ + // avoid scope creep, the keys array can then be collected + 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', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) return; + + // no more data can be written. + // But allow more writes to happen in this tick. + 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) { + // we ignore the value if the stream + // has not been initialized yet + if (this._readableState === undefined || this._writableState === undefined) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._readableState.destroyed = value; + this._writableState.destroyed = value; + } +}); + +Duplex.prototype._destroy = function (err, cb) { + this.push(null); + this.end(); + + pna.nextTick(cb, err); +}; + +/***/ }), + +/***/ 5283: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + + + +module.exports = PassThrough; + +var Transform = __nccwpck_require__(2337); + +/**/ +var util = Object.create(__nccwpck_require__(5481)); +util.inherits = __nccwpck_require__(9598); +/**/ + +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); +}; + +/***/ }), + +/***/ 6893: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +/**/ + +var pna = __nccwpck_require__(1564); +/**/ + +module.exports = Readable; + +/**/ +var isArray = __nccwpck_require__(2513); +/**/ + +/**/ +var Duplex; +/**/ + +Readable.ReadableState = ReadableState; + +/**/ +var EE = (__nccwpck_require__(4434).EventEmitter); + +var EElistenerCount = function (emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +/**/ +var Stream = __nccwpck_require__(3283); +/**/ + +/**/ + +var Buffer = (__nccwpck_require__(1475).Buffer); +var OurUint8Array = (typeof global !== 'undefined' ? global : 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(__nccwpck_require__(5481)); +util.inherits = __nccwpck_require__(9598); +/**/ + +/**/ +var debugUtil = __nccwpck_require__(9023); +var debug = void 0; +if (debugUtil && debugUtil.debuglog) { + debug = debugUtil.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + +var BufferList = __nccwpck_require__(9381); +var destroyImpl = __nccwpck_require__(5089); +var StringDecoder; + +util.inherits(Readable, Stream); + +var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume']; + +function prependListener(emitter, event, fn) { + // Sadly this is not cacheable as some libraries bundle their own + // event emitter implementation with them. + if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn); + + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + 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 || __nccwpck_require__(2063); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + 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; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + 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; + + // a flag to be able to tell if the event 'readable'/'data' is emitted + // immediately, or on a later tick. We set this to true at first, because + // any actions that shouldn't happen until "later" should generally also + // not happen before the first read call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + this.resumeScheduled = false; + + // has it been destroyed + this.destroyed = false; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(634)/* .StringDecoder */ .I); + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + Duplex = Duplex || __nccwpck_require__(2063); + + if (!(this instanceof Readable)) return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + 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) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._readableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + 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); +}; + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +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); +}; + +// Unshift should *always* be something directly out of read() +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 { + // update the buffer info. + 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; +} + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); +} + +Readable.prototype.isPaused = function () { + return this._readableState.flowing === false; +}; + +// backwards compatibility. +Readable.prototype.setEncoding = function (enc) { + if (!StringDecoder) StringDecoder = (__nccwpck_require__(634)/* .StringDecoder */ .I); + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 8MB +var MAX_HWM = 0x800000; +function computeNewHighWaterMark(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts + n--; + n |= n >>> 1; + n |= n >>> 2; + n |= n >>> 4; + n |= n >>> 8; + n |= n >>> 16; + n++; + } + return n; +} + +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function howMuchToRead(n, state) { + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; + } + // If we're asking for more than the current hwm, then raise the hwm. + if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; + } + return state.length; +} + +// you can override either this method, or the async _read(n) below. +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 we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + 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 we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + 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 the length is currently zero, then we *need* a readable event. + if (state.length === 0) state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + 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 we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + 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; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +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); +} + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +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) + // didn't get any data, stop spinning. + break;else len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +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(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + var cleanedUp = false; + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + 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 the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); + } + + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + increasedAwaitDrain = false; + var ret = dest.write(chunk); + if (false === ret && !increasedAwaitDrain) { + // If the user unpiped during `dest.write()`, it is possible + // to get stuck in a permanently paused state if that write + // also returned false. + // => Check whether `dest` is still a piping destination. + 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(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); + } + + // Make sure our error handler is attached before userland ones. + prependListener(dest, 'error', onerror); + + // Both close and finish should trigger unpipe, but only once. + 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); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + 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 we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) return this; + + if (!dest) dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) dest.emit('unpipe', this, unpipeInfo); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + 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; + } + + // try to find the right one. + 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; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function (ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + 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); +} + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +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) {} +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +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); + + // don't skip over falsy values in objectMode + 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(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + 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); + } + } + + // proxy certain important events. + for (var n = 0; n < kProxyEvents.length; n++) { + stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n])); + } + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + this._read = function (n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return this; +}; + +Object.defineProperty(Readable.prototype, 'readableHighWaterMark', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._readableState.highWaterMark; + } +}); + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromList(n, state) { + // nothing buffered + if (state.length === 0) return null; + + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + 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 { + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } + + return ret; +} + +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} + +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +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; +} + +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +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 we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + 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) { + // Check that we didn't get one last unshift. + 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; +} + +/***/ }), + +/***/ 2337: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + + + +module.exports = Transform; + +var Duplex = __nccwpck_require__(2063); + +/**/ +var util = Object.create(__nccwpck_require__(5481)); +util.inherits = __nccwpck_require__(9598); +/**/ + +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) // single equals check for both `null` and `undefined` + 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 + }; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + if (options) { + if (typeof options.transform === 'function') this._transform = options.transform; + + if (typeof options.flush === 'function') this._flush = options.flush; + } + + // When the writable side finishes, then flush out anything remaining. + 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); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +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); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +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 { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + 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) // single equals check for both `null` and `undefined` + stream.push(data); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + 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); +} + +/***/ }), + +/***/ 8797: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, encoding, cb), and it'll handle all +// the drain event emission and buffering. + + + +/**/ + +var pna = __nccwpck_require__(1564); +/**/ + +module.exports = Writable; + +/* */ +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; + this.next = null; +} + +// It seems a linked list but it is not +// there will be only 2 of these for each stream +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(__nccwpck_require__(5481)); +util.inherits = __nccwpck_require__(9598); +/**/ + +/**/ +var internalUtil = { + deprecate: __nccwpck_require__(4488) +}; +/**/ + +/**/ +var Stream = __nccwpck_require__(3283); +/**/ + +/**/ + +var Buffer = (__nccwpck_require__(1475).Buffer); +var OurUint8Array = (typeof global !== 'undefined' ? global : 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 = __nccwpck_require__(5089); + +util.inherits(Writable, Stream); + +function nop() {} + +function WritableState(options, stream) { + Duplex = Duplex || __nccwpck_require__(2063); + + options = options || {}; + + // Duplex streams are both readable and writable, but share + // the same options object. + // However, some cases require setting options to different + // values for the readable and the writable sides of the duplex stream. + // These options can be provided separately as readableXXX and writableXXX. + var isDuplex = stream instanceof Duplex; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + 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; + + // cast to ints. + this.highWaterMark = Math.floor(this.highWaterMark); + + // if _final has been called + this.finalCalled = false; + + // drain event flag. + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // has it been destroyed + this.destroyed = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function (er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.bufferedRequest = null; + this.lastBufferedRequest = null; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; + + // count buffered requests + this.bufferedRequestCount = 0; + + // allocate the first CorkedRequest, there is always + // one allocated and free to use, and we maintain at most two + 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 (_) {} +})(); + +// Test _writableState for inheritance to account for Duplex streams, +// whose prototype chain only points to Readable. +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 || __nccwpck_require__(2063); + + // Writable ctor is applied to Duplexes, too. + // `realHasInstance` is necessary because using plain `instanceof` + // would return false, as no `_writableState` property is attached. + + // Trying to use the custom `instanceof` for Writable here will also break the + // Node.js LazyTransform implementation, which has a non-trivial getter for + // `_writableState` that would lead to infinite recursion. + if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) { + return new Writable(options); + } + + this._writableState = new WritableState(options, this); + + // legacy. + 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); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function () { + this.emit('error', new Error('Cannot pipe, not readable')); +}; + +function writeAfterEnd(stream, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + pna.nextTick(cb, er); +} + +// Checks that a user-supplied chunk is valid, especially for the particular +// mode the stream is in. Currently this means that `null` is never accepted +// and undefined/non-string values are only allowed in object mode. +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) { + // node::ParseEncoding() requires lower case. + 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', { + // making it explicit this property is not enumerable + // because otherwise some prototype manipulation in + // userland will fail + enumerable: false, + get: function () { + return this._writableState.highWaterMark; + } +}); + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +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; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) state.needDrain = true; + + if (state.writing || state.corked) { + var last = state.lastBufferedRequest; + state.lastBufferedRequest = { + chunk: chunk, + encoding: encoding, + isBuf: 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) { + // defer the callback if we are being called synchronously + // to avoid piling up things on the stack + pna.nextTick(cb, er); + // this can emit finish, and it will always happen + // after error + pna.nextTick(finishMaybe, stream, state); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + } else { + // the caller expect this to happen before if + // it is async + cb(er); + stream._writableState.errorEmitted = true; + stream.emit('error', er); + // this can emit finish, but finish must + // always follow error + 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 { + // Check if we're actually ready to finish, but don't emit yet + 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); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + var entry = state.bufferedRequest; + + if (stream._writev && entry && entry.next) { + // Fast case, write everything using _writev() + 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); + + // doWrite is almost always async, defer these to save a bit of time + // as the hot path ends with doWrite + 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 { + // Slow case, write chunks one-by-one + 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 we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + 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); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + 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; + } + + // reuse the free corkReq. + state.corkedRequestsFree.next = corkReq; +} + +Object.defineProperty(Writable.prototype, 'destroyed', { + get: function () { + if (this._writableState === undefined) { + return false; + } + return this._writableState.destroyed; + }, + set: function (value) { + // we ignore the value if the stream + // has not been initialized yet + if (!this._writableState) { + return; + } + + // backward compatibility, the user is explicitly + // managing destroyed + this._writableState.destroyed = value; + } +}); + +Writable.prototype.destroy = destroyImpl.destroy; +Writable.prototype._undestroy = destroyImpl.undestroy; +Writable.prototype._destroy = function (err, cb) { + this.end(); + cb(err); +}; + +/***/ }), + +/***/ 9381: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Buffer = (__nccwpck_require__(1475).Buffer); +var util = __nccwpck_require__(9023); + +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; + }; +} + +/***/ }), + +/***/ 5089: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +/**/ + +var pna = __nccwpck_require__(1564); +/**/ + +// undocumented cb() API, needed for core, not for public API +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; + } + + // we set destroyed to true before firing error callbacks in order + // to make it re-entrance safe in case destroy() is called within callbacks + + if (this._readableState) { + this._readableState.destroyed = true; + } + + // if this is a duplex stream mark the writable part as destroyed as well + 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: destroy, + undestroy: undestroy +}; + +/***/ }), + +/***/ 3283: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +module.exports = __nccwpck_require__(2203); + + +/***/ }), + +/***/ 1475: +/***/ ((module, exports, __nccwpck_require__) => { + +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(181) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +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 { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +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) +} + + +/***/ }), + +/***/ 6131: +/***/ ((module, exports, __nccwpck_require__) => { + +var Stream = __nccwpck_require__(2203); +if (process.env.READABLE_STREAM === 'disable' && Stream) { + module.exports = Stream; + exports = module.exports = Stream.Readable; + exports.Readable = Stream.Readable; + exports.Writable = Stream.Writable; + exports.Duplex = Stream.Duplex; + exports.Transform = Stream.Transform; + exports.PassThrough = Stream.PassThrough; + exports.Stream = Stream; +} else { + exports = module.exports = __nccwpck_require__(6893); + exports.Stream = Stream || exports; + exports.Readable = exports; + exports.Writable = __nccwpck_require__(8797); + exports.Duplex = __nccwpck_require__(2063); + exports.Transform = __nccwpck_require__(2337); + exports.PassThrough = __nccwpck_require__(5283); +} + + +/***/ }), + +/***/ 7525: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const fs = __nccwpck_require__(9896); +const { Readable } = __nccwpck_require__(2203); +const sysPath = __nccwpck_require__(6928); +const { promisify } = __nccwpck_require__(9023); +const picomatch = __nccwpck_require__(3285); + +const readdir = promisify(fs.readdir); +const stat = promisify(fs.stat); +const lstat = promisify(fs.lstat); +const realpath = promisify(fs.realpath); + +/** + * @typedef {Object} EntryInfo + * @property {String} path + * @property {String} fullPath + * @property {fs.Stats=} stats + * @property {fs.Dirent=} dirent + * @property {String} basename + */ + +const BANG = '!'; +const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR'; +const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]); +const FILE_TYPE = 'files'; +const DIR_TYPE = 'directories'; +const FILE_DIR_TYPE = 'files_directories'; +const EVERYTHING_TYPE = 'all'; +const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE]; + +const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code); +const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10)); +const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5)); + +const normalizeFilter = filter => { + if (filter === undefined) return; + if (typeof filter === 'function') return filter; + + if (typeof filter === 'string') { + const glob = picomatch(filter.trim()); + return entry => glob(entry.basename); + } + + if (Array.isArray(filter)) { + const positive = []; + const negative = []; + for (const item of filter) { + const trimmed = item.trim(); + if (trimmed.charAt(0) === BANG) { + negative.push(picomatch(trimmed.slice(1))); + } else { + positive.push(picomatch(trimmed)); + } + } + + if (negative.length > 0) { + if (positive.length > 0) { + return entry => + positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename)); + } + return entry => !negative.some(f => f(entry.basename)); + } + return entry => positive.some(f => f(entry.basename)); + } +}; + +class ReaddirpStream extends Readable { + static get defaultOptions() { + return { + root: '.', + /* eslint-disable no-unused-vars */ + fileFilter: (path) => true, + directoryFilter: (path) => true, + /* eslint-enable no-unused-vars */ + type: FILE_TYPE, + lstat: false, + depth: 2147483648, + alwaysStat: false + }; + } + + constructor(options = {}) { + super({ + objectMode: true, + autoDestroy: true, + highWaterMark: options.highWaterMark || 4096 + }); + const opts = { ...ReaddirpStream.defaultOptions, ...options }; + const { root, type } = opts; + + this._fileFilter = normalizeFilter(opts.fileFilter); + this._directoryFilter = normalizeFilter(opts.directoryFilter); + + const statMethod = opts.lstat ? lstat : stat; + // Use bigint stats if it's windows and stat() supports options (node 10+). + if (wantBigintFsStats) { + this._stat = path => statMethod(path, { bigint: true }); + } else { + this._stat = statMethod; + } + + this._maxDepth = opts.depth; + this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type); + this._wantsEverything = type === EVERYTHING_TYPE; + this._root = sysPath.resolve(root); + this._isDirent = ('Dirent' in fs) && !opts.alwaysStat; + this._statsProp = this._isDirent ? 'dirent' : 'stats'; + this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent }; + + // Launch stream with one parent, the root dir. + this.parents = [this._exploreDir(root, 1)]; + this.reading = false; + this.parent = undefined; + } + + async _read(batch) { + if (this.reading) return; + this.reading = true; + + try { + while (!this.destroyed && batch > 0) { + const { path, depth, files = [] } = this.parent || {}; + + if (files.length > 0) { + const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path)); + for (const entry of await Promise.all(slice)) { + if (this.destroyed) return; + + const entryType = await this._getEntryType(entry); + if (entryType === 'directory' && this._directoryFilter(entry)) { + if (depth <= this._maxDepth) { + this.parents.push(this._exploreDir(entry.fullPath, depth + 1)); + } + + if (this._wantsDir) { + this.push(entry); + batch--; + } + } else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) { + if (this._wantsFile) { + this.push(entry); + batch--; + } + } + } + } else { + const parent = this.parents.pop(); + if (!parent) { + this.push(null); + break; + } + this.parent = await parent; + if (this.destroyed) return; + } + } + } catch (error) { + this.destroy(error); + } finally { + this.reading = false; + } + } + + async _exploreDir(path, depth) { + let files; + try { + files = await readdir(path, this._rdOptions); + } catch (error) { + this._onError(error); + } + return { files, depth, path }; + } + + async _formatEntry(dirent, path) { + let entry; + try { + const basename = this._isDirent ? dirent.name : dirent; + const fullPath = sysPath.resolve(sysPath.join(path, basename)); + entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename }; + entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath); + } catch (err) { + this._onError(err); + } + return entry; + } + + _onError(err) { + if (isNormalFlowError(err) && !this.destroyed) { + this.emit('warn', err); + } else { + this.destroy(err); + } + } + + async _getEntryType(entry) { + // entry may be undefined, because a warning or an error were emitted + // and the statsProp is undefined + const stats = entry && entry[this._statsProp]; + if (!stats) { + return; + } + if (stats.isFile()) { + return 'file'; + } + if (stats.isDirectory()) { + return 'directory'; + } + if (stats && stats.isSymbolicLink()) { + const full = entry.fullPath; + try { + const entryRealPath = await realpath(full); + const entryRealPathStats = await lstat(entryRealPath); + if (entryRealPathStats.isFile()) { + return 'file'; + } + if (entryRealPathStats.isDirectory()) { + const len = entryRealPath.length; + if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) { + const recursiveError = new Error( + `Circular symlink detected: "${full}" points to "${entryRealPath}"` + ); + recursiveError.code = RECURSIVE_ERROR_CODE; + return this._onError(recursiveError); + } + return 'directory'; + } + } catch (error) { + this._onError(error); + } + } + } + + _includeAsFile(entry) { + const stats = entry && entry[this._statsProp]; + + return stats && this._wantsEverything && !stats.isDirectory(); + } +} + +/** + * @typedef {Object} ReaddirpArguments + * @property {Function=} fileFilter + * @property {Function=} directoryFilter + * @property {String=} type + * @property {Number=} depth + * @property {String=} root + * @property {Boolean=} lstat + * @property {Boolean=} bigint + */ + +/** + * Main function which ends up calling readdirRec and reads all files and directories in given root recursively. + * @param {String} root Root directory + * @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth + */ +const readdirp = (root, options = {}) => { + let type = options.entryType || options.type; + if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility + if (type) options.type = type; + if (!root) { + throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)'); + } else if (typeof root !== 'string') { + throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)'); + } else if (type && !ALL_TYPES.includes(type)) { + throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`); + } + + options.root = root; + return new ReaddirpStream(options); +}; + +const readdirpPromise = (root, options = {}) => { + return new Promise((resolve, reject) => { + const files = []; + readdirp(root, options) + .on('data', entry => files.push(entry)) + .on('end', () => resolve(files)) + .on('error', error => reject(error)); + }); +}; + +readdirp.promise = readdirpPromise; +readdirp.ReaddirpStream = ReaddirpStream; +readdirp.default = readdirp; + +module.exports = readdirp; + + +/***/ }), + +/***/ 3285: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +module.exports = __nccwpck_require__(4019); + + +/***/ }), + +/***/ 7892: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const path = __nccwpck_require__(6928); +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +module.exports = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + + +/***/ }), + +/***/ 9810: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const constants = __nccwpck_require__(7892); +const utils = __nccwpck_require__(7432); + +/** + * Constants + */ + +const { + MAX_LENGTH, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + try { + /* eslint-disable-next-line no-new */ + new RegExp(value); + } catch (ex) { + return args.map(v => utils.escapeRegex(v)).join('..'); + } + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants.globChars(win32); + const EXTGLOB_CHARS = constants.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +module.exports = parse; + + +/***/ }), + +/***/ 4019: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const path = __nccwpck_require__(6928); +const scan = __nccwpck_require__(1472); +const parse = __nccwpck_require__(9810); +const utils = __nccwpck_require__(7432); +const constants = __nccwpck_require__(7892); +const isObject = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils.isWindows(options); + const regex = isState + ? picomatch.compileRe(glob, options) + : picomatch.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options); + return regex.test(path.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options)); + return parse(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch.scan = (input, options) => scan(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse(input, options); + } + + return picomatch.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch.constants = constants; + +/** + * Expose "picomatch" + */ + +module.exports = picomatch; + + +/***/ }), + +/***/ 1472: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const utils = __nccwpck_require__(7432); +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA, /* , */ + CHAR_DOT, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE, /* { */ + CHAR_LEFT_PARENTHESES, /* ( */ + CHAR_LEFT_SQUARE_BRACKET, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE, /* } */ + CHAR_RIGHT_PARENTHESES, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET /* ] */ +} = __nccwpck_require__(7892); + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +module.exports = scan; + + +/***/ }), + +/***/ 7432: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const path = __nccwpck_require__(6928); +const win32 = process.platform === 'win32'; +const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL +} = __nccwpck_require__(7892); + +exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); +exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); +exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); +exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); +exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + +exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); +}; + +exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; +}; + +exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; +}; + +exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; +}; + +exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; +}; + +exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; +}; + + +/***/ }), + +/***/ 8825: +/***/ ((module) => { + + +module.exports = rfdc + +function copyBuffer (cur) { + if (cur instanceof Buffer) { + return Buffer.from(cur) + } + + return new cur.constructor(cur.buffer.slice(), cur.byteOffset, cur.length) +} + +function rfdc (opts) { + opts = opts || {} + if (opts.circles) return rfdcCircles(opts) + + const constructorHandlers = new Map() + constructorHandlers.set(Date, (o) => new Date(o)) + constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn))) + constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn))) + if (opts.constructorHandlers) { + for (const handler of opts.constructorHandlers) { + constructorHandlers.set(handler[0], handler[1]) + } + } + + let handler = null + + return opts.proto ? cloneProto : clone + + function cloneArray (a, fn) { + const keys = Object.keys(a) + const a2 = new Array(keys.length) + for (let i = 0; i < keys.length; i++) { + const k = keys[i] + const cur = a[k] + if (typeof cur !== 'object' || cur === null) { + a2[k] = cur + } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { + a2[k] = handler(cur, fn) + } else if (ArrayBuffer.isView(cur)) { + a2[k] = copyBuffer(cur) + } else { + a2[k] = fn(cur) + } + } + return a2 + } + + function clone (o) { + if (typeof o !== 'object' || o === null) return o + if (Array.isArray(o)) return cloneArray(o, clone) + if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { + return handler(o, clone) + } + const o2 = {} + for (const k in o) { + if (Object.hasOwnProperty.call(o, k) === false) continue + const cur = o[k] + if (typeof cur !== 'object' || cur === null) { + o2[k] = cur + } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { + o2[k] = handler(cur, clone) + } else if (ArrayBuffer.isView(cur)) { + o2[k] = copyBuffer(cur) + } else { + o2[k] = clone(cur) + } + } + return o2 + } + + function cloneProto (o) { + if (typeof o !== 'object' || o === null) return o + if (Array.isArray(o)) return cloneArray(o, cloneProto) + if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { + return handler(o, cloneProto) + } + const o2 = {} + for (const k in o) { + const cur = o[k] + if (typeof cur !== 'object' || cur === null) { + o2[k] = cur + } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { + o2[k] = handler(cur, cloneProto) + } else if (ArrayBuffer.isView(cur)) { + o2[k] = copyBuffer(cur) + } else { + o2[k] = cloneProto(cur) + } + } + return o2 + } +} + +function rfdcCircles (opts) { + const refs = [] + const refsNew = [] + + const constructorHandlers = new Map() + constructorHandlers.set(Date, (o) => new Date(o)) + constructorHandlers.set(Map, (o, fn) => new Map(cloneArray(Array.from(o), fn))) + constructorHandlers.set(Set, (o, fn) => new Set(cloneArray(Array.from(o), fn))) + if (opts.constructorHandlers) { + for (const handler of opts.constructorHandlers) { + constructorHandlers.set(handler[0], handler[1]) + } + } + + let handler = null + return opts.proto ? cloneProto : clone + + function cloneArray (a, fn) { + const keys = Object.keys(a) + const a2 = new Array(keys.length) + for (let i = 0; i < keys.length; i++) { + const k = keys[i] + const cur = a[k] + if (typeof cur !== 'object' || cur === null) { + a2[k] = cur + } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { + a2[k] = handler(cur, fn) + } else if (ArrayBuffer.isView(cur)) { + a2[k] = copyBuffer(cur) + } else { + const index = refs.indexOf(cur) + if (index !== -1) { + a2[k] = refsNew[index] + } else { + a2[k] = fn(cur) + } + } + } + return a2 + } + + function clone (o) { + if (typeof o !== 'object' || o === null) return o + if (Array.isArray(o)) return cloneArray(o, clone) + if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { + return handler(o, clone) + } + const o2 = {} + refs.push(o) + refsNew.push(o2) + for (const k in o) { + if (Object.hasOwnProperty.call(o, k) === false) continue + const cur = o[k] + if (typeof cur !== 'object' || cur === null) { + o2[k] = cur + } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { + o2[k] = handler(cur, clone) + } else if (ArrayBuffer.isView(cur)) { + o2[k] = copyBuffer(cur) + } else { + const i = refs.indexOf(cur) + if (i !== -1) { + o2[k] = refsNew[i] + } else { + o2[k] = clone(cur) + } + } + } + refs.pop() + refsNew.pop() + return o2 + } + + function cloneProto (o) { + if (typeof o !== 'object' || o === null) return o + if (Array.isArray(o)) return cloneArray(o, cloneProto) + if (o.constructor !== Object && (handler = constructorHandlers.get(o.constructor))) { + return handler(o, cloneProto) + } + const o2 = {} + refs.push(o) + refsNew.push(o2) + for (const k in o) { + const cur = o[k] + if (typeof cur !== 'object' || cur === null) { + o2[k] = cur + } else if (cur.constructor !== Object && (handler = constructorHandlers.get(cur.constructor))) { + o2[k] = handler(cur, cloneProto) + } else if (ArrayBuffer.isView(cur)) { + o2[k] = copyBuffer(cur) + } else { + const i = refs.indexOf(cur) + if (i !== -1) { + o2[k] = refsNew[i] + } else { + o2[k] = cloneProto(cur) + } + } + } + refs.pop() + refsNew.pop() + return o2 + } +} + + +/***/ }), + +/***/ 3058: +/***/ ((module, exports, __nccwpck_require__) => { + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(181) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +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 { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +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) +} + + +/***/ }), + +/***/ 4690: +/***/ ((module) => { + +/* +node-bzip - a pure-javascript Node.JS module for decoding bzip2 data + +Copyright (C) 2012 Eli Skeggs + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Adapted from bzip2.js, copyright 2011 antimatter15 (antimatter15@gmail.com). + +Based on micro-bunzip by Rob Landley (rob@landley.net). + +Based on bzip2 decompression code by Julian R Seward (jseward@acm.org), +which also acknowledges contributions by Mike Burrows, David Wheeler, +Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten, +Robert Sedgewick, and Jon L. Bentley. +*/ + +var BITMASK = [0x00, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF]; + +// offset in bytes +var BitReader = function(stream) { + this.stream = stream; + this.bitOffset = 0; + this.curByte = 0; + this.hasByte = false; +}; + +BitReader.prototype._ensureByte = function() { + if (!this.hasByte) { + this.curByte = this.stream.readByte(); + this.hasByte = true; + } +}; + +// reads bits from the buffer +BitReader.prototype.read = function(bits) { + var result = 0; + while (bits > 0) { + this._ensureByte(); + var remaining = 8 - this.bitOffset; + // if we're in a byte + if (bits >= remaining) { + result <<= remaining; + result |= BITMASK[remaining] & this.curByte; + this.hasByte = false; + this.bitOffset = 0; + bits -= remaining; + } else { + result <<= bits; + var shift = remaining - bits; + result |= (this.curByte & (BITMASK[bits] << shift)) >> shift; + this.bitOffset += bits; + bits = 0; + } + } + return result; +}; + +// seek to an arbitrary point in the buffer (expressed in bits) +BitReader.prototype.seek = function(pos) { + var n_bit = pos % 8; + var n_byte = (pos - n_bit) / 8; + this.bitOffset = n_bit; + this.stream.seek(n_byte); + this.hasByte = false; +}; + +// reads 6 bytes worth of data using the read method +BitReader.prototype.pi = function() { + var buf = new Buffer(6), i; + for (i = 0; i < buf.length; i++) { + buf[i] = this.read(8); + } + return buf.toString('hex'); +}; + +module.exports = BitReader; + + +/***/ }), + +/***/ 9050: +/***/ ((module) => { + +/* CRC32, used in Bzip2 implementation. + * This is a port of CRC32.java from the jbzip2 implementation at + * https://code.google.com/p/jbzip2 + * which is: + * Copyright (c) 2011 Matthew Francis + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * This JavaScript implementation is: + * Copyright (c) 2013 C. Scott Ananian + * with the same licensing terms as Matthew Francis' original implementation. + */ +module.exports = (function() { + + /** + * A static CRC lookup table + */ + var crc32Lookup = new Uint32Array([ + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, + 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, + 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, + 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, + 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, + 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, + 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, + 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, + 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, + 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, + 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, + 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, + 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, + 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, + 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, + 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, + 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, + 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, + 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, + 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, + 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, + 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 + ]); + + var CRC32 = function() { + /** + * The current CRC + */ + var crc = 0xffffffff; + + /** + * @return The current CRC + */ + this.getCRC = function() { + return (~crc) >>> 0; // return an unsigned value + }; + + /** + * Update the CRC with a single byte + * @param value The value to update the CRC with + */ + this.updateCRC = function(value) { + crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff]; + }; + + /** + * Update the CRC with a sequence of identical bytes + * @param value The value to update the CRC with + * @param count The number of bytes + */ + this.updateCRCRun = function(value, count) { + while (count-- > 0) { + crc = (crc << 8) ^ crc32Lookup[((crc >>> 24) ^ value) & 0xff]; + } + }; + }; + return CRC32; +})(); + + +/***/ }), + +/***/ 9634: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/* +seek-bzip - a pure-javascript module for seeking within bzip2 data + +Copyright (C) 2013 C. Scott Ananian +Copyright (C) 2012 Eli Skeggs +Copyright (C) 2011 Kevin Kwok + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Adapted from node-bzip, copyright 2012 Eli Skeggs. +Adapted from bzip2.js, copyright 2011 Kevin Kwok (antimatter15@gmail.com). + +Based on micro-bunzip by Rob Landley (rob@landley.net). + +Based on bzip2 decompression code by Julian R Seward (jseward@acm.org), +which also acknowledges contributions by Mike Burrows, David Wheeler, +Peter Fenwick, Alistair Moffat, Radford Neal, Ian H. Witten, +Robert Sedgewick, and Jon L. Bentley. +*/ + +var BitReader = __nccwpck_require__(4690); +var Stream = __nccwpck_require__(8744); +var CRC32 = __nccwpck_require__(9050); +var pjson = __nccwpck_require__(5302); + +var MAX_HUFCODE_BITS = 20; +var MAX_SYMBOLS = 258; +var SYMBOL_RUNA = 0; +var SYMBOL_RUNB = 1; +var MIN_GROUPS = 2; +var MAX_GROUPS = 6; +var GROUP_SIZE = 50; + +var WHOLEPI = "314159265359"; +var SQRTPI = "177245385090"; + +var mtf = function(array, index) { + var src = array[index], i; + for (i = index; i > 0; i--) { + array[i] = array[i-1]; + } + array[0] = src; + return src; +}; + +var Err = { + OK: 0, + LAST_BLOCK: -1, + NOT_BZIP_DATA: -2, + UNEXPECTED_INPUT_EOF: -3, + UNEXPECTED_OUTPUT_EOF: -4, + DATA_ERROR: -5, + OUT_OF_MEMORY: -6, + OBSOLETE_INPUT: -7, + END_OF_BLOCK: -8 +}; +var ErrorMessages = {}; +ErrorMessages[Err.LAST_BLOCK] = "Bad file checksum"; +ErrorMessages[Err.NOT_BZIP_DATA] = "Not bzip data"; +ErrorMessages[Err.UNEXPECTED_INPUT_EOF] = "Unexpected input EOF"; +ErrorMessages[Err.UNEXPECTED_OUTPUT_EOF] = "Unexpected output EOF"; +ErrorMessages[Err.DATA_ERROR] = "Data error"; +ErrorMessages[Err.OUT_OF_MEMORY] = "Out of memory"; +ErrorMessages[Err.OBSOLETE_INPUT] = "Obsolete (pre 0.9.5) bzip format not supported."; + +var _throw = function(status, optDetail) { + var msg = ErrorMessages[status] || 'unknown error'; + if (optDetail) { msg += ': '+optDetail; } + var e = new TypeError(msg); + e.errorCode = status; + throw e; +}; + +var Bunzip = function(inputStream, outputStream) { + this.writePos = this.writeCurrent = this.writeCount = 0; + + this._start_bunzip(inputStream, outputStream); +}; +Bunzip.prototype._init_block = function() { + var moreBlocks = this._get_next_block(); + if ( !moreBlocks ) { + this.writeCount = -1; + return false; /* no more blocks */ + } + this.blockCRC = new CRC32(); + return true; +}; +/* XXX micro-bunzip uses (inputStream, inputBuffer, len) as arguments */ +Bunzip.prototype._start_bunzip = function(inputStream, outputStream) { + /* Ensure that file starts with "BZh['1'-'9']." */ + var buf = new Buffer(4); + if (inputStream.read(buf, 0, 4) !== 4 || + String.fromCharCode(buf[0], buf[1], buf[2]) !== 'BZh') + _throw(Err.NOT_BZIP_DATA, 'bad magic'); + + var level = buf[3] - 0x30; + if (level < 1 || level > 9) + _throw(Err.NOT_BZIP_DATA, 'level out of range'); + + this.reader = new BitReader(inputStream); + + /* Fourth byte (ascii '1'-'9'), indicates block size in units of 100k of + uncompressed data. Allocate intermediate buffer for block. */ + this.dbufSize = 100000 * level; + this.nextoutput = 0; + this.outputStream = outputStream; + this.streamCRC = 0; +}; +Bunzip.prototype._get_next_block = function() { + var i, j, k; + var reader = this.reader; + // this is get_next_block() function from micro-bunzip: + /* Read in header signature and CRC, then validate signature. + (last block signature means CRC is for whole file, return now) */ + var h = reader.pi(); + if (h === SQRTPI) { // last block + return false; /* no more blocks */ + } + if (h !== WHOLEPI) + _throw(Err.NOT_BZIP_DATA); + this.targetBlockCRC = reader.read(32) >>> 0; // (convert to unsigned) + this.streamCRC = (this.targetBlockCRC ^ + ((this.streamCRC << 1) | (this.streamCRC>>>31))) >>> 0; + /* We can add support for blockRandomised if anybody complains. There was + some code for this in busybox 1.0.0-pre3, but nobody ever noticed that + it didn't actually work. */ + if (reader.read(1)) + _throw(Err.OBSOLETE_INPUT); + var origPointer = reader.read(24); + if (origPointer > this.dbufSize) + _throw(Err.DATA_ERROR, 'initial position out of bounds'); + /* mapping table: if some byte values are never used (encoding things + like ascii text), the compression code removes the gaps to have fewer + symbols to deal with, and writes a sparse bitfield indicating which + values were present. We make a translation table to convert the symbols + back to the corresponding bytes. */ + var t = reader.read(16); + var symToByte = new Buffer(256), symTotal = 0; + for (i = 0; i < 16; i++) { + if (t & (1 << (0xF - i))) { + var o = i * 16; + k = reader.read(16); + for (j = 0; j < 16; j++) + if (k & (1 << (0xF - j))) + symToByte[symTotal++] = o + j; + } + } + + /* How many different huffman coding groups does this block use? */ + var groupCount = reader.read(3); + if (groupCount < MIN_GROUPS || groupCount > MAX_GROUPS) + _throw(Err.DATA_ERROR); + /* nSelectors: Every GROUP_SIZE many symbols we select a new huffman coding + group. Read in the group selector list, which is stored as MTF encoded + bit runs. (MTF=Move To Front, as each value is used it's moved to the + start of the list.) */ + var nSelectors = reader.read(15); + if (nSelectors === 0) + _throw(Err.DATA_ERROR); + + var mtfSymbol = new Buffer(256); + for (i = 0; i < groupCount; i++) + mtfSymbol[i] = i; + + var selectors = new Buffer(nSelectors); // was 32768... + + for (i = 0; i < nSelectors; i++) { + /* Get next value */ + for (j = 0; reader.read(1); j++) + if (j >= groupCount) _throw(Err.DATA_ERROR); + /* Decode MTF to get the next selector */ + selectors[i] = mtf(mtfSymbol, j); + } + + /* Read the huffman coding tables for each group, which code for symTotal + literal symbols, plus two run symbols (RUNA, RUNB) */ + var symCount = symTotal + 2; + var groups = [], hufGroup; + for (j = 0; j < groupCount; j++) { + var length = new Buffer(symCount), temp = new Uint16Array(MAX_HUFCODE_BITS + 1); + /* Read huffman code lengths for each symbol. They're stored in + a way similar to mtf; record a starting value for the first symbol, + and an offset from the previous value for everys symbol after that. */ + t = reader.read(5); // lengths + for (i = 0; i < symCount; i++) { + for (;;) { + if (t < 1 || t > MAX_HUFCODE_BITS) _throw(Err.DATA_ERROR); + /* If first bit is 0, stop. Else second bit indicates whether + to increment or decrement the value. */ + if(!reader.read(1)) + break; + if(!reader.read(1)) + t++; + else + t--; + } + length[i] = t; + } + + /* Find largest and smallest lengths in this group */ + var minLen, maxLen; + minLen = maxLen = length[0]; + for (i = 1; i < symCount; i++) { + if (length[i] > maxLen) + maxLen = length[i]; + else if (length[i] < minLen) + minLen = length[i]; + } + + /* Calculate permute[], base[], and limit[] tables from length[]. + * + * permute[] is the lookup table for converting huffman coded symbols + * into decoded symbols. base[] is the amount to subtract from the + * value of a huffman symbol of a given length when using permute[]. + * + * limit[] indicates the largest numerical value a symbol with a given + * number of bits can have. This is how the huffman codes can vary in + * length: each code with a value>limit[length] needs another bit. + */ + hufGroup = {}; + groups.push(hufGroup); + hufGroup.permute = new Uint16Array(MAX_SYMBOLS); + hufGroup.limit = new Uint32Array(MAX_HUFCODE_BITS + 2); + hufGroup.base = new Uint32Array(MAX_HUFCODE_BITS + 1); + hufGroup.minLen = minLen; + hufGroup.maxLen = maxLen; + /* Calculate permute[]. Concurently, initialize temp[] and limit[]. */ + var pp = 0; + for (i = minLen; i <= maxLen; i++) { + temp[i] = hufGroup.limit[i] = 0; + for (t = 0; t < symCount; t++) + if (length[t] === i) + hufGroup.permute[pp++] = t; + } + /* Count symbols coded for at each bit length */ + for (i = 0; i < symCount; i++) + temp[length[i]]++; + /* Calculate limit[] (the largest symbol-coding value at each bit + * length, which is (previous limit<<1)+symbols at this level), and + * base[] (number of symbols to ignore at each bit length, which is + * limit minus the cumulative count of symbols coded for already). */ + pp = t = 0; + for (i = minLen; i < maxLen; i++) { + pp += temp[i]; + /* We read the largest possible symbol size and then unget bits + after determining how many we need, and those extra bits could + be set to anything. (They're noise from future symbols.) At + each level we're really only interested in the first few bits, + so here we set all the trailing to-be-ignored bits to 1 so they + don't affect the value>limit[length] comparison. */ + hufGroup.limit[i] = pp - 1; + pp <<= 1; + t += temp[i]; + hufGroup.base[i + 1] = pp - t; + } + hufGroup.limit[maxLen + 1] = Number.MAX_VALUE; /* Sentinal value for reading next sym. */ + hufGroup.limit[maxLen] = pp + temp[maxLen] - 1; + hufGroup.base[minLen] = 0; + } + /* We've finished reading and digesting the block header. Now read this + block's huffman coded symbols from the file and undo the huffman coding + and run length encoding, saving the result into dbuf[dbufCount++]=uc */ + + /* Initialize symbol occurrence counters and symbol Move To Front table */ + var byteCount = new Uint32Array(256); + for (i = 0; i < 256; i++) + mtfSymbol[i] = i; + /* Loop through compressed symbols. */ + var runPos = 0, dbufCount = 0, selector = 0, uc; + var dbuf = this.dbuf = new Uint32Array(this.dbufSize); + symCount = 0; + for (;;) { + /* Determine which huffman coding group to use. */ + if (!(symCount--)) { + symCount = GROUP_SIZE - 1; + if (selector >= nSelectors) { _throw(Err.DATA_ERROR); } + hufGroup = groups[selectors[selector++]]; + } + /* Read next huffman-coded symbol. */ + i = hufGroup.minLen; + j = reader.read(i); + for (;;i++) { + if (i > hufGroup.maxLen) { _throw(Err.DATA_ERROR); } + if (j <= hufGroup.limit[i]) + break; + j = (j << 1) | reader.read(1); + } + /* Huffman decode value to get nextSym (with bounds checking) */ + j -= hufGroup.base[i]; + if (j < 0 || j >= MAX_SYMBOLS) { _throw(Err.DATA_ERROR); } + var nextSym = hufGroup.permute[j]; + /* We have now decoded the symbol, which indicates either a new literal + byte, or a repeated run of the most recent literal byte. First, + check if nextSym indicates a repeated run, and if so loop collecting + how many times to repeat the last literal. */ + if (nextSym === SYMBOL_RUNA || nextSym === SYMBOL_RUNB) { + /* If this is the start of a new run, zero out counter */ + if (!runPos){ + runPos = 1; + t = 0; + } + /* Neat trick that saves 1 symbol: instead of or-ing 0 or 1 at + each bit position, add 1 or 2 instead. For example, + 1011 is 1<<0 + 1<<1 + 2<<2. 1010 is 2<<0 + 2<<1 + 1<<2. + You can make any bit pattern that way using 1 less symbol than + the basic or 0/1 method (except all bits 0, which would use no + symbols, but a run of length 0 doesn't mean anything in this + context). Thus space is saved. */ + if (nextSym === SYMBOL_RUNA) + t += runPos; + else + t += 2 * runPos; + runPos <<= 1; + continue; + } + /* When we hit the first non-run symbol after a run, we now know + how many times to repeat the last literal, so append that many + copies to our buffer of decoded symbols (dbuf) now. (The last + literal used is the one at the head of the mtfSymbol array.) */ + if (runPos){ + runPos = 0; + if (dbufCount + t > this.dbufSize) { _throw(Err.DATA_ERROR); } + uc = symToByte[mtfSymbol[0]]; + byteCount[uc] += t; + while (t--) + dbuf[dbufCount++] = uc; + } + /* Is this the terminating symbol? */ + if (nextSym > symTotal) + break; + /* At this point, nextSym indicates a new literal character. Subtract + one to get the position in the MTF array at which this literal is + currently to be found. (Note that the result can't be -1 or 0, + because 0 and 1 are RUNA and RUNB. But another instance of the + first symbol in the mtf array, position 0, would have been handled + as part of a run above. Therefore 1 unused mtf position minus + 2 non-literal nextSym values equals -1.) */ + if (dbufCount >= this.dbufSize) { _throw(Err.DATA_ERROR); } + i = nextSym - 1; + uc = mtf(mtfSymbol, i); + uc = symToByte[uc]; + /* We have our literal byte. Save it into dbuf. */ + byteCount[uc]++; + dbuf[dbufCount++] = uc; + } + /* At this point, we've read all the huffman-coded symbols (and repeated + runs) for this block from the input stream, and decoded them into the + intermediate buffer. There are dbufCount many decoded bytes in dbuf[]. + Now undo the Burrows-Wheeler transform on dbuf. + See http://dogma.net/markn/articles/bwt/bwt.htm + */ + if (origPointer < 0 || origPointer >= dbufCount) { _throw(Err.DATA_ERROR); } + /* Turn byteCount into cumulative occurrence counts of 0 to n-1. */ + j = 0; + for (i = 0; i < 256; i++) { + k = j + byteCount[i]; + byteCount[i] = j; + j = k; + } + /* Figure out what order dbuf would be in if we sorted it. */ + for (i = 0; i < dbufCount; i++) { + uc = dbuf[i] & 0xff; + dbuf[byteCount[uc]] |= (i << 8); + byteCount[uc]++; + } + /* Decode first byte by hand to initialize "previous" byte. Note that it + doesn't get output, and if the first three characters are identical + it doesn't qualify as a run (hence writeRunCountdown=5). */ + var pos = 0, current = 0, run = 0; + if (dbufCount) { + pos = dbuf[origPointer]; + current = (pos & 0xff); + pos >>= 8; + run = -1; + } + this.writePos = pos; + this.writeCurrent = current; + this.writeCount = dbufCount; + this.writeRun = run; + + return true; /* more blocks to come */ +}; +/* Undo burrows-wheeler transform on intermediate buffer to produce output. + If start_bunzip was initialized with out_fd=-1, then up to len bytes of + data are written to outbuf. Return value is number of bytes written or + error (all errors are negative numbers). If out_fd!=-1, outbuf and len + are ignored, data is written to out_fd and return is RETVAL_OK or error. +*/ +Bunzip.prototype._read_bunzip = function(outputBuffer, len) { + var copies, previous, outbyte; + /* james@jamestaylor.org: writeCount goes to -1 when the buffer is fully + decoded, which results in this returning RETVAL_LAST_BLOCK, also + equal to -1... Confusing, I'm returning 0 here to indicate no + bytes written into the buffer */ + if (this.writeCount < 0) { return 0; } + + var gotcount = 0; + var dbuf = this.dbuf, pos = this.writePos, current = this.writeCurrent; + var dbufCount = this.writeCount, outputsize = this.outputsize; + var run = this.writeRun; + + while (dbufCount) { + dbufCount--; + previous = current; + pos = dbuf[pos]; + current = pos & 0xff; + pos >>= 8; + if (run++ === 3){ + copies = current; + outbyte = previous; + current = -1; + } else { + copies = 1; + outbyte = current; + } + this.blockCRC.updateCRCRun(outbyte, copies); + while (copies--) { + this.outputStream.writeByte(outbyte); + this.nextoutput++; + } + if (current != previous) + run = 0; + } + this.writeCount = dbufCount; + // check CRC + if (this.blockCRC.getCRC() !== this.targetBlockCRC) { + _throw(Err.DATA_ERROR, "Bad block CRC "+ + "(got "+this.blockCRC.getCRC().toString(16)+ + " expected "+this.targetBlockCRC.toString(16)+")"); + } + return this.nextoutput; +}; + +var coerceInputStream = function(input) { + if ('readByte' in input) { return input; } + var inputStream = new Stream(); + inputStream.pos = 0; + inputStream.readByte = function() { return input[this.pos++]; }; + inputStream.seek = function(pos) { this.pos = pos; }; + inputStream.eof = function() { return this.pos >= input.length; }; + return inputStream; +}; +var coerceOutputStream = function(output) { + var outputStream = new Stream(); + var resizeOk = true; + if (output) { + if (typeof(output)==='number') { + outputStream.buffer = new Buffer(output); + resizeOk = false; + } else if ('writeByte' in output) { + return output; + } else { + outputStream.buffer = output; + resizeOk = false; + } + } else { + outputStream.buffer = new Buffer(16384); + } + outputStream.pos = 0; + outputStream.writeByte = function(_byte) { + if (resizeOk && this.pos >= this.buffer.length) { + var newBuffer = new Buffer(this.buffer.length*2); + this.buffer.copy(newBuffer); + this.buffer = newBuffer; + } + this.buffer[this.pos++] = _byte; + }; + outputStream.getBuffer = function() { + // trim buffer + if (this.pos !== this.buffer.length) { + if (!resizeOk) + throw new TypeError('outputsize does not match decoded input'); + var newBuffer = new Buffer(this.pos); + this.buffer.copy(newBuffer, 0, 0, this.pos); + this.buffer = newBuffer; + } + return this.buffer; + }; + outputStream._coerced = true; + return outputStream; +}; + +/* Static helper functions */ +Bunzip.Err = Err; +// 'input' can be a stream or a buffer +// 'output' can be a stream or a buffer or a number (buffer size) +Bunzip.decode = function(input, output, multistream) { + // make a stream from a buffer, if necessary + var inputStream = coerceInputStream(input); + var outputStream = coerceOutputStream(output); + + var bz = new Bunzip(inputStream, outputStream); + while (true) { + if ('eof' in inputStream && inputStream.eof()) break; + if (bz._init_block()) { + bz._read_bunzip(); + } else { + var targetStreamCRC = bz.reader.read(32) >>> 0; // (convert to unsigned) + if (targetStreamCRC !== bz.streamCRC) { + _throw(Err.DATA_ERROR, "Bad stream CRC "+ + "(got "+bz.streamCRC.toString(16)+ + " expected "+targetStreamCRC.toString(16)+")"); + } + if (multistream && + 'eof' in inputStream && + !inputStream.eof()) { + // note that start_bunzip will also resync the bit reader to next byte + bz._start_bunzip(inputStream, outputStream); + } else break; + } + } + if ('getBuffer' in outputStream) + return outputStream.getBuffer(); +}; +Bunzip.decodeBlock = function(input, pos, output) { + // make a stream from a buffer, if necessary + var inputStream = coerceInputStream(input); + var outputStream = coerceOutputStream(output); + var bz = new Bunzip(inputStream, outputStream); + bz.reader.seek(pos); + /* Fill the decode buffer for the block */ + var moreBlocks = bz._get_next_block(); + if (moreBlocks) { + /* Init the CRC for writing */ + bz.blockCRC = new CRC32(); + + /* Zero this so the current byte from before the seek is not written */ + bz.writeCopies = 0; + + /* Decompress the block and write to stdout */ + bz._read_bunzip(); + // XXX keep writing? + } + if ('getBuffer' in outputStream) + return outputStream.getBuffer(); +}; +/* Reads bzip2 file from stream or buffer `input`, and invoke + * `callback(position, size)` once for each bzip2 block, + * where position gives the starting position (in *bits*) + * and size gives uncompressed size of the block (in *bytes*). */ +Bunzip.table = function(input, callback, multistream) { + // make a stream from a buffer, if necessary + var inputStream = new Stream(); + inputStream.delegate = coerceInputStream(input); + inputStream.pos = 0; + inputStream.readByte = function() { + this.pos++; + return this.delegate.readByte(); + }; + if (inputStream.delegate.eof) { + inputStream.eof = inputStream.delegate.eof.bind(inputStream.delegate); + } + var outputStream = new Stream(); + outputStream.pos = 0; + outputStream.writeByte = function() { this.pos++; }; + + var bz = new Bunzip(inputStream, outputStream); + var blockSize = bz.dbufSize; + while (true) { + if ('eof' in inputStream && inputStream.eof()) break; + + var position = inputStream.pos*8 + bz.reader.bitOffset; + if (bz.reader.hasByte) { position -= 8; } + + if (bz._init_block()) { + var start = outputStream.pos; + bz._read_bunzip(); + callback(position, outputStream.pos - start); + } else { + var crc = bz.reader.read(32); // (but we ignore the crc) + if (multistream && + 'eof' in inputStream && + !inputStream.eof()) { + // note that start_bunzip will also resync the bit reader to next byte + bz._start_bunzip(inputStream, outputStream); + console.assert(bz.dbufSize === blockSize, + "shouldn't change block size within multistream file"); + } else break; + } + } +}; + +Bunzip.Stream = Stream; + +Bunzip.version = pjson.version; +Bunzip.license = pjson.license; + +module.exports = Bunzip; + + +/***/ }), + +/***/ 8744: +/***/ ((module) => { + +/* very simple input/output stream interface */ +var Stream = function() { +}; + +// input streams ////////////// +/** Returns the next byte, or -1 for EOF. */ +Stream.prototype.readByte = function() { + throw new Error("abstract method readByte() not implemented"); +}; +/** Attempts to fill the buffer; returns number of bytes read, or + * -1 for EOF. */ +Stream.prototype.read = function(buffer, bufOffset, length) { + var bytesRead = 0; + while (bytesRead < length) { + var c = this.readByte(); + if (c < 0) { // EOF + return (bytesRead===0) ? -1 : bytesRead; + } + buffer[bufOffset++] = c; + bytesRead++; + } + return bytesRead; +}; +Stream.prototype.seek = function(new_pos) { + throw new Error("abstract method seek() not implemented"); +}; + +// output streams /////////// +Stream.prototype.writeByte = function(_byte) { + throw new Error("abstract method readByte() not implemented"); +}; +Stream.prototype.write = function(buffer, bufOffset, length) { + var i; + for (i=0; i { + + + +var GetIntrinsic = __nccwpck_require__(470); +var define = __nccwpck_require__(1316); +var hasDescriptors = __nccwpck_require__(497)(); +var gOPD = __nccwpck_require__(3170); + +var $TypeError = __nccwpck_require__(3314); +var $floor = GetIntrinsic('%Math.floor%'); + +/** @type {import('.')} */ +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 > 0xFFFFFFFF || $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(/** @type {Parameters[0]} */ (fn), 'length', length, true, true); + } else { + define(/** @type {Parameters[0]} */ (fn), 'length', length); + } + } + return fn; +}; + + +/***/ }), + +/***/ 634: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + + +/**/ + +var Buffer = (__nccwpck_require__(6132).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; // undefined + enc = ('' + enc).toLowerCase(); + retried = true; + } + } +}; + +// Do not cache `Buffer.isEncoding` when checking encoding names as some +// modules monkey-patch it to support additional encodings +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; +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. +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; + +// Returns only complete characters in a Buffer +StringDecoder.prototype.text = utf8Text; + +// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer +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; +}; + +// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a +// continuation byte. If an invalid byte is detected, -2 is returned. +function utf8CheckByte(byte) { + if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; + return byte >> 6 === 0x02 ? -1 : -2; +} + +// Checks at most 3 bytes at the end of a Buffer in order to detect an +// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4) +// needed to complete the UTF-8 character (if applicable) are returned. +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; +} + +// Validates as many continuation bytes for a multi-byte UTF-8 character as +// needed or are available. If we see a non-continuation byte where we expect +// one, we "replace" the validated continuation bytes we've seen so far with +// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding +// behavior. The continuation byte check is included three times in the case +// where all of the continuation bytes for a character exist in the same buffer. +// It is also done this way as a slight performance increase instead of using a +// loop. +function utf8CheckExtraBytes(self, buf, p) { + if ((buf[0] & 0xC0) !== 0x80) { + self.lastNeed = 0; + return '\ufffd'; + } + if (self.lastNeed > 1 && buf.length > 1) { + if ((buf[1] & 0xC0) !== 0x80) { + self.lastNeed = 1; + return '\ufffd'; + } + if (self.lastNeed > 2 && buf.length > 2) { + if ((buf[2] & 0xC0) !== 0x80) { + self.lastNeed = 2; + return '\ufffd'; + } + } + } +} + +// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer. +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; +} + +// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a +// partial character, the character's bytes are buffered until the required +// number of bytes are available. +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); +} + +// For UTF-8, a replacement character is added when ending on a partial +// character. +function utf8End(buf) { + var r = buf && buf.length ? this.write(buf) : ''; + if (this.lastNeed) return r + '\ufffd'; + return r; +} + +// UTF-16LE typically needs two bytes per character, but even if we have an even +// number of bytes available, we need to check if we end on a leading/high +// surrogate. In that case, we need to wait for the next two bytes in order to +// decode the last character properly. +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 >= 0xD800 && c <= 0xDBFF) { + 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); +} + +// For UTF-16LE we do not explicitly append special replacement characters if we +// end on a partial character, we simply let v8 handle that. +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; +} + +// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex) +function simpleWrite(buf) { + return buf.toString(this.encoding); +} + +function simpleEnd(buf) { + return buf && buf.length ? this.write(buf) : ''; +} + +/***/ }), + +/***/ 6132: +/***/ ((module, exports, __nccwpck_require__) => { + +/* eslint-disable node/no-deprecated-api */ +var buffer = __nccwpck_require__(181) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +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 { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +// Copy static methods from Buffer +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) +} + + +/***/ }), + +/***/ 5245: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/*! + * strip-dirs | MIT (c) Shinnosuke Watanabe + * https://github.com/shinnn/node-strip-dirs +*/ + + +const path = __nccwpck_require__(6928); +const util = __nccwpck_require__(9023); + +const isNaturalNumber = __nccwpck_require__(6834); + +module.exports = function stripDirs(pathStr, count, option) { + if (typeof pathStr !== 'string') { + throw new TypeError( + util.inspect(pathStr) + + ' is not a string. First argument to strip-dirs must be a path string.' + ); + } + + if (path.posix.isAbsolute(pathStr) || path.win32.isAbsolute(pathStr)) { + throw new Error(`${pathStr} is an absolute path. strip-dirs requires a relative path.`); + } + + if (!isNaturalNumber(count, {includeZero: true})) { + throw new Error( + 'The Second argument of strip-dirs must be a natural number or 0, but received ' + + util.inspect(count) + + '.' + ); + } + + if (option) { + if (typeof option !== 'object') { + throw new TypeError( + util.inspect(option) + + ' is not an object. Expected an object with a boolean `disallowOverflow` property.' + ); + } + + if (Array.isArray(option)) { + throw new TypeError( + util.inspect(option) + + ' is an array. Expected an object with a boolean `disallowOverflow` property.' + ); + } + + if ('disallowOverflow' in option && typeof option.disallowOverflow !== 'boolean') { + throw new TypeError( + util.inspect(option.disallowOverflow) + + ' is neither true nor false. `disallowOverflow` option must be a Boolean value.' + ); + } + } else { + option = {disallowOverflow: false}; + } + + const pathComponents = path.normalize(pathStr).split(path.sep); + + if (pathComponents.length > 1 && pathComponents[0] === '.') { + pathComponents.shift(); + } + + if (count > pathComponents.length - 1) { + if (option.disallowOverflow) { + throw new RangeError('Cannot strip more directories than there are.'); + } + + count = pathComponents.length - 1; + } + + return path.join.apply(null, pathComponents.slice(count)); +}; + + +/***/ }), + +/***/ 5763: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var util = __nccwpck_require__(9023) +var bl = __nccwpck_require__(794) +var xtend = __nccwpck_require__(869) +var headers = __nccwpck_require__(8428) + +var Writable = (__nccwpck_require__(6131).Writable) +var PassThrough = (__nccwpck_require__(6131).PassThrough) + +var noop = function () {} + +var overflow = function (size) { + size &= 511 + return size && 512 - size +} + +var emptyStream = function (self, offset) { + var s = new Source(self, offset) + s.end() + return s +} + +var mixinPax = function (header, pax) { + if (pax.path) header.name = pax.path + if (pax.linkpath) header.linkname = pax.linkpath + if (pax.size) header.size = parseInt(pax.size, 10) + header.pax = pax + return header +} + +var Source = function (self, offset) { + this._parent = self + this.offset = offset + PassThrough.call(this) +} + +util.inherits(Source, PassThrough) + +Source.prototype.destroy = function (err) { + this._parent.destroy(err) +} + +var Extract = function (opts) { + if (!(this instanceof Extract)) return new Extract(opts) + Writable.call(this, opts) + + opts = opts || {} + + this._offset = 0 + this._buffer = bl() + this._missing = 0 + this._partial = false + this._onparse = noop + this._header = null + this._stream = null + this._overflow = null + this._cb = null + this._locked = false + this._destroyed = false + this._pax = null + this._paxGlobal = null + this._gnuLongPath = null + this._gnuLongLinkPath = null + + var self = this + var b = self._buffer + + var oncontinue = function () { + self._continue() + } + + var onunlock = function (err) { + self._locked = false + if (err) return self.destroy(err) + if (!self._stream) oncontinue() + } + + var onstreamend = function () { + self._stream = null + var drain = overflow(self._header.size) + if (drain) self._parse(drain, ondrain) + else self._parse(512, onheader) + if (!self._locked) oncontinue() + } + + var ondrain = function () { + self._buffer.consume(overflow(self._header.size)) + self._parse(512, onheader) + oncontinue() + } + + var onpaxglobalheader = function () { + var size = self._header.size + self._paxGlobal = headers.decodePax(b.slice(0, size)) + b.consume(size) + onstreamend() + } + + var onpaxheader = function () { + var size = self._header.size + self._pax = headers.decodePax(b.slice(0, size)) + if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax) + b.consume(size) + onstreamend() + } + + var ongnulongpath = function () { + var size = self._header.size + this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) + b.consume(size) + onstreamend() + } + + var ongnulonglinkpath = function () { + var size = self._header.size + this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding) + b.consume(size) + onstreamend() + } + + var onheader = function () { + var offset = self._offset + var header + try { + header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding) + } catch (err) { + self.emit('error', err) + } + b.consume(512) + + if (!header) { + self._parse(512, onheader) + oncontinue() + return + } + if (header.type === 'gnu-long-path') { + self._parse(header.size, ongnulongpath) + oncontinue() + return + } + if (header.type === 'gnu-long-link-path') { + self._parse(header.size, ongnulonglinkpath) + oncontinue() + return + } + if (header.type === 'pax-global-header') { + self._parse(header.size, onpaxglobalheader) + oncontinue() + return + } + if (header.type === 'pax-header') { + self._parse(header.size, onpaxheader) + oncontinue() + return + } + + if (self._gnuLongPath) { + header.name = self._gnuLongPath + self._gnuLongPath = null + } + + if (self._gnuLongLinkPath) { + header.linkname = self._gnuLongLinkPath + self._gnuLongLinkPath = null + } + + if (self._pax) { + self._header = header = mixinPax(header, self._pax) + self._pax = null + } + + self._locked = true + + if (!header.size || header.type === 'directory') { + self._parse(512, onheader) + self.emit('entry', header, emptyStream(self, offset), onunlock) + return + } + + self._stream = new Source(self, offset) + + self.emit('entry', header, self._stream, onunlock) + self._parse(header.size, onstreamend) + oncontinue() + } + + this._onheader = onheader + this._parse(512, onheader) +} + +util.inherits(Extract, Writable) + +Extract.prototype.destroy = function (err) { + if (this._destroyed) return + this._destroyed = true + + if (err) this.emit('error', err) + this.emit('close') + if (this._stream) this._stream.emit('close') +} + +Extract.prototype._parse = function (size, onparse) { + if (this._destroyed) return + this._offset += size + this._missing = size + if (onparse === this._onheader) this._partial = false + this._onparse = onparse +} + +Extract.prototype._continue = function () { + if (this._destroyed) return + var cb = this._cb + this._cb = noop + if (this._overflow) this._write(this._overflow, undefined, cb) + else cb() +} + +Extract.prototype._write = function (data, enc, cb) { + if (this._destroyed) return + + var s = this._stream + var b = this._buffer + var missing = this._missing + if (data.length) this._partial = true + + // we do not reach end-of-chunk now. just forward it + + if (data.length < missing) { + this._missing -= data.length + this._overflow = null + if (s) return s.write(data, cb) + b.append(data) + return cb() + } + + // end-of-chunk. the parser should call cb. + + this._cb = cb + this._missing = 0 + + var overflow = null + if (data.length > missing) { + overflow = data.slice(missing) + data = data.slice(0, missing) + } + + if (s) s.end(data) + else b.append(data) + + this._overflow = overflow + this._onparse() +} + +Extract.prototype._final = function (cb) { + if (this._partial) return this.destroy(new Error('Unexpected end of data')) + cb() +} + +module.exports = Extract + + +/***/ }), + +/***/ 8428: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var toBuffer = __nccwpck_require__(6870) +var alloc = __nccwpck_require__(8950) + +var ZEROS = '0000000000000000000' +var SEVENS = '7777777777777777777' +var ZERO_OFFSET = '0'.charCodeAt(0) +var USTAR = 'ustar\x0000' +var MASK = parseInt('7777', 8) + +var clamp = function (index, len, defaultValue) { + if (typeof index !== 'number') return defaultValue + index = ~~index // Coerce to integer. + if (index >= len) return len + if (index >= 0) return index + index += len + if (index >= 0) return index + return 0 +} + +var toType = function (flag) { + switch (flag) { + case 0: + return 'file' + case 1: + return 'link' + case 2: + return 'symlink' + case 3: + return 'character-device' + case 4: + return 'block-device' + case 5: + return 'directory' + case 6: + return 'fifo' + case 7: + return 'contiguous-file' + case 72: + return 'pax-header' + case 55: + return 'pax-global-header' + case 27: + return 'gnu-long-link-path' + case 28: + case 30: + return 'gnu-long-path' + } + + return null +} + +var toTypeflag = function (flag) { + switch (flag) { + case 'file': + return 0 + case 'link': + return 1 + case 'symlink': + return 2 + case 'character-device': + return 3 + case 'block-device': + return 4 + case 'directory': + return 5 + case 'fifo': + return 6 + case 'contiguous-file': + return 7 + case 'pax-header': + return 72 + } + + return 0 +} + +var indexOf = function (block, num, offset, end) { + for (; offset < end; offset++) { + if (block[offset] === num) return offset + } + return end +} + +var cksum = function (block) { + var sum = 8 * 32 + for (var i = 0; i < 148; i++) sum += block[i] + for (var j = 156; j < 512; j++) sum += block[j] + return sum +} + +var encodeOct = function (val, n) { + val = val.toString(8) + if (val.length > n) return SEVENS.slice(0, n) + ' ' + else return ZEROS.slice(0, n - val.length) + val + ' ' +} + +/* Copied from the node-tar repo and modified to meet + * tar-stream coding standard. + * + * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349 + */ +function parse256 (buf) { + // first byte MUST be either 80 or FF + // 80 for positive, FF for 2's comp + var positive + if (buf[0] === 0x80) positive = true + else if (buf[0] === 0xFF) positive = false + else return null + + // build up a base-256 tuple from the least sig to the highest + var zero = false + var tuple = [] + for (var i = buf.length - 1; i > 0; i--) { + var byte = buf[i] + if (positive) tuple.push(byte) + else if (zero && byte === 0) tuple.push(0) + else if (zero) { + zero = false + tuple.push(0x100 - byte) + } else tuple.push(0xFF - byte) + } + + var sum = 0 + var l = tuple.length + for (i = 0; i < l; i++) { + sum += tuple[i] * Math.pow(256, i) + } + + return positive ? sum : -1 * sum +} + +var decodeOct = function (val, offset, length) { + val = val.slice(offset, offset + length) + offset = 0 + + // If prefixed with 0x80 then parse as a base-256 integer + if (val[offset] & 0x80) { + return parse256(val) + } else { + // Older versions of tar can prefix with spaces + while (offset < val.length && val[offset] === 32) offset++ + var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length) + while (offset < end && val[offset] === 0) offset++ + if (end === offset) return 0 + return parseInt(val.slice(offset, end).toString(), 8) + } +} + +var decodeStr = function (val, offset, length, encoding) { + return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding) +} + +var addLength = function (str) { + var len = Buffer.byteLength(str) + var digits = Math.floor(Math.log(len) / Math.log(10)) + 1 + if (len + digits >= Math.pow(10, digits)) digits++ + + return (len + digits) + str +} + +exports.decodeLongPath = function (buf, encoding) { + return decodeStr(buf, 0, buf.length, encoding) +} + +exports.encodePax = function (opts) { // TODO: encode more stuff in pax + var result = '' + if (opts.name) result += addLength(' path=' + opts.name + '\n') + if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n') + var pax = opts.pax + if (pax) { + for (var key in pax) { + result += addLength(' ' + key + '=' + pax[key] + '\n') + } + } + return toBuffer(result) +} + +exports.decodePax = function (buf) { + var result = {} + + while (buf.length) { + var i = 0 + while (i < buf.length && buf[i] !== 32) i++ + var len = parseInt(buf.slice(0, i).toString(), 10) + if (!len) return result + + var b = buf.slice(i + 1, len - 1).toString() + var keyIndex = b.indexOf('=') + if (keyIndex === -1) return result + result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1) + + buf = buf.slice(len) + } + + return result +} + +exports.encode = function (opts) { + var buf = alloc(512) + var name = opts.name + var prefix = '' + + if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/' + if (Buffer.byteLength(name) !== name.length) return null // utf-8 + + while (Buffer.byteLength(name) > 100) { + var i = name.indexOf('/') + if (i === -1) return null + prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i) + name = name.slice(i + 1) + } + + if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null + if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null + + buf.write(name) + buf.write(encodeOct(opts.mode & MASK, 6), 100) + buf.write(encodeOct(opts.uid, 6), 108) + buf.write(encodeOct(opts.gid, 6), 116) + buf.write(encodeOct(opts.size, 11), 124) + buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136) + + buf[156] = ZERO_OFFSET + toTypeflag(opts.type) + + if (opts.linkname) buf.write(opts.linkname, 157) + + buf.write(USTAR, 257) + if (opts.uname) buf.write(opts.uname, 265) + if (opts.gname) buf.write(opts.gname, 297) + buf.write(encodeOct(opts.devmajor || 0, 6), 329) + buf.write(encodeOct(opts.devminor || 0, 6), 337) + + if (prefix) buf.write(prefix, 345) + + buf.write(encodeOct(cksum(buf), 6), 148) + + return buf +} + +exports.decode = function (buf, filenameEncoding) { + var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET + + var name = decodeStr(buf, 0, 100, filenameEncoding) + var mode = decodeOct(buf, 100, 8) + var uid = decodeOct(buf, 108, 8) + var gid = decodeOct(buf, 116, 8) + var size = decodeOct(buf, 124, 12) + var mtime = decodeOct(buf, 136, 12) + var type = toType(typeflag) + var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding) + var uname = decodeStr(buf, 265, 32) + var gname = decodeStr(buf, 297, 32) + var devmajor = decodeOct(buf, 329, 8) + var devminor = decodeOct(buf, 337, 8) + + if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name + + // to support old tar versions that use trailing / to indicate dirs + if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5 + + var c = cksum(buf) + + // checksum is still initial value if header was null. + if (c === 8 * 32) return null + + // valid checksum + if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?') + + return { + name: name, + mode: mode, + uid: uid, + gid: gid, + size: size, + mtime: new Date(1000 * mtime), + type: type, + linkname: linkname, + uname: uname, + gname: gname, + devmajor: devmajor, + devminor: devminor + } +} + + +/***/ }), + +/***/ 6118: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +exports.extract = __nccwpck_require__(5763) +exports.pack = __nccwpck_require__(861) + + +/***/ }), + +/***/ 861: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var constants = __nccwpck_require__(2147) +var eos = __nccwpck_require__(1424) +var util = __nccwpck_require__(9023) +var alloc = __nccwpck_require__(8950) +var toBuffer = __nccwpck_require__(6870) + +var Readable = (__nccwpck_require__(6131).Readable) +var Writable = (__nccwpck_require__(6131).Writable) +var StringDecoder = (__nccwpck_require__(3193).StringDecoder) + +var headers = __nccwpck_require__(8428) + +var DMODE = parseInt('755', 8) +var FMODE = parseInt('644', 8) + +var END_OF_TAR = alloc(1024) + +var noop = function () {} + +var overflow = function (self, size) { + size &= 511 + if (size) self.push(END_OF_TAR.slice(0, 512 - size)) +} + +function modeToType (mode) { + switch (mode & constants.S_IFMT) { + case constants.S_IFBLK: return 'block-device' + case constants.S_IFCHR: return 'character-device' + case constants.S_IFDIR: return 'directory' + case constants.S_IFIFO: return 'fifo' + case constants.S_IFLNK: return 'symlink' + } + + return 'file' +} + +var Sink = function (to) { + Writable.call(this) + this.written = 0 + this._to = to + this._destroyed = false +} + +util.inherits(Sink, Writable) + +Sink.prototype._write = function (data, enc, cb) { + this.written += data.length + if (this._to.push(data)) return cb() + this._to._drain = cb +} + +Sink.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var LinkSink = function () { + Writable.call(this) + this.linkname = '' + this._decoder = new StringDecoder('utf-8') + this._destroyed = false +} + +util.inherits(LinkSink, Writable) + +LinkSink.prototype._write = function (data, enc, cb) { + this.linkname += this._decoder.write(data) + cb() +} + +LinkSink.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var Void = function () { + Writable.call(this) + this._destroyed = false +} + +util.inherits(Void, Writable) + +Void.prototype._write = function (data, enc, cb) { + cb(new Error('No body allowed for this entry')) +} + +Void.prototype.destroy = function () { + if (this._destroyed) return + this._destroyed = true + this.emit('close') +} + +var Pack = function (opts) { + if (!(this instanceof Pack)) return new Pack(opts) + Readable.call(this, opts) + + this._drain = noop + this._finalized = false + this._finalizing = false + this._destroyed = false + this._stream = null +} + +util.inherits(Pack, Readable) + +Pack.prototype.entry = function (header, buffer, callback) { + if (this._stream) throw new Error('already piping an entry') + if (this._finalized || this._destroyed) return + + if (typeof buffer === 'function') { + callback = buffer + buffer = null + } + + if (!callback) callback = noop + + var self = this + + if (!header.size || header.type === 'symlink') header.size = 0 + if (!header.type) header.type = modeToType(header.mode) + if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE + if (!header.uid) header.uid = 0 + if (!header.gid) header.gid = 0 + if (!header.mtime) header.mtime = new Date() + + if (typeof buffer === 'string') buffer = toBuffer(buffer) + if (Buffer.isBuffer(buffer)) { + header.size = buffer.length + this._encode(header) + this.push(buffer) + overflow(self, header.size) + process.nextTick(callback) + return new Void() + } + + if (header.type === 'symlink' && !header.linkname) { + var linkSink = new LinkSink() + eos(linkSink, function (err) { + if (err) { // stream was closed + self.destroy() + return callback(err) + } + + header.linkname = linkSink.linkname + self._encode(header) + callback() + }) + + return linkSink + } + + this._encode(header) + + if (header.type !== 'file' && header.type !== 'contiguous-file') { + process.nextTick(callback) + return new Void() + } + + var sink = new Sink(this) + + this._stream = sink + + eos(sink, function (err) { + self._stream = null + + if (err) { // stream was closed + self.destroy() + return callback(err) + } + + if (sink.written !== header.size) { // corrupting tar + self.destroy() + return callback(new Error('size mismatch')) + } + + overflow(self, header.size) + if (self._finalizing) self.finalize() + callback() + }) + + return sink +} + +Pack.prototype.finalize = function () { + if (this._stream) { + this._finalizing = true + return + } + + if (this._finalized) return + this._finalized = true + this.push(END_OF_TAR) + this.push(null) +} + +Pack.prototype.destroy = function (err) { + if (this._destroyed) return + this._destroyed = true + + if (err) this.emit('error', err) + this.emit('close') + if (this._stream && this._stream.destroy) this._stream.destroy() +} + +Pack.prototype._encode = function (header) { + if (!header.pax) { + var buf = headers.encode(header) + if (buf) { + this.push(buf) + return + } + } + this._encodePax(header) +} + +Pack.prototype._encodePax = function (header) { + var paxHeader = headers.encodePax({ + name: header.name, + linkname: header.linkname, + pax: header.pax + }) + + var newHeader = { + name: 'PaxHeader', + mode: header.mode, + uid: header.uid, + gid: header.gid, + size: paxHeader.length, + mtime: header.mtime, + type: 'pax-header', + linkname: header.linkname && 'PaxHeader', + uname: header.uname, + gname: header.gname, + devmajor: header.devmajor, + devminor: header.devminor + } + + this.push(headers.encode(newHeader)) + this.push(paxHeader) + overflow(this, paxHeader.length) + + newHeader.size = header.size + newHeader.type = header.type + this.push(headers.encode(newHeader)) +} + +Pack.prototype._read = function (n) { + var drain = this._drain + this._drain = noop + drain() +} + +module.exports = Pack + + +/***/ }), + +/***/ 461: +/***/ ((module, exports, __nccwpck_require__) => { + +var Stream = __nccwpck_require__(2203) + +// through +// +// a stream that does nothing but re-emit the input. +// useful for aggregating a series of changing but not ending streams into one stream) + +exports = module.exports = through +through.through = through + +//create a readable writable stream. + +function through (write, end, opts) { + write = write || function (data) { this.queue(data) } + end = end || function () { this.queue(null) } + + var ended = false, destroyed = false, buffer = [], _ended = false + var stream = new Stream() + stream.readable = stream.writable = true + stream.paused = false + +// stream.autoPause = !(opts && opts.autoPause === false) + stream.autoDestroy = !(opts && opts.autoDestroy === false) + + stream.write = function (data) { + write.call(this, data) + return !stream.paused + } + + function drain() { + while(buffer.length && !stream.paused) { + var data = buffer.shift() + if(null === data) + return stream.emit('end') + else + stream.emit('data', data) + } + } + + stream.queue = stream.push = function (data) { +// console.error(ended) + if(_ended) return stream + if(data === null) _ended = true + buffer.push(data) + drain() + return stream + } + + //this will be registered as the first 'end' listener + //must call destroy next tick, to make sure we're after any + //stream piped from here. + //this is only a problem if end is not emitted synchronously. + //a nicer way to do this is to make sure this is the last listener for 'end' + + stream.on('end', function () { + stream.readable = false + if(!stream.writable && stream.autoDestroy) + process.nextTick(function () { + stream.destroy() + }) + }) + + function _end () { + stream.writable = false + end.call(stream) + if(!stream.readable && stream.autoDestroy) + stream.destroy() + } + + stream.end = function (data) { + if(ended) return + ended = true + if(arguments.length) stream.write(data) + _end() // will emit or queue + return stream + } + + stream.destroy = function () { + if(destroyed) return + destroyed = true + ended = true + buffer.length = 0 + stream.writable = stream.readable = false + stream.emit('close') + return stream + } + + stream.pause = function () { + if(stream.paused) return + stream.paused = true + return stream + } + + stream.resume = function () { + if(stream.paused) { + stream.paused = false + stream.emit('resume') + } + drain() + //may have become paused again, + //as drain emits 'data'. + if(!stream.paused) + stream.emit('drain') + return stream + } + return stream +} + + + +/***/ }), + +/***/ 6870: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var Buffer = (__nccwpck_require__(3058).Buffer); +var isArray = __nccwpck_require__(3803); +var typedArrayBuffer = __nccwpck_require__(8489); + +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) { + /* + * No need to do anything for exact instance + * This is only valid when safe-buffer.Buffer === buffer.Buffer, i.e. when Buffer.from/Buffer.alloc existed + */ + if (data instanceof Buffer) { + return data; + } + + if (typeof data === 'string') { + return Buffer.from(data, encoding); + } + + /* + * Wrap any TypedArray instances and DataViews + * Makes sense only on engines with full TypedArray support -- let Buffer detect that + */ + if (useArrayBuffer && isView(data)) { + // Bug in Node.js <6.3.1, which treats this as out-of-bounds + if (data.byteLength === 0) { + return Buffer.alloc(0); + } + + // When Buffer is based on Uint8Array, we can just construct it from ArrayBuffer + if (useFromArrayBuffer) { + var res = Buffer.from(data.buffer, data.byteOffset, data.byteLength); + /* + * Recheck result size, as offset/length doesn't work on Node.js <5.10 + * We just go to Uint8Array case if this fails + */ + if (res.byteLength === data.byteLength) { + return res; + } + } + + // Convert to Uint8Array bytes and then to Buffer + var uint8 = data instanceof Uint8Array ? data : new Uint8Array(data.buffer, data.byteOffset, data.byteLength); + var result = Buffer.from(uint8); + + /* + * Let's recheck that conversion succeeded + * We have .length but not .byteLength when useFromArrayBuffer is false + */ + if (result.length === data.byteLength) { + return result; + } + } + + /* + * Uint8Array in engines where Buffer.from might not work with ArrayBuffer, just copy over + * Doesn't make sense with other TypedArray instances + */ + 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 // NaN and integer check + ) { + throw new RangeError('Array items must be numbers in the range 0-255.'); + } + } + } + + /* + * Old Buffer polyfill on an engine that doesn't have TypedArray support + * Also, this is from a different Buffer polyfill implementation then we have, as instanceof check failed + * Convert to our current Buffer implementation + */ + 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.'); +}; + + +/***/ }), + +/***/ 3803: +/***/ ((module) => { + +var toString = {}.toString; + +module.exports = Array.isArray || function (arr) { + return toString.call(arr) == '[object Array]'; +}; + + +/***/ }), + +/***/ 7551: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/*! + * to-regex-range + * + * Copyright (c) 2015-present, Jon Schlinkert. + * Released under the MIT License. + */ + + + +const isNumber = __nccwpck_require__(721); + +const toRegexRange = (min, max, options) => { + if (isNumber(min) === false) { + throw new TypeError('toRegexRange: expected the first argument to be a number'); + } + + if (max === void 0 || min === max) { + return String(min); + } + + if (isNumber(max) === false) { + throw new TypeError('toRegexRange: expected the second argument to be a number.'); + } + + let opts = { relaxZeros: true, ...options }; + if (typeof opts.strictZeros === 'boolean') { + opts.relaxZeros = opts.strictZeros === false; + } + + let relax = String(opts.relaxZeros); + let shorthand = String(opts.shorthand); + let capture = String(opts.capture); + let wrap = String(opts.wrap); + let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap; + + if (toRegexRange.cache.hasOwnProperty(cacheKey)) { + return toRegexRange.cache[cacheKey].result; + } + + let a = Math.min(min, max); + let b = Math.max(min, max); + + if (Math.abs(a - b) === 1) { + let result = min + '|' + max; + if (opts.capture) { + return `(${result})`; + } + if (opts.wrap === false) { + return result; + } + return `(?:${result})`; + } + + let isPadded = hasPadding(min) || hasPadding(max); + let state = { min, max, a, b }; + let positives = []; + let negatives = []; + + if (isPadded) { + state.isPadded = isPadded; + state.maxLen = String(state.max).length; + } + + if (a < 0) { + let newMin = b < 0 ? Math.abs(b) : 1; + negatives = splitToPatterns(newMin, Math.abs(a), state, opts); + a = state.a = 0; + } + + if (b >= 0) { + positives = splitToPatterns(a, b, state, opts); + } + + state.negatives = negatives; + state.positives = positives; + state.result = collatePatterns(negatives, positives, opts); + + if (opts.capture === true) { + state.result = `(${state.result})`; + } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) { + state.result = `(?:${state.result})`; + } + + toRegexRange.cache[cacheKey] = state; + return state.result; +}; + +function collatePatterns(neg, pos, options) { + let onlyNegative = filterPatterns(neg, pos, '-', false, options) || []; + let onlyPositive = filterPatterns(pos, neg, '', false, options) || []; + let intersected = filterPatterns(neg, pos, '-?', true, options) || []; + let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive); + return subpatterns.join('|'); +} + +function splitToRanges(min, max) { + let nines = 1; + let zeros = 1; + + let stop = countNines(min, nines); + let stops = new Set([max]); + + while (min <= stop && stop <= max) { + stops.add(stop); + nines += 1; + stop = countNines(min, nines); + } + + stop = countZeros(max + 1, zeros) - 1; + + while (min < stop && stop <= max) { + stops.add(stop); + zeros += 1; + stop = countZeros(max + 1, zeros) - 1; + } + + stops = [...stops]; + stops.sort(compare); + return stops; +} + +/** + * Convert a range to a regex pattern + * @param {Number} `start` + * @param {Number} `stop` + * @return {String} + */ + +function rangeToPattern(start, stop, options) { + if (start === stop) { + return { pattern: start, count: [], digits: 0 }; + } + + let zipped = zip(start, stop); + let digits = zipped.length; + let pattern = ''; + let count = 0; + + for (let i = 0; i < digits; i++) { + let [startDigit, stopDigit] = zipped[i]; + + if (startDigit === stopDigit) { + pattern += startDigit; + + } else if (startDigit !== '0' || stopDigit !== '9') { + pattern += toCharacterClass(startDigit, stopDigit, options); + + } else { + count++; + } + } + + if (count) { + pattern += options.shorthand === true ? '\\d' : '[0-9]'; + } + + return { pattern, count: [count], digits }; +} + +function splitToPatterns(min, max, tok, options) { + let ranges = splitToRanges(min, max); + let tokens = []; + let start = min; + let prev; + + for (let i = 0; i < ranges.length; i++) { + let max = ranges[i]; + let obj = rangeToPattern(String(start), String(max), options); + let zeros = ''; + + if (!tok.isPadded && prev && prev.pattern === obj.pattern) { + if (prev.count.length > 1) { + prev.count.pop(); + } + + prev.count.push(obj.count[0]); + prev.string = prev.pattern + toQuantifier(prev.count); + start = max + 1; + continue; + } + + if (tok.isPadded) { + zeros = padZeros(max, tok, options); + } + + obj.string = zeros + obj.pattern + toQuantifier(obj.count); + tokens.push(obj); + start = max + 1; + prev = obj; + } + + return tokens; +} + +function filterPatterns(arr, comparison, prefix, intersection, options) { + let result = []; + + for (let ele of arr) { + let { string } = ele; + + // only push if _both_ are negative... + if (!intersection && !contains(comparison, 'string', string)) { + result.push(prefix + string); + } + + // or _both_ are positive + if (intersection && contains(comparison, 'string', string)) { + result.push(prefix + string); + } + } + return result; +} + +/** + * Zip strings + */ + +function zip(a, b) { + let arr = []; + for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]); + return arr; +} + +function compare(a, b) { + return a > b ? 1 : b > a ? -1 : 0; +} + +function contains(arr, key, val) { + return arr.some(ele => ele[key] === val); +} + +function countNines(min, len) { + return Number(String(min).slice(0, -len) + '9'.repeat(len)); +} + +function countZeros(integer, zeros) { + return integer - (integer % Math.pow(10, zeros)); +} + +function toQuantifier(digits) { + let [start = 0, stop = ''] = digits; + if (stop || start > 1) { + return `{${start + (stop ? ',' + stop : '')}}`; + } + return ''; +} + +function toCharacterClass(a, b, options) { + return `[${a}${(b - a === 1) ? '' : '-'}${b}]`; +} + +function hasPadding(str) { + return /^-?(0+)\d/.test(str); +} + +function padZeros(value, tok, options) { + if (!tok.isPadded) { + return value; + } + + let diff = Math.abs(tok.maxLen - String(value).length); + let relax = options.relaxZeros !== false; + + switch (diff) { + case 0: + return ''; + case 1: + return relax ? '0?' : '0'; + case 2: + return relax ? '0{0,2}' : '00'; + default: { + return relax ? `0{0,${diff}}` : `0{${diff}}`; + } + } +} + +/** + * Cache + */ + +toRegexRange.cache = {}; +toRegexRange.clearCache = () => (toRegexRange.cache = {}); + +/** + * Expose `toRegexRange` + */ + +module.exports = toRegexRange; + + +/***/ }), + +/***/ 1552: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +const punycode = __nccwpck_require__(8328); +const regexes = __nccwpck_require__(7023); +const mappingTable = __nccwpck_require__(2472); +const { STATUS_MAPPING } = __nccwpck_require__(9156); + +function containsNonASCII(str) { + return /[^\x00-\x7F]/u.test(str); +} + +function findStatus(val) { + let start = 0; + let end = mappingTable.length - 1; + + while (start <= end) { + const mid = Math.floor((start + end) / 2); + + const target = mappingTable[mid]; + const min = Array.isArray(target[0]) ? target[0][0] : target[0]; + const max = Array.isArray(target[0]) ? target[0][1] : target[0]; + + if (min <= val && max >= val) { + return target.slice(1); + } else if (min > val) { + end = mid - 1; + } else { + start = mid + 1; + } + } + + return null; +} + +function mapChars(domainName, { transitionalProcessing }) { + let processed = ""; + + for (const ch of domainName) { + const [status, mapping] = findStatus(ch.codePointAt(0)); + + switch (status) { + case STATUS_MAPPING.disallowed: + processed += ch; + break; + case STATUS_MAPPING.ignored: + break; + case STATUS_MAPPING.mapped: + if (transitionalProcessing && ch === "ẞ") { + processed += "ss"; + } else { + processed += mapping; + } + break; + case STATUS_MAPPING.deviation: + if (transitionalProcessing) { + processed += mapping; + } else { + processed += ch; + } + break; + case STATUS_MAPPING.valid: + processed += ch; + break; + } + } + + return processed; +} + +function validateLabel(label, { + checkHyphens, + checkBidi, + checkJoiners, + transitionalProcessing, + useSTD3ASCIIRules, + isBidi +}) { + // "must be satisfied for a non-empty label" + if (label.length === 0) { + return true; + } + + // "1. The label must be in Unicode Normalization Form NFC." + if (label.normalize("NFC") !== label) { + return false; + } + + const codePoints = Array.from(label); + + // "2. If CheckHyphens, the label must not contain a U+002D HYPHEN-MINUS character in both the + // third and fourth positions." + // + // "3. If CheckHyphens, the label must neither begin nor end with a U+002D HYPHEN-MINUS character." + if (checkHyphens) { + if ((codePoints[2] === "-" && codePoints[3] === "-") || + (label.startsWith("-") || label.endsWith("-"))) { + return false; + } + } + + // "4. If not CheckHyphens, the label must not begin with “xn--”." + if (!checkHyphens) { + if (label.startsWith("xn--")) { + return false; + } + } + + // "5. The label must not contain a U+002E ( . ) FULL STOP." + if (label.includes(".")) { + return false; + } + + // "6. The label must not begin with a combining mark, that is: General_Category=Mark." + if (regexes.combiningMarks.test(codePoints[0])) { + return false; + } + + // "7. Each code point in the label must only have certain Status values according to Section 5" + for (const ch of codePoints) { + const codePoint = ch.codePointAt(0); + const [status] = findStatus(codePoint); + if (transitionalProcessing) { + // "For Transitional Processing (deprecated), each value must be valid." + if (status !== STATUS_MAPPING.valid) { + return false; + } + } else if (status !== STATUS_MAPPING.valid && status !== STATUS_MAPPING.deviation) { + // "For Nontransitional Processing, each value must be either valid or deviation." + return false; + } + // "In addition, if UseSTD3ASCIIRules=true and the code point is an ASCII code point (U+0000..U+007F), then it must + // be a lowercase letter (a-z), a digit (0-9), or a hyphen-minus (U+002D). (Note: This excludes uppercase ASCII + // A-Z which are mapped in UTS #46 and disallowed in IDNA2008.)" + if (useSTD3ASCIIRules && codePoint <= 0x7F) { + if (!/^(?:[a-z]|[0-9]|-)$/u.test(ch)) { + return false; + } + } + } + + // "8. If CheckJoiners, the label must satisify the ContextJ rules" + // https://tools.ietf.org/html/rfc5892#appendix-A + if (checkJoiners) { + let last = 0; + for (const [i, ch] of codePoints.entries()) { + if (ch === "\u200C" || ch === "\u200D") { + if (i > 0) { + if (regexes.combiningClassVirama.test(codePoints[i - 1])) { + continue; + } + if (ch === "\u200C") { + // TODO: make this more efficient + const next = codePoints.indexOf("\u200C", i + 1); + const test = next < 0 ? codePoints.slice(last) : codePoints.slice(last, next); + if (regexes.validZWNJ.test(test.join(""))) { + last = i + 1; + continue; + } + } + } + return false; + } + } + } + + // "9. If CheckBidi, and if the domain name is a Bidi domain name, then the label must satisfy..." + // https://tools.ietf.org/html/rfc5893#section-2 + if (checkBidi && isBidi) { + let rtl; + + // 1 + if (regexes.bidiS1LTR.test(codePoints[0])) { + rtl = false; + } else if (regexes.bidiS1RTL.test(codePoints[0])) { + rtl = true; + } else { + return false; + } + + if (rtl) { + // 2-4 + if (!regexes.bidiS2.test(label) || + !regexes.bidiS3.test(label) || + (regexes.bidiS4EN.test(label) && regexes.bidiS4AN.test(label))) { + return false; + } + } else if (!regexes.bidiS5.test(label) || + !regexes.bidiS6.test(label)) { // 5-6 + return false; + } + } + + return true; +} + +function isBidiDomain(labels) { + const domain = labels.map(label => { + if (label.startsWith("xn--")) { + try { + return punycode.decode(label.substring(4)); + } catch { + return ""; + } + } + return label; + }).join("."); + return regexes.bidiDomain.test(domain); +} + +function processing(domainName, options) { + // 1. Map. + let string = mapChars(domainName, options); + + // 2. Normalize. + string = string.normalize("NFC"); + + // 3. Break. + const labels = string.split("."); + const isBidi = isBidiDomain(labels); + + // 4. Convert/Validate. + let error = false; + for (const [i, origLabel] of labels.entries()) { + let label = origLabel; + let transitionalProcessingForThisLabel = options.transitionalProcessing; + if (label.startsWith("xn--")) { + if (containsNonASCII(label)) { + error = true; + continue; + } + + try { + label = punycode.decode(label.substring(4)); + } catch { + if (!options.ignoreInvalidPunycode) { + error = true; + continue; + } + } + labels[i] = label; + + if (label === "" || !containsNonASCII(label)) { + error = true; + } + + transitionalProcessingForThisLabel = false; + } + + // No need to validate if we already know there is an error. + if (error) { + continue; + } + const validation = validateLabel(label, { + ...options, + transitionalProcessing: transitionalProcessingForThisLabel, + isBidi + }); + if (!validation) { + error = true; + } + } + + return { + string: labels.join("."), + error + }; +} + +function toASCII(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + verifyDNSLength = false, + transitionalProcessing = false, + ignoreInvalidPunycode = false +} = {}) { + const result = processing(domainName, { + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules, + transitionalProcessing, + ignoreInvalidPunycode + }); + let labels = result.string.split("."); + labels = labels.map(l => { + if (containsNonASCII(l)) { + try { + return `xn--${punycode.encode(l)}`; + } catch { + result.error = true; + } + } + return l; + }); + + if (verifyDNSLength) { + const total = labels.join(".").length; + if (total > 253 || total === 0) { + result.error = true; + } + + for (let i = 0; i < labels.length; ++i) { + if (labels[i].length > 63 || labels[i].length === 0) { + result.error = true; + break; + } + } + } + + if (result.error) { + return null; + } + return labels.join("."); +} + +function toUnicode(domainName, { + checkHyphens = false, + checkBidi = false, + checkJoiners = false, + useSTD3ASCIIRules = false, + transitionalProcessing = false, + ignoreInvalidPunycode = false +} = {}) { + const result = processing(domainName, { + checkHyphens, + checkBidi, + checkJoiners, + useSTD3ASCIIRules, + transitionalProcessing, + ignoreInvalidPunycode + }); + + return { + domain: result.string, + error: result.error + }; +} + +module.exports = { + toASCII, + toUnicode +}; + + +/***/ }), + +/***/ 7023: +/***/ ((module) => { + + + +const combiningMarks = /[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{11002}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11082}\u{110B0}-\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{11134}\u{11145}\u{11146}\u{11173}\u{11180}-\u{11182}\u{111B3}-\u{111C0}\u{111C9}-\u{111CC}\u{111CE}\u{111CF}\u{1122C}-\u{11237}\u{1123E}\u{11241}\u{112DF}-\u{112EA}\u{11300}-\u{11303}\u{1133B}\u{1133C}\u{1133E}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11357}\u{11362}\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113B8}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11435}-\u{11446}\u{1145E}\u{114B0}-\u{114C3}\u{115AF}-\u{115B5}\u{115B8}-\u{115C0}\u{115DC}\u{115DD}\u{11630}-\u{11640}\u{116AB}-\u{116B7}\u{1171D}-\u{1172B}\u{1182C}-\u{1183A}\u{11930}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{1193E}\u{11940}\u{11942}\u{11943}\u{119D1}-\u{119D7}\u{119DA}-\u{119E0}\u{119E4}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A39}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A5B}\u{11A8A}-\u{11A99}\u{11C2F}-\u{11C36}\u{11C38}-\u{11C3F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D8A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D97}\u{11EF3}-\u{11EF6}\u{11F00}\u{11F01}\u{11F03}\u{11F34}-\u{11F3A}\u{11F3E}-\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F51}-\u{16F87}\u{16F8F}-\u{16F92}\u{16FE4}\u{16FF0}\u{16FF1}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D165}-\u{1D169}\u{1D16D}-\u{1D172}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]/u; +const combiningClassVirama = /[\u094D\u09CD\u0A4D\u0ACD\u0B4D\u0BCD\u0C4D\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E3A\u0EBA\u0F84\u1039\u103A\u1714\u1715\u1734\u17D2\u1A60\u1B44\u1BAA\u1BAB\u1BF2\u1BF3\u2D7F\uA806\uA82C\uA8C4\uA953\uA9C0\uAAF6\uABED\u{10A3F}\u{11046}\u{11070}\u{1107F}\u{110B9}\u{11133}\u{11134}\u{111C0}\u{11235}\u{112EA}\u{1134D}\u{113CE}-\u{113D0}\u{11442}\u{114C2}\u{115BF}\u{1163F}\u{116B6}\u{1172B}\u{11839}\u{1193D}\u{1193E}\u{119E0}\u{11A34}\u{11A47}\u{11A99}\u{11C3F}\u{11D44}\u{11D45}\u{11D97}\u{11F41}\u{11F42}\u{1612F}]/u; +const validZWNJ = /[\u0620\u0626\u0628\u062A-\u062E\u0633-\u063F\u0641-\u0647\u0649\u064A\u066E\u066F\u0678-\u0687\u069A-\u06BF\u06C1\u06C2\u06CC\u06CE\u06D0\u06D1\u06FA-\u06FC\u06FF\u0712-\u0714\u071A-\u071D\u071F-\u0727\u0729\u072B\u072D\u072E\u074E-\u0758\u075C-\u076A\u076D-\u0770\u0772\u0775-\u0777\u077A-\u077F\u07CA-\u07EA\u0841-\u0845\u0848\u084A-\u0853\u0855\u0860\u0862-\u0865\u0868\u0886\u0889-\u088D\u08A0-\u08A9\u08AF\u08B0\u08B3-\u08B8\u08BA-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA872\u{10AC0}-\u{10AC4}\u{10ACD}\u{10AD3}-\u{10ADC}\u{10ADE}-\u{10AE0}\u{10AEB}-\u{10AEE}\u{10B80}\u{10B82}\u{10B86}-\u{10B88}\u{10B8A}\u{10B8B}\u{10B8D}\u{10B90}\u{10BAD}\u{10BAE}\u{10D00}-\u{10D21}\u{10D23}\u{10EC3}\u{10EC4}\u{10F30}-\u{10F32}\u{10F34}-\u{10F44}\u{10F51}-\u{10F53}\u{10F70}-\u{10F73}\u{10F76}-\u{10F81}\u{10FB0}\u{10FB2}\u{10FB3}\u{10FB8}\u{10FBB}\u{10FBC}\u{10FBE}\u{10FBF}\u{10FC1}\u{10FC4}\u{10FCA}\u{10FCB}\u{1E900}-\u{1E943}][\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*\u200C[\xAD\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u061C\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u070F\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u200B\u200E\u200F\u202A-\u202E\u2060-\u2064\u206A-\u206F\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFEFF\uFFF9-\uFFFB\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C3F}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13430}-\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94B}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*[\u0620\u0622-\u063F\u0641-\u064A\u066E\u066F\u0671-\u0673\u0675-\u06D3\u06D5\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u077F\u07CA-\u07EA\u0840-\u0858\u0860\u0862-\u0865\u0867-\u086A\u0870-\u0882\u0886\u0889-\u088E\u08A0-\u08AC\u08AE-\u08C8\u1807\u1820-\u1878\u1887-\u18A8\u18AA\uA840-\uA871\u{10AC0}-\u{10AC5}\u{10AC7}\u{10AC9}\u{10ACA}\u{10ACE}-\u{10AD6}\u{10AD8}-\u{10AE1}\u{10AE4}\u{10AEB}-\u{10AEF}\u{10B80}-\u{10B91}\u{10BA9}-\u{10BAE}\u{10D01}-\u{10D23}\u{10EC2}-\u{10EC4}\u{10F30}-\u{10F44}\u{10F51}-\u{10F54}\u{10F70}-\u{10F81}\u{10FB0}\u{10FB2}-\u{10FB6}\u{10FB8}-\u{10FBF}\u{10FC1}-\u{10FC4}\u{10FC9}\u{10FCA}\u{1E900}-\u{1E943}]/u; +const bidiDomain = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; +const bidiS1LTR = /[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u249C-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCEF}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D800}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]/u; +const bidiS1RTL = /[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}]/u; +const bidiS2 = /^[\0-\x08\x0E-\x1B!-@\[-`\{-\x84\x86-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02B9\u02BA\u02C2-\u02CF\u02D2-\u02DF\u02E5-\u02ED\u02EF-\u036F\u0374\u0375\u037E\u0384\u0385\u0387\u03F6\u0483-\u0489\u058A\u058D-\u058F\u0591-\u05C7\u05D0-\u05EA\u05EF-\u05F4\u0600-\u070D\u070F-\u074A\u074D-\u07B1\u07C0-\u07FA\u07FD-\u082D\u0830-\u083E\u0840-\u085B\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u0897-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09F2\u09F3\u09FB\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AF1\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0BF3-\u0BFA\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C78-\u0C7E\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E3F\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39-\u0F3D\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1390-\u1399\u1400\u169B\u169C\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DB\u17DD\u17F0-\u17F9\u1800-\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1940\u1944\u1945\u19DE-\u19FF\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u200B-\u200D\u200F-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2070\u2074-\u207E\u2080-\u208E\u20A0-\u20C0\u20D0-\u20F0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u2150-\u215F\u2189-\u218B\u2190-\u2335\u237B-\u2394\u2396-\u2429\u2440-\u244A\u2460-\u249B\u24EA-\u26AB\u26AD-\u27FF\u2900-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2CEF-\u2CF1\u2CF9-\u2CFF\u2D7F\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u3004\u3008-\u3020\u302A-\u302D\u3030\u3036\u3037\u303D-\u303F\u3099-\u309C\u30A0\u30FB\u31C0-\u31E5\u31EF\u321D\u321E\u3250-\u325F\u327C-\u327E\u32B1-\u32BF\u32CC-\u32CF\u3377-\u337A\u33DE\u33DF\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA60D-\uA60F\uA66F-\uA67F\uA69E\uA69F\uA6F0\uA6F1\uA700-\uA721\uA788\uA802\uA806\uA80B\uA825\uA826\uA828-\uA82C\uA838\uA839\uA874-\uA877\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uAB6A\uAB6B\uABE5\uABE8\uABED\uFB1D-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD8F\uFD92-\uFDC7\uFDCF\uFDF0-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF01-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10101}\u{10140}-\u{1018C}\u{10190}-\u{1019C}\u{101A0}\u{101FD}\u{102E0}-\u{102FB}\u{10376}-\u{1037A}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{1091F}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A38}-\u{10A3A}\u{10A3F}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE6}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B39}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D27}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D69}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAB}-\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10EFC}-\u{10F27}\u{10F30}-\u{10F59}\u{10F70}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{11001}\u{11038}-\u{11046}\u{11052}-\u{11065}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{11660}-\u{1166C}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{11FD5}-\u{11FF1}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE2}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1BCA0}-\u{1BCA3}\u{1CC00}-\u{1CCD5}\u{1CCF0}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D173}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D1E9}\u{1D1EA}\u{1D200}-\u{1D245}\u{1D300}-\u{1D356}\u{1D6C1}\u{1D6DB}\u{1D6FB}\u{1D715}\u{1D735}\u{1D74F}\u{1D76F}\u{1D789}\u{1D7A9}\u{1D7C3}\u{1D7CE}-\u{1D7FF}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E2FF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8D6}\u{1E900}-\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F10F}\u{1F12F}\u{1F16A}-\u{1F16F}\u{1F1AD}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}]*$/u; +const bidiS3 = /[0-9\xB2\xB3\xB9\u05BE\u05C0\u05C3\u05C6\u05D0-\u05EA\u05EF-\u05F4\u0600-\u0605\u0608\u060B\u060D\u061B-\u064A\u0660-\u0669\u066B-\u066F\u0671-\u06D5\u06DD\u06E5\u06E6\u06EE-\u070D\u070F\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u083E\u0840-\u0858\u085E\u0860-\u086A\u0870-\u088E\u0890\u0891\u08A0-\u08C9\u08E2\u200F\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBC2\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\u{102E1}-\u{102FB}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10857}-\u{1089E}\u{108A7}-\u{108AF}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{108FB}-\u{1091B}\u{10920}-\u{10939}\u{1093F}\u{10980}-\u{109B7}\u{109BC}-\u{109CF}\u{109D2}-\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A40}-\u{10A48}\u{10A50}-\u{10A58}\u{10A60}-\u{10A9F}\u{10AC0}-\u{10AE4}\u{10AEB}-\u{10AF6}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B58}-\u{10B72}\u{10B78}-\u{10B91}\u{10B99}-\u{10B9C}\u{10BA9}-\u{10BAF}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10CFA}-\u{10D23}\u{10D30}-\u{10D39}\u{10D40}-\u{10D65}\u{10D6F}-\u{10D85}\u{10D8E}\u{10D8F}\u{10E60}-\u{10E7E}\u{10E80}-\u{10EA9}\u{10EAD}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F27}\u{10F30}-\u{10F45}\u{10F51}-\u{10F59}\u{10F70}-\u{10F81}\u{10F86}-\u{10F89}\u{10FB0}-\u{10FCB}\u{10FE0}-\u{10FF6}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1E800}-\u{1E8C4}\u{1E8C7}-\u{1E8CF}\u{1E900}-\u{1E943}\u{1E94B}\u{1E950}-\u{1E959}\u{1E95E}\u{1E95F}\u{1EC71}-\u{1ECB4}\u{1ED01}-\u{1ED3D}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; +const bidiS4EN = /[0-9\xB2\xB3\xB9\u06F0-\u06F9\u2070\u2074-\u2079\u2080-\u2089\u2488-\u249B\uFF10-\uFF19\u{102E1}-\u{102FB}\u{1CCF0}-\u{1CCF9}\u{1D7CE}-\u{1D7FF}\u{1F100}-\u{1F10A}\u{1FBF0}-\u{1FBF9}]/u; +const bidiS4AN = /[\u0600-\u0605\u0660-\u0669\u066B\u066C\u06DD\u0890\u0891\u08E2\u{10D30}-\u{10D39}\u{10D40}-\u{10D49}\u{10E60}-\u{10E7E}]/u; +const bidiS5 = /^[\0-\x08\x0E-\x1B!-\x84\x86-\u0377\u037A-\u037F\u0384-\u038A\u038C\u038E-\u03A1\u03A3-\u052F\u0531-\u0556\u0559-\u058A\u058D-\u058F\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0606\u0607\u0609\u060A\u060C\u060E-\u061A\u064B-\u065F\u066A\u0670\u06D6-\u06DC\u06DE-\u06E4\u06E7-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07F6-\u07F9\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A76\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AF1\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BFA\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3C-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C5D\u0C60-\u0C63\u0C66-\u0C6F\u0C77-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4F\u0D54-\u0D63\u0D66-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E3A\u0E3F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECE\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F47\u0F49-\u0F6C\u0F71-\u0F97\u0F99-\u0FBC\u0FBE-\u0FCC\u0FCE-\u0FDA\u1000-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u137C\u1380-\u1399\u13A0-\u13F5\u13F8-\u13FD\u1400-\u167F\u1681-\u169C\u16A0-\u16F8\u1700-\u1715\u171F-\u1736\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17DD\u17E0-\u17E9\u17F0-\u17F9\u1800-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1940\u1944-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u19DE-\u1A1B\u1A1E-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1AB0-\u1ACE\u1B00-\u1B4C\u1B4E-\u1BF3\u1BFC-\u1C37\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD0-\u1CFA\u1D00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FC4\u1FC6-\u1FD3\u1FD6-\u1FDB\u1FDD-\u1FEF\u1FF2-\u1FF4\u1FF6-\u1FFE\u200B-\u200E\u2010-\u2027\u202F-\u205E\u2060-\u2064\u206A-\u2071\u2074-\u208E\u2090-\u209C\u20A0-\u20C0\u20D0-\u20F0\u2100-\u218B\u2190-\u2429\u2440-\u244A\u2460-\u2B73\u2B76-\u2B95\u2B97-\u2CF3\u2CF9-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2E5D\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3001-\u303F\u3041-\u3096\u3099-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31E5\u31EF-\u321E\u3220-\uA48C\uA490-\uA4C6\uA4D0-\uA62B\uA640-\uA6F7\uA700-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA82C\uA830-\uA839\uA840-\uA877\uA880-\uA8C5\uA8CE-\uA8D9\uA8E0-\uA953\uA95F-\uA97C\uA980-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA5C-\uAAC2\uAADB-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB6B\uAB70-\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1E\uFB29\uFD3E-\uFD4F\uFDCF\uFDFD-\uFE19\uFE20-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFEFF\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFF9-\uFFFD\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}-\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1018E}\u{10190}-\u{1019C}\u{101A0}\u{101D0}-\u{101FD}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E0}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{1037A}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{1091F}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10B39}-\u{10B3F}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6E}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11000}-\u{1104D}\u{11052}-\u{11075}\u{1107F}-\u{110C2}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11100}-\u{11134}\u{11136}-\u{11147}\u{11150}-\u{11176}\u{11180}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{11241}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112EA}\u{112F0}-\u{112F9}\u{11300}-\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133B}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113C0}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}-\u{113D5}\u{113D7}\u{113D8}\u{113E1}\u{113E2}\u{11400}-\u{1145B}\u{1145D}-\u{11461}\u{11480}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B5}\u{115B8}-\u{115DD}\u{11600}-\u{11644}\u{11650}-\u{11659}\u{11660}-\u{1166C}\u{11680}-\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171D}-\u{1172B}\u{11730}-\u{11746}\u{11800}-\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193B}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D7}\u{119DA}-\u{119E4}\u{11A00}-\u{11A47}\u{11A50}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C36}\u{11C38}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11C92}-\u{11CA7}\u{11CA9}-\u{11CB6}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D47}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D90}\u{11D91}\u{11D93}-\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF8}\u{11F00}-\u{11F10}\u{11F12}-\u{11F3A}\u{11F3E}-\u{11F5A}\u{11FB0}\u{11FC0}-\u{11FF1}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{13455}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF0}-\u{16AF5}\u{16B00}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F4F}-\u{16F87}\u{16F8F}-\u{16F9F}\u{16FE0}-\u{16FE4}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}-\u{1BCA3}\u{1CC00}-\u{1CCF9}\u{1CD00}-\u{1CEB3}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D1EA}\u{1D200}-\u{1D245}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D300}-\u{1D356}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D7CB}\u{1D7CE}-\u{1DA8B}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E030}-\u{1E06D}\u{1E08F}\u{1E100}-\u{1E12C}\u{1E130}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AE}\u{1E2C0}-\u{1E2F9}\u{1E2FF}\u{1E4D0}-\u{1E4F9}\u{1E5D0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{1EEF0}\u{1EEF1}\u{1F000}-\u{1F02B}\u{1F030}-\u{1F093}\u{1F0A0}-\u{1F0AE}\u{1F0B1}-\u{1F0BF}\u{1F0C1}-\u{1F0CF}\u{1F0D1}-\u{1F0F5}\u{1F100}-\u{1F1AD}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1F260}-\u{1F265}\u{1F300}-\u{1F6D7}\u{1F6DC}-\u{1F6EC}\u{1F6F0}-\u{1F6FC}\u{1F700}-\u{1F776}\u{1F77B}-\u{1F7D9}\u{1F7E0}-\u{1F7EB}\u{1F7F0}\u{1F800}-\u{1F80B}\u{1F810}-\u{1F847}\u{1F850}-\u{1F859}\u{1F860}-\u{1F887}\u{1F890}-\u{1F8AD}\u{1F8B0}-\u{1F8BB}\u{1F8C0}\u{1F8C1}\u{1F900}-\u{1FA53}\u{1FA60}-\u{1FA6D}\u{1FA70}-\u{1FA7C}\u{1FA80}-\u{1FA89}\u{1FA8F}-\u{1FAC6}\u{1FACE}-\u{1FADC}\u{1FADF}-\u{1FAE9}\u{1FAF0}-\u{1FAF8}\u{1FB00}-\u{1FB92}\u{1FB94}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{E0001}\u{E0020}-\u{E007F}\u{E0100}-\u{E01EF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}]*$/u; +const bidiS6 = /[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u02BB-\u02C1\u02D0\u02D1\u02E0-\u02E4\u02EE\u0370-\u0373\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0482\u048A-\u052F\u0531-\u0556\u0559-\u0589\u06F0-\u06F9\u0903-\u0939\u093B\u093D-\u0940\u0949-\u094C\u094E-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD-\u09C0\u09C7\u09C8\u09CB\u09CC\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09FA\u09FC\u09FD\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3E-\u0A40\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A76\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD-\u0AC0\u0AC9\u0ACB\u0ACC\u0AD0\u0AE0\u0AE1\u0AE6-\u0AF0\u0AF9\u0B02\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B3E\u0B40\u0B47\u0B48\u0B4B\u0B4C\u0B57\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE\u0BBF\u0BC1\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCC\u0BD0\u0BD7\u0BE6-\u0BF2\u0C01-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C41-\u0C44\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C77\u0C7F\u0C80\u0C82-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD-\u0CC4\u0CC6-\u0CC8\u0CCA\u0CCB\u0CD5\u0CD6\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1-\u0CF3\u0D02-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D40\u0D46-\u0D48\u0D4A-\u0D4C\u0D4E\u0D4F\u0D54-\u0D61\u0D66-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCF-\u0DD1\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2-\u0DF4\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E4F-\u0E5B\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00-\u0F17\u0F1A-\u0F34\u0F36\u0F38\u0F3E-\u0F47\u0F49-\u0F6C\u0F7F\u0F85\u0F88-\u0F8C\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE-\u0FDA\u1000-\u102C\u1031\u1038\u103B\u103C\u103F-\u1057\u105A-\u105D\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108C\u108E-\u109C\u109E-\u10C5\u10C7\u10CD\u10D0-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1360-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u167F\u1681-\u169A\u16A0-\u16F8\u1700-\u1711\u1715\u171F-\u1731\u1734-\u1736\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17B6\u17BE-\u17C5\u17C7\u17C8\u17D4-\u17DA\u17DC\u17E0-\u17E9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1923-\u1926\u1929-\u192B\u1930\u1931\u1933-\u1938\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A19\u1A1A\u1A1E-\u1A55\u1A57\u1A61\u1A63\u1A64\u1A6D-\u1A72\u1A80-\u1A89\u1A90-\u1A99\u1AA0-\u1AAD\u1B04-\u1B33\u1B35\u1B3B\u1B3D-\u1B41\u1B43-\u1B4C\u1B4E-\u1B6A\u1B74-\u1B7F\u1B82-\u1BA1\u1BA6\u1BA7\u1BAA\u1BAE-\u1BE5\u1BE7\u1BEA-\u1BEC\u1BEE\u1BF2\u1BF3\u1BFC-\u1C2B\u1C34\u1C35\u1C3B-\u1C49\u1C4D-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CC7\u1CD3\u1CE1\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5-\u1CF7\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200E\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u214F\u2160-\u2188\u2336-\u237A\u2395\u2488-\u24E9\u26AC\u2800-\u28FF\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D70\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u302E\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3190-\u31BF\u31F0-\u321C\u3220-\u324F\u3260-\u327B\u327F-\u32B0\u32C0-\u32CB\u32D0-\u3376\u337B-\u33DD\u33E0-\u33FE\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA60C\uA610-\uA62B\uA640-\uA66E\uA680-\uA69D\uA6A0-\uA6EF\uA6F2-\uA6F7\uA722-\uA787\uA789-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA824\uA827\uA830-\uA837\uA840-\uA873\uA880-\uA8C3\uA8CE-\uA8D9\uA8F2-\uA8FE\uA900-\uA925\uA92E-\uA946\uA952\uA953\uA95F-\uA97C\uA983-\uA9B2\uA9B4\uA9B5\uA9BA\uA9BB\uA9BE-\uA9CD\uA9CF-\uA9D9\uA9DE-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA2F\uAA30\uAA33\uAA34\uAA40-\uAA42\uAA44-\uAA4B\uAA4D\uAA50-\uAA59\uAA5C-\uAA7B\uAA7D-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAAEB\uAAEE-\uAAF5\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB69\uAB70-\uABE4\uABE6\uABE7\uABE9-\uABEC\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uD800-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10100}\u{10102}\u{10107}-\u{10133}\u{10137}-\u{1013F}\u{1018D}\u{1018E}\u{101D0}-\u{101FC}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{102E1}-\u{102FB}\u{10300}-\u{10323}\u{1032D}-\u{1034A}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{1039F}-\u{103C3}\u{103C8}-\u{103D5}\u{10400}-\u{1049D}\u{104A0}-\u{104A9}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{1056F}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{11000}\u{11002}-\u{11037}\u{11047}-\u{1104D}\u{11066}-\u{1106F}\u{11071}\u{11072}\u{11075}\u{11082}-\u{110B2}\u{110B7}\u{110B8}\u{110BB}-\u{110C1}\u{110CD}\u{110D0}-\u{110E8}\u{110F0}-\u{110F9}\u{11103}-\u{11126}\u{1112C}\u{11136}-\u{11147}\u{11150}-\u{11172}\u{11174}-\u{11176}\u{11182}-\u{111B5}\u{111BF}-\u{111C8}\u{111CD}\u{111CE}\u{111D0}-\u{111DF}\u{111E1}-\u{111F4}\u{11200}-\u{11211}\u{11213}-\u{1122E}\u{11232}\u{11233}\u{11235}\u{11238}-\u{1123D}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A9}\u{112B0}-\u{112DE}\u{112E0}-\u{112E2}\u{112F0}-\u{112F9}\u{11302}\u{11303}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}-\u{1133F}\u{11341}-\u{11344}\u{11347}\u{11348}\u{1134B}-\u{1134D}\u{11350}\u{11357}\u{1135D}-\u{11363}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}-\u{113BA}\u{113C2}\u{113C5}\u{113C7}-\u{113CA}\u{113CC}\u{113CD}\u{113CF}\u{113D1}\u{113D3}-\u{113D5}\u{113D7}\u{113D8}\u{11400}-\u{11437}\u{11440}\u{11441}\u{11445}\u{11447}-\u{1145B}\u{1145D}\u{1145F}-\u{11461}\u{11480}-\u{114B2}\u{114B9}\u{114BB}-\u{114BE}\u{114C1}\u{114C4}-\u{114C7}\u{114D0}-\u{114D9}\u{11580}-\u{115B1}\u{115B8}-\u{115BB}\u{115BE}\u{115C1}-\u{115DB}\u{11600}-\u{11632}\u{1163B}\u{1163C}\u{1163E}\u{11641}-\u{11644}\u{11650}-\u{11659}\u{11680}-\u{116AA}\u{116AC}\u{116AE}\u{116AF}\u{116B6}\u{116B8}\u{116B9}\u{116C0}-\u{116C9}\u{116D0}-\u{116E3}\u{11700}-\u{1171A}\u{1171E}\u{11720}\u{11721}\u{11726}\u{11730}-\u{11746}\u{11800}-\u{1182E}\u{11838}\u{1183B}\u{118A0}-\u{118F2}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{11935}\u{11937}\u{11938}\u{1193D}\u{1193F}-\u{11942}\u{11944}-\u{11946}\u{11950}-\u{11959}\u{119A0}-\u{119A7}\u{119AA}-\u{119D3}\u{119DC}-\u{119DF}\u{119E1}-\u{119E4}\u{11A00}\u{11A07}\u{11A08}\u{11A0B}-\u{11A32}\u{11A39}\u{11A3A}\u{11A3F}-\u{11A46}\u{11A50}\u{11A57}\u{11A58}\u{11A5C}-\u{11A89}\u{11A97}\u{11A9A}-\u{11AA2}\u{11AB0}-\u{11AF8}\u{11B00}-\u{11B09}\u{11BC0}-\u{11BE1}\u{11BF0}-\u{11BF9}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2F}\u{11C3E}-\u{11C45}\u{11C50}-\u{11C6C}\u{11C70}-\u{11C8F}\u{11CA9}\u{11CB1}\u{11CB4}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D50}-\u{11D59}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D8E}\u{11D93}\u{11D94}\u{11D96}\u{11D98}\u{11DA0}-\u{11DA9}\u{11EE0}-\u{11EF2}\u{11EF5}-\u{11EF8}\u{11F02}-\u{11F10}\u{11F12}-\u{11F35}\u{11F3E}\u{11F3F}\u{11F41}\u{11F43}-\u{11F59}\u{11FB0}\u{11FC0}-\u{11FD4}\u{11FFF}-\u{12399}\u{12400}-\u{1246E}\u{12470}-\u{12474}\u{12480}-\u{12543}\u{12F90}-\u{12FF2}\u{13000}-\u{1343F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{1612A}-\u{1612C}\u{16130}-\u{16139}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A60}-\u{16A69}\u{16A6E}-\u{16ABE}\u{16AC0}-\u{16AC9}\u{16AD0}-\u{16AED}\u{16AF5}\u{16B00}-\u{16B2F}\u{16B37}-\u{16B45}\u{16B50}-\u{16B59}\u{16B5B}-\u{16B61}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D79}\u{16E40}-\u{16E9A}\u{16F00}-\u{16F4A}\u{16F50}-\u{16F87}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{16FF0}\u{16FF1}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1BC9C}\u{1BC9F}\u{1CCD6}-\u{1CCF9}\u{1CF50}-\u{1CFC3}\u{1D000}-\u{1D0F5}\u{1D100}-\u{1D126}\u{1D129}-\u{1D166}\u{1D16A}-\u{1D172}\u{1D183}\u{1D184}\u{1D18C}-\u{1D1A9}\u{1D1AE}-\u{1D1E8}\u{1D2C0}-\u{1D2D3}\u{1D2E0}-\u{1D2F3}\u{1D360}-\u{1D378}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1D7CE}-\u{1D9FF}\u{1DA37}-\u{1DA3A}\u{1DA6D}-\u{1DA74}\u{1DA76}-\u{1DA83}\u{1DA85}-\u{1DA8B}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E140}-\u{1E149}\u{1E14E}\u{1E14F}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E2F0}-\u{1E2F9}\u{1E4D0}-\u{1E4EB}\u{1E4F0}-\u{1E4F9}\u{1E5D0}-\u{1E5ED}\u{1E5F0}-\u{1E5FA}\u{1E5FF}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1F100}-\u{1F10A}\u{1F110}-\u{1F12E}\u{1F130}-\u{1F169}\u{1F170}-\u{1F1AC}\u{1F1E6}-\u{1F202}\u{1F210}-\u{1F23B}\u{1F240}-\u{1F248}\u{1F250}\u{1F251}\u{1FBF0}-\u{1FBF9}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}\u{F0000}-\u{FFFFD}\u{100000}-\u{10FFFD}][\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u09FE\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B55\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C00\u0C04\u0C3C\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81\u0CBC\u0CCC\u0CCD\u0CE2\u0CE3\u0D00\u0D01\u0D3B\u0D3C\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0D81\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732\u1733\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u180F\u1885\u1886\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A1B\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1AB0-\u1ACE\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB-\u1BAD\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1CF8\u1CF9\u1DC0-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA82C\uA8C4\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uA9BD\uA9E5\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAA7C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\u{101FD}\u{102E0}\u{10376}-\u{1037A}\u{10A01}-\u{10A03}\u{10A05}\u{10A06}\u{10A0C}-\u{10A0F}\u{10A38}-\u{10A3A}\u{10A3F}\u{10AE5}\u{10AE6}\u{10D24}-\u{10D27}\u{10D69}-\u{10D6D}\u{10EAB}\u{10EAC}\u{10EFC}-\u{10EFF}\u{10F46}-\u{10F50}\u{10F82}-\u{10F85}\u{11001}\u{11038}-\u{11046}\u{11070}\u{11073}\u{11074}\u{1107F}-\u{11081}\u{110B3}-\u{110B6}\u{110B9}\u{110BA}\u{110C2}\u{11100}-\u{11102}\u{11127}-\u{1112B}\u{1112D}-\u{11134}\u{11173}\u{11180}\u{11181}\u{111B6}-\u{111BE}\u{111C9}-\u{111CC}\u{111CF}\u{1122F}-\u{11231}\u{11234}\u{11236}\u{11237}\u{1123E}\u{11241}\u{112DF}\u{112E3}-\u{112EA}\u{11300}\u{11301}\u{1133B}\u{1133C}\u{11340}\u{11366}-\u{1136C}\u{11370}-\u{11374}\u{113BB}-\u{113C0}\u{113CE}\u{113D0}\u{113D2}\u{113E1}\u{113E2}\u{11438}-\u{1143F}\u{11442}-\u{11444}\u{11446}\u{1145E}\u{114B3}-\u{114B8}\u{114BA}\u{114BF}\u{114C0}\u{114C2}\u{114C3}\u{115B2}-\u{115B5}\u{115BC}\u{115BD}\u{115BF}\u{115C0}\u{115DC}\u{115DD}\u{11633}-\u{1163A}\u{1163D}\u{1163F}\u{11640}\u{116AB}\u{116AD}\u{116B0}-\u{116B5}\u{116B7}\u{1171D}\u{1171F}\u{11722}-\u{11725}\u{11727}-\u{1172B}\u{1182F}-\u{11837}\u{11839}\u{1183A}\u{1193B}\u{1193C}\u{1193E}\u{11943}\u{119D4}-\u{119D7}\u{119DA}\u{119DB}\u{119E0}\u{11A01}-\u{11A06}\u{11A09}\u{11A0A}\u{11A33}-\u{11A38}\u{11A3B}-\u{11A3E}\u{11A47}\u{11A51}-\u{11A56}\u{11A59}-\u{11A5B}\u{11A8A}-\u{11A96}\u{11A98}\u{11A99}\u{11C30}-\u{11C36}\u{11C38}-\u{11C3D}\u{11C92}-\u{11CA7}\u{11CAA}-\u{11CB0}\u{11CB2}\u{11CB3}\u{11CB5}\u{11CB6}\u{11D31}-\u{11D36}\u{11D3A}\u{11D3C}\u{11D3D}\u{11D3F}-\u{11D45}\u{11D47}\u{11D90}\u{11D91}\u{11D95}\u{11D97}\u{11EF3}\u{11EF4}\u{11F00}\u{11F01}\u{11F36}-\u{11F3A}\u{11F40}\u{11F42}\u{11F5A}\u{13440}\u{13447}-\u{13455}\u{1611E}-\u{16129}\u{1612D}-\u{1612F}\u{16AF0}-\u{16AF4}\u{16B30}-\u{16B36}\u{16F4F}\u{16F8F}-\u{16F92}\u{16FE4}\u{1BC9D}\u{1BC9E}\u{1CF00}-\u{1CF2D}\u{1CF30}-\u{1CF46}\u{1D167}-\u{1D169}\u{1D17B}-\u{1D182}\u{1D185}-\u{1D18B}\u{1D1AA}-\u{1D1AD}\u{1D242}-\u{1D244}\u{1DA00}-\u{1DA36}\u{1DA3B}-\u{1DA6C}\u{1DA75}\u{1DA84}\u{1DA9B}-\u{1DA9F}\u{1DAA1}-\u{1DAAF}\u{1E000}-\u{1E006}\u{1E008}-\u{1E018}\u{1E01B}-\u{1E021}\u{1E023}\u{1E024}\u{1E026}-\u{1E02A}\u{1E08F}\u{1E130}-\u{1E136}\u{1E2AE}\u{1E2EC}-\u{1E2EF}\u{1E4EC}-\u{1E4EF}\u{1E5EE}\u{1E5EF}\u{1E8D0}-\u{1E8D6}\u{1E944}-\u{1E94A}\u{E0100}-\u{E01EF}]*$/u; + +module.exports = { + combiningMarks, + combiningClassVirama, + validZWNJ, + bidiDomain, + bidiS1LTR, + bidiS1RTL, + bidiS2, + bidiS3, + bidiS4EN, + bidiS4AN, + bidiS5, + bidiS6 + }; + + +/***/ }), + +/***/ 9156: +/***/ ((module) => { + + + +module.exports.STATUS_MAPPING = { + mapped: 1, + valid: 2, + disallowed: 3, + deviation: 6, + ignored: 7 +}; + + /***/ }), /***/ 770: @@ -3457,6 +27652,550 @@ if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) { exports.debug = debug; // for test +/***/ }), + +/***/ 8489: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var $TypeError = __nccwpck_require__(3314); + +var callBound = __nccwpck_require__(3105); + +/** @type {undefined | ((thisArg: import('.').TypedArray) => Buffer)} */ +var $typedArrayBuffer = callBound('TypedArray.prototype.buffer', true); + +var isTypedArray = __nccwpck_require__(6405); + +/** @type {import('.')} */ +// node <= 0.10, < 0.11.4 has a nonconfigurable own property instead of a prototype getter +module.exports = $typedArrayBuffer || function typedArrayBuffer(x) { + if (!isTypedArray(x)) { + throw new $TypeError('Not a Typed Array'); + } + return x.buffer; +}; + + +/***/ }), + +/***/ 8183: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +var through = __nccwpck_require__(461); +var bz2 = __nccwpck_require__(9226); +var bitIterator = __nccwpck_require__(7685); + +module.exports = unbzip2Stream; + +function unbzip2Stream() { + var bufferQueue = []; + var hasBytes = 0; + var blockSize = 0; + var broken = false; + var done = false; + var bitReader = null; + var streamCRC = null; + + function decompressBlock(push){ + if(!blockSize){ + blockSize = bz2.header(bitReader); + //console.error("got header of", blockSize); + streamCRC = 0; + return true; + }else{ + var bufsize = 100000 * blockSize; + var buf = new Int32Array(bufsize); + + var chunk = []; + var f = function(b) { + chunk.push(b); + }; + + streamCRC = bz2.decompress(bitReader, f, buf, bufsize, streamCRC); + if (streamCRC === null) { + // reset for next bzip2 header + blockSize = 0; + return false; + }else{ + //console.error('decompressed', chunk.length,'bytes'); + push(Buffer.from(chunk)); + return true; + } + } + } + + var outlength = 0; + function decompressAndQueue(stream) { + if (broken) return; + try { + return decompressBlock(function(d) { + stream.queue(d); + if (d !== null) { + //console.error('write at', outlength.toString(16)); + outlength += d.length; + } else { + //console.error('written EOS'); + } + }); + } catch(e) { + //console.error(e); + stream.emit('error', e); + broken = true; + return false; + } + } + + return through( + function write(data) { + //console.error('received', data.length,'bytes in', typeof data); + bufferQueue.push(data); + hasBytes += data.length; + if (bitReader === null) { + bitReader = bitIterator(function() { + return bufferQueue.shift(); + }); + } + while (!broken && hasBytes - bitReader.bytesRead + 1 >= ((25000 + 100000 * blockSize) || 4)){ + //console.error('decompressing with', hasBytes - bitReader.bytesRead + 1, 'bytes in buffer'); + decompressAndQueue(this); + } + }, + function end(x) { + //console.error(x,'last compressing with', hasBytes, 'bytes in buffer'); + while (!broken && bitReader && hasBytes > bitReader.bytesRead){ + decompressAndQueue(this); + } + if (!broken) { + if (streamCRC !== null) + this.emit('error', new Error("input stream ended prematurely")); + this.queue(null); + } + } + ); +} + + + +/***/ }), + +/***/ 7685: +/***/ ((module) => { + +var BITMASK = [0, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF]; + +// returns a function that reads bits. +// takes a buffer iterator as input +module.exports = function bitIterator(nextBuffer) { + var bit = 0, byte = 0; + var bytes = nextBuffer(); + var f = function(n) { + if (n === null && bit != 0) { // align to byte boundary + bit = 0 + byte++; + return; + } + var result = 0; + while(n > 0) { + if (byte >= bytes.length) { + byte = 0; + bytes = nextBuffer(); + } + var left = 8 - bit; + if (bit === 0 && n > 0) + f.bytesRead++; + if (n >= left) { + result <<= left; + result |= (BITMASK[left] & bytes[byte++]); + bit = 0; + n -= left; + } else { + result <<= n; + result |= ((bytes[byte] & (BITMASK[n] << (8 - n - bit))) >> (8 - n - bit)); + bit += n; + n = 0; + } + } + return result; + }; + f.bytesRead = 0; + return f; +}; + + +/***/ }), + +/***/ 9226: +/***/ ((module) => { + +/* + bzip2.js - a small bzip2 decompression implementation + + Copyright 2011 by antimatter15 (antimatter15@gmail.com) + + Based on micro-bunzip by Rob Landley (rob@landley.net). + + Copyright (c) 2011 by antimatter15 (antimatter15@gmail.com). + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH + THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ +function Bzip2Error(message) { + this.name = 'Bzip2Error'; + this.message = message; + this.stack = (new Error()).stack; +} +Bzip2Error.prototype = new Error; + +var message = { + Error: function(message) {throw new Bzip2Error(message);} +}; + +var bzip2 = {}; +bzip2.Bzip2Error = Bzip2Error; + +bzip2.crcTable = +[ + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, + 0x130476dc, 0x17c56b6b, 0x1a864db2, 0x1e475005, + 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, + 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, + 0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, + 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, + 0x791d4014, 0x7ddc5da3, 0x709f7b7a, 0x745e66cd, + 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, + 0xbe2b5b58, 0xbaea46ef, 0xb7a96036, 0xb3687d81, + 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, + 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95, + 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, + 0x34867077, 0x30476dc0, 0x3d044b19, 0x39c556ae, + 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, + 0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, + 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, + 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, + 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1, 0x53dc6066, + 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, + 0xbfa1b04b, 0xbb60adfc, 0xb6238b25, 0xb2e29692, + 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, + 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, + 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e, + 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, + 0xd5b88683, 0xd1799b34, 0xdc3abded, 0xd8fba05a, + 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, + 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, + 0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, + 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, + 0x36194d42, 0x32d850f5, 0x3f9b762c, 0x3b5a6b9b, + 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, + 0xf12f560e, 0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, + 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, + 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3, + 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, + 0x9b3660c6, 0x9ff77d71, 0x92b45ba8, 0x9675461f, + 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, + 0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, + 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, + 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, + 0x119b4be9, 0x155a565e, 0x18197087, 0x1cd86d30, + 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, + 0x2497d08d, 0x2056cd3a, 0x2d15ebe3, 0x29d4f654, + 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, + 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, + 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18, + 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, + 0x9abc8bd5, 0x9e7d9662, 0x933eb0bb, 0x97ffad0c, + 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, + 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 +]; + +bzip2.array = function(bytes) { + var bit = 0, byte = 0; + var BITMASK = [0, 0x01, 0x03, 0x07, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF ]; + return function(n) { + var result = 0; + while(n > 0) { + var left = 8 - bit; + if (n >= left) { + result <<= left; + result |= (BITMASK[left] & bytes[byte++]); + bit = 0; + n -= left; + } else { + result <<= n; + result |= ((bytes[byte] & (BITMASK[n] << (8 - n - bit))) >> (8 - n - bit)); + bit += n; + n = 0; + } + } + return result; + } +} + + +bzip2.simple = function(srcbuffer, stream) { + var bits = bzip2.array(srcbuffer); + var size = bzip2.header(bits); + var ret = false; + var bufsize = 100000 * size; + var buf = new Int32Array(bufsize); + + do { + ret = bzip2.decompress(bits, stream, buf, bufsize); + } while(!ret); +} + +bzip2.header = function(bits) { + this.byteCount = new Int32Array(256); + this.symToByte = new Uint8Array(256); + this.mtfSymbol = new Int32Array(256); + this.selectors = new Uint8Array(0x8000); + + if (bits(8*3) != 4348520) message.Error("No magic number found"); + + var i = bits(8) - 48; + if (i < 1 || i > 9) message.Error("Not a BZIP archive"); + return i; +}; + + +//takes a function for reading the block data (starting with 0x314159265359) +//a block size (0-9) (optional, defaults to 9) +//a length at which to stop decompressing and return the output +bzip2.decompress = function(bits, stream, buf, bufsize, streamCRC) { + var MAX_HUFCODE_BITS = 20; + var MAX_SYMBOLS = 258; + var SYMBOL_RUNA = 0; + var SYMBOL_RUNB = 1; + var GROUP_SIZE = 50; + var crc = 0 ^ (-1); + + for(var h = '', i = 0; i < 6; i++) h += bits(8).toString(16); + if (h == "177245385090") { + var finalCRC = bits(32)|0; + if (finalCRC !== streamCRC) message.Error("Error in bzip2: crc32 do not match"); + // align stream to byte + bits(null); + return null; // reset streamCRC for next call + } + if (h != "314159265359") message.Error("eek not valid bzip data"); + var crcblock = bits(32)|0; // CRC code + if (bits(1)) message.Error("unsupported obsolete version"); + var origPtr = bits(24); + if (origPtr > bufsize) message.Error("Initial position larger than buffer size"); + var t = bits(16); + var symTotal = 0; + for (i = 0; i < 16; i++) { + if (t & (1 << (15 - i))) { + var k = bits(16); + for(j = 0; j < 16; j++) { + if (k & (1 << (15 - j))) { + this.symToByte[symTotal++] = (16 * i) + j; + } + } + } + } + + var groupCount = bits(3); + if (groupCount < 2 || groupCount > 6) message.Error("another error"); + var nSelectors = bits(15); + if (nSelectors == 0) message.Error("meh"); + for(var i = 0; i < groupCount; i++) this.mtfSymbol[i] = i; + + for(var i = 0; i < nSelectors; i++) { + for(var j = 0; bits(1); j++) if (j >= groupCount) message.Error("whoops another error"); + var uc = this.mtfSymbol[j]; + for(var k = j-1; k>=0; k--) { + this.mtfSymbol[k+1] = this.mtfSymbol[k]; + } + this.mtfSymbol[0] = uc; + this.selectors[i] = uc; + } + + var symCount = symTotal + 2; + var groups = []; + var length = new Uint8Array(MAX_SYMBOLS), + temp = new Uint16Array(MAX_HUFCODE_BITS+1); + + var hufGroup; + + for(var j = 0; j < groupCount; j++) { + t = bits(5); //lengths + for(var i = 0; i < symCount; i++) { + while(true){ + if (t < 1 || t > MAX_HUFCODE_BITS) message.Error("I gave up a while ago on writing error messages"); + if (!bits(1)) break; + if (!bits(1)) t++; + else t--; + } + length[i] = t; + } + var minLen, maxLen; + minLen = maxLen = length[0]; + for(var i = 1; i < symCount; i++) { + if (length[i] > maxLen) maxLen = length[i]; + else if (length[i] < minLen) minLen = length[i]; + } + hufGroup = groups[j] = {}; + hufGroup.permute = new Int32Array(MAX_SYMBOLS); + hufGroup.limit = new Int32Array(MAX_HUFCODE_BITS + 1); + hufGroup.base = new Int32Array(MAX_HUFCODE_BITS + 1); + + hufGroup.minLen = minLen; + hufGroup.maxLen = maxLen; + var base = hufGroup.base; + var limit = hufGroup.limit; + var pp = 0; + for(var i = minLen; i <= maxLen; i++) + for(var t = 0; t < symCount; t++) + if (length[t] == i) hufGroup.permute[pp++] = t; + for(i = minLen; i <= maxLen; i++) temp[i] = limit[i] = 0; + for(i = 0; i < symCount; i++) temp[length[i]]++; + pp = t = 0; + for(i = minLen; i < maxLen; i++) { + pp += temp[i]; + limit[i] = pp - 1; + pp <<= 1; + base[i+1] = pp - (t += temp[i]); + } + limit[maxLen] = pp + temp[maxLen] - 1; + base[minLen] = 0; + } + + for(var i = 0; i < 256; i++) { + this.mtfSymbol[i] = i; + this.byteCount[i] = 0; + } + var runPos, count, symCount, selector; + runPos = count = symCount = selector = 0; + while(true) { + if (!(symCount--)) { + symCount = GROUP_SIZE - 1; + if (selector >= nSelectors) message.Error("meow i'm a kitty, that's an error"); + hufGroup = groups[this.selectors[selector++]]; + base = hufGroup.base; + limit = hufGroup.limit; + } + i = hufGroup.minLen; + j = bits(i); + while(true) { + if (i > hufGroup.maxLen) message.Error("rawr i'm a dinosaur"); + if (j <= limit[i]) break; + i++; + j = (j << 1) | bits(1); + } + j -= base[i]; + if (j < 0 || j >= MAX_SYMBOLS) message.Error("moo i'm a cow"); + var nextSym = hufGroup.permute[j]; + if (nextSym == SYMBOL_RUNA || nextSym == SYMBOL_RUNB) { + if (!runPos){ + runPos = 1; + t = 0; + } + if (nextSym == SYMBOL_RUNA) t += runPos; + else t += 2 * runPos; + runPos <<= 1; + continue; + } + if (runPos) { + runPos = 0; + if (count + t > bufsize) message.Error("Boom."); + uc = this.symToByte[this.mtfSymbol[0]]; + this.byteCount[uc] += t; + while(t--) buf[count++] = uc; + } + if (nextSym > symTotal) break; + if (count >= bufsize) message.Error("I can't think of anything. Error"); + i = nextSym - 1; + uc = this.mtfSymbol[i]; + for(var k = i-1; k>=0; k--) { + this.mtfSymbol[k+1] = this.mtfSymbol[k]; + } + this.mtfSymbol[0] = uc + uc = this.symToByte[uc]; + this.byteCount[uc]++; + buf[count++] = uc; + } + if (origPtr < 0 || origPtr >= count) message.Error("I'm a monkey and I'm throwing something at someone, namely you"); + var j = 0; + for(var i = 0; i < 256; i++) { + k = j + this.byteCount[i]; + this.byteCount[i] = j; + j = k; + } + for(var i = 0; i < count; i++) { + uc = buf[i] & 0xff; + buf[this.byteCount[uc]] |= (i << 8); + this.byteCount[uc]++; + } + var pos = 0, current = 0, run = 0; + if (count) { + pos = buf[origPtr]; + current = (pos & 0xff); + pos >>= 8; + run = -1; + } + count = count; + var copies, previous, outbyte; + while(count) { + count--; + previous = current; + pos = buf[pos]; + current = pos & 0xff; + pos >>= 8; + if (run++ == 3) { + copies = current; + outbyte = previous; + current = -1; + } else { + copies = 1; + outbyte = current; + } + while(copies--) { + crc = ((crc << 8) ^ this.crcTable[((crc>>24) ^ outbyte) & 0xFF])&0xFFFFFFFF; // crc32 + stream(outbyte); + } + if (current != previous) run = 0; + } + + crc = (crc ^ (-1)) >>> 0; + if ((crc|0) != (crcblock|0)) message.Error("Error in bzip2: crc32 do not match"); + streamCRC = (crc ^ ((streamCRC << 1) | (streamCRC >>> 31))) & 0xFFFFFFFF; + return streamCRC; +} + +module.exports = bzip2; + + /***/ }), /***/ 6752: @@ -25553,6 +50292,5756 @@ module.exports = { } +/***/ }), + +/***/ 4488: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = __nccwpck_require__(9023).deprecate; + + +/***/ }), + +/***/ 7125: +/***/ ((__unused_webpack_module, exports) => { + + + +function makeException(ErrorType, message, options) { + if (options.globals) { + ErrorType = options.globals[ErrorType.name]; + } + return new ErrorType(`${options.context ? options.context : "Value"} ${message}.`); +} + +function toNumber(value, options) { + if (typeof value === "bigint") { + throw makeException(TypeError, "is a BigInt which cannot be converted to a number", options); + } + if (!options.globals) { + return Number(value); + } + return options.globals.Number(value); +} + +// Round x to the nearest integer, choosing the even integer if it lies halfway between two. +function evenRound(x) { + // There are four cases for numbers with fractional part being .5: + // + // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example + // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0 + // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2 + // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0 + // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2 + // (where n is a non-negative integer) + // + // Branch here for cases 1 and 4 + if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) || + (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) { + return censorNegativeZero(Math.floor(x)); + } + + return censorNegativeZero(Math.round(x)); +} + +function integerPart(n) { + return censorNegativeZero(Math.trunc(n)); +} + +function sign(x) { + return x < 0 ? -1 : 1; +} + +function modulo(x, y) { + // https://tc39.github.io/ecma262/#eqn-modulo + // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos + const signMightNotMatch = x % y; + if (sign(y) !== sign(signMightNotMatch)) { + return signMightNotMatch + y; + } + return signMightNotMatch; +} + +function censorNegativeZero(x) { + return x === 0 ? 0 : x; +} + +function createIntegerConversion(bitLength, { unsigned }) { + let lowerBound, upperBound; + if (unsigned) { + lowerBound = 0; + upperBound = 2 ** bitLength - 1; + } else { + lowerBound = -(2 ** (bitLength - 1)); + upperBound = 2 ** (bitLength - 1) - 1; + } + + const twoToTheBitLength = 2 ** bitLength; + const twoToOneLessThanTheBitLength = 2 ** (bitLength - 1); + + return (value, options = {}) => { + let x = toNumber(value, options); + x = censorNegativeZero(x); + + if (options.enforceRange) { + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite number", options); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + + return x; + } + + if (!Number.isNaN(x) && options.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + x = integerPart(x); + + // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if + // possible. Hopefully it's an optimization for the non-64-bitLength cases too. + if (x >= lowerBound && x <= upperBound) { + return x; + } + + // These will not work great for bitLength of 64, but oh well. See the README for more details. + x = modulo(x, twoToTheBitLength); + if (!unsigned && x >= twoToOneLessThanTheBitLength) { + return x - twoToTheBitLength; + } + return x; + }; +} + +function createLongLongConversion(bitLength, { unsigned }) { + const upperBound = Number.MAX_SAFE_INTEGER; + const lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; + const asBigIntN = unsigned ? BigInt.asUintN : BigInt.asIntN; + + return (value, options = {}) => { + let x = toNumber(value, options); + x = censorNegativeZero(x); + + if (options.enforceRange) { + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite number", options); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw makeException( + TypeError, + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, + options + ); + } + + return x; + } + + if (!Number.isNaN(x) && options.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + + let xBigInt = BigInt(integerPart(x)); + xBigInt = asBigIntN(bitLength, xBigInt); + return Number(xBigInt); + }; +} + +exports.any = value => { + return value; +}; + +exports.undefined = () => { + return undefined; +}; + +exports.boolean = value => { + return Boolean(value); +}; + +exports.byte = createIntegerConversion(8, { unsigned: false }); +exports.octet = createIntegerConversion(8, { unsigned: true }); + +exports.short = createIntegerConversion(16, { unsigned: false }); +exports["unsigned short"] = createIntegerConversion(16, { unsigned: true }); + +exports.long = createIntegerConversion(32, { unsigned: false }); +exports["unsigned long"] = createIntegerConversion(32, { unsigned: true }); + +exports["long long"] = createLongLongConversion(64, { unsigned: false }); +exports["unsigned long long"] = createLongLongConversion(64, { unsigned: true }); + +exports.double = (value, options = {}) => { + const x = toNumber(value, options); + + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + + return x; +}; + +exports["unrestricted double"] = (value, options = {}) => { + const x = toNumber(value, options); + + return x; +}; + +exports.float = (value, options = {}) => { + const x = toNumber(value, options); + + if (!Number.isFinite(x)) { + throw makeException(TypeError, "is not a finite floating-point value", options); + } + + if (Object.is(x, -0)) { + return x; + } + + const y = Math.fround(x); + + if (!Number.isFinite(y)) { + throw makeException(TypeError, "is outside the range of a single-precision floating-point value", options); + } + + return y; +}; + +exports["unrestricted float"] = (value, options = {}) => { + const x = toNumber(value, options); + + if (isNaN(x)) { + return x; + } + + if (Object.is(x, -0)) { + return x; + } + + return Math.fround(x); +}; + +exports.DOMString = (value, options = {}) => { + if (options.treatNullAsEmptyString && value === null) { + return ""; + } + + if (typeof value === "symbol") { + throw makeException(TypeError, "is a symbol, which cannot be converted to a string", options); + } + + const StringCtor = options.globals ? options.globals.String : String; + return StringCtor(value); +}; + +exports.ByteString = (value, options = {}) => { + const x = exports.DOMString(value, options); + let c; + for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw makeException(TypeError, "is not a valid ByteString", options); + } + } + + return x; +}; + +exports.USVString = (value, options = {}) => { + const S = exports.DOMString(value, options); + const n = S.length; + const U = []; + for (let i = 0; i < n; ++i) { + const c = S.charCodeAt(i); + if (c < 0xD800 || c > 0xDFFF) { + U.push(String.fromCodePoint(c)); + } else if (0xDC00 <= c && c <= 0xDFFF) { + U.push(String.fromCodePoint(0xFFFD)); + } else if (i === n - 1) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + const d = S.charCodeAt(i + 1); + if (0xDC00 <= d && d <= 0xDFFF) { + const a = c & 0x3FF; + const b = d & 0x3FF; + U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xFFFD)); + } + } + } + + return U.join(""); +}; + +exports.object = (value, options = {}) => { + if (value === null || (typeof value !== "object" && typeof value !== "function")) { + throw makeException(TypeError, "is not an object", options); + } + + return value; +}; + +const abByteLengthGetter = + Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; +const sabByteLengthGetter = + typeof SharedArrayBuffer === "function" ? + Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, "byteLength").get : + null; + +function isNonSharedArrayBuffer(value) { + try { + // This will throw on SharedArrayBuffers, but not detached ArrayBuffers. + // (The spec says it should throw, but the spec conflicts with implementations: https://github.com/tc39/ecma262/issues/678) + abByteLengthGetter.call(value); + + return true; + } catch { + return false; + } +} + +function isSharedArrayBuffer(value) { + try { + sabByteLengthGetter.call(value); + return true; + } catch { + return false; + } +} + +function isArrayBufferDetached(value) { + try { + // eslint-disable-next-line no-new + new Uint8Array(value); + return false; + } catch { + return true; + } +} + +exports.ArrayBuffer = (value, options = {}) => { + if (!isNonSharedArrayBuffer(value)) { + if (options.allowShared && !isSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or SharedArrayBuffer", options); + } + throw makeException(TypeError, "is not an ArrayBuffer", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + + return value; +}; + +const dvByteLengthGetter = + Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; +exports.DataView = (value, options = {}) => { + try { + dvByteLengthGetter.call(value); + } catch (e) { + throw makeException(TypeError, "is not a DataView", options); + } + + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is backed by a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is backed by a detached ArrayBuffer", options); + } + + return value; +}; + +// Returns the unforgeable `TypedArray` constructor name or `undefined`, +// if the `this` value isn't a valid `TypedArray` object. +// +// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag +const typedArrayNameGetter = Object.getOwnPropertyDescriptor( + Object.getPrototypeOf(Uint8Array).prototype, + Symbol.toStringTag +).get; +[ + Int8Array, + Int16Array, + Int32Array, + Uint8Array, + Uint16Array, + Uint32Array, + Uint8ClampedArray, + Float32Array, + Float64Array +].forEach(func => { + const { name } = func; + const article = /^[AEIOU]/u.test(name) ? "an" : "a"; + exports[name] = (value, options = {}) => { + if (!ArrayBuffer.isView(value) || typedArrayNameGetter.call(value) !== name) { + throw makeException(TypeError, `is not ${article} ${name} object`, options); + } + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + + return value; + }; +}); + +// Common definitions + +exports.ArrayBufferView = (value, options = {}) => { + if (!ArrayBuffer.isView(value)) { + throw makeException(TypeError, "is not a view on an ArrayBuffer or SharedArrayBuffer", options); + } + + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; +}; + +exports.BufferSource = (value, options = {}) => { + if (ArrayBuffer.isView(value)) { + if (!options.allowShared && isSharedArrayBuffer(value.buffer)) { + throw makeException(TypeError, "is a view on a SharedArrayBuffer, which is not allowed", options); + } + + if (isArrayBufferDetached(value.buffer)) { + throw makeException(TypeError, "is a view on a detached ArrayBuffer", options); + } + return value; + } + + if (!options.allowShared && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer or a view on one", options); + } + if (options.allowShared && !isSharedArrayBuffer(value) && !isNonSharedArrayBuffer(value)) { + throw makeException(TypeError, "is not an ArrayBuffer, SharedArrayBuffer, or a view on one", options); + } + if (isArrayBufferDetached(value)) { + throw makeException(TypeError, "is a detached ArrayBuffer", options); + } + + return value; +}; + +exports.DOMTimeStamp = exports["unsigned long long"]; + + +/***/ }), + +/***/ 8012: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var __webpack_unused_export__; + + +const { URL, URLSearchParams } = __nccwpck_require__(4108); +const urlStateMachine = __nccwpck_require__(905); +const percentEncoding = __nccwpck_require__(687); + +const sharedGlobalObject = { Array, Object, Promise, String, TypeError }; +URL.install(sharedGlobalObject, ["Window"]); +URLSearchParams.install(sharedGlobalObject, ["Window"]); + +exports.k = sharedGlobalObject.URL; +__webpack_unused_export__ = sharedGlobalObject.URLSearchParams; + +__webpack_unused_export__ = urlStateMachine.parseURL; +__webpack_unused_export__ = urlStateMachine.basicURLParse; +__webpack_unused_export__ = urlStateMachine.serializeURL; +__webpack_unused_export__ = urlStateMachine.serializePath; +__webpack_unused_export__ = urlStateMachine.serializeHost; +__webpack_unused_export__ = urlStateMachine.serializeInteger; +__webpack_unused_export__ = urlStateMachine.serializeURLOrigin; +__webpack_unused_export__ = urlStateMachine.setTheUsername; +__webpack_unused_export__ = urlStateMachine.setThePassword; +__webpack_unused_export__ = urlStateMachine.cannotHaveAUsernamePasswordPort; +__webpack_unused_export__ = urlStateMachine.hasAnOpaquePath; + +__webpack_unused_export__ = percentEncoding.percentDecodeString; +__webpack_unused_export__ = percentEncoding.percentDecodeBytes; + + +/***/ }), + +/***/ 6426: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const conversions = __nccwpck_require__(7125); +const utils = __nccwpck_require__(9857); + +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (typeof value !== "function") { + throw new globalObject.TypeError(context + " is not a function"); + } + + function invokeTheCallbackFunction(...args) { + const thisArg = utils.tryWrapperForImpl(this); + let callResult; + + for (let i = 0; i < args.length; i++) { + args[i] = utils.tryWrapperForImpl(args[i]); + } + + callResult = Reflect.apply(value, thisArg, args); + + callResult = conversions["any"](callResult, { context: context, globals: globalObject }); + + return callResult; + } + + invokeTheCallbackFunction.construct = (...args) => { + for (let i = 0; i < args.length; i++) { + args[i] = utils.tryWrapperForImpl(args[i]); + } + + let callResult = Reflect.construct(value, args); + + callResult = conversions["any"](callResult, { context: context, globals: globalObject }); + + return callResult; + }; + + invokeTheCallbackFunction[utils.wrapperSymbol] = value; + invokeTheCallbackFunction.objectReference = value; + + return invokeTheCallbackFunction; +}; + + +/***/ }), + +/***/ 3184: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +const usm = __nccwpck_require__(905); +const urlencoded = __nccwpck_require__(6367); +const URLSearchParams = __nccwpck_require__(3627); + +exports.implementation = class URLImpl { + // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error + // messages in the constructor that distinguish between the different causes of failure. + constructor(globalObject, [url, base]) { + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + throw new TypeError(`Invalid base URL: ${base}`); + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${url}`); + } + + const query = parsedURL.query !== null ? parsedURL.query : ""; + + this._url = parsedURL; + + // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips + // question mark by default. Therefore the doNotStripQMark hack is used. + this._query = URLSearchParams.createImpl(globalObject, [query], { doNotStripQMark: true }); + this._query._url = this; + } + + static parse(globalObject, input, base) { + try { + return new URLImpl(globalObject, [input, base]); + } catch { + return null; + } + } + + static canParse(url, base) { + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + return false; + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + return false; + } + + return true; + } + + get href() { + return usm.serializeURL(this._url); + } + + set href(v) { + const parsedURL = usm.basicURLParse(v); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${v}`); + } + + this._url = parsedURL; + + this._query._list.splice(0); + const { query } = parsedURL; + if (query !== null) { + this._query._list = urlencoded.parseUrlencodedString(query); + } + } + + get origin() { + return usm.serializeURLOrigin(this._url); + } + + get protocol() { + return `${this._url.scheme}:`; + } + + set protocol(v) { + usm.basicURLParse(`${v}:`, { url: this._url, stateOverride: "scheme start" }); + } + + get username() { + return this._url.username; + } + + set username(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setTheUsername(this._url, v); + } + + get password() { + return this._url.password; + } + + set password(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setThePassword(this._url, v); + } + + get host() { + const url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return usm.serializeHost(url.host); + } + + return `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`; + } + + set host(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); + } + + get hostname() { + if (this._url.host === null) { + return ""; + } + + return usm.serializeHost(this._url.host); + } + + set hostname(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); + } + + get port() { + if (this._url.port === null) { + return ""; + } + + return usm.serializeInteger(this._url.port); + } + + set port(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); + } + } + + get pathname() { + return usm.serializePath(this._url); + } + + set pathname(v) { + if (usm.hasAnOpaquePath(this._url)) { + return; + } + + this._url.path = []; + usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); + } + + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return `?${this._url.query}`; + } + + set search(v) { + const url = this._url; + + if (v === "") { + url.query = null; + this._query._list = []; + return; + } + + const input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + this._query._list = urlencoded.parseUrlencodedString(input); + } + + get searchParams() { + return this._query; + } + + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return `#${this._url.fragment}`; + } + + set hash(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + const input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + + toJSON() { + return this.href; + } +}; + + +/***/ }), + +/***/ 6633: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const conversions = __nccwpck_require__(7125); +const utils = __nccwpck_require__(9857); + +const implSymbol = utils.implSymbol; +const ctorRegistrySymbol = utils.ctorRegistrySymbol; + +const interfaceName = "URL"; + +exports.is = value => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; +}; +exports.isImpl = value => { + return utils.isObject(value) && value instanceof Impl.implementation; +}; +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URL'.`); +}; + +function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== undefined) { + proto = newTarget.prototype; + } + + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URL"].prototype; + } + + return Object.create(proto); +} + +exports.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports.setup(wrapper, globalObject, constructorArgs, privateData); +}; + +exports.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); +}; + +exports._internalSetup = (wrapper, globalObject) => {}; + +exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; +}; + +exports["new"] = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; +}; + +const exposed = new Set(["Window", "Worker"]); + +exports.install = (globalObject, globalNames) => { + if (!globalNames.some(globalName => exposed.has(globalName))) { + return; + } + + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URL { + constructor(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return exports.setup(Object.create(new.target.prototype), globalObject, args); + } + + toJSON() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'toJSON' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol].toJSON(); + } + + get href() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get href' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["href"]; + } + + set href(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set href' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'href' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["href"] = V; + } + + toString() { + const esValue = this; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'toString' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["href"]; + } + + get origin() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get origin' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["origin"]; + } + + get protocol() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get protocol' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["protocol"]; + } + + set protocol(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set protocol' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'protocol' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["protocol"] = V; + } + + get username() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get username' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["username"]; + } + + set username(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set username' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'username' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["username"] = V; + } + + get password() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get password' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["password"]; + } + + set password(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set password' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'password' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["password"] = V; + } + + get host() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get host' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["host"]; + } + + set host(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set host' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'host' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["host"] = V; + } + + get hostname() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get hostname' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["hostname"]; + } + + set hostname(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set hostname' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'hostname' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["hostname"] = V; + } + + get port() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get port' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["port"]; + } + + set port(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set port' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'port' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["port"] = V; + } + + get pathname() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get pathname' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["pathname"]; + } + + set pathname(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set pathname' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'pathname' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["pathname"] = V; + } + + get search() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get search' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["search"]; + } + + set search(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set search' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'search' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["search"] = V; + } + + get searchParams() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get searchParams' called on an object that is not a valid instance of URL."); + } + + return utils.getSameObject(this, "searchParams", () => { + return utils.tryWrapperForImpl(esValue[implSymbol]["searchParams"]); + }); + } + + get hash() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get hash' called on an object that is not a valid instance of URL."); + } + + return esValue[implSymbol]["hash"]; + } + + set hash(V) { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set hash' called on an object that is not a valid instance of URL."); + } + + V = conversions["USVString"](V, { + context: "Failed to set the 'hash' property on 'URL': The provided value", + globals: globalObject + }); + + esValue[implSymbol]["hash"] = V; + } + + static parse(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'parse' on 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'parse' on 'URL': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'parse' on 'URL': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return utils.tryWrapperForImpl(Impl.implementation.parse(globalObject, ...args)); + } + + static canParse(url) { + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'canParse' on 'URL': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'canParse' on 'URL': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return Impl.implementation.canParse(...args); + } + } + Object.defineProperties(URL.prototype, { + toJSON: { enumerable: true }, + href: { enumerable: true }, + toString: { enumerable: true }, + origin: { enumerable: true }, + protocol: { enumerable: true }, + username: { enumerable: true }, + password: { enumerable: true }, + host: { enumerable: true }, + hostname: { enumerable: true }, + port: { enumerable: true }, + pathname: { enumerable: true }, + search: { enumerable: true }, + searchParams: { enumerable: true }, + hash: { enumerable: true }, + [Symbol.toStringTag]: { value: "URL", configurable: true } + }); + Object.defineProperties(URL, { parse: { enumerable: true }, canParse: { enumerable: true } }); + ctorRegistry[interfaceName] = URL; + + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URL + }); + + if (globalNames.includes("Window")) { + Object.defineProperty(globalObject, "webkitURL", { + configurable: true, + writable: true, + value: URL + }); + } +}; + +const Impl = __nccwpck_require__(3184); + + +/***/ }), + +/***/ 2894: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + +const urlencoded = __nccwpck_require__(6367); + +exports.implementation = class URLSearchParamsImpl { + constructor(globalObject, constructorArgs, { doNotStripQMark = false }) { + let init = constructorArgs[0]; + this._list = []; + this._url = null; + + if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { + init = init.slice(1); + } + + if (Array.isArray(init)) { + for (const pair of init) { + if (pair.length !== 2) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " + + "contain exactly two elements."); + } + this._list.push([pair[0], pair[1]]); + } + } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { + for (const name of Object.keys(init)) { + const value = init[name]; + this._list.push([name, value]); + } + } else { + this._list = urlencoded.parseUrlencodedString(init); + } + } + + _updateSteps() { + if (this._url !== null) { + let serializedQuery = urlencoded.serializeUrlencoded(this._list); + if (serializedQuery === "") { + serializedQuery = null; + } + + this._url._url.query = serializedQuery; + } + } + + get size() { + return this._list.length; + } + + append(name, value) { + this._list.push([name, value]); + this._updateSteps(); + } + + delete(name, value) { + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name && (value === undefined || this._list[i][1] === value)) { + this._list.splice(i, 1); + } else { + i++; + } + } + this._updateSteps(); + } + + get(name) { + for (const tuple of this._list) { + if (tuple[0] === name) { + return tuple[1]; + } + } + return null; + } + + getAll(name) { + const output = []; + for (const tuple of this._list) { + if (tuple[0] === name) { + output.push(tuple[1]); + } + } + return output; + } + + has(name, value) { + for (const tuple of this._list) { + if (tuple[0] === name && (value === undefined || tuple[1] === value)) { + return true; + } + } + return false; + } + + set(name, value) { + let found = false; + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name) { + if (found) { + this._list.splice(i, 1); + } else { + found = true; + this._list[i][1] = value; + i++; + } + } else { + i++; + } + } + if (!found) { + this._list.push([name, value]); + } + this._updateSteps(); + } + + sort() { + this._list.sort((a, b) => { + if (a[0] < b[0]) { + return -1; + } + if (a[0] > b[0]) { + return 1; + } + return 0; + }); + + this._updateSteps(); + } + + [Symbol.iterator]() { + return this._list[Symbol.iterator](); + } + + toString() { + return urlencoded.serializeUrlencoded(this._list); + } +}; + + +/***/ }), + +/***/ 3627: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const conversions = __nccwpck_require__(7125); +const utils = __nccwpck_require__(9857); + +const Function = __nccwpck_require__(6426); +const newObjectInRealm = utils.newObjectInRealm; +const implSymbol = utils.implSymbol; +const ctorRegistrySymbol = utils.ctorRegistrySymbol; + +const interfaceName = "URLSearchParams"; + +exports.is = value => { + return utils.isObject(value) && utils.hasOwn(value, implSymbol) && value[implSymbol] instanceof Impl.implementation; +}; +exports.isImpl = value => { + return utils.isObject(value) && value instanceof Impl.implementation; +}; +exports.convert = (globalObject, value, { context = "The provided value" } = {}) => { + if (exports.is(value)) { + return utils.implForWrapper(value); + } + throw new globalObject.TypeError(`${context} is not of type 'URLSearchParams'.`); +}; + +exports.createDefaultIterator = (globalObject, target, kind) => { + const ctorRegistry = globalObject[ctorRegistrySymbol]; + const iteratorPrototype = ctorRegistry["URLSearchParams Iterator"]; + const iterator = Object.create(iteratorPrototype); + Object.defineProperty(iterator, utils.iterInternalSymbol, { + value: { target, kind, index: 0 }, + configurable: true + }); + return iterator; +}; + +function makeWrapper(globalObject, newTarget) { + let proto; + if (newTarget !== undefined) { + proto = newTarget.prototype; + } + + if (!utils.isObject(proto)) { + proto = globalObject[ctorRegistrySymbol]["URLSearchParams"].prototype; + } + + return Object.create(proto); +} + +exports.create = (globalObject, constructorArgs, privateData) => { + const wrapper = makeWrapper(globalObject); + return exports.setup(wrapper, globalObject, constructorArgs, privateData); +}; + +exports.createImpl = (globalObject, constructorArgs, privateData) => { + const wrapper = exports.create(globalObject, constructorArgs, privateData); + return utils.implForWrapper(wrapper); +}; + +exports._internalSetup = (wrapper, globalObject) => {}; + +exports.setup = (wrapper, globalObject, constructorArgs = [], privateData = {}) => { + privateData.wrapper = wrapper; + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: new Impl.implementation(globalObject, constructorArgs, privateData), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper; +}; + +exports["new"] = (globalObject, newTarget) => { + const wrapper = makeWrapper(globalObject, newTarget); + + exports._internalSetup(wrapper, globalObject); + Object.defineProperty(wrapper, implSymbol, { + value: Object.create(Impl.implementation.prototype), + configurable: true + }); + + wrapper[implSymbol][utils.wrapperSymbol] = wrapper; + if (Impl.init) { + Impl.init(wrapper[implSymbol]); + } + return wrapper[implSymbol]; +}; + +const exposed = new Set(["Window", "Worker"]); + +exports.install = (globalObject, globalNames) => { + if (!globalNames.some(globalName => exposed.has(globalName))) { + return; + } + + const ctorRegistry = utils.initCtorRegistry(globalObject); + class URLSearchParams { + constructor() { + const args = []; + { + let curArg = arguments[0]; + if (curArg !== undefined) { + if (utils.isObject(curArg)) { + if (curArg[Symbol.iterator] !== undefined) { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object." + ); + } else { + const V = []; + const tmp = curArg; + for (let nextItem of tmp) { + if (!utils.isObject(nextItem)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + + " sequence" + + "'s element" + + " is not an iterable object." + ); + } else { + const V = []; + const tmp = nextItem; + for (let nextItem of tmp) { + nextItem = conversions["USVString"](nextItem, { + context: + "Failed to construct 'URLSearchParams': parameter 1" + + " sequence" + + "'s element" + + "'s element", + globals: globalObject + }); + + V.push(nextItem); + } + nextItem = V; + } + + V.push(nextItem); + } + curArg = V; + } + } else { + if (!utils.isObject(curArg)) { + throw new globalObject.TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object." + ); + } else { + const result = Object.create(null); + for (const key of Reflect.ownKeys(curArg)) { + const desc = Object.getOwnPropertyDescriptor(curArg, key); + if (desc && desc.enumerable) { + let typedKey = key; + + typedKey = conversions["USVString"](typedKey, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key", + globals: globalObject + }); + + let typedValue = curArg[key]; + + typedValue = conversions["USVString"](typedValue, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value", + globals: globalObject + }); + + result[typedKey] = typedValue; + } + } + curArg = result; + } + } + } else { + curArg = conversions["USVString"](curArg, { + context: "Failed to construct 'URLSearchParams': parameter 1", + globals: globalObject + }); + } + } else { + curArg = ""; + } + args.push(curArg); + } + return exports.setup(Object.create(new.target.prototype), globalObject, args); + } + + append(name, value) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'append' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].append(...args)); + } + + delete(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'delete' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].delete(...args)); + } + + get(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'get' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'get' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return esValue[implSymbol].get(...args); + } + + getAll(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'getAll' called on an object that is not a valid instance of URLSearchParams." + ); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].getAll(...args)); + } + + has(name) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'has' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 1) { + throw new globalObject.TypeError( + `Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + } + args.push(curArg); + } + return esValue[implSymbol].has(...args); + } + + set(name, value) { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'set' called on an object that is not a valid instance of URLSearchParams."); + } + + if (arguments.length < 2) { + throw new globalObject.TypeError( + `Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only ${arguments.length} present.` + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 1", + globals: globalObject + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 2", + globals: globalObject + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(esValue[implSymbol].set(...args)); + } + + sort() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError("'sort' called on an object that is not a valid instance of URLSearchParams."); + } + + return utils.tryWrapperForImpl(esValue[implSymbol].sort()); + } + + toString() { + const esValue = this !== null && this !== undefined ? this : globalObject; + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'toString' called on an object that is not a valid instance of URLSearchParams." + ); + } + + return esValue[implSymbol].toString(); + } + + keys() { + if (!exports.is(this)) { + throw new globalObject.TypeError("'keys' called on an object that is not a valid instance of URLSearchParams."); + } + return exports.createDefaultIterator(globalObject, this, "key"); + } + + values() { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'values' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports.createDefaultIterator(globalObject, this, "value"); + } + + entries() { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'entries' called on an object that is not a valid instance of URLSearchParams." + ); + } + return exports.createDefaultIterator(globalObject, this, "key+value"); + } + + forEach(callback) { + if (!exports.is(this)) { + throw new globalObject.TypeError( + "'forEach' called on an object that is not a valid instance of URLSearchParams." + ); + } + if (arguments.length < 1) { + throw new globalObject.TypeError( + "Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present." + ); + } + callback = Function.convert(globalObject, callback, { + context: "Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1" + }); + const thisArg = arguments[1]; + let pairs = Array.from(this[implSymbol]); + let i = 0; + while (i < pairs.length) { + const [key, value] = pairs[i].map(utils.tryWrapperForImpl); + callback.call(thisArg, value, key, this); + pairs = Array.from(this[implSymbol]); + i++; + } + } + + get size() { + const esValue = this !== null && this !== undefined ? this : globalObject; + + if (!exports.is(esValue)) { + throw new globalObject.TypeError( + "'get size' called on an object that is not a valid instance of URLSearchParams." + ); + } + + return esValue[implSymbol]["size"]; + } + } + Object.defineProperties(URLSearchParams.prototype, { + append: { enumerable: true }, + delete: { enumerable: true }, + get: { enumerable: true }, + getAll: { enumerable: true }, + has: { enumerable: true }, + set: { enumerable: true }, + sort: { enumerable: true }, + toString: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true }, + forEach: { enumerable: true }, + size: { enumerable: true }, + [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, + [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } + }); + ctorRegistry[interfaceName] = URLSearchParams; + + ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], { + [Symbol.toStringTag]: { + configurable: true, + value: "URLSearchParams Iterator" + } + }); + utils.define(ctorRegistry["URLSearchParams Iterator"], { + next() { + const internal = this && this[utils.iterInternalSymbol]; + if (!internal) { + throw new globalObject.TypeError("next() called on a value that is not a URLSearchParams iterator object"); + } + + const { target, kind, index } = internal; + const values = Array.from(target[implSymbol]); + const len = values.length; + if (index >= len) { + return newObjectInRealm(globalObject, { value: undefined, done: true }); + } + + const pair = values[index]; + internal.index = index + 1; + return newObjectInRealm(globalObject, utils.iteratorResult(pair.map(utils.tryWrapperForImpl), kind)); + } + }); + + Object.defineProperty(globalObject, interfaceName, { + configurable: true, + writable: true, + value: URLSearchParams + }); +}; + +const Impl = __nccwpck_require__(2894); + + +/***/ }), + +/***/ 4887: +/***/ ((module) => { + + +const utf8Encoder = new TextEncoder(); +const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }); + +function utf8Encode(string) { + return utf8Encoder.encode(string); +} + +function utf8DecodeWithoutBOM(bytes) { + return utf8Decoder.decode(bytes); +} + +module.exports = { + utf8Encode, + utf8DecodeWithoutBOM +}; + + +/***/ }), + +/***/ 3102: +/***/ ((module) => { + + + +// Note that we take code points as JS numbers, not JS strings. + +function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; +} + +function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); +} + +function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); +} + +function isASCIIHex(c) { + return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); +} + +module.exports = { + isASCIIDigit, + isASCIIAlpha, + isASCIIAlphanumeric, + isASCIIHex +}; + + +/***/ }), + +/***/ 687: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const { isASCIIHex } = __nccwpck_require__(3102); +const { utf8Encode } = __nccwpck_require__(4887); + +function p(char) { + return char.codePointAt(0); +} + +// https://url.spec.whatwg.org/#percent-encode +function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = `0${hex}`; + } + + return `%${hex}`; +} + +// https://url.spec.whatwg.org/#percent-decode +function percentDecodeBytes(input) { + const output = new Uint8Array(input.byteLength); + let outputIndex = 0; + for (let i = 0; i < input.byteLength; ++i) { + const byte = input[i]; + if (byte !== 0x25) { + output[outputIndex++] = byte; + } else if (byte === 0x25 && (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) { + output[outputIndex++] = byte; + } else { + const bytePoint = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16); + output[outputIndex++] = bytePoint; + i += 2; + } + } + + return output.slice(0, outputIndex); +} + +// https://url.spec.whatwg.org/#string-percent-decode +function percentDecodeString(input) { + const bytes = utf8Encode(input); + return percentDecodeBytes(bytes); +} + +// https://url.spec.whatwg.org/#c0-control-percent-encode-set +function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; +} + +// https://url.spec.whatwg.org/#fragment-percent-encode-set +const extraFragmentPercentEncodeSet = new Set([p(" "), p("\""), p("<"), p(">"), p("`")]); +function isFragmentPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#query-percent-encode-set +const extraQueryPercentEncodeSet = new Set([p(" "), p("\""), p("#"), p("<"), p(">")]); +function isQueryPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraQueryPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#special-query-percent-encode-set +function isSpecialQueryPercentEncode(c) { + return isQueryPercentEncode(c) || c === p("'"); +} + +// https://url.spec.whatwg.org/#path-percent-encode-set +const extraPathPercentEncodeSet = new Set([p("?"), p("`"), p("{"), p("}"), p("^")]); +function isPathPercentEncode(c) { + return isQueryPercentEncode(c) || extraPathPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#userinfo-percent-encode-set +const extraUserinfoPercentEncodeSet = + new Set([p("/"), p(":"), p(";"), p("="), p("@"), p("["), p("\\"), p("]"), p("|")]); +function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#component-percent-encode-set +const extraComponentPercentEncodeSet = new Set([p("$"), p("%"), p("&"), p("+"), p(",")]); +function isComponentPercentEncode(c) { + return isUserinfoPercentEncode(c) || extraComponentPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#application-x-www-form-urlencoded-percent-encode-set +const extraURLEncodedPercentEncodeSet = new Set([p("!"), p("'"), p("("), p(")"), p("~")]); +function isURLEncodedPercentEncode(c) { + return isComponentPercentEncode(c) || extraURLEncodedPercentEncodeSet.has(c); +} + +// https://url.spec.whatwg.org/#code-point-percent-encode-after-encoding +// https://url.spec.whatwg.org/#utf-8-percent-encode +// Assuming encoding is always utf-8 allows us to trim one of the logic branches. TODO: support encoding. +// The "-Internal" variant here has code points as JS strings. The external version used by other files has code points +// as JS numbers, like the rest of the codebase. +function utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate) { + const bytes = utf8Encode(codePoint); + let output = ""; + for (const byte of bytes) { + // Our percentEncodePredicate operates on bytes, not code points, so this is slightly different from the spec. + if (!percentEncodePredicate(byte)) { + output += String.fromCharCode(byte); + } else { + output += percentEncode(byte); + } + } + + return output; +} + +function utf8PercentEncodeCodePoint(codePoint, percentEncodePredicate) { + return utf8PercentEncodeCodePointInternal(String.fromCodePoint(codePoint), percentEncodePredicate); +} + +// https://url.spec.whatwg.org/#string-percent-encode-after-encoding +// https://url.spec.whatwg.org/#string-utf-8-percent-encode +function utf8PercentEncodeString(input, percentEncodePredicate, spaceAsPlus = false) { + let output = ""; + for (const codePoint of input) { + if (spaceAsPlus && codePoint === " ") { + output += "+"; + } else { + output += utf8PercentEncodeCodePointInternal(codePoint, percentEncodePredicate); + } + } + return output; +} + +module.exports = { + isC0ControlPercentEncode, + isFragmentPercentEncode, + isQueryPercentEncode, + isSpecialQueryPercentEncode, + isPathPercentEncode, + isUserinfoPercentEncode, + isURLEncodedPercentEncode, + percentDecodeString, + percentDecodeBytes, + utf8PercentEncodeString, + utf8PercentEncodeCodePoint +}; + + +/***/ }), + +/***/ 905: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const tr46 = __nccwpck_require__(1552); + +const infra = __nccwpck_require__(3102); +const { utf8DecodeWithoutBOM } = __nccwpck_require__(4887); +const { percentDecodeString, utf8PercentEncodeCodePoint, utf8PercentEncodeString, isC0ControlPercentEncode, + isFragmentPercentEncode, isQueryPercentEncode, isSpecialQueryPercentEncode, isPathPercentEncode, + isUserinfoPercentEncode } = __nccwpck_require__(687); + +function p(char) { + return char.codePointAt(0); +} + +const specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +const failure = Symbol("failure"); + +function countSymbols(str) { + return [...str].length; +} + +function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); +} + +function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; +} + +function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; +} + +function isWindowsDriveLetterCodePoints(cp1, cp2) { + return infra.isASCIIAlpha(cp1) && (cp2 === p(":") || cp2 === p("|")); +} + +function isWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); +} + +function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; +} + +function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|<|>|\?|@|\[|\\|\]|\^|\|/u) !== -1; +} + +function containsForbiddenDomainCodePoint(string) { + return containsForbiddenHostCodePoint(string) || string.search(/[\u0000-\u001F]|%|\u007F/u) !== -1; +} + +function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; +} + +function isSpecial(url) { + return isSpecialScheme(url.scheme); +} + +function isNotSpecial(url) { + return !isSpecialScheme(url.scheme); +} + +function defaultPort(scheme) { + return specialSchemes[scheme]; +} + +function parseIPv4Number(input) { + if (input === "") { + return failure; + } + + let R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + let regex = /[^0-7]/u; + if (R === 10) { + regex = /[^0-9]/u; + } + if (R === 16) { + regex = /[^0-9A-Fa-f]/u; + } + + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); +} + +function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return failure; + } + + const numbers = []; + for (const part of parts) { + const n = parseIPv4Number(part); + if (n === failure) { + return failure; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= 256 ** (5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * 256 ** (3 - counter); + ++counter; + } + + return ipv4; +} + +function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = `.${output}`; + } + n = Math.floor(n / 256); + } + + return output; +} + +function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = Array.from(input, c => c.codePointAt(0)); + + if (input[pointer] === p(":")) { + if (input[pointer + 1] !== p(":")) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === p(":")) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && infra.isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === p(".")) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === p(".") && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!infra.isASCIIDigit(input[pointer])) { + return failure; + } + + while (infra.isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === p(":")) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; +} + +function serializeIPv6(address) { + let output = ""; + const compress = findTheIPv6AddressCompressedPieceIndex(address); + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; +} + +function parseHost(input, isOpaque = false) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (isOpaque) { + return parseOpaqueHost(input); + } + + const domain = utf8DecodeWithoutBOM(percentDecodeString(input)); + const asciiDomain = domainToASCII(domain); + if (asciiDomain === failure) { + return failure; + } + + if (endsInANumber(asciiDomain)) { + return parseIPv4(asciiDomain); + } + + return asciiDomain; +} + +function endsInANumber(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length === 1) { + return false; + } + parts.pop(); + } + + const last = parts[parts.length - 1]; + if (parseIPv4Number(last) !== failure) { + return true; + } + + if (/^[0-9]+$/u.test(last)) { + return true; + } + + return false; +} + +function parseOpaqueHost(input) { + if (containsForbiddenHostCodePoint(input)) { + return failure; + } + + return utf8PercentEncodeString(input, isC0ControlPercentEncode); +} + +function findTheIPv6AddressCompressedPieceIndex(address) { + let longestIndex = null; + let longestSize = 1; // only find elements > 1 + let foundIndex = null; + let foundSize = 0; + + for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) { + if (address[pieceIndex] !== 0) { + if (foundSize > longestSize) { + longestIndex = foundIndex; + longestSize = foundSize; + } + + foundIndex = null; + foundSize = 0; + } else { + if (foundIndex === null) { + foundIndex = pieceIndex; + } + ++foundSize; + } + } + + if (foundSize > longestSize) { + return foundIndex; + } + + return longestIndex; +} + +function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return `[${serializeIPv6(host)}]`; + } + + return host; +} + +function domainToASCII(domain, beStrict = false) { + const result = tr46.toASCII(domain, { + checkHyphens: beStrict, + checkBidi: true, + checkJoiners: true, + useSTD3ASCIIRules: beStrict, + transitionalProcessing: false, + verifyDNSLength: beStrict, + ignoreInvalidPunycode: false + }); + if (result === null) { + return failure; + } + + if (!beStrict) { + if (result === "") { + return failure; + } + if (containsForbiddenDomainCodePoint(result)) { + return failure; + } + } + return result; +} + +function trimControlChars(string) { + // Avoid using regexp because of this V8 bug: https://issues.chromium.org/issues/42204424 + + let start = 0; + let end = string.length; + for (; start < end; ++start) { + if (string.charCodeAt(start) > 0x20) { + break; + } + } + for (; end > start; --end) { + if (string.charCodeAt(end - 1) > 0x20) { + break; + } + } + return string.substring(start, end); +} + +function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/ug, ""); +} + +function shortenPath(url) { + const { path } = url; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); +} + +function includesCredentials(url) { + return url.username !== "" || url.password !== ""; +} + +function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.scheme === "file"; +} + +function hasAnOpaquePath(url) { + return typeof url.path === "string"; +} + +function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/u.test(string); +} + +function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = Array.from(this.input, c => c.codePointAt(0)); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this[`parse ${this.state}`](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } +} + +URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (infra.isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (infra.isASCIIAlphanumeric(c) || c === p("+") || c === p("-") || c === p(".")) { + this.buffer += cStr.toLowerCase(); + } else if (c === p(":")) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && this.url.host === "") { + return false; + } + } + this.url.scheme = this.buffer; + if (this.stateOverride) { + if (this.url.port === defaultPort(this.url.scheme)) { + this.url.port = null; + } + return false; + } + this.buffer = ""; + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== p("/") || this.input[this.pointer + 2] !== p("/")) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === p("/")) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.path = ""; + this.state = "opaque path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (hasAnOpaquePath(this.base) && c !== p("#"))) { + return failure; + } else if (hasAnOpaquePath(this.base) && c === p("#")) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path; + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === p("/") && this.input[this.pointer + 1] === p("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === p("/")) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (c === p("/")) { + this.state = "relative slash"; + } else if (isSpecial(this.url) && c === p("\\")) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c)) { + this.url.query = null; + this.url.path.pop(); + this.state = "path"; + --this.pointer; + } + } + + return true; +}; + +URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === p("/") || c === p("\\"))) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === p("/")) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === p("/") && this.input[this.pointer + 1] === p("/")) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== p("/") && c !== p("\\")) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; +}; + +URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === p("@")) { + this.parseError = true; + if (this.atFlag) { + this.buffer = `%40${this.buffer}`; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === p(":") && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = utf8PercentEncodeCodePoint(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\"))) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse hostname"] = +URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === p(":") && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + if (this.stateOverride === "hostname") { + return false; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\"))) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === p("[")) { + this.arrFlag = true; + } else if (c === p("]")) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (infra.isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === p("/") || c === p("?") || c === p("#") || + (isSpecial(this.url) && c === p("\\")) || + this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > 2 ** 16 - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +const fileOtherwiseCodePoints = new Set([p("/"), p("\\"), p("?"), p("#")]); + +function startsWithWindowsDriveLetter(input, pointer) { + const length = input.length - pointer; + return length >= 2 && + isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && + (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); +} + +URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + this.url.host = ""; + + if (c === p("/") || c === p("\\")) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (!isNaN(c)) { + this.url.query = null; + if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { + shortenPath(this.url); + } else { + this.parseError = true; + this.url.path = []; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === p("/") || c === p("\\")) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file") { + if (!startsWithWindowsDriveLetter(this.input, this.pointer) && + isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } + this.url.host = this.base.host; + } + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === p("/") || c === p("\\") || c === p("?") || c === p("#")) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === p("\\")) { + this.parseError = true; + } + this.state = "path"; + + if (c !== p("/") && c !== p("\\")) { + --this.pointer; + } + } else if (!this.stateOverride && c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== p("/")) { + --this.pointer; + } + } else if (this.stateOverride && this.url.host === null) { + this.url.path.push(""); + } + + return true; +}; + +URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === p("/") || (isSpecial(this.url) && c === p("\\")) || + (!this.stateOverride && (c === p("?") || c === p("#")))) { + if (isSpecial(this.url) && c === p("\\")) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== p("/") && !(isSpecial(this.url) && c === p("\\"))) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== p("/") && + !(isSpecial(this.url) && c === p("\\"))) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + this.buffer = `${this.buffer[0]}:`; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } + if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += utf8PercentEncodeCodePoint(c, isPathPercentEncode); + } + + return true; +}; + +URLStateMachine.prototype["parse opaque path"] = function parseOpaquePath(c) { + if (c === p("?")) { + this.url.query = ""; + this.state = "query"; + } else if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c === p(" ")) { + const remaining = this.input[this.pointer + 1]; + if (remaining === p("?") || remaining === p("#")) { + this.url.path += "%20"; + } else { + this.url.path += " "; + } + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== p("%")) { + this.parseError = true; + } + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path += utf8PercentEncodeCodePoint(c, isC0ControlPercentEncode); + } + } + + return true; +}; + +URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + if ((!this.stateOverride && c === p("#")) || isNaN(c)) { + const queryPercentEncodePredicate = isSpecial(this.url) ? isSpecialQueryPercentEncode : isQueryPercentEncode; + this.url.query += utf8PercentEncodeString(this.buffer, queryPercentEncodePredicate); + + this.buffer = ""; + + if (c === p("#")) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else if (!isNaN(c)) { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (!isNaN(c)) { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === p("%") && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode); + } + + return true; +}; + +function serializeURL(url, excludeFragment) { + let output = `${url.scheme}:`; + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += `:${url.password}`; + } + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += `:${url.port}`; + } + } + + if (url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "") { + output += "/."; + } + output += serializePath(url); + + if (url.query !== null) { + output += `?${url.query}`; + } + + if (!excludeFragment && url.fragment !== null) { + output += `#${url.fragment}`; + } + + return output; +} + +function serializeOrigin(tuple) { + let result = `${tuple.scheme}://`; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += `:${tuple.port}`; + } + + return result; +} + +function serializePath(url) { + if (hasAnOpaquePath(url)) { + return url.path; + } + + let output = ""; + for (const segment of url.path) { + output += `/${segment}`; + } + return output; +} + +module.exports.serializeURL = serializeURL; + +module.exports.serializePath = serializePath; + +module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": { + const pathURL = module.exports.parseURL(serializePath(url)); + if (pathURL === null) { + return "null"; + } + if (pathURL.scheme !== "http" && pathURL.scheme !== "https") { + return "null"; + } + return module.exports.serializeURLOrigin(pathURL); + } + case "ftp": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + // The spec says: + // > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin. + // Browsers tested so far: + // - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g. + // https://bugs.chromium.org/p/chromium/issues/detail?id=37586 + // - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see + // https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs + return "null"; + default: + // serializing an opaque origin returns "null" + return "null"; + } +}; + +module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return null; + } + + return usm.url; +}; + +module.exports.setTheUsername = function (url, username) { + url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode); +}; + +module.exports.setThePassword = function (url, password) { + url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode); +}; + +module.exports.serializeHost = serializeHost; + +module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + +module.exports.hasAnOpaquePath = hasAnOpaquePath; + +module.exports.serializeInteger = function (integer) { + return String(integer); +}; + +module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); +}; + + +/***/ }), + +/***/ 6367: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +const { utf8Encode, utf8DecodeWithoutBOM } = __nccwpck_require__(4887); +const { percentDecodeBytes, utf8PercentEncodeString, isURLEncodedPercentEncode } = __nccwpck_require__(687); + +function p(char) { + return char.codePointAt(0); +} + +// https://url.spec.whatwg.org/#concept-urlencoded-parser +function parseUrlencoded(input) { + const sequences = strictlySplitByteSequence(input, p("&")); + const output = []; + for (const bytes of sequences) { + if (bytes.length === 0) { + continue; + } + + let name, value; + const indexOfEqual = bytes.indexOf(p("=")); + + if (indexOfEqual >= 0) { + name = bytes.slice(0, indexOfEqual); + value = bytes.slice(indexOfEqual + 1); + } else { + name = bytes; + value = new Uint8Array(0); + } + + name = replaceByteInByteSequence(name, 0x2B, 0x20); + value = replaceByteInByteSequence(value, 0x2B, 0x20); + + const nameString = utf8DecodeWithoutBOM(percentDecodeBytes(name)); + const valueString = utf8DecodeWithoutBOM(percentDecodeBytes(value)); + + output.push([nameString, valueString]); + } + return output; +} + +// https://url.spec.whatwg.org/#concept-urlencoded-string-parser +function parseUrlencodedString(input) { + return parseUrlencoded(utf8Encode(input)); +} + +// https://url.spec.whatwg.org/#concept-urlencoded-serializer +function serializeUrlencoded(tuples) { + // TODO: accept and use encoding argument + + let output = ""; + for (const [i, tuple] of tuples.entries()) { + const name = utf8PercentEncodeString(tuple[0], isURLEncodedPercentEncode, true); + const value = utf8PercentEncodeString(tuple[1], isURLEncodedPercentEncode, true); + + if (i !== 0) { + output += "&"; + } + output += `${name}=${value}`; + } + return output; +} + +function strictlySplitByteSequence(buf, cp) { + const list = []; + let last = 0; + let i = buf.indexOf(cp); + while (i >= 0) { + list.push(buf.slice(last, i)); + last = i + 1; + i = buf.indexOf(cp, last); + } + if (last !== buf.length) { + list.push(buf.slice(last)); + } + return list; +} + +function replaceByteInByteSequence(buf, from, to) { + let i = buf.indexOf(from); + while (i >= 0) { + buf[i] = to; + i = buf.indexOf(from, i + 1); + } + return buf; +} + +module.exports = { + parseUrlencodedString, + serializeUrlencoded +}; + + +/***/ }), + +/***/ 9857: +/***/ ((module, exports) => { + + + +// Returns "Type(value) is Object" in ES terminology. +function isObject(value) { + return (typeof value === "object" && value !== null) || typeof value === "function"; +} + +const hasOwn = Function.prototype.call.bind(Object.prototype.hasOwnProperty); + +// Like `Object.assign`, but using `[[GetOwnProperty]]` and `[[DefineOwnProperty]]` +// instead of `[[Get]]` and `[[Set]]` and only allowing objects +function define(target, source) { + for (const key of Reflect.ownKeys(source)) { + const descriptor = Reflect.getOwnPropertyDescriptor(source, key); + if (descriptor && !Reflect.defineProperty(target, key, descriptor)) { + throw new TypeError(`Cannot redefine property: ${String(key)}`); + } + } +} + +function newObjectInRealm(globalObject, object) { + const ctorRegistry = initCtorRegistry(globalObject); + return Object.defineProperties( + Object.create(ctorRegistry["%Object.prototype%"]), + Object.getOwnPropertyDescriptors(object) + ); +} + +const wrapperSymbol = Symbol("wrapper"); +const implSymbol = Symbol("impl"); +const sameObjectCaches = Symbol("SameObject caches"); +const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); + +const AsyncIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf(async function* () {}).prototype); + +function initCtorRegistry(globalObject) { + if (hasOwn(globalObject, ctorRegistrySymbol)) { + return globalObject[ctorRegistrySymbol]; + } + + const ctorRegistry = Object.create(null); + + // In addition to registering all the WebIDL2JS-generated types in the constructor registry, + // we also register a few intrinsics that we make use of in generated code, since they are not + // easy to grab from the globalObject variable. + ctorRegistry["%Object.prototype%"] = globalObject.Object.prototype; + ctorRegistry["%IteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf(new globalObject.Array()[Symbol.iterator]()) + ); + + try { + ctorRegistry["%AsyncIteratorPrototype%"] = Object.getPrototypeOf( + Object.getPrototypeOf( + globalObject.eval("(async function* () {})").prototype + ) + ); + } catch { + ctorRegistry["%AsyncIteratorPrototype%"] = AsyncIteratorPrototype; + } + + globalObject[ctorRegistrySymbol] = ctorRegistry; + return ctorRegistry; +} + +function getSameObject(wrapper, prop, creator) { + if (!wrapper[sameObjectCaches]) { + wrapper[sameObjectCaches] = Object.create(null); + } + + if (prop in wrapper[sameObjectCaches]) { + return wrapper[sameObjectCaches][prop]; + } + + wrapper[sameObjectCaches][prop] = creator(); + return wrapper[sameObjectCaches][prop]; +} + +function wrapperForImpl(impl) { + return impl ? impl[wrapperSymbol] : null; +} + +function implForWrapper(wrapper) { + return wrapper ? wrapper[implSymbol] : null; +} + +function tryWrapperForImpl(impl) { + const wrapper = wrapperForImpl(impl); + return wrapper ? wrapper : impl; +} + +function tryImplForWrapper(wrapper) { + const impl = implForWrapper(wrapper); + return impl ? impl : wrapper; +} + +const iterInternalSymbol = Symbol("internal"); + +function isArrayIndexPropName(P) { + if (typeof P !== "string") { + return false; + } + const i = P >>> 0; + if (i === 2 ** 32 - 1) { + return false; + } + const s = `${i}`; + if (P !== s) { + return false; + } + return true; +} + +const byteLengthGetter = + Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; +function isArrayBuffer(value) { + try { + byteLengthGetter.call(value); + return true; + } catch (e) { + return false; + } +} + +function iteratorResult([key, value], kind) { + let result; + switch (kind) { + case "key": + result = key; + break; + case "value": + result = value; + break; + case "key+value": + result = [key, value]; + break; + } + return { value: result, done: false }; +} + +const supportsPropertyIndex = Symbol("supports property index"); +const supportedPropertyIndices = Symbol("supported property indices"); +const supportsPropertyName = Symbol("supports property name"); +const supportedPropertyNames = Symbol("supported property names"); +const indexedGet = Symbol("indexed property get"); +const indexedSetNew = Symbol("indexed property set new"); +const indexedSetExisting = Symbol("indexed property set existing"); +const namedGet = Symbol("named property get"); +const namedSetNew = Symbol("named property set new"); +const namedSetExisting = Symbol("named property set existing"); +const namedDelete = Symbol("named property delete"); + +const asyncIteratorNext = Symbol("async iterator get the next iteration result"); +const asyncIteratorReturn = Symbol("async iterator return steps"); +const asyncIteratorInit = Symbol("async iterator initialization steps"); +const asyncIteratorEOI = Symbol("async iterator end of iteration"); + +module.exports = exports = { + isObject, + hasOwn, + define, + newObjectInRealm, + wrapperSymbol, + implSymbol, + getSameObject, + ctorRegistrySymbol, + initCtorRegistry, + wrapperForImpl, + implForWrapper, + tryWrapperForImpl, + tryImplForWrapper, + iterInternalSymbol, + isArrayBuffer, + isArrayIndexPropName, + supportsPropertyIndex, + supportedPropertyIndices, + supportsPropertyName, + supportedPropertyNames, + indexedGet, + indexedSetNew, + indexedSetExisting, + namedGet, + namedSetNew, + namedSetExisting, + namedDelete, + asyncIteratorNext, + asyncIteratorReturn, + asyncIteratorInit, + asyncIteratorEOI, + iteratorResult +}; + + +/***/ }), + +/***/ 4108: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + + + +const URL = __nccwpck_require__(6633); +const URLSearchParams = __nccwpck_require__(3627); + +exports.URL = URL; +exports.URLSearchParams = URLSearchParams; + + +/***/ }), + +/***/ 4768: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var forEach = __nccwpck_require__(4963); +var availableTypedArrays = __nccwpck_require__(1506); +var callBind = __nccwpck_require__(3844); +var callBound = __nccwpck_require__(3105); +var gOPD = __nccwpck_require__(3170); +var getProto = __nccwpck_require__(1967); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = __nccwpck_require__(5479)(); + +var g = typeof globalThis === 'undefined' ? global : globalThis; +var typedArrays = availableTypedArrays(); + +var $slice = callBound('String.prototype.slice'); + +/** @type {(array: readonly T[], value: unknown) => number} */ +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; +}; + +/** @typedef {import('./types').Getter} Getter */ +/** @type {import('./types').Cache} */ +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); + // @ts-expect-error TS won't narrow inside a closure + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor && proto) { + var superProto = getProto(proto); + // @ts-expect-error TS won't narrow inside a closure + descriptor = gOPD(superProto, Symbol.toStringTag); + } + // @ts-expect-error TODO: fix + cache['$' + typedArray] = callBind(descriptor.get); + } + }); +} else { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + var fn = arr.slice || arr.set; + if (fn) { + cache[ + /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray) + ] = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ ( + // @ts-expect-error TODO FIXME + callBind(fn) + ); + } + }); +} + +/** @type {(value: object) => false | import('.').TypedArrayName} */ +var tryTypedArrays = function tryAllTypedArrays(value) { + /** @type {ReturnType} */ var found = false; + forEach( + /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ (cache), + /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ + function (getter, typedArray) { + if (!found) { + try { + // @ts-expect-error a throw is fine here + if ('$' + getter(value) === typedArray) { + found = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1)); + } + } catch (e) { /**/ } + } + } + ); + return found; +}; + +/** @type {(value: object) => false | import('.').TypedArrayName} */ +var trySlices = function tryAllSlices(value) { + /** @type {ReturnType} */ var found = false; + forEach( + /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */(cache), + /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) { + if (!found) { + try { + // @ts-expect-error a throw is fine here + getter(value); + found = /** @type {import('.').TypedArrayName} */ ($slice(name, 1)); + } catch (e) { /**/ } + } + } + ); + return found; +}; + +/** @type {import('.')} */ +module.exports = function whichTypedArray(value) { + if (!value || typeof value !== 'object') { return false; } + if (!hasToStringTag) { + /** @type {string} */ + var tag = $slice($toString(value), 8, -1); + if ($indexOf(typedArrays, tag) > -1) { + return tag; + } + if (tag !== 'Object') { + return false; + } + // node < 0.6 hits here on real Typed Arrays + return trySlices(value); + } + if (!gOPD) { return null; } // unknown engine + return tryTypedArrays(value); +}; + + +/***/ }), + +/***/ 8264: +/***/ ((module) => { + +// Returns a wrapper function that returns a wrapped callback +// The wrapper function should do some stuff, and return a +// presumably different callback function. +// This makes sure that own properties are retained, so that +// decorations and such are not lost along the way. +module.exports = wrappy +function wrappy (fn, cb) { + if (fn && cb) return wrappy(fn)(cb) + + if (typeof fn !== 'function') + throw new TypeError('need wrapper function') + + Object.keys(fn).forEach(function (k) { + wrapper[k] = fn[k] + }) + + return wrapper + + function wrapper() { + var args = new Array(arguments.length) + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i] + } + var ret = fn.apply(this, args) + var cb = args[args.length-1] + if (typeof ret === 'function' && ret !== cb) { + Object.keys(cb).forEach(function (k) { + ret[k] = cb[k] + }) + } + return ret + } +} + + +/***/ }), + +/***/ 869: +/***/ ((module) => { + +module.exports = extend + +var hasOwnProperty = Object.prototype.hasOwnProperty; + +function extend() { + var target = {} + + for (var i = 0; i < arguments.length; i++) { + var source = arguments[i] + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + target[key] = source[key] + } + } + } + + return target +} + + +/***/ }), + +/***/ 663: +/***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { + +var fs = __nccwpck_require__(9896); +var zlib = __nccwpck_require__(3106); +var fd_slicer = __nccwpck_require__(3045); +var crc32 = __nccwpck_require__(9776); +var util = __nccwpck_require__(9023); +var EventEmitter = (__nccwpck_require__(4434).EventEmitter); +var Transform = (__nccwpck_require__(2203).Transform); +var PassThrough = (__nccwpck_require__(2203).PassThrough); +var Writable = (__nccwpck_require__(2203).Writable); + +exports.open = open; +exports.fromFd = fromFd; +exports.fromBuffer = fromBuffer; +exports.fromRandomAccessReader = fromRandomAccessReader; +exports.dosDateTimeToDate = dosDateTimeToDate; +exports.validateFileName = validateFileName; +exports.ZipFile = ZipFile; +exports.Entry = Entry; +exports.RandomAccessReader = RandomAccessReader; + +function open(path, options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } + if (options == null) options = {}; + if (options.autoClose == null) options.autoClose = true; + if (options.lazyEntries == null) options.lazyEntries = false; + if (options.decodeStrings == null) options.decodeStrings = true; + if (options.validateEntrySizes == null) options.validateEntrySizes = true; + if (options.strictFileNames == null) options.strictFileNames = false; + if (callback == null) callback = defaultCallback; + fs.open(path, "r", function(err, fd) { + if (err) return callback(err); + fromFd(fd, options, function(err, zipfile) { + if (err) fs.close(fd, defaultCallback); + callback(err, zipfile); + }); + }); +} + +function fromFd(fd, options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } + if (options == null) options = {}; + if (options.autoClose == null) options.autoClose = false; + if (options.lazyEntries == null) options.lazyEntries = false; + if (options.decodeStrings == null) options.decodeStrings = true; + if (options.validateEntrySizes == null) options.validateEntrySizes = true; + if (options.strictFileNames == null) options.strictFileNames = false; + if (callback == null) callback = defaultCallback; + fs.fstat(fd, function(err, stats) { + if (err) return callback(err); + var reader = fd_slicer.createFromFd(fd, {autoClose: true}); + fromRandomAccessReader(reader, stats.size, options, callback); + }); +} + +function fromBuffer(buffer, options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } + if (options == null) options = {}; + options.autoClose = false; + if (options.lazyEntries == null) options.lazyEntries = false; + if (options.decodeStrings == null) options.decodeStrings = true; + if (options.validateEntrySizes == null) options.validateEntrySizes = true; + if (options.strictFileNames == null) options.strictFileNames = false; + // limit the max chunk size. see https://github.com/thejoshwolfe/yauzl/issues/87 + var reader = fd_slicer.createFromBuffer(buffer, {maxChunkSize: 0x10000}); + fromRandomAccessReader(reader, buffer.length, options, callback); +} + +function fromRandomAccessReader(reader, totalSize, options, callback) { + if (typeof options === "function") { + callback = options; + options = null; + } + if (options == null) options = {}; + if (options.autoClose == null) options.autoClose = true; + if (options.lazyEntries == null) options.lazyEntries = false; + if (options.decodeStrings == null) options.decodeStrings = true; + var decodeStrings = !!options.decodeStrings; + if (options.validateEntrySizes == null) options.validateEntrySizes = true; + if (options.strictFileNames == null) options.strictFileNames = false; + if (callback == null) callback = defaultCallback; + if (typeof totalSize !== "number") throw new Error("expected totalSize parameter to be a number"); + if (totalSize > Number.MAX_SAFE_INTEGER) { + throw new Error("zip file too large. only file sizes up to 2^52 are supported due to JavaScript's Number type being an IEEE 754 double."); + } + + // the matching unref() call is in zipfile.close() + reader.ref(); + + // eocdr means End of Central Directory Record. + // search backwards for the eocdr signature. + // the last field of the eocdr is a variable-length comment. + // the comment size is encoded in a 2-byte field in the eocdr, which we can't find without trudging backwards through the comment to find it. + // as a consequence of this design decision, it's possible to have ambiguous zip file metadata if a coherent eocdr was in the comment. + // we search backwards for a eocdr signature, and hope that whoever made the zip file was smart enough to forbid the eocdr signature in the comment. + var eocdrWithoutCommentSize = 22; + var maxCommentSize = 0xffff; // 2-byte size + var bufferSize = Math.min(eocdrWithoutCommentSize + maxCommentSize, totalSize); + var buffer = newBuffer(bufferSize); + var bufferReadStart = totalSize - buffer.length; + readAndAssertNoEof(reader, buffer, 0, bufferSize, bufferReadStart, function(err) { + if (err) return callback(err); + for (var i = bufferSize - eocdrWithoutCommentSize; i >= 0; i -= 1) { + if (buffer.readUInt32LE(i) !== 0x06054b50) continue; + // found eocdr + var eocdrBuffer = buffer.slice(i); + + // 0 - End of central directory signature = 0x06054b50 + // 4 - Number of this disk + var diskNumber = eocdrBuffer.readUInt16LE(4); + if (diskNumber !== 0) { + return callback(new Error("multi-disk zip files are not supported: found disk number: " + diskNumber)); + } + // 6 - Disk where central directory starts + // 8 - Number of central directory records on this disk + // 10 - Total number of central directory records + var entryCount = eocdrBuffer.readUInt16LE(10); + // 12 - Size of central directory (bytes) + // 16 - Offset of start of central directory, relative to start of archive + var centralDirectoryOffset = eocdrBuffer.readUInt32LE(16); + // 20 - Comment length + var commentLength = eocdrBuffer.readUInt16LE(20); + var expectedCommentLength = eocdrBuffer.length - eocdrWithoutCommentSize; + if (commentLength !== expectedCommentLength) { + return callback(new Error("invalid comment length. expected: " + expectedCommentLength + ". found: " + commentLength)); + } + // 22 - Comment + // the encoding is always cp437. + var comment = decodeStrings ? decodeBuffer(eocdrBuffer, 22, eocdrBuffer.length, false) + : eocdrBuffer.slice(22); + + if (!(entryCount === 0xffff || centralDirectoryOffset === 0xffffffff)) { + return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); + } + + // ZIP64 format + + // ZIP64 Zip64 end of central directory locator + var zip64EocdlBuffer = newBuffer(20); + var zip64EocdlOffset = bufferReadStart + i - zip64EocdlBuffer.length; + readAndAssertNoEof(reader, zip64EocdlBuffer, 0, zip64EocdlBuffer.length, zip64EocdlOffset, function(err) { + if (err) return callback(err); + + // 0 - zip64 end of central dir locator signature = 0x07064b50 + if (zip64EocdlBuffer.readUInt32LE(0) !== 0x07064b50) { + return callback(new Error("invalid zip64 end of central directory locator signature")); + } + // 4 - number of the disk with the start of the zip64 end of central directory + // 8 - relative offset of the zip64 end of central directory record + var zip64EocdrOffset = readUInt64LE(zip64EocdlBuffer, 8); + // 16 - total number of disks + + // ZIP64 end of central directory record + var zip64EocdrBuffer = newBuffer(56); + readAndAssertNoEof(reader, zip64EocdrBuffer, 0, zip64EocdrBuffer.length, zip64EocdrOffset, function(err) { + if (err) return callback(err); + + // 0 - zip64 end of central dir signature 4 bytes (0x06064b50) + if (zip64EocdrBuffer.readUInt32LE(0) !== 0x06064b50) { + return callback(new Error("invalid zip64 end of central directory record signature")); + } + // 4 - size of zip64 end of central directory record 8 bytes + // 12 - version made by 2 bytes + // 14 - version needed to extract 2 bytes + // 16 - number of this disk 4 bytes + // 20 - number of the disk with the start of the central directory 4 bytes + // 24 - total number of entries in the central directory on this disk 8 bytes + // 32 - total number of entries in the central directory 8 bytes + entryCount = readUInt64LE(zip64EocdrBuffer, 32); + // 40 - size of the central directory 8 bytes + // 48 - offset of start of central directory with respect to the starting disk number 8 bytes + centralDirectoryOffset = readUInt64LE(zip64EocdrBuffer, 48); + // 56 - zip64 extensible data sector (variable size) + return callback(null, new ZipFile(reader, centralDirectoryOffset, totalSize, entryCount, comment, options.autoClose, options.lazyEntries, decodeStrings, options.validateEntrySizes, options.strictFileNames)); + }); + }); + return; + } + callback(new Error("end of central directory record signature not found")); + }); +} + +util.inherits(ZipFile, EventEmitter); +function ZipFile(reader, centralDirectoryOffset, fileSize, entryCount, comment, autoClose, lazyEntries, decodeStrings, validateEntrySizes, strictFileNames) { + var self = this; + EventEmitter.call(self); + self.reader = reader; + // forward close events + self.reader.on("error", function(err) { + // error closing the fd + emitError(self, err); + }); + self.reader.once("close", function() { + self.emit("close"); + }); + self.readEntryCursor = centralDirectoryOffset; + self.fileSize = fileSize; + self.entryCount = entryCount; + self.comment = comment; + self.entriesRead = 0; + self.autoClose = !!autoClose; + self.lazyEntries = !!lazyEntries; + self.decodeStrings = !!decodeStrings; + self.validateEntrySizes = !!validateEntrySizes; + self.strictFileNames = !!strictFileNames; + self.isOpen = true; + self.emittedError = false; + + if (!self.lazyEntries) self._readEntry(); +} +ZipFile.prototype.close = function() { + if (!this.isOpen) return; + this.isOpen = false; + this.reader.unref(); +}; + +function emitErrorAndAutoClose(self, err) { + if (self.autoClose) self.close(); + emitError(self, err); +} +function emitError(self, err) { + if (self.emittedError) return; + self.emittedError = true; + self.emit("error", err); +} + +ZipFile.prototype.readEntry = function() { + if (!this.lazyEntries) throw new Error("readEntry() called without lazyEntries:true"); + this._readEntry(); +}; +ZipFile.prototype._readEntry = function() { + var self = this; + if (self.entryCount === self.entriesRead) { + // done with metadata + setImmediate(function() { + if (self.autoClose) self.close(); + if (self.emittedError) return; + self.emit("end"); + }); + return; + } + if (self.emittedError) return; + var buffer = newBuffer(46); + readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) { + if (err) return emitErrorAndAutoClose(self, err); + if (self.emittedError) return; + var entry = new Entry(); + // 0 - Central directory file header signature + var signature = buffer.readUInt32LE(0); + if (signature !== 0x02014b50) return emitErrorAndAutoClose(self, new Error("invalid central directory file header signature: 0x" + signature.toString(16))); + // 4 - Version made by + entry.versionMadeBy = buffer.readUInt16LE(4); + // 6 - Version needed to extract (minimum) + entry.versionNeededToExtract = buffer.readUInt16LE(6); + // 8 - General purpose bit flag + entry.generalPurposeBitFlag = buffer.readUInt16LE(8); + // 10 - Compression method + entry.compressionMethod = buffer.readUInt16LE(10); + // 12 - File last modification time + entry.lastModFileTime = buffer.readUInt16LE(12); + // 14 - File last modification date + entry.lastModFileDate = buffer.readUInt16LE(14); + // 16 - CRC-32 + entry.crc32 = buffer.readUInt32LE(16); + // 20 - Compressed size + entry.compressedSize = buffer.readUInt32LE(20); + // 24 - Uncompressed size + entry.uncompressedSize = buffer.readUInt32LE(24); + // 28 - File name length (n) + entry.fileNameLength = buffer.readUInt16LE(28); + // 30 - Extra field length (m) + entry.extraFieldLength = buffer.readUInt16LE(30); + // 32 - File comment length (k) + entry.fileCommentLength = buffer.readUInt16LE(32); + // 34 - Disk number where file starts + // 36 - Internal file attributes + entry.internalFileAttributes = buffer.readUInt16LE(36); + // 38 - External file attributes + entry.externalFileAttributes = buffer.readUInt32LE(38); + // 42 - Relative offset of local file header + entry.relativeOffsetOfLocalHeader = buffer.readUInt32LE(42); + + if (entry.generalPurposeBitFlag & 0x40) return emitErrorAndAutoClose(self, new Error("strong encryption is not supported")); + + self.readEntryCursor += 46; + + buffer = newBuffer(entry.fileNameLength + entry.extraFieldLength + entry.fileCommentLength); + readAndAssertNoEof(self.reader, buffer, 0, buffer.length, self.readEntryCursor, function(err) { + if (err) return emitErrorAndAutoClose(self, err); + if (self.emittedError) return; + // 46 - File name + var isUtf8 = (entry.generalPurposeBitFlag & 0x800) !== 0; + entry.fileName = self.decodeStrings ? decodeBuffer(buffer, 0, entry.fileNameLength, isUtf8) + : buffer.slice(0, entry.fileNameLength); + + // 46+n - Extra field + var fileCommentStart = entry.fileNameLength + entry.extraFieldLength; + var extraFieldBuffer = buffer.slice(entry.fileNameLength, fileCommentStart); + entry.extraFields = []; + var i = 0; + while (i < extraFieldBuffer.length - 3) { + var headerId = extraFieldBuffer.readUInt16LE(i + 0); + var dataSize = extraFieldBuffer.readUInt16LE(i + 2); + var dataStart = i + 4; + var dataEnd = dataStart + dataSize; + if (dataEnd > extraFieldBuffer.length) return emitErrorAndAutoClose(self, new Error("extra field length exceeds extra field buffer size")); + var dataBuffer = newBuffer(dataSize); + extraFieldBuffer.copy(dataBuffer, 0, dataStart, dataEnd); + entry.extraFields.push({ + id: headerId, + data: dataBuffer, + }); + i = dataEnd; + } + + // 46+n+m - File comment + entry.fileComment = self.decodeStrings ? decodeBuffer(buffer, fileCommentStart, fileCommentStart + entry.fileCommentLength, isUtf8) + : buffer.slice(fileCommentStart, fileCommentStart + entry.fileCommentLength); + // compatibility hack for https://github.com/thejoshwolfe/yauzl/issues/47 + entry.comment = entry.fileComment; + + self.readEntryCursor += buffer.length; + self.entriesRead += 1; + + if (entry.uncompressedSize === 0xffffffff || + entry.compressedSize === 0xffffffff || + entry.relativeOffsetOfLocalHeader === 0xffffffff) { + // ZIP64 format + // find the Zip64 Extended Information Extra Field + var zip64EiefBuffer = null; + for (var i = 0; i < entry.extraFields.length; i++) { + var extraField = entry.extraFields[i]; + if (extraField.id === 0x0001) { + zip64EiefBuffer = extraField.data; + break; + } + } + if (zip64EiefBuffer == null) { + return emitErrorAndAutoClose(self, new Error("expected zip64 extended information extra field")); + } + var index = 0; + // 0 - Original Size 8 bytes + if (entry.uncompressedSize === 0xffffffff) { + if (index + 8 > zip64EiefBuffer.length) { + return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include uncompressed size")); + } + entry.uncompressedSize = readUInt64LE(zip64EiefBuffer, index); + index += 8; + } + // 8 - Compressed Size 8 bytes + if (entry.compressedSize === 0xffffffff) { + if (index + 8 > zip64EiefBuffer.length) { + return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include compressed size")); + } + entry.compressedSize = readUInt64LE(zip64EiefBuffer, index); + index += 8; + } + // 16 - Relative Header Offset 8 bytes + if (entry.relativeOffsetOfLocalHeader === 0xffffffff) { + if (index + 8 > zip64EiefBuffer.length) { + return emitErrorAndAutoClose(self, new Error("zip64 extended information extra field does not include relative header offset")); + } + entry.relativeOffsetOfLocalHeader = readUInt64LE(zip64EiefBuffer, index); + index += 8; + } + // 24 - Disk Start Number 4 bytes + } + + // check for Info-ZIP Unicode Path Extra Field (0x7075) + // see https://github.com/thejoshwolfe/yauzl/issues/33 + if (self.decodeStrings) { + for (var i = 0; i < entry.extraFields.length; i++) { + var extraField = entry.extraFields[i]; + if (extraField.id === 0x7075) { + if (extraField.data.length < 6) { + // too short to be meaningful + continue; + } + // Version 1 byte version of this extra field, currently 1 + if (extraField.data.readUInt8(0) !== 1) { + // > Changes may not be backward compatible so this extra + // > field should not be used if the version is not recognized. + continue; + } + // NameCRC32 4 bytes File Name Field CRC32 Checksum + var oldNameCrc32 = extraField.data.readUInt32LE(1); + if (crc32.unsigned(buffer.slice(0, entry.fileNameLength)) !== oldNameCrc32) { + // > If the CRC check fails, this UTF-8 Path Extra Field should be + // > ignored and the File Name field in the header should be used instead. + continue; + } + // UnicodeName Variable UTF-8 version of the entry File Name + entry.fileName = decodeBuffer(extraField.data, 5, extraField.data.length, true); + break; + } + } + } + + // validate file size + if (self.validateEntrySizes && entry.compressionMethod === 0) { + var expectedCompressedSize = entry.uncompressedSize; + if (entry.isEncrypted()) { + // traditional encryption prefixes the file data with a header + expectedCompressedSize += 12; + } + if (entry.compressedSize !== expectedCompressedSize) { + var msg = "compressed/uncompressed size mismatch for stored file: " + entry.compressedSize + " != " + entry.uncompressedSize; + return emitErrorAndAutoClose(self, new Error(msg)); + } + } + + if (self.decodeStrings) { + if (!self.strictFileNames) { + // allow backslash + entry.fileName = entry.fileName.replace(/\\/g, "/"); + } + var errorMessage = validateFileName(entry.fileName, self.validateFileNameOptions); + if (errorMessage != null) return emitErrorAndAutoClose(self, new Error(errorMessage)); + } + self.emit("entry", entry); + + if (!self.lazyEntries) self._readEntry(); + }); + }); +}; + +ZipFile.prototype.openReadStream = function(entry, options, callback) { + var self = this; + // parameter validation + var relativeStart = 0; + var relativeEnd = entry.compressedSize; + if (callback == null) { + callback = options; + options = {}; + } else { + // validate options that the caller has no excuse to get wrong + if (options.decrypt != null) { + if (!entry.isEncrypted()) { + throw new Error("options.decrypt can only be specified for encrypted entries"); + } + if (options.decrypt !== false) throw new Error("invalid options.decrypt value: " + options.decrypt); + if (entry.isCompressed()) { + if (options.decompress !== false) throw new Error("entry is encrypted and compressed, and options.decompress !== false"); + } + } + if (options.decompress != null) { + if (!entry.isCompressed()) { + throw new Error("options.decompress can only be specified for compressed entries"); + } + if (!(options.decompress === false || options.decompress === true)) { + throw new Error("invalid options.decompress value: " + options.decompress); + } + } + if (options.start != null || options.end != null) { + if (entry.isCompressed() && options.decompress !== false) { + throw new Error("start/end range not allowed for compressed entry without options.decompress === false"); + } + if (entry.isEncrypted() && options.decrypt !== false) { + throw new Error("start/end range not allowed for encrypted entry without options.decrypt === false"); + } + } + if (options.start != null) { + relativeStart = options.start; + if (relativeStart < 0) throw new Error("options.start < 0"); + if (relativeStart > entry.compressedSize) throw new Error("options.start > entry.compressedSize"); + } + if (options.end != null) { + relativeEnd = options.end; + if (relativeEnd < 0) throw new Error("options.end < 0"); + if (relativeEnd > entry.compressedSize) throw new Error("options.end > entry.compressedSize"); + if (relativeEnd < relativeStart) throw new Error("options.end < options.start"); + } + } + // any further errors can either be caused by the zipfile, + // or were introduced in a minor version of yauzl, + // so should be passed to the client rather than thrown. + if (!self.isOpen) return callback(new Error("closed")); + if (entry.isEncrypted()) { + if (options.decrypt !== false) return callback(new Error("entry is encrypted, and options.decrypt !== false")); + } + // make sure we don't lose the fd before we open the actual read stream + self.reader.ref(); + var buffer = newBuffer(30); + readAndAssertNoEof(self.reader, buffer, 0, buffer.length, entry.relativeOffsetOfLocalHeader, function(err) { + try { + if (err) return callback(err); + // 0 - Local file header signature = 0x04034b50 + var signature = buffer.readUInt32LE(0); + if (signature !== 0x04034b50) { + return callback(new Error("invalid local file header signature: 0x" + signature.toString(16))); + } + // all this should be redundant + // 4 - Version needed to extract (minimum) + // 6 - General purpose bit flag + // 8 - Compression method + // 10 - File last modification time + // 12 - File last modification date + // 14 - CRC-32 + // 18 - Compressed size + // 22 - Uncompressed size + // 26 - File name length (n) + var fileNameLength = buffer.readUInt16LE(26); + // 28 - Extra field length (m) + var extraFieldLength = buffer.readUInt16LE(28); + // 30 - File name + // 30+n - Extra field + var localFileHeaderEnd = entry.relativeOffsetOfLocalHeader + buffer.length + fileNameLength + extraFieldLength; + var decompress; + if (entry.compressionMethod === 0) { + // 0 - The file is stored (no compression) + decompress = false; + } else if (entry.compressionMethod === 8) { + // 8 - The file is Deflated + decompress = options.decompress != null ? options.decompress : true; + } else { + return callback(new Error("unsupported compression method: " + entry.compressionMethod)); + } + var fileDataStart = localFileHeaderEnd; + var fileDataEnd = fileDataStart + entry.compressedSize; + if (entry.compressedSize !== 0) { + // bounds check now, because the read streams will probably not complain loud enough. + // since we're dealing with an unsigned offset plus an unsigned size, + // we only have 1 thing to check for. + if (fileDataEnd > self.fileSize) { + return callback(new Error("file data overflows file bounds: " + + fileDataStart + " + " + entry.compressedSize + " > " + self.fileSize)); + } + } + var readStream = self.reader.createReadStream({ + start: fileDataStart + relativeStart, + end: fileDataStart + relativeEnd, + }); + var endpointStream = readStream; + if (decompress) { + var destroyed = false; + var inflateFilter = zlib.createInflateRaw(); + readStream.on("error", function(err) { + // setImmediate here because errors can be emitted during the first call to pipe() + setImmediate(function() { + if (!destroyed) inflateFilter.emit("error", err); + }); + }); + readStream.pipe(inflateFilter); + + if (self.validateEntrySizes) { + endpointStream = new AssertByteCountStream(entry.uncompressedSize); + inflateFilter.on("error", function(err) { + // forward zlib errors to the client-visible stream + setImmediate(function() { + if (!destroyed) endpointStream.emit("error", err); + }); + }); + inflateFilter.pipe(endpointStream); + } else { + // the zlib filter is the client-visible stream + endpointStream = inflateFilter; + } + // this is part of yauzl's API, so implement this function on the client-visible stream + endpointStream.destroy = function() { + destroyed = true; + if (inflateFilter !== endpointStream) inflateFilter.unpipe(endpointStream); + readStream.unpipe(inflateFilter); + // TODO: the inflateFilter may cause a memory leak. see Issue #27. + readStream.destroy(); + }; + } + callback(null, endpointStream); + } finally { + self.reader.unref(); + } + }); +}; + +function Entry() { +} +Entry.prototype.getLastModDate = function() { + return dosDateTimeToDate(this.lastModFileDate, this.lastModFileTime); +}; +Entry.prototype.isEncrypted = function() { + return (this.generalPurposeBitFlag & 0x1) !== 0; +}; +Entry.prototype.isCompressed = function() { + return this.compressionMethod === 8; +}; + +function dosDateTimeToDate(date, time) { + var day = date & 0x1f; // 1-31 + var month = (date >> 5 & 0xf) - 1; // 1-12, 0-11 + var year = (date >> 9 & 0x7f) + 1980; // 0-128, 1980-2108 + + var millisecond = 0; + var second = (time & 0x1f) * 2; // 0-29, 0-58 (even numbers) + var minute = time >> 5 & 0x3f; // 0-59 + var hour = time >> 11 & 0x1f; // 0-23 + + return new Date(year, month, day, hour, minute, second, millisecond); +} + +function validateFileName(fileName) { + if (fileName.indexOf("\\") !== -1) { + return "invalid characters in fileName: " + fileName; + } + if (/^[a-zA-Z]:/.test(fileName) || /^\//.test(fileName)) { + return "absolute path: " + fileName; + } + if (fileName.split("/").indexOf("..") !== -1) { + return "invalid relative path: " + fileName; + } + // all good + return null; +} + +function readAndAssertNoEof(reader, buffer, offset, length, position, callback) { + if (length === 0) { + // fs.read will throw an out-of-bounds error if you try to read 0 bytes from a 0 byte file + return setImmediate(function() { callback(null, newBuffer(0)); }); + } + reader.read(buffer, offset, length, position, function(err, bytesRead) { + if (err) return callback(err); + if (bytesRead < length) { + return callback(new Error("unexpected EOF")); + } + callback(); + }); +} + +util.inherits(AssertByteCountStream, Transform); +function AssertByteCountStream(byteCount) { + Transform.call(this); + this.actualByteCount = 0; + this.expectedByteCount = byteCount; +} +AssertByteCountStream.prototype._transform = function(chunk, encoding, cb) { + this.actualByteCount += chunk.length; + if (this.actualByteCount > this.expectedByteCount) { + var msg = "too many bytes in the stream. expected " + this.expectedByteCount + ". got at least " + this.actualByteCount; + return cb(new Error(msg)); + } + cb(null, chunk); +}; +AssertByteCountStream.prototype._flush = function(cb) { + if (this.actualByteCount < this.expectedByteCount) { + var msg = "not enough bytes in the stream. expected " + this.expectedByteCount + ". got only " + this.actualByteCount; + return cb(new Error(msg)); + } + cb(); +}; + +util.inherits(RandomAccessReader, EventEmitter); +function RandomAccessReader() { + EventEmitter.call(this); + this.refCount = 0; +} +RandomAccessReader.prototype.ref = function() { + this.refCount += 1; +}; +RandomAccessReader.prototype.unref = function() { + var self = this; + self.refCount -= 1; + + if (self.refCount > 0) return; + if (self.refCount < 0) throw new Error("invalid unref"); + + self.close(onCloseDone); + + function onCloseDone(err) { + if (err) return self.emit('error', err); + self.emit('close'); + } +}; +RandomAccessReader.prototype.createReadStream = function(options) { + var start = options.start; + var end = options.end; + if (start === end) { + var emptyStream = new PassThrough(); + setImmediate(function() { + emptyStream.end(); + }); + return emptyStream; + } + var stream = this._readStreamForRange(start, end); + + var destroyed = false; + var refUnrefFilter = new RefUnrefFilter(this); + stream.on("error", function(err) { + setImmediate(function() { + if (!destroyed) refUnrefFilter.emit("error", err); + }); + }); + refUnrefFilter.destroy = function() { + stream.unpipe(refUnrefFilter); + refUnrefFilter.unref(); + stream.destroy(); + }; + + var byteCounter = new AssertByteCountStream(end - start); + refUnrefFilter.on("error", function(err) { + setImmediate(function() { + if (!destroyed) byteCounter.emit("error", err); + }); + }); + byteCounter.destroy = function() { + destroyed = true; + refUnrefFilter.unpipe(byteCounter); + refUnrefFilter.destroy(); + }; + + return stream.pipe(refUnrefFilter).pipe(byteCounter); +}; +RandomAccessReader.prototype._readStreamForRange = function(start, end) { + throw new Error("not implemented"); +}; +RandomAccessReader.prototype.read = function(buffer, offset, length, position, callback) { + var readStream = this.createReadStream({start: position, end: position + length}); + var writeStream = new Writable(); + var written = 0; + writeStream._write = function(chunk, encoding, cb) { + chunk.copy(buffer, offset + written, 0, chunk.length); + written += chunk.length; + cb(); + }; + writeStream.on("finish", callback); + readStream.on("error", function(error) { + callback(error); + }); + readStream.pipe(writeStream); +}; +RandomAccessReader.prototype.close = function(callback) { + setImmediate(callback); +}; + +util.inherits(RefUnrefFilter, PassThrough); +function RefUnrefFilter(context) { + PassThrough.call(this); + this.context = context; + this.context.ref(); + this.unreffedYet = false; +} +RefUnrefFilter.prototype._flush = function(cb) { + this.unref(); + cb(); +}; +RefUnrefFilter.prototype.unref = function(cb) { + if (this.unreffedYet) return; + this.unreffedYet = true; + this.context.unref(); +}; + +var cp437 = '\u0000☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ '; +function decodeBuffer(buffer, start, end, isUtf8) { + if (isUtf8) { + return buffer.toString("utf8", start, end); + } else { + var result = ""; + for (var i = start; i < end; i++) { + result += cp437[buffer[i]]; + } + return result; + } +} + +function readUInt64LE(buffer, offset) { + // there is no native function for this, because we can't actually store 64-bit integers precisely. + // after 53 bits, JavaScript's Number type (IEEE 754 double) can't store individual integers anymore. + // but since 53 bits is a whole lot more than 32 bits, we do our best anyway. + var lower32 = buffer.readUInt32LE(offset); + var upper32 = buffer.readUInt32LE(offset + 4); + // we can't use bitshifting here, because JavaScript bitshifting only works on 32-bit integers. + return upper32 * 0x100000000 + lower32; + // as long as we're bounds checking the result of this function against the total file size, + // we'll catch any overflow errors, because we already made sure the total file size was within reason. +} + +// Node 10 deprecated new Buffer(). +var newBuffer; +if (typeof Buffer.allocUnsafe === "function") { + newBuffer = function(len) { + return Buffer.allocUnsafe(len); + }; +} else { + newBuffer = function(len) { + return new Buffer(len); + }; +} + +function defaultCallback(err) { + if (err) throw err; +} + + +/***/ }), + +/***/ 6539: +/***/ ((module, exports, __nccwpck_require__) => { + +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.log()` when available. + * No-op when `console.log` is not a "function". + * + * @api public + */ +function log(...args) { + // This hackery is required for IE8/9, where + // the `console.log` function doesn't have 'apply' + return typeof console === 'object' && + console.log && + console.log(...args); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = __nccwpck_require__(8230)(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; + + +/***/ }), + +/***/ 8230: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = __nccwpck_require__(4263); + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * Active `debug` instances. + */ + createDebug.instances = []; + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return match; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.enabled = createDebug.enabled(namespace); + debug.useColors = createDebug.useColors(); + debug.color = selectColor(namespace); + debug.destroy = destroy; + debug.extend = extend; + // Debug.formatArgs = formatArgs; + // debug.rawLog = rawLog; + + // env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + createDebug.instances.push(debug); + + return debug; + } + + function destroy() { + const index = createDebug.instances.indexOf(this); + if (index !== -1) { + createDebug.instances.splice(index, 1); + return true; + } + return false; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + + for (i = 0; i < createDebug.instances.length; i++) { + const instance = createDebug.instances[i]; + instance.enabled = createDebug.enabled(instance.namespace); + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; + + +/***/ }), + +/***/ 983: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + +/** + * Detect Electron renderer / nwjs process, which is node, but we should + * treat as a browser. + */ + +if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) { + module.exports = __nccwpck_require__(6539); +} else { + module.exports = __nccwpck_require__(9703); +} + + +/***/ }), + +/***/ 9703: +/***/ ((module, exports, __nccwpck_require__) => { + +/** + * Module dependencies. + */ + +const tty = __nccwpck_require__(2018); +const util = __nccwpck_require__(9023); + +/** + * This is the Node.js implementation of `debug()`. + */ + +exports.init = init; +exports.log = log; +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; + +/** + * Colors. + */ + +exports.colors = [6, 2, 3, 4, 5, 1]; + +try { + // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json) + // eslint-disable-next-line import/no-extraneous-dependencies + const supportsColor = __nccwpck_require__(75); + + if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) { + exports.colors = [ + 20, + 21, + 26, + 27, + 32, + 33, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 56, + 57, + 62, + 63, + 68, + 69, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 92, + 93, + 98, + 99, + 112, + 113, + 128, + 129, + 134, + 135, + 148, + 149, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 178, + 179, + 184, + 185, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 214, + 215, + 220, + 221 + ]; + } +} catch (error) { + // Swallow - we only care if `supports-color` is available; it doesn't have to be. +} + +/** + * Build up the default `inspectOpts` object from the environment variables. + * + * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js + */ + +exports.inspectOpts = Object.keys(process.env).filter(key => { + return /^debug_/i.test(key); +}).reduce((obj, key) => { + // Camel-case + const prop = key + .substring(6) + .toLowerCase() + .replace(/_([a-z])/g, (_, k) => { + return k.toUpperCase(); + }); + + // Coerce string value into JS value + let val = process.env[key]; + if (/^(yes|on|true|enabled)$/i.test(val)) { + val = true; + } else if (/^(no|off|false|disabled)$/i.test(val)) { + val = false; + } else if (val === 'null') { + val = null; + } else { + val = Number(val); + } + + obj[prop] = val; + return obj; +}, {}); + +/** + * Is stdout a TTY? Colored output is enabled when `true`. + */ + +function useColors() { + return 'colors' in exports.inspectOpts ? + Boolean(exports.inspectOpts.colors) : + tty.isatty(process.stderr.fd); +} + +/** + * Adds ANSI color escape codes if enabled. + * + * @api public + */ + +function formatArgs(args) { + const {namespace: name, useColors} = this; + + if (useColors) { + const c = this.color; + const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c); + const prefix = ` ${colorCode};1m${name} \u001B[0m`; + + args[0] = prefix + args[0].split('\n').join('\n' + prefix); + args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m'); + } else { + args[0] = getDate() + name + ' ' + args[0]; + } +} + +function getDate() { + if (exports.inspectOpts.hideDate) { + return ''; + } + return new Date().toISOString() + ' '; +} + +/** + * Invokes `util.format()` with the specified arguments and writes to stderr. + */ + +function log(...args) { + return process.stderr.write(util.format(...args) + '\n'); +} + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + if (namespaces) { + process.env.DEBUG = namespaces; + } else { + // If you set a process.env field to null or undefined, it gets cast to the + // string 'null' or 'undefined'. Just delete instead. + delete process.env.DEBUG; + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ + +function load() { + return process.env.DEBUG; +} + +/** + * Init logic for `debug` instances. + * + * Create a new `inspectOpts` object in case `useColors` is set + * differently for a particular `debug` instance. + */ + +function init(debug) { + debug.inspectOpts = {}; + + const keys = Object.keys(exports.inspectOpts); + for (let i = 0; i < keys.length; i++) { + debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]]; + } +} + +module.exports = __nccwpck_require__(8230)(exports); + +const {formatters} = module.exports; + +/** + * Map %o to `util.inspect()`, all on a single line. + */ + +formatters.o = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts) + .replace(/\s*\n\s*/g, ' '); +}; + +/** + * Map %O to `util.inspect()`, allowing multiple lines if needed. + */ + +formatters.O = function (v) { + this.inspectOpts.colors = this.useColors; + return util.inspect(v, this.inspectOpts); +}; + + +/***/ }), + +/***/ 4263: +/***/ ((module) => { + +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} + + +/***/ }), + +/***/ 8383: +/***/ ((module) => { + +module.exports = eval("require")("fsevents"); + + +/***/ }), + +/***/ 75: +/***/ ((module) => { + +module.exports = eval("require")("supports-color"); + + /***/ }), /***/ 2613: @@ -25590,6 +56079,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("console"); /***/ }), +/***/ 9140: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("constants"); + +/***/ }), + /***/ 6982: /***/ ((module) => { @@ -25737,6 +56233,13 @@ module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tls"); /***/ }), +/***/ 2018: +/***/ ((module) => { + +module.exports = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("tty"); + +/***/ }), + /***/ 7016: /***/ ((module) => { @@ -27383,6 +57886,63 @@ function parseParams (str) { module.exports = parseParams +/***/ }), + +/***/ 1506: +/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { + + + +var possibleNames = __nccwpck_require__(8879); + +var g = typeof globalThis === 'undefined' ? global : globalThis; + +/** @type {import('.')} */ +module.exports = function availableTypedArrays() { + var /** @type {ReturnType} */ out = []; + for (var i = 0; i < possibleNames.length; i++) { + if (typeof g[possibleNames[i]] === 'function') { + // @ts-expect-error + out[out.length] = possibleNames[i]; + } + } + return out; +}; + + +/***/ }), + +/***/ 9272: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => { + +__nccwpck_require__.r(__webpack_exports__); +/* harmony export */ __nccwpck_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) +/* harmony export */ }); +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({"array":"an array","boolean":"a boolean","bug-of-mc":"Due to a bug of Minecraft (%0%), %1%. Please Mojang, fix your game","code-action.block-state-sort-keys":"Sort block state","code-action.command-replaceitem":"Update this command to /item … replace","code-action.fix-file":"Fix all auto-fixable problems in this file","code-action.fix-workspace":"Fix all auto-fixable problems in the workspace","code-action.id-attribute-datafix":"Update this attribute name to 1.16","code-action.add-default-namespace":"Add default namespace","code-action.add-leading-slash":"Add leading slash","code-action.create-undeclared-file":"Create %0% %1% in the same pack","code-action.id-omit-default-namespace":"Omit default namespace","code-action.id-zombified-piglin-datafix":"Change this ID to Zombified Piglin's","code-action.nbt-compound-sort-keys":"Sort NBT compound tag","code-action.nbt-type-to-byte":"Convert to an NBT byte tag","code-action.nbt-type-to-double":"Convert to an NBT double tag","code-action.nbt-type-to-float":"Convert to an NBT float tag","code-action.nbt-type-to-int":"Convert to an NBT int tag","code-action.nbt-type-to-long":"Convert to an NBT long tag","code-action.nbt-type-to-short":"Convert to an NBT short tag","code-action.nbt-uuid-datafix":"Update this UUID to 1.16","code-action.remove-leading-slash":"Remove leading slash","code-action.remove-trailing-separation":"Remove trailing separation","code-action.selector-sort-keys":"Sort selector argument","code-action.string-double-quote":"Quote this string with double quotation marks","code-action.string-single-quote":"Quote this string with single quotation marks","code-action.string-unquote":"Unquote this string","code-action.vector-align-0.0":"Align this vector to block origin","code-action.vector-align-0.5":"Align this vector to block center","comment":"a comment starting with %0%","conjunction.and_2":" and ","conjunction.and_3+_1":", ","conjunction.and_3+_2":", and ","conjunction.or_2":" or ","conjunction.or_3+_1":", ","conjunction.or_3+_2":", or ","datafix.error.command-replaceitem":"/replaceitem was removed in 20w46a (the second snapshot of 1.17) in favour of /item","duplicate-key":"Duplicate key %0%","ending-quote":"an ending quote %0%","entity":"an entity","error.unparseable-content":"Encountered unparseable content","expected":"Expected %0%","expected-got":"Expected %0% but got %1%","float":"a float","float.between":"a float between %0% and %1%","integer":"an integer","integer.between":"an integer between %0% and %1%","invalid-key-combination":"Invalid combination of keys %0%","invalid-regex-pattern":"Invalid regex pattern: %0%","mismatching-regex-pattern":"Value does not match regex: %0%","java-edition.binder.wrong-folder":"Files in the %0% folder are not recognized in loaded version %1%, did you meant to use the %2% folder?","java-edition.binder.wrong-version":"Files in the %0% folder are not recognized in loaded version %1%","java-edition.translation-value.percent-escape-hint":"%0%. If you want to display a literal percent sign, use “%%” instead","json.doc.advancement.display":"Advancement display settings. If present, the advancement will be visible in the advancement tabs.","json.checker.array.length-between":"%0% with length between %1% and %2%","json.checker.object.field.union-empty-members":"Disallowed property","json.checker.item.duplicate":"Duplicate list item","json.checker.property.deprecated":"Property %0% is deprecated","json.checker.property.missing":"Missing property %0%","json.checker.property.unknown":"Unknown property %0%","json.checker.string.hex-color":"a 6-digit hexadecimal number","json.checker.tag-entry.duplicate":"Duplicate tag entry","json.checker.value":"a value","json.node.array":"an array","json.node.boolean":"a boolean","json.node.null":"a null","json.node.number":"a number","json.node.object":"an object","json.node.string":"a string","key-not-following-convention":"Invalid key %0% which doesn't follow %1% convention","linter.diagnostic-message-wrapper":"%0% (rule: %1%)","linter.name-convention.illegal":"Name %0% doesn't match %1%","linter.undeclared-symbol.message":"Cannot find %0% %1%","linter-config-validator.name-convention.type":"Expects a string that contains a regular expression describing the name","linter-config-validator.wrapper":"%0%. See [the documentation](%1) for more information","long":"a long","long.between":"a long between %0% and %1%","mcdoc.binder.dispatcher-statement.duplicated-key":"Duplicated dispatcher case %0%","mcdoc.binder.dispatcher-statement.duplicated-key.related":"%0% has already been dispatched here","mcdoc.binder.duplicated-declaration":"Duplicated declaration for %0%","mcdoc.binder.duplicated-declaration.related":"%0% is already declared here","mcdoc.binder.out-of-root":"File %0% is not under the root directory of any mcdoc project; semantic checking will be skipped","mcdoc.binder.path.super-from-root":"Cannot access super of the project root","mcdoc.binder.path.unknown-identifier":"Identifier %0% does not exist in module %1%","mcdoc.binder.path.unknown-module":"Module %0% does not exist","mcdoc.checker.entry.empty-mod-seg":"You cannot put “mod.mcdoc” under a root directly","mcdoc.checker.inject-clause.unmatched-injection":"Cannot inject %0% with %1%","mcdoc.checker.type-not-assignable":"Type %0% is not assignable to type %1%","mcdoc.node.compound-definition":"a compound definition","mcdoc.node.enum-definition":"an enum definition","mcdoc.node.identifier":"an identifier","mcdoc.parser.compound-definition.field-type":"a field type","mcdoc.parser.float.illegal":"Encountered illegal float number","mcdoc.parser.identifier.reserved-word":"%0% is a reserved word and cannot be used as an identifier name","mcdoc.parser.identifier.illegal":"%0% doesn't follow the format of %1%","mcdoc.parser.index-body.dynamic-index-not-allowed":"Dynamic indexing is not allowed","mcdoc.parser.inject-clause.definition-expected":"Expected either an enum inject or a compound inject","mcdoc.parser.keyword.separation":"a separation","mcdoc.parser.resource-location.colon-expected":"Expected the colon (%0%) of resource locations","mcdoc.parser.syntax.doc-comment-unexpected":"Doc comments are not allowed here; you might want to replace the three slashes with two slashes","mcdoc.runtime.checker.key-value-pair":"a key-value pair","mcdoc.runtime.checker.range.collection":"collection length to be %0%","mcdoc.runtime.checker.range.concat":"%0% and %1%","mcdoc.runtime.checker.range.left-exclusive":"above %0%","mcdoc.runtime.checker.range.left-inclusive":"at least %0%","mcdoc.runtime.checker.range.right-exclusive":"below %0%","mcdoc.runtime.checker.range.right-inclusive":"at most %0%","mcdoc.runtime.checker.range.number":"numeric value to be %0%","mcdoc.runtime.checker.range.string":"string length to be %0%","mcdoc.runtime.checker.some-missing-keys":"Missing at least one of the keys %0%","mcdoc.runtime.checker.trailing":"Trailing data encountered","mcdoc.runtime.checker.value":"a value","mcdoc.type.boolean":"a boolean","mcdoc.type.byte":"a byte","mcdoc.type.short":"a short","mcdoc.type.int":"an int","mcdoc.type.long":"a long","mcdoc.type.float":"a float","mcdoc.type.double":"a double","mcdoc.type.list":"a list","mcdoc.type.byte_array":"a byte array","mcdoc.type.int_array":"an int array","mcdoc.type.long_array":"a long array","mcdoc.type.string":"a string","mcdoc.type.struct":"a map-like","mcfunction.checker.command.data-modify-unapplicable-operation":"Operation %0% can only be used on %1%; the target path has type %2% instead","mcfunction.completer.block.states.default-value":"Default: %0%","mcfunction.parser.command-too-long":"Command with length %0% is longer than maximum length %1%","mcfunction.parser.duplicate-components":"Duplicate component","mcfunction.parser.entity-selector.arguments.not-applicable":"%0% is not applicable here","mcfunction.parser.entity-selector.arguments.unknown":"Unknown entity selector argument %0%","mcfunction.parser.entity-selector.entities-disallowed":"The selector contains non-player entities","mcfunction.parser.entity-selector.invalid":"Invalid entity selector: “%0%”","mcfunction.parser.entity-selector.multiple-disallowed":"The selector contains multiple entities","mcfunction.parser.entity-selector.player-name.too-long":"Player names cannot be longer than %0% characters","mcfunction.parser.eoc-unexpected":"Expected more arguments","mcfunction.parser.leading-slash":"a leading slash “/”","mcfunction.parser.leading-slash.unexpected":"Unexpected leading slash “/”","mcfunction.parser.macro.at-least-one":"at least one macro argument","mcfunction.parser.macro.disallowed":"Macro lines are only supported since 1.20.2","mcfunction.parser.macro.illegal-key":"Illegal key character: “%0%”","mcfunction.parser.macro.key":"a macro key","mcfunction.parser.no-permission":"Permission level %0% is required, which is higher than %1% defined in config","mcfunction.parser.objective.too-long":"Objective names cannot be longer than %0% characters","mcfunction.parser.range.min>max":"The minimum value %0% is larger than the maximum value %1%","mcfunction.parser.range.span-too-large":"The range size %0% is larger than the maximum %1%","mcfunction.parser.range.span-too-small":"The range size %0% is smaller than the minimum %1%","mcfunction.parser.score_holder.fake-name.too-long":"Fake names cannot be longer than %0% characters","mcfunction.parser.sep":"a space (%0%)","mcfunction.parser.trailing":"Trailing data encountered: %0%","mcfunction.parser.unknown-parser":"Parser %0% hasn't been supported yet","mcfunction.parser.uuid.invalid":"Invalid UUID format","mcfunction.parser.vector.local-disallowed":"Local coordinates disallowed","mcfunction.parser.vector.mixed":"Cannot mix local coordinates and world coordinates together","mcfunction.signature-help.command-documentation":"[Minecraft Wiki: `%0%` command](https://minecraft.fandom.com/wiki/Commands/%0%)","mcfunction.signature-help.argument-parser-documentation":"[Minecraft Wiki: `%0%` argument parser](https://minecraft.fandom.com/wiki/Argument_types#%0%)","missing-key":"Missing key %0%","nbt.checker.block-states.fake-boolean":"Boolean block state values should be quoted","nbt.checker.block-states.unexpected-value-type":"Block state values should be either a string or an int","nbt.checker.block-states.unknown-state":"Unknown block state %0% for the following block(s): %1%","nbt.checker.boolean.out-of-range":"A boolean value should be either %0% or %1%","nbt.checker.collection.length-between":"%0% with length between %1% and %2%","nbt.checker.compound.field.union-empty-members":"Disallowed property","nbt.checker.path.index-out-of-bound":"The provided index %0% is out of bound, as the collection can only have at most %1% elements","nbt.checker.path.unexpected-filter":"Compound filters can only be used on compound tags","nbt.checker.path.unexpected-index":"Indices can only be used on array or list tags","nbt.checker.path.unexpected-key":"String keys can only be specified for compound tags","nbt.node":"a tag","nbt.node.byte":"a byte tag","nbt.node.byte_array":"a byte array tag","nbt.node.compound":"a compound tag","nbt.node.double":"a double tag","nbt.node.float":"a float tag","nbt.node.int":"an int tag","nbt.node.int_array":"an int array tag","nbt.node.list":"a list tag","nbt.node.long":"a long tag","nbt.node.long_array":"a long array tag","nbt.node.path.end":"the end of path","nbt.node.path.filter":"a compound filter","nbt.node.path.index":"an index","nbt.node.path.key":"a key","nbt.node.short":"a short tag","nbt.node.string":"a string tag","nbt.path":"an NBT path","nbt.parser.number.out-of-range":"This looks like %0%, but it is actually %1% due to the numeral value being out of [%2%, %3%]","not-allowed-here":"Value %0% is not allowed here","not-divisible-by":"Value %0% is not divisible by %1%","not-matching-any-child":"Invalid argument type","nothing":"nothing","number":"a number","number-range":"a number range","number-range.missing-min-and-max":"Expected either a minimum value or a maximum value","number.<=":"a number smaller than or equal to %0%","number.>=":"a number greater than or equal to %0%","number.between":"a number between %0% and %1%","object":"an object","objective":"an objective","objective-not-following-convention":"Invalid objective %0% which doesn't follow %1% convention","parser.float.illegal":"Illegal float numeral that doesn't follow %0%","parser.integer.illegal":"Illegal integer that doesn't follow %0%","parser.line-continuation-end-of-file":"A line continuation cannot be the end of the file","parser.list.value":"a value","parser.list.trailing-sep":"Trailing separation","parser.long.illegal":"Illegal long numeral that doesn't follow %0%","parser.record.key":"a key","parser.record.trailing-end":"Trailing separation","parser.record.unexpected-char":"Unexpected character %0%","parser.record.value":"a value","parser.resource-location.illegal":"Illegal character(s): %0%","parser.resource-location.namespace-expected":"Namespaces cannot be omitted here","parser.resource-location.tag-disallowed":"Tags are not allowed here","parser.resource-location.tag-required":"Only tags are allowed here","parser.string.illegal-brigadier":"Encountered non-[0-9A-Za-z_.+-] characters in %0%","parser.string.illegal-escape":"Unexpected escape character %0%","parser.string.illegal-quote":"Only %0% can be used to quote strings here","parser.string.illegal-unicode-escape":"Hexadecimal digit expected","progress.initializing.title":"Initializing Spyglass…","progress.reset-project-cache.title":"Resetting Project Cache…","punc.period":".","punc.quote":"“%0%”","quote":"a quote (“'” or “\"”)","quote_prefer_double":"Double quote (“\"”) is preferable here","quote_prefer_single":"Single quote (“'”) is preferable here","resource-location":"a resource location","score-holder":"a score holder","scoreholder-not-following-convention":"Invalid score_holder %0% which doesn't follow %1% convention","selector":"a selector","server.new-version":"The Data-pack Language Server has been updated to a newer version: %0%","server.progress.fixing-workspace.begin":"Fixing all auto-fixable problems in the workspace","server.progress.fixing-workspace.report":"fixing %0%","server.progress.preparing.title":"Preparing Spyglass language features","server.remove-cache-file":"The cache file of DHP was moved to a storage location provided by VSCode. You can safely delete the ugly “.datapack” folder in your workspace root.","server.show-release-notes":"Show Release Notes","string":"a string","tag":"a tag","tag-not-following-convention":"Invalid tag %0% which doesn't follow %1% convention","team":"a team","team-not-following-convention":"Invalid team %0% which doesn't follow %1% convention","text-component":"a text component","time-unit":"a time unit","too-many-block-affected":"Too many blocks in the specified area (maximum %0%, specified %1%)","too-many-chunk-affected":"Too many chunks in the specified area (maximum %0%, specified %1%)","unexpected-character":"Found non [a-z0-9/._-] character(s)","unexpected-datapack-tag":"Tags are not allowed here","unexpected-default-namespace":"Default namespace should be omitted here","unexpected-local-coordinate":"Local coordinate %0% is not allowed","unexpected-nbt":"This tag doesn't exist here","unexpected-nbt-array-type":"Invalid array type %0%. Should be one of “B”, “I”, and “L”","unexpected-nbt-path-filter":"Compound filters are only used for compound tags","unexpected-nbt-path-index":"Indices are only used for lists/arrays tags","unexpected-nbt-path-key":"Keys are only used for compound tags","unexpected-nbt-path-sub":"The current tag doesn't have extra items","unexpected-omitted-default-namespace":"Default namespace shouldn't be omitted here","unexpected-relative-coordinate":"Relative coordinate %0% is not allowed","unexpected-scoreboard-sub-slot":"Only “sidebar” has sub slots","unknown-command":"Unknown command %0%","unknown-escape":"Unexpected escape character %0%","unknown-key":"Unknown key %0%","unquoted-string":"an unquoted string","unsorted-keys":"Unsorted keys","uuid":"a UUID","vector":"a vector"}); + + +/***/ }), + +/***/ 6548: +/***/ ((module) => { + +module.exports = /*#__PURE__*/JSON.parse('["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]'); + +/***/ }), + +/***/ 5302: +/***/ ((module) => { + +module.exports = /*#__PURE__*/JSON.parse('{"name":"seek-bzip","version":"1.0.6","contributors":["C. Scott Ananian (http://cscott.net)","Eli Skeggs","Kevin Kwok","Rob Landley (http://landley.net)"],"description":"a pure-JavaScript Node.JS module for random-access decoding bzip2 data","main":"./lib/index.js","repository":{"type":"git","url":"https://github.com/cscott/seek-bzip.git"},"license":"MIT","bin":{"seek-bunzip":"./bin/seek-bunzip","seek-table":"./bin/seek-bzip-table"},"directories":{"test":"test"},"dependencies":{"commander":"^2.8.1"},"devDependencies":{"fibers":"~1.0.6","mocha":"~2.2.5"},"scripts":{"test":"mocha"}}'); + +/***/ }), + +/***/ 2472: +/***/ ((module) => { + +module.exports = /*#__PURE__*/JSON.parse('[[[0,44],2],[[45,46],2],[47,2],[[48,57],2],[[58,64],2],[65,1,"a"],[66,1,"b"],[67,1,"c"],[68,1,"d"],[69,1,"e"],[70,1,"f"],[71,1,"g"],[72,1,"h"],[73,1,"i"],[74,1,"j"],[75,1,"k"],[76,1,"l"],[77,1,"m"],[78,1,"n"],[79,1,"o"],[80,1,"p"],[81,1,"q"],[82,1,"r"],[83,1,"s"],[84,1,"t"],[85,1,"u"],[86,1,"v"],[87,1,"w"],[88,1,"x"],[89,1,"y"],[90,1,"z"],[[91,96],2],[[97,122],2],[[123,127],2],[[128,159],3],[160,1," "],[[161,167],2],[168,1," ̈"],[169,2],[170,1,"a"],[[171,172],2],[173,7],[174,2],[175,1," ̄"],[[176,177],2],[178,1,"2"],[179,1,"3"],[180,1," ́"],[181,1,"μ"],[182,2],[183,2],[184,1," ̧"],[185,1,"1"],[186,1,"o"],[187,2],[188,1,"1⁄4"],[189,1,"1⁄2"],[190,1,"3⁄4"],[191,2],[192,1,"à"],[193,1,"á"],[194,1,"â"],[195,1,"ã"],[196,1,"ä"],[197,1,"å"],[198,1,"æ"],[199,1,"ç"],[200,1,"è"],[201,1,"é"],[202,1,"ê"],[203,1,"ë"],[204,1,"ì"],[205,1,"í"],[206,1,"î"],[207,1,"ï"],[208,1,"ð"],[209,1,"ñ"],[210,1,"ò"],[211,1,"ó"],[212,1,"ô"],[213,1,"õ"],[214,1,"ö"],[215,2],[216,1,"ø"],[217,1,"ù"],[218,1,"ú"],[219,1,"û"],[220,1,"ü"],[221,1,"ý"],[222,1,"þ"],[223,6,"ss"],[[224,246],2],[247,2],[[248,255],2],[256,1,"ā"],[257,2],[258,1,"ă"],[259,2],[260,1,"ą"],[261,2],[262,1,"ć"],[263,2],[264,1,"ĉ"],[265,2],[266,1,"ċ"],[267,2],[268,1,"č"],[269,2],[270,1,"ď"],[271,2],[272,1,"đ"],[273,2],[274,1,"ē"],[275,2],[276,1,"ĕ"],[277,2],[278,1,"ė"],[279,2],[280,1,"ę"],[281,2],[282,1,"ě"],[283,2],[284,1,"ĝ"],[285,2],[286,1,"ğ"],[287,2],[288,1,"ġ"],[289,2],[290,1,"ģ"],[291,2],[292,1,"ĥ"],[293,2],[294,1,"ħ"],[295,2],[296,1,"ĩ"],[297,2],[298,1,"ī"],[299,2],[300,1,"ĭ"],[301,2],[302,1,"į"],[303,2],[304,1,"i̇"],[305,2],[[306,307],1,"ij"],[308,1,"ĵ"],[309,2],[310,1,"ķ"],[[311,312],2],[313,1,"ĺ"],[314,2],[315,1,"ļ"],[316,2],[317,1,"ľ"],[318,2],[[319,320],1,"l·"],[321,1,"ł"],[322,2],[323,1,"ń"],[324,2],[325,1,"ņ"],[326,2],[327,1,"ň"],[328,2],[329,1,"ʼn"],[330,1,"ŋ"],[331,2],[332,1,"ō"],[333,2],[334,1,"ŏ"],[335,2],[336,1,"ő"],[337,2],[338,1,"œ"],[339,2],[340,1,"ŕ"],[341,2],[342,1,"ŗ"],[343,2],[344,1,"ř"],[345,2],[346,1,"ś"],[347,2],[348,1,"ŝ"],[349,2],[350,1,"ş"],[351,2],[352,1,"š"],[353,2],[354,1,"ţ"],[355,2],[356,1,"ť"],[357,2],[358,1,"ŧ"],[359,2],[360,1,"ũ"],[361,2],[362,1,"ū"],[363,2],[364,1,"ŭ"],[365,2],[366,1,"ů"],[367,2],[368,1,"ű"],[369,2],[370,1,"ų"],[371,2],[372,1,"ŵ"],[373,2],[374,1,"ŷ"],[375,2],[376,1,"ÿ"],[377,1,"ź"],[378,2],[379,1,"ż"],[380,2],[381,1,"ž"],[382,2],[383,1,"s"],[384,2],[385,1,"ɓ"],[386,1,"ƃ"],[387,2],[388,1,"ƅ"],[389,2],[390,1,"ɔ"],[391,1,"ƈ"],[392,2],[393,1,"ɖ"],[394,1,"ɗ"],[395,1,"ƌ"],[[396,397],2],[398,1,"ǝ"],[399,1,"ə"],[400,1,"ɛ"],[401,1,"ƒ"],[402,2],[403,1,"ɠ"],[404,1,"ɣ"],[405,2],[406,1,"ɩ"],[407,1,"ɨ"],[408,1,"ƙ"],[[409,411],2],[412,1,"ɯ"],[413,1,"ɲ"],[414,2],[415,1,"ɵ"],[416,1,"ơ"],[417,2],[418,1,"ƣ"],[419,2],[420,1,"ƥ"],[421,2],[422,1,"ʀ"],[423,1,"ƨ"],[424,2],[425,1,"ʃ"],[[426,427],2],[428,1,"ƭ"],[429,2],[430,1,"ʈ"],[431,1,"ư"],[432,2],[433,1,"ʊ"],[434,1,"ʋ"],[435,1,"ƴ"],[436,2],[437,1,"ƶ"],[438,2],[439,1,"ʒ"],[440,1,"ƹ"],[[441,443],2],[444,1,"ƽ"],[[445,451],2],[[452,454],1,"dž"],[[455,457],1,"lj"],[[458,460],1,"nj"],[461,1,"ǎ"],[462,2],[463,1,"ǐ"],[464,2],[465,1,"ǒ"],[466,2],[467,1,"ǔ"],[468,2],[469,1,"ǖ"],[470,2],[471,1,"ǘ"],[472,2],[473,1,"ǚ"],[474,2],[475,1,"ǜ"],[[476,477],2],[478,1,"ǟ"],[479,2],[480,1,"ǡ"],[481,2],[482,1,"ǣ"],[483,2],[484,1,"ǥ"],[485,2],[486,1,"ǧ"],[487,2],[488,1,"ǩ"],[489,2],[490,1,"ǫ"],[491,2],[492,1,"ǭ"],[493,2],[494,1,"ǯ"],[[495,496],2],[[497,499],1,"dz"],[500,1,"ǵ"],[501,2],[502,1,"ƕ"],[503,1,"ƿ"],[504,1,"ǹ"],[505,2],[506,1,"ǻ"],[507,2],[508,1,"ǽ"],[509,2],[510,1,"ǿ"],[511,2],[512,1,"ȁ"],[513,2],[514,1,"ȃ"],[515,2],[516,1,"ȅ"],[517,2],[518,1,"ȇ"],[519,2],[520,1,"ȉ"],[521,2],[522,1,"ȋ"],[523,2],[524,1,"ȍ"],[525,2],[526,1,"ȏ"],[527,2],[528,1,"ȑ"],[529,2],[530,1,"ȓ"],[531,2],[532,1,"ȕ"],[533,2],[534,1,"ȗ"],[535,2],[536,1,"ș"],[537,2],[538,1,"ț"],[539,2],[540,1,"ȝ"],[541,2],[542,1,"ȟ"],[543,2],[544,1,"ƞ"],[545,2],[546,1,"ȣ"],[547,2],[548,1,"ȥ"],[549,2],[550,1,"ȧ"],[551,2],[552,1,"ȩ"],[553,2],[554,1,"ȫ"],[555,2],[556,1,"ȭ"],[557,2],[558,1,"ȯ"],[559,2],[560,1,"ȱ"],[561,2],[562,1,"ȳ"],[563,2],[[564,566],2],[[567,569],2],[570,1,"ⱥ"],[571,1,"ȼ"],[572,2],[573,1,"ƚ"],[574,1,"ⱦ"],[[575,576],2],[577,1,"ɂ"],[578,2],[579,1,"ƀ"],[580,1,"ʉ"],[581,1,"ʌ"],[582,1,"ɇ"],[583,2],[584,1,"ɉ"],[585,2],[586,1,"ɋ"],[587,2],[588,1,"ɍ"],[589,2],[590,1,"ɏ"],[591,2],[[592,680],2],[[681,685],2],[[686,687],2],[688,1,"h"],[689,1,"ɦ"],[690,1,"j"],[691,1,"r"],[692,1,"ɹ"],[693,1,"ɻ"],[694,1,"ʁ"],[695,1,"w"],[696,1,"y"],[[697,705],2],[[706,709],2],[[710,721],2],[[722,727],2],[728,1," ̆"],[729,1," ̇"],[730,1," ̊"],[731,1," ̨"],[732,1," ̃"],[733,1," ̋"],[734,2],[735,2],[736,1,"ɣ"],[737,1,"l"],[738,1,"s"],[739,1,"x"],[740,1,"ʕ"],[[741,745],2],[[746,747],2],[748,2],[749,2],[750,2],[[751,767],2],[[768,831],2],[832,1,"̀"],[833,1,"́"],[834,2],[835,1,"̓"],[836,1,"̈́"],[837,1,"ι"],[[838,846],2],[847,7],[[848,855],2],[[856,860],2],[[861,863],2],[[864,865],2],[866,2],[[867,879],2],[880,1,"ͱ"],[881,2],[882,1,"ͳ"],[883,2],[884,1,"ʹ"],[885,2],[886,1,"ͷ"],[887,2],[[888,889],3],[890,1," ι"],[[891,893],2],[894,1,";"],[895,1,"ϳ"],[[896,899],3],[900,1," ́"],[901,1," ̈́"],[902,1,"ά"],[903,1,"·"],[904,1,"έ"],[905,1,"ή"],[906,1,"ί"],[907,3],[908,1,"ό"],[909,3],[910,1,"ύ"],[911,1,"ώ"],[912,2],[913,1,"α"],[914,1,"β"],[915,1,"γ"],[916,1,"δ"],[917,1,"ε"],[918,1,"ζ"],[919,1,"η"],[920,1,"θ"],[921,1,"ι"],[922,1,"κ"],[923,1,"λ"],[924,1,"μ"],[925,1,"ν"],[926,1,"ξ"],[927,1,"ο"],[928,1,"π"],[929,1,"ρ"],[930,3],[931,1,"σ"],[932,1,"τ"],[933,1,"υ"],[934,1,"φ"],[935,1,"χ"],[936,1,"ψ"],[937,1,"ω"],[938,1,"ϊ"],[939,1,"ϋ"],[[940,961],2],[962,6,"σ"],[[963,974],2],[975,1,"ϗ"],[976,1,"β"],[977,1,"θ"],[978,1,"υ"],[979,1,"ύ"],[980,1,"ϋ"],[981,1,"φ"],[982,1,"π"],[983,2],[984,1,"ϙ"],[985,2],[986,1,"ϛ"],[987,2],[988,1,"ϝ"],[989,2],[990,1,"ϟ"],[991,2],[992,1,"ϡ"],[993,2],[994,1,"ϣ"],[995,2],[996,1,"ϥ"],[997,2],[998,1,"ϧ"],[999,2],[1000,1,"ϩ"],[1001,2],[1002,1,"ϫ"],[1003,2],[1004,1,"ϭ"],[1005,2],[1006,1,"ϯ"],[1007,2],[1008,1,"κ"],[1009,1,"ρ"],[1010,1,"σ"],[1011,2],[1012,1,"θ"],[1013,1,"ε"],[1014,2],[1015,1,"ϸ"],[1016,2],[1017,1,"σ"],[1018,1,"ϻ"],[1019,2],[1020,2],[1021,1,"ͻ"],[1022,1,"ͼ"],[1023,1,"ͽ"],[1024,1,"ѐ"],[1025,1,"ё"],[1026,1,"ђ"],[1027,1,"ѓ"],[1028,1,"є"],[1029,1,"ѕ"],[1030,1,"і"],[1031,1,"ї"],[1032,1,"ј"],[1033,1,"љ"],[1034,1,"њ"],[1035,1,"ћ"],[1036,1,"ќ"],[1037,1,"ѝ"],[1038,1,"ў"],[1039,1,"џ"],[1040,1,"а"],[1041,1,"б"],[1042,1,"в"],[1043,1,"г"],[1044,1,"д"],[1045,1,"е"],[1046,1,"ж"],[1047,1,"з"],[1048,1,"и"],[1049,1,"й"],[1050,1,"к"],[1051,1,"л"],[1052,1,"м"],[1053,1,"н"],[1054,1,"о"],[1055,1,"п"],[1056,1,"р"],[1057,1,"с"],[1058,1,"т"],[1059,1,"у"],[1060,1,"ф"],[1061,1,"х"],[1062,1,"ц"],[1063,1,"ч"],[1064,1,"ш"],[1065,1,"щ"],[1066,1,"ъ"],[1067,1,"ы"],[1068,1,"ь"],[1069,1,"э"],[1070,1,"ю"],[1071,1,"я"],[[1072,1103],2],[1104,2],[[1105,1116],2],[1117,2],[[1118,1119],2],[1120,1,"ѡ"],[1121,2],[1122,1,"ѣ"],[1123,2],[1124,1,"ѥ"],[1125,2],[1126,1,"ѧ"],[1127,2],[1128,1,"ѩ"],[1129,2],[1130,1,"ѫ"],[1131,2],[1132,1,"ѭ"],[1133,2],[1134,1,"ѯ"],[1135,2],[1136,1,"ѱ"],[1137,2],[1138,1,"ѳ"],[1139,2],[1140,1,"ѵ"],[1141,2],[1142,1,"ѷ"],[1143,2],[1144,1,"ѹ"],[1145,2],[1146,1,"ѻ"],[1147,2],[1148,1,"ѽ"],[1149,2],[1150,1,"ѿ"],[1151,2],[1152,1,"ҁ"],[1153,2],[1154,2],[[1155,1158],2],[1159,2],[[1160,1161],2],[1162,1,"ҋ"],[1163,2],[1164,1,"ҍ"],[1165,2],[1166,1,"ҏ"],[1167,2],[1168,1,"ґ"],[1169,2],[1170,1,"ғ"],[1171,2],[1172,1,"ҕ"],[1173,2],[1174,1,"җ"],[1175,2],[1176,1,"ҙ"],[1177,2],[1178,1,"қ"],[1179,2],[1180,1,"ҝ"],[1181,2],[1182,1,"ҟ"],[1183,2],[1184,1,"ҡ"],[1185,2],[1186,1,"ң"],[1187,2],[1188,1,"ҥ"],[1189,2],[1190,1,"ҧ"],[1191,2],[1192,1,"ҩ"],[1193,2],[1194,1,"ҫ"],[1195,2],[1196,1,"ҭ"],[1197,2],[1198,1,"ү"],[1199,2],[1200,1,"ұ"],[1201,2],[1202,1,"ҳ"],[1203,2],[1204,1,"ҵ"],[1205,2],[1206,1,"ҷ"],[1207,2],[1208,1,"ҹ"],[1209,2],[1210,1,"һ"],[1211,2],[1212,1,"ҽ"],[1213,2],[1214,1,"ҿ"],[1215,2],[1216,1,"ӏ"],[1217,1,"ӂ"],[1218,2],[1219,1,"ӄ"],[1220,2],[1221,1,"ӆ"],[1222,2],[1223,1,"ӈ"],[1224,2],[1225,1,"ӊ"],[1226,2],[1227,1,"ӌ"],[1228,2],[1229,1,"ӎ"],[1230,2],[1231,2],[1232,1,"ӑ"],[1233,2],[1234,1,"ӓ"],[1235,2],[1236,1,"ӕ"],[1237,2],[1238,1,"ӗ"],[1239,2],[1240,1,"ә"],[1241,2],[1242,1,"ӛ"],[1243,2],[1244,1,"ӝ"],[1245,2],[1246,1,"ӟ"],[1247,2],[1248,1,"ӡ"],[1249,2],[1250,1,"ӣ"],[1251,2],[1252,1,"ӥ"],[1253,2],[1254,1,"ӧ"],[1255,2],[1256,1,"ө"],[1257,2],[1258,1,"ӫ"],[1259,2],[1260,1,"ӭ"],[1261,2],[1262,1,"ӯ"],[1263,2],[1264,1,"ӱ"],[1265,2],[1266,1,"ӳ"],[1267,2],[1268,1,"ӵ"],[1269,2],[1270,1,"ӷ"],[1271,2],[1272,1,"ӹ"],[1273,2],[1274,1,"ӻ"],[1275,2],[1276,1,"ӽ"],[1277,2],[1278,1,"ӿ"],[1279,2],[1280,1,"ԁ"],[1281,2],[1282,1,"ԃ"],[1283,2],[1284,1,"ԅ"],[1285,2],[1286,1,"ԇ"],[1287,2],[1288,1,"ԉ"],[1289,2],[1290,1,"ԋ"],[1291,2],[1292,1,"ԍ"],[1293,2],[1294,1,"ԏ"],[1295,2],[1296,1,"ԑ"],[1297,2],[1298,1,"ԓ"],[1299,2],[1300,1,"ԕ"],[1301,2],[1302,1,"ԗ"],[1303,2],[1304,1,"ԙ"],[1305,2],[1306,1,"ԛ"],[1307,2],[1308,1,"ԝ"],[1309,2],[1310,1,"ԟ"],[1311,2],[1312,1,"ԡ"],[1313,2],[1314,1,"ԣ"],[1315,2],[1316,1,"ԥ"],[1317,2],[1318,1,"ԧ"],[1319,2],[1320,1,"ԩ"],[1321,2],[1322,1,"ԫ"],[1323,2],[1324,1,"ԭ"],[1325,2],[1326,1,"ԯ"],[1327,2],[1328,3],[1329,1,"ա"],[1330,1,"բ"],[1331,1,"գ"],[1332,1,"դ"],[1333,1,"ե"],[1334,1,"զ"],[1335,1,"է"],[1336,1,"ը"],[1337,1,"թ"],[1338,1,"ժ"],[1339,1,"ի"],[1340,1,"լ"],[1341,1,"խ"],[1342,1,"ծ"],[1343,1,"կ"],[1344,1,"հ"],[1345,1,"ձ"],[1346,1,"ղ"],[1347,1,"ճ"],[1348,1,"մ"],[1349,1,"յ"],[1350,1,"ն"],[1351,1,"շ"],[1352,1,"ո"],[1353,1,"չ"],[1354,1,"պ"],[1355,1,"ջ"],[1356,1,"ռ"],[1357,1,"ս"],[1358,1,"վ"],[1359,1,"տ"],[1360,1,"ր"],[1361,1,"ց"],[1362,1,"ւ"],[1363,1,"փ"],[1364,1,"ք"],[1365,1,"օ"],[1366,1,"ֆ"],[[1367,1368],3],[1369,2],[[1370,1375],2],[1376,2],[[1377,1414],2],[1415,1,"եւ"],[1416,2],[1417,2],[1418,2],[[1419,1420],3],[[1421,1422],2],[1423,2],[1424,3],[[1425,1441],2],[1442,2],[[1443,1455],2],[[1456,1465],2],[1466,2],[[1467,1469],2],[1470,2],[1471,2],[1472,2],[[1473,1474],2],[1475,2],[1476,2],[1477,2],[1478,2],[1479,2],[[1480,1487],3],[[1488,1514],2],[[1515,1518],3],[1519,2],[[1520,1524],2],[[1525,1535],3],[[1536,1539],3],[1540,3],[1541,3],[[1542,1546],2],[1547,2],[1548,2],[[1549,1551],2],[[1552,1557],2],[[1558,1562],2],[1563,2],[1564,3],[1565,2],[1566,2],[1567,2],[1568,2],[[1569,1594],2],[[1595,1599],2],[1600,2],[[1601,1618],2],[[1619,1621],2],[[1622,1624],2],[[1625,1630],2],[1631,2],[[1632,1641],2],[[1642,1645],2],[[1646,1647],2],[[1648,1652],2],[1653,1,"اٴ"],[1654,1,"وٴ"],[1655,1,"ۇٴ"],[1656,1,"يٴ"],[[1657,1719],2],[[1720,1721],2],[[1722,1726],2],[1727,2],[[1728,1742],2],[1743,2],[[1744,1747],2],[1748,2],[[1749,1756],2],[1757,3],[1758,2],[[1759,1768],2],[1769,2],[[1770,1773],2],[[1774,1775],2],[[1776,1785],2],[[1786,1790],2],[1791,2],[[1792,1805],2],[1806,3],[1807,3],[[1808,1836],2],[[1837,1839],2],[[1840,1866],2],[[1867,1868],3],[[1869,1871],2],[[1872,1901],2],[[1902,1919],2],[[1920,1968],2],[1969,2],[[1970,1983],3],[[1984,2037],2],[[2038,2042],2],[[2043,2044],3],[2045,2],[[2046,2047],2],[[2048,2093],2],[[2094,2095],3],[[2096,2110],2],[2111,3],[[2112,2139],2],[[2140,2141],3],[2142,2],[2143,3],[[2144,2154],2],[[2155,2159],3],[[2160,2183],2],[2184,2],[[2185,2190],2],[2191,3],[[2192,2193],3],[[2194,2198],3],[2199,2],[[2200,2207],2],[2208,2],[2209,2],[[2210,2220],2],[[2221,2226],2],[[2227,2228],2],[2229,2],[[2230,2237],2],[[2238,2247],2],[[2248,2258],2],[2259,2],[[2260,2273],2],[2274,3],[2275,2],[[2276,2302],2],[2303,2],[2304,2],[[2305,2307],2],[2308,2],[[2309,2361],2],[[2362,2363],2],[[2364,2381],2],[2382,2],[2383,2],[[2384,2388],2],[2389,2],[[2390,2391],2],[2392,1,"क़"],[2393,1,"ख़"],[2394,1,"ग़"],[2395,1,"ज़"],[2396,1,"ड़"],[2397,1,"ढ़"],[2398,1,"फ़"],[2399,1,"य़"],[[2400,2403],2],[[2404,2405],2],[[2406,2415],2],[2416,2],[[2417,2418],2],[[2419,2423],2],[2424,2],[[2425,2426],2],[[2427,2428],2],[2429,2],[[2430,2431],2],[2432,2],[[2433,2435],2],[2436,3],[[2437,2444],2],[[2445,2446],3],[[2447,2448],2],[[2449,2450],3],[[2451,2472],2],[2473,3],[[2474,2480],2],[2481,3],[2482,2],[[2483,2485],3],[[2486,2489],2],[[2490,2491],3],[2492,2],[2493,2],[[2494,2500],2],[[2501,2502],3],[[2503,2504],2],[[2505,2506],3],[[2507,2509],2],[2510,2],[[2511,2518],3],[2519,2],[[2520,2523],3],[2524,1,"ড়"],[2525,1,"ঢ়"],[2526,3],[2527,1,"য়"],[[2528,2531],2],[[2532,2533],3],[[2534,2545],2],[[2546,2554],2],[2555,2],[2556,2],[2557,2],[2558,2],[[2559,2560],3],[2561,2],[2562,2],[2563,2],[2564,3],[[2565,2570],2],[[2571,2574],3],[[2575,2576],2],[[2577,2578],3],[[2579,2600],2],[2601,3],[[2602,2608],2],[2609,3],[2610,2],[2611,1,"ਲ਼"],[2612,3],[2613,2],[2614,1,"ਸ਼"],[2615,3],[[2616,2617],2],[[2618,2619],3],[2620,2],[2621,3],[[2622,2626],2],[[2627,2630],3],[[2631,2632],2],[[2633,2634],3],[[2635,2637],2],[[2638,2640],3],[2641,2],[[2642,2648],3],[2649,1,"ਖ਼"],[2650,1,"ਗ਼"],[2651,1,"ਜ਼"],[2652,2],[2653,3],[2654,1,"ਫ਼"],[[2655,2661],3],[[2662,2676],2],[2677,2],[2678,2],[[2679,2688],3],[[2689,2691],2],[2692,3],[[2693,2699],2],[2700,2],[2701,2],[2702,3],[[2703,2705],2],[2706,3],[[2707,2728],2],[2729,3],[[2730,2736],2],[2737,3],[[2738,2739],2],[2740,3],[[2741,2745],2],[[2746,2747],3],[[2748,2757],2],[2758,3],[[2759,2761],2],[2762,3],[[2763,2765],2],[[2766,2767],3],[2768,2],[[2769,2783],3],[2784,2],[[2785,2787],2],[[2788,2789],3],[[2790,2799],2],[2800,2],[2801,2],[[2802,2808],3],[2809,2],[[2810,2815],2],[2816,3],[[2817,2819],2],[2820,3],[[2821,2828],2],[[2829,2830],3],[[2831,2832],2],[[2833,2834],3],[[2835,2856],2],[2857,3],[[2858,2864],2],[2865,3],[[2866,2867],2],[2868,3],[2869,2],[[2870,2873],2],[[2874,2875],3],[[2876,2883],2],[2884,2],[[2885,2886],3],[[2887,2888],2],[[2889,2890],3],[[2891,2893],2],[[2894,2900],3],[2901,2],[[2902,2903],2],[[2904,2907],3],[2908,1,"ଡ଼"],[2909,1,"ଢ଼"],[2910,3],[[2911,2913],2],[[2914,2915],2],[[2916,2917],3],[[2918,2927],2],[2928,2],[2929,2],[[2930,2935],2],[[2936,2945],3],[[2946,2947],2],[2948,3],[[2949,2954],2],[[2955,2957],3],[[2958,2960],2],[2961,3],[[2962,2965],2],[[2966,2968],3],[[2969,2970],2],[2971,3],[2972,2],[2973,3],[[2974,2975],2],[[2976,2978],3],[[2979,2980],2],[[2981,2983],3],[[2984,2986],2],[[2987,2989],3],[[2990,2997],2],[2998,2],[[2999,3001],2],[[3002,3005],3],[[3006,3010],2],[[3011,3013],3],[[3014,3016],2],[3017,3],[[3018,3021],2],[[3022,3023],3],[3024,2],[[3025,3030],3],[3031,2],[[3032,3045],3],[3046,2],[[3047,3055],2],[[3056,3058],2],[[3059,3066],2],[[3067,3071],3],[3072,2],[[3073,3075],2],[3076,2],[[3077,3084],2],[3085,3],[[3086,3088],2],[3089,3],[[3090,3112],2],[3113,3],[[3114,3123],2],[3124,2],[[3125,3129],2],[[3130,3131],3],[3132,2],[3133,2],[[3134,3140],2],[3141,3],[[3142,3144],2],[3145,3],[[3146,3149],2],[[3150,3156],3],[[3157,3158],2],[3159,3],[[3160,3161],2],[3162,2],[[3163,3164],3],[3165,2],[[3166,3167],3],[[3168,3169],2],[[3170,3171],2],[[3172,3173],3],[[3174,3183],2],[[3184,3190],3],[3191,2],[[3192,3199],2],[3200,2],[3201,2],[[3202,3203],2],[3204,2],[[3205,3212],2],[3213,3],[[3214,3216],2],[3217,3],[[3218,3240],2],[3241,3],[[3242,3251],2],[3252,3],[[3253,3257],2],[[3258,3259],3],[[3260,3261],2],[[3262,3268],2],[3269,3],[[3270,3272],2],[3273,3],[[3274,3277],2],[[3278,3284],3],[[3285,3286],2],[[3287,3292],3],[3293,2],[3294,2],[3295,3],[[3296,3297],2],[[3298,3299],2],[[3300,3301],3],[[3302,3311],2],[3312,3],[[3313,3314],2],[3315,2],[[3316,3327],3],[3328,2],[3329,2],[[3330,3331],2],[3332,2],[[3333,3340],2],[3341,3],[[3342,3344],2],[3345,3],[[3346,3368],2],[3369,2],[[3370,3385],2],[3386,2],[[3387,3388],2],[3389,2],[[3390,3395],2],[3396,2],[3397,3],[[3398,3400],2],[3401,3],[[3402,3405],2],[3406,2],[3407,2],[[3408,3411],3],[[3412,3414],2],[3415,2],[[3416,3422],2],[3423,2],[[3424,3425],2],[[3426,3427],2],[[3428,3429],3],[[3430,3439],2],[[3440,3445],2],[[3446,3448],2],[3449,2],[[3450,3455],2],[3456,3],[3457,2],[[3458,3459],2],[3460,3],[[3461,3478],2],[[3479,3481],3],[[3482,3505],2],[3506,3],[[3507,3515],2],[3516,3],[3517,2],[[3518,3519],3],[[3520,3526],2],[[3527,3529],3],[3530,2],[[3531,3534],3],[[3535,3540],2],[3541,3],[3542,2],[3543,3],[[3544,3551],2],[[3552,3557],3],[[3558,3567],2],[[3568,3569],3],[[3570,3571],2],[3572,2],[[3573,3584],3],[[3585,3634],2],[3635,1,"ํา"],[[3636,3642],2],[[3643,3646],3],[3647,2],[[3648,3662],2],[3663,2],[[3664,3673],2],[[3674,3675],2],[[3676,3712],3],[[3713,3714],2],[3715,3],[3716,2],[3717,3],[3718,2],[[3719,3720],2],[3721,2],[3722,2],[3723,3],[3724,2],[3725,2],[[3726,3731],2],[[3732,3735],2],[3736,2],[[3737,3743],2],[3744,2],[[3745,3747],2],[3748,3],[3749,2],[3750,3],[3751,2],[[3752,3753],2],[[3754,3755],2],[3756,2],[[3757,3762],2],[3763,1,"ໍາ"],[[3764,3769],2],[3770,2],[[3771,3773],2],[[3774,3775],3],[[3776,3780],2],[3781,3],[3782,2],[3783,3],[[3784,3789],2],[3790,2],[3791,3],[[3792,3801],2],[[3802,3803],3],[3804,1,"ຫນ"],[3805,1,"ຫມ"],[[3806,3807],2],[[3808,3839],3],[3840,2],[[3841,3850],2],[3851,2],[3852,1,"་"],[[3853,3863],2],[[3864,3865],2],[[3866,3871],2],[[3872,3881],2],[[3882,3892],2],[3893,2],[3894,2],[3895,2],[3896,2],[3897,2],[[3898,3901],2],[[3902,3906],2],[3907,1,"གྷ"],[[3908,3911],2],[3912,3],[[3913,3916],2],[3917,1,"ཌྷ"],[[3918,3921],2],[3922,1,"དྷ"],[[3923,3926],2],[3927,1,"བྷ"],[[3928,3931],2],[3932,1,"ཛྷ"],[[3933,3944],2],[3945,1,"ཀྵ"],[3946,2],[[3947,3948],2],[[3949,3952],3],[[3953,3954],2],[3955,1,"ཱི"],[3956,2],[3957,1,"ཱུ"],[3958,1,"ྲྀ"],[3959,1,"ྲཱྀ"],[3960,1,"ླྀ"],[3961,1,"ླཱྀ"],[[3962,3968],2],[3969,1,"ཱྀ"],[[3970,3972],2],[3973,2],[[3974,3979],2],[[3980,3983],2],[[3984,3986],2],[3987,1,"ྒྷ"],[[3988,3989],2],[3990,2],[3991,2],[3992,3],[[3993,3996],2],[3997,1,"ྜྷ"],[[3998,4001],2],[4002,1,"ྡྷ"],[[4003,4006],2],[4007,1,"ྦྷ"],[[4008,4011],2],[4012,1,"ྫྷ"],[4013,2],[[4014,4016],2],[[4017,4023],2],[4024,2],[4025,1,"ྐྵ"],[[4026,4028],2],[4029,3],[[4030,4037],2],[4038,2],[[4039,4044],2],[4045,3],[4046,2],[4047,2],[[4048,4049],2],[[4050,4052],2],[[4053,4056],2],[[4057,4058],2],[[4059,4095],3],[[4096,4129],2],[4130,2],[[4131,4135],2],[4136,2],[[4137,4138],2],[4139,2],[[4140,4146],2],[[4147,4149],2],[[4150,4153],2],[[4154,4159],2],[[4160,4169],2],[[4170,4175],2],[[4176,4185],2],[[4186,4249],2],[[4250,4253],2],[[4254,4255],2],[4256,1,"ⴀ"],[4257,1,"ⴁ"],[4258,1,"ⴂ"],[4259,1,"ⴃ"],[4260,1,"ⴄ"],[4261,1,"ⴅ"],[4262,1,"ⴆ"],[4263,1,"ⴇ"],[4264,1,"ⴈ"],[4265,1,"ⴉ"],[4266,1,"ⴊ"],[4267,1,"ⴋ"],[4268,1,"ⴌ"],[4269,1,"ⴍ"],[4270,1,"ⴎ"],[4271,1,"ⴏ"],[4272,1,"ⴐ"],[4273,1,"ⴑ"],[4274,1,"ⴒ"],[4275,1,"ⴓ"],[4276,1,"ⴔ"],[4277,1,"ⴕ"],[4278,1,"ⴖ"],[4279,1,"ⴗ"],[4280,1,"ⴘ"],[4281,1,"ⴙ"],[4282,1,"ⴚ"],[4283,1,"ⴛ"],[4284,1,"ⴜ"],[4285,1,"ⴝ"],[4286,1,"ⴞ"],[4287,1,"ⴟ"],[4288,1,"ⴠ"],[4289,1,"ⴡ"],[4290,1,"ⴢ"],[4291,1,"ⴣ"],[4292,1,"ⴤ"],[4293,1,"ⴥ"],[4294,3],[4295,1,"ⴧ"],[[4296,4300],3],[4301,1,"ⴭ"],[[4302,4303],3],[[4304,4342],2],[[4343,4344],2],[[4345,4346],2],[4347,2],[4348,1,"ნ"],[[4349,4351],2],[[4352,4441],2],[[4442,4446],2],[[4447,4448],7],[[4449,4514],2],[[4515,4519],2],[[4520,4601],2],[[4602,4607],2],[[4608,4614],2],[4615,2],[[4616,4678],2],[4679,2],[4680,2],[4681,3],[[4682,4685],2],[[4686,4687],3],[[4688,4694],2],[4695,3],[4696,2],[4697,3],[[4698,4701],2],[[4702,4703],3],[[4704,4742],2],[4743,2],[4744,2],[4745,3],[[4746,4749],2],[[4750,4751],3],[[4752,4782],2],[4783,2],[4784,2],[4785,3],[[4786,4789],2],[[4790,4791],3],[[4792,4798],2],[4799,3],[4800,2],[4801,3],[[4802,4805],2],[[4806,4807],3],[[4808,4814],2],[4815,2],[[4816,4822],2],[4823,3],[[4824,4846],2],[4847,2],[[4848,4878],2],[4879,2],[4880,2],[4881,3],[[4882,4885],2],[[4886,4887],3],[[4888,4894],2],[4895,2],[[4896,4934],2],[4935,2],[[4936,4954],2],[[4955,4956],3],[[4957,4958],2],[4959,2],[4960,2],[[4961,4988],2],[[4989,4991],3],[[4992,5007],2],[[5008,5017],2],[[5018,5023],3],[[5024,5108],2],[5109,2],[[5110,5111],3],[5112,1,"Ᏸ"],[5113,1,"Ᏹ"],[5114,1,"Ᏺ"],[5115,1,"Ᏻ"],[5116,1,"Ᏼ"],[5117,1,"Ᏽ"],[[5118,5119],3],[5120,2],[[5121,5740],2],[[5741,5742],2],[[5743,5750],2],[[5751,5759],2],[5760,3],[[5761,5786],2],[[5787,5788],2],[[5789,5791],3],[[5792,5866],2],[[5867,5872],2],[[5873,5880],2],[[5881,5887],3],[[5888,5900],2],[5901,2],[[5902,5908],2],[5909,2],[[5910,5918],3],[5919,2],[[5920,5940],2],[[5941,5942],2],[[5943,5951],3],[[5952,5971],2],[[5972,5983],3],[[5984,5996],2],[5997,3],[[5998,6000],2],[6001,3],[[6002,6003],2],[[6004,6015],3],[[6016,6067],2],[[6068,6069],7],[[6070,6099],2],[[6100,6102],2],[6103,2],[[6104,6107],2],[6108,2],[6109,2],[[6110,6111],3],[[6112,6121],2],[[6122,6127],3],[[6128,6137],2],[[6138,6143],3],[[6144,6154],2],[[6155,6158],7],[6159,7],[[6160,6169],2],[[6170,6175],3],[[6176,6263],2],[6264,2],[[6265,6271],3],[[6272,6313],2],[6314,2],[[6315,6319],3],[[6320,6389],2],[[6390,6399],3],[[6400,6428],2],[[6429,6430],2],[6431,3],[[6432,6443],2],[[6444,6447],3],[[6448,6459],2],[[6460,6463],3],[6464,2],[[6465,6467],3],[[6468,6469],2],[[6470,6509],2],[[6510,6511],3],[[6512,6516],2],[[6517,6527],3],[[6528,6569],2],[[6570,6571],2],[[6572,6575],3],[[6576,6601],2],[[6602,6607],3],[[6608,6617],2],[6618,2],[[6619,6621],3],[[6622,6623],2],[[6624,6655],2],[[6656,6683],2],[[6684,6685],3],[[6686,6687],2],[[6688,6750],2],[6751,3],[[6752,6780],2],[[6781,6782],3],[[6783,6793],2],[[6794,6799],3],[[6800,6809],2],[[6810,6815],3],[[6816,6822],2],[6823,2],[[6824,6829],2],[[6830,6831],3],[[6832,6845],2],[6846,2],[[6847,6848],2],[[6849,6862],2],[[6863,6911],3],[[6912,6987],2],[6988,2],[6989,3],[[6990,6991],2],[[6992,7001],2],[[7002,7018],2],[[7019,7027],2],[[7028,7036],2],[[7037,7038],2],[7039,2],[[7040,7082],2],[[7083,7085],2],[[7086,7097],2],[[7098,7103],2],[[7104,7155],2],[[7156,7163],3],[[7164,7167],2],[[7168,7223],2],[[7224,7226],3],[[7227,7231],2],[[7232,7241],2],[[7242,7244],3],[[7245,7293],2],[[7294,7295],2],[7296,1,"в"],[7297,1,"д"],[7298,1,"о"],[7299,1,"с"],[[7300,7301],1,"т"],[7302,1,"ъ"],[7303,1,"ѣ"],[7304,1,"ꙋ"],[7305,1,"ᲊ"],[7306,2],[[7307,7311],3],[7312,1,"ა"],[7313,1,"ბ"],[7314,1,"გ"],[7315,1,"დ"],[7316,1,"ე"],[7317,1,"ვ"],[7318,1,"ზ"],[7319,1,"თ"],[7320,1,"ი"],[7321,1,"კ"],[7322,1,"ლ"],[7323,1,"მ"],[7324,1,"ნ"],[7325,1,"ო"],[7326,1,"პ"],[7327,1,"ჟ"],[7328,1,"რ"],[7329,1,"ს"],[7330,1,"ტ"],[7331,1,"უ"],[7332,1,"ფ"],[7333,1,"ქ"],[7334,1,"ღ"],[7335,1,"ყ"],[7336,1,"შ"],[7337,1,"ჩ"],[7338,1,"ც"],[7339,1,"ძ"],[7340,1,"წ"],[7341,1,"ჭ"],[7342,1,"ხ"],[7343,1,"ჯ"],[7344,1,"ჰ"],[7345,1,"ჱ"],[7346,1,"ჲ"],[7347,1,"ჳ"],[7348,1,"ჴ"],[7349,1,"ჵ"],[7350,1,"ჶ"],[7351,1,"ჷ"],[7352,1,"ჸ"],[7353,1,"ჹ"],[7354,1,"ჺ"],[[7355,7356],3],[7357,1,"ჽ"],[7358,1,"ჾ"],[7359,1,"ჿ"],[[7360,7367],2],[[7368,7375],3],[[7376,7378],2],[7379,2],[[7380,7410],2],[[7411,7414],2],[7415,2],[[7416,7417],2],[7418,2],[[7419,7423],3],[[7424,7467],2],[7468,1,"a"],[7469,1,"æ"],[7470,1,"b"],[7471,2],[7472,1,"d"],[7473,1,"e"],[7474,1,"ǝ"],[7475,1,"g"],[7476,1,"h"],[7477,1,"i"],[7478,1,"j"],[7479,1,"k"],[7480,1,"l"],[7481,1,"m"],[7482,1,"n"],[7483,2],[7484,1,"o"],[7485,1,"ȣ"],[7486,1,"p"],[7487,1,"r"],[7488,1,"t"],[7489,1,"u"],[7490,1,"w"],[7491,1,"a"],[7492,1,"ɐ"],[7493,1,"ɑ"],[7494,1,"ᴂ"],[7495,1,"b"],[7496,1,"d"],[7497,1,"e"],[7498,1,"ə"],[7499,1,"ɛ"],[7500,1,"ɜ"],[7501,1,"g"],[7502,2],[7503,1,"k"],[7504,1,"m"],[7505,1,"ŋ"],[7506,1,"o"],[7507,1,"ɔ"],[7508,1,"ᴖ"],[7509,1,"ᴗ"],[7510,1,"p"],[7511,1,"t"],[7512,1,"u"],[7513,1,"ᴝ"],[7514,1,"ɯ"],[7515,1,"v"],[7516,1,"ᴥ"],[7517,1,"β"],[7518,1,"γ"],[7519,1,"δ"],[7520,1,"φ"],[7521,1,"χ"],[7522,1,"i"],[7523,1,"r"],[7524,1,"u"],[7525,1,"v"],[7526,1,"β"],[7527,1,"γ"],[7528,1,"ρ"],[7529,1,"φ"],[7530,1,"χ"],[7531,2],[[7532,7543],2],[7544,1,"н"],[[7545,7578],2],[7579,1,"ɒ"],[7580,1,"c"],[7581,1,"ɕ"],[7582,1,"ð"],[7583,1,"ɜ"],[7584,1,"f"],[7585,1,"ɟ"],[7586,1,"ɡ"],[7587,1,"ɥ"],[7588,1,"ɨ"],[7589,1,"ɩ"],[7590,1,"ɪ"],[7591,1,"ᵻ"],[7592,1,"ʝ"],[7593,1,"ɭ"],[7594,1,"ᶅ"],[7595,1,"ʟ"],[7596,1,"ɱ"],[7597,1,"ɰ"],[7598,1,"ɲ"],[7599,1,"ɳ"],[7600,1,"ɴ"],[7601,1,"ɵ"],[7602,1,"ɸ"],[7603,1,"ʂ"],[7604,1,"ʃ"],[7605,1,"ƫ"],[7606,1,"ʉ"],[7607,1,"ʊ"],[7608,1,"ᴜ"],[7609,1,"ʋ"],[7610,1,"ʌ"],[7611,1,"z"],[7612,1,"ʐ"],[7613,1,"ʑ"],[7614,1,"ʒ"],[7615,1,"θ"],[[7616,7619],2],[[7620,7626],2],[[7627,7654],2],[[7655,7669],2],[[7670,7673],2],[7674,2],[7675,2],[7676,2],[7677,2],[[7678,7679],2],[7680,1,"ḁ"],[7681,2],[7682,1,"ḃ"],[7683,2],[7684,1,"ḅ"],[7685,2],[7686,1,"ḇ"],[7687,2],[7688,1,"ḉ"],[7689,2],[7690,1,"ḋ"],[7691,2],[7692,1,"ḍ"],[7693,2],[7694,1,"ḏ"],[7695,2],[7696,1,"ḑ"],[7697,2],[7698,1,"ḓ"],[7699,2],[7700,1,"ḕ"],[7701,2],[7702,1,"ḗ"],[7703,2],[7704,1,"ḙ"],[7705,2],[7706,1,"ḛ"],[7707,2],[7708,1,"ḝ"],[7709,2],[7710,1,"ḟ"],[7711,2],[7712,1,"ḡ"],[7713,2],[7714,1,"ḣ"],[7715,2],[7716,1,"ḥ"],[7717,2],[7718,1,"ḧ"],[7719,2],[7720,1,"ḩ"],[7721,2],[7722,1,"ḫ"],[7723,2],[7724,1,"ḭ"],[7725,2],[7726,1,"ḯ"],[7727,2],[7728,1,"ḱ"],[7729,2],[7730,1,"ḳ"],[7731,2],[7732,1,"ḵ"],[7733,2],[7734,1,"ḷ"],[7735,2],[7736,1,"ḹ"],[7737,2],[7738,1,"ḻ"],[7739,2],[7740,1,"ḽ"],[7741,2],[7742,1,"ḿ"],[7743,2],[7744,1,"ṁ"],[7745,2],[7746,1,"ṃ"],[7747,2],[7748,1,"ṅ"],[7749,2],[7750,1,"ṇ"],[7751,2],[7752,1,"ṉ"],[7753,2],[7754,1,"ṋ"],[7755,2],[7756,1,"ṍ"],[7757,2],[7758,1,"ṏ"],[7759,2],[7760,1,"ṑ"],[7761,2],[7762,1,"ṓ"],[7763,2],[7764,1,"ṕ"],[7765,2],[7766,1,"ṗ"],[7767,2],[7768,1,"ṙ"],[7769,2],[7770,1,"ṛ"],[7771,2],[7772,1,"ṝ"],[7773,2],[7774,1,"ṟ"],[7775,2],[7776,1,"ṡ"],[7777,2],[7778,1,"ṣ"],[7779,2],[7780,1,"ṥ"],[7781,2],[7782,1,"ṧ"],[7783,2],[7784,1,"ṩ"],[7785,2],[7786,1,"ṫ"],[7787,2],[7788,1,"ṭ"],[7789,2],[7790,1,"ṯ"],[7791,2],[7792,1,"ṱ"],[7793,2],[7794,1,"ṳ"],[7795,2],[7796,1,"ṵ"],[7797,2],[7798,1,"ṷ"],[7799,2],[7800,1,"ṹ"],[7801,2],[7802,1,"ṻ"],[7803,2],[7804,1,"ṽ"],[7805,2],[7806,1,"ṿ"],[7807,2],[7808,1,"ẁ"],[7809,2],[7810,1,"ẃ"],[7811,2],[7812,1,"ẅ"],[7813,2],[7814,1,"ẇ"],[7815,2],[7816,1,"ẉ"],[7817,2],[7818,1,"ẋ"],[7819,2],[7820,1,"ẍ"],[7821,2],[7822,1,"ẏ"],[7823,2],[7824,1,"ẑ"],[7825,2],[7826,1,"ẓ"],[7827,2],[7828,1,"ẕ"],[[7829,7833],2],[7834,1,"aʾ"],[7835,1,"ṡ"],[[7836,7837],2],[7838,1,"ß"],[7839,2],[7840,1,"ạ"],[7841,2],[7842,1,"ả"],[7843,2],[7844,1,"ấ"],[7845,2],[7846,1,"ầ"],[7847,2],[7848,1,"ẩ"],[7849,2],[7850,1,"ẫ"],[7851,2],[7852,1,"ậ"],[7853,2],[7854,1,"ắ"],[7855,2],[7856,1,"ằ"],[7857,2],[7858,1,"ẳ"],[7859,2],[7860,1,"ẵ"],[7861,2],[7862,1,"ặ"],[7863,2],[7864,1,"ẹ"],[7865,2],[7866,1,"ẻ"],[7867,2],[7868,1,"ẽ"],[7869,2],[7870,1,"ế"],[7871,2],[7872,1,"ề"],[7873,2],[7874,1,"ể"],[7875,2],[7876,1,"ễ"],[7877,2],[7878,1,"ệ"],[7879,2],[7880,1,"ỉ"],[7881,2],[7882,1,"ị"],[7883,2],[7884,1,"ọ"],[7885,2],[7886,1,"ỏ"],[7887,2],[7888,1,"ố"],[7889,2],[7890,1,"ồ"],[7891,2],[7892,1,"ổ"],[7893,2],[7894,1,"ỗ"],[7895,2],[7896,1,"ộ"],[7897,2],[7898,1,"ớ"],[7899,2],[7900,1,"ờ"],[7901,2],[7902,1,"ở"],[7903,2],[7904,1,"ỡ"],[7905,2],[7906,1,"ợ"],[7907,2],[7908,1,"ụ"],[7909,2],[7910,1,"ủ"],[7911,2],[7912,1,"ứ"],[7913,2],[7914,1,"ừ"],[7915,2],[7916,1,"ử"],[7917,2],[7918,1,"ữ"],[7919,2],[7920,1,"ự"],[7921,2],[7922,1,"ỳ"],[7923,2],[7924,1,"ỵ"],[7925,2],[7926,1,"ỷ"],[7927,2],[7928,1,"ỹ"],[7929,2],[7930,1,"ỻ"],[7931,2],[7932,1,"ỽ"],[7933,2],[7934,1,"ỿ"],[7935,2],[[7936,7943],2],[7944,1,"ἀ"],[7945,1,"ἁ"],[7946,1,"ἂ"],[7947,1,"ἃ"],[7948,1,"ἄ"],[7949,1,"ἅ"],[7950,1,"ἆ"],[7951,1,"ἇ"],[[7952,7957],2],[[7958,7959],3],[7960,1,"ἐ"],[7961,1,"ἑ"],[7962,1,"ἒ"],[7963,1,"ἓ"],[7964,1,"ἔ"],[7965,1,"ἕ"],[[7966,7967],3],[[7968,7975],2],[7976,1,"ἠ"],[7977,1,"ἡ"],[7978,1,"ἢ"],[7979,1,"ἣ"],[7980,1,"ἤ"],[7981,1,"ἥ"],[7982,1,"ἦ"],[7983,1,"ἧ"],[[7984,7991],2],[7992,1,"ἰ"],[7993,1,"ἱ"],[7994,1,"ἲ"],[7995,1,"ἳ"],[7996,1,"ἴ"],[7997,1,"ἵ"],[7998,1,"ἶ"],[7999,1,"ἷ"],[[8000,8005],2],[[8006,8007],3],[8008,1,"ὀ"],[8009,1,"ὁ"],[8010,1,"ὂ"],[8011,1,"ὃ"],[8012,1,"ὄ"],[8013,1,"ὅ"],[[8014,8015],3],[[8016,8023],2],[8024,3],[8025,1,"ὑ"],[8026,3],[8027,1,"ὓ"],[8028,3],[8029,1,"ὕ"],[8030,3],[8031,1,"ὗ"],[[8032,8039],2],[8040,1,"ὠ"],[8041,1,"ὡ"],[8042,1,"ὢ"],[8043,1,"ὣ"],[8044,1,"ὤ"],[8045,1,"ὥ"],[8046,1,"ὦ"],[8047,1,"ὧ"],[8048,2],[8049,1,"ά"],[8050,2],[8051,1,"έ"],[8052,2],[8053,1,"ή"],[8054,2],[8055,1,"ί"],[8056,2],[8057,1,"ό"],[8058,2],[8059,1,"ύ"],[8060,2],[8061,1,"ώ"],[[8062,8063],3],[8064,1,"ἀι"],[8065,1,"ἁι"],[8066,1,"ἂι"],[8067,1,"ἃι"],[8068,1,"ἄι"],[8069,1,"ἅι"],[8070,1,"ἆι"],[8071,1,"ἇι"],[8072,1,"ἀι"],[8073,1,"ἁι"],[8074,1,"ἂι"],[8075,1,"ἃι"],[8076,1,"ἄι"],[8077,1,"ἅι"],[8078,1,"ἆι"],[8079,1,"ἇι"],[8080,1,"ἠι"],[8081,1,"ἡι"],[8082,1,"ἢι"],[8083,1,"ἣι"],[8084,1,"ἤι"],[8085,1,"ἥι"],[8086,1,"ἦι"],[8087,1,"ἧι"],[8088,1,"ἠι"],[8089,1,"ἡι"],[8090,1,"ἢι"],[8091,1,"ἣι"],[8092,1,"ἤι"],[8093,1,"ἥι"],[8094,1,"ἦι"],[8095,1,"ἧι"],[8096,1,"ὠι"],[8097,1,"ὡι"],[8098,1,"ὢι"],[8099,1,"ὣι"],[8100,1,"ὤι"],[8101,1,"ὥι"],[8102,1,"ὦι"],[8103,1,"ὧι"],[8104,1,"ὠι"],[8105,1,"ὡι"],[8106,1,"ὢι"],[8107,1,"ὣι"],[8108,1,"ὤι"],[8109,1,"ὥι"],[8110,1,"ὦι"],[8111,1,"ὧι"],[[8112,8113],2],[8114,1,"ὰι"],[8115,1,"αι"],[8116,1,"άι"],[8117,3],[8118,2],[8119,1,"ᾶι"],[8120,1,"ᾰ"],[8121,1,"ᾱ"],[8122,1,"ὰ"],[8123,1,"ά"],[8124,1,"αι"],[8125,1," ̓"],[8126,1,"ι"],[8127,1," ̓"],[8128,1," ͂"],[8129,1," ̈͂"],[8130,1,"ὴι"],[8131,1,"ηι"],[8132,1,"ήι"],[8133,3],[8134,2],[8135,1,"ῆι"],[8136,1,"ὲ"],[8137,1,"έ"],[8138,1,"ὴ"],[8139,1,"ή"],[8140,1,"ηι"],[8141,1," ̓̀"],[8142,1," ̓́"],[8143,1," ̓͂"],[[8144,8146],2],[8147,1,"ΐ"],[[8148,8149],3],[[8150,8151],2],[8152,1,"ῐ"],[8153,1,"ῑ"],[8154,1,"ὶ"],[8155,1,"ί"],[8156,3],[8157,1," ̔̀"],[8158,1," ̔́"],[8159,1," ̔͂"],[[8160,8162],2],[8163,1,"ΰ"],[[8164,8167],2],[8168,1,"ῠ"],[8169,1,"ῡ"],[8170,1,"ὺ"],[8171,1,"ύ"],[8172,1,"ῥ"],[8173,1," ̈̀"],[8174,1," ̈́"],[8175,1,"`"],[[8176,8177],3],[8178,1,"ὼι"],[8179,1,"ωι"],[8180,1,"ώι"],[8181,3],[8182,2],[8183,1,"ῶι"],[8184,1,"ὸ"],[8185,1,"ό"],[8186,1,"ὼ"],[8187,1,"ώ"],[8188,1,"ωι"],[8189,1," ́"],[8190,1," ̔"],[8191,3],[[8192,8202],1," "],[8203,7],[[8204,8205],6,""],[[8206,8207],3],[8208,2],[8209,1,"‐"],[[8210,8214],2],[8215,1," ̳"],[[8216,8227],2],[[8228,8230],3],[8231,2],[[8232,8238],3],[8239,1," "],[[8240,8242],2],[8243,1,"′′"],[8244,1,"′′′"],[8245,2],[8246,1,"‵‵"],[8247,1,"‵‵‵"],[[8248,8251],2],[8252,1,"!!"],[8253,2],[8254,1," ̅"],[[8255,8262],2],[8263,1,"??"],[8264,1,"?!"],[8265,1,"!?"],[[8266,8269],2],[[8270,8274],2],[[8275,8276],2],[[8277,8278],2],[8279,1,"′′′′"],[[8280,8286],2],[8287,1," "],[[8288,8291],7],[8292,7],[8293,3],[[8294,8297],3],[[8298,8303],7],[8304,1,"0"],[8305,1,"i"],[[8306,8307],3],[8308,1,"4"],[8309,1,"5"],[8310,1,"6"],[8311,1,"7"],[8312,1,"8"],[8313,1,"9"],[8314,1,"+"],[8315,1,"−"],[8316,1,"="],[8317,1,"("],[8318,1,")"],[8319,1,"n"],[8320,1,"0"],[8321,1,"1"],[8322,1,"2"],[8323,1,"3"],[8324,1,"4"],[8325,1,"5"],[8326,1,"6"],[8327,1,"7"],[8328,1,"8"],[8329,1,"9"],[8330,1,"+"],[8331,1,"−"],[8332,1,"="],[8333,1,"("],[8334,1,")"],[8335,3],[8336,1,"a"],[8337,1,"e"],[8338,1,"o"],[8339,1,"x"],[8340,1,"ə"],[8341,1,"h"],[8342,1,"k"],[8343,1,"l"],[8344,1,"m"],[8345,1,"n"],[8346,1,"p"],[8347,1,"s"],[8348,1,"t"],[[8349,8351],3],[[8352,8359],2],[8360,1,"rs"],[[8361,8362],2],[8363,2],[8364,2],[[8365,8367],2],[[8368,8369],2],[[8370,8373],2],[[8374,8376],2],[8377,2],[8378,2],[[8379,8381],2],[8382,2],[8383,2],[8384,2],[[8385,8399],3],[[8400,8417],2],[[8418,8419],2],[[8420,8426],2],[8427,2],[[8428,8431],2],[8432,2],[[8433,8447],3],[8448,1,"a/c"],[8449,1,"a/s"],[8450,1,"c"],[8451,1,"°c"],[8452,2],[8453,1,"c/o"],[8454,1,"c/u"],[8455,1,"ɛ"],[8456,2],[8457,1,"°f"],[8458,1,"g"],[[8459,8462],1,"h"],[8463,1,"ħ"],[[8464,8465],1,"i"],[[8466,8467],1,"l"],[8468,2],[8469,1,"n"],[8470,1,"no"],[[8471,8472],2],[8473,1,"p"],[8474,1,"q"],[[8475,8477],1,"r"],[[8478,8479],2],[8480,1,"sm"],[8481,1,"tel"],[8482,1,"tm"],[8483,2],[8484,1,"z"],[8485,2],[8486,1,"ω"],[8487,2],[8488,1,"z"],[8489,2],[8490,1,"k"],[8491,1,"å"],[8492,1,"b"],[8493,1,"c"],[8494,2],[[8495,8496],1,"e"],[8497,1,"f"],[8498,1,"ⅎ"],[8499,1,"m"],[8500,1,"o"],[8501,1,"א"],[8502,1,"ב"],[8503,1,"ג"],[8504,1,"ד"],[8505,1,"i"],[8506,2],[8507,1,"fax"],[8508,1,"π"],[[8509,8510],1,"γ"],[8511,1,"π"],[8512,1,"∑"],[[8513,8516],2],[[8517,8518],1,"d"],[8519,1,"e"],[8520,1,"i"],[8521,1,"j"],[[8522,8523],2],[8524,2],[8525,2],[8526,2],[8527,2],[8528,1,"1⁄7"],[8529,1,"1⁄9"],[8530,1,"1⁄10"],[8531,1,"1⁄3"],[8532,1,"2⁄3"],[8533,1,"1⁄5"],[8534,1,"2⁄5"],[8535,1,"3⁄5"],[8536,1,"4⁄5"],[8537,1,"1⁄6"],[8538,1,"5⁄6"],[8539,1,"1⁄8"],[8540,1,"3⁄8"],[8541,1,"5⁄8"],[8542,1,"7⁄8"],[8543,1,"1⁄"],[8544,1,"i"],[8545,1,"ii"],[8546,1,"iii"],[8547,1,"iv"],[8548,1,"v"],[8549,1,"vi"],[8550,1,"vii"],[8551,1,"viii"],[8552,1,"ix"],[8553,1,"x"],[8554,1,"xi"],[8555,1,"xii"],[8556,1,"l"],[8557,1,"c"],[8558,1,"d"],[8559,1,"m"],[8560,1,"i"],[8561,1,"ii"],[8562,1,"iii"],[8563,1,"iv"],[8564,1,"v"],[8565,1,"vi"],[8566,1,"vii"],[8567,1,"viii"],[8568,1,"ix"],[8569,1,"x"],[8570,1,"xi"],[8571,1,"xii"],[8572,1,"l"],[8573,1,"c"],[8574,1,"d"],[8575,1,"m"],[[8576,8578],2],[8579,1,"ↄ"],[8580,2],[[8581,8584],2],[8585,1,"0⁄3"],[[8586,8587],2],[[8588,8591],3],[[8592,8682],2],[[8683,8691],2],[[8692,8703],2],[[8704,8747],2],[8748,1,"∫∫"],[8749,1,"∫∫∫"],[8750,2],[8751,1,"∮∮"],[8752,1,"∮∮∮"],[[8753,8945],2],[[8946,8959],2],[8960,2],[8961,2],[[8962,9000],2],[9001,1,"〈"],[9002,1,"〉"],[[9003,9082],2],[9083,2],[9084,2],[[9085,9114],2],[[9115,9166],2],[[9167,9168],2],[[9169,9179],2],[[9180,9191],2],[9192,2],[[9193,9203],2],[[9204,9210],2],[[9211,9214],2],[9215,2],[[9216,9252],2],[[9253,9254],2],[[9255,9257],2],[[9258,9279],3],[[9280,9290],2],[[9291,9311],3],[9312,1,"1"],[9313,1,"2"],[9314,1,"3"],[9315,1,"4"],[9316,1,"5"],[9317,1,"6"],[9318,1,"7"],[9319,1,"8"],[9320,1,"9"],[9321,1,"10"],[9322,1,"11"],[9323,1,"12"],[9324,1,"13"],[9325,1,"14"],[9326,1,"15"],[9327,1,"16"],[9328,1,"17"],[9329,1,"18"],[9330,1,"19"],[9331,1,"20"],[9332,1,"(1)"],[9333,1,"(2)"],[9334,1,"(3)"],[9335,1,"(4)"],[9336,1,"(5)"],[9337,1,"(6)"],[9338,1,"(7)"],[9339,1,"(8)"],[9340,1,"(9)"],[9341,1,"(10)"],[9342,1,"(11)"],[9343,1,"(12)"],[9344,1,"(13)"],[9345,1,"(14)"],[9346,1,"(15)"],[9347,1,"(16)"],[9348,1,"(17)"],[9349,1,"(18)"],[9350,1,"(19)"],[9351,1,"(20)"],[[9352,9371],3],[9372,1,"(a)"],[9373,1,"(b)"],[9374,1,"(c)"],[9375,1,"(d)"],[9376,1,"(e)"],[9377,1,"(f)"],[9378,1,"(g)"],[9379,1,"(h)"],[9380,1,"(i)"],[9381,1,"(j)"],[9382,1,"(k)"],[9383,1,"(l)"],[9384,1,"(m)"],[9385,1,"(n)"],[9386,1,"(o)"],[9387,1,"(p)"],[9388,1,"(q)"],[9389,1,"(r)"],[9390,1,"(s)"],[9391,1,"(t)"],[9392,1,"(u)"],[9393,1,"(v)"],[9394,1,"(w)"],[9395,1,"(x)"],[9396,1,"(y)"],[9397,1,"(z)"],[9398,1,"a"],[9399,1,"b"],[9400,1,"c"],[9401,1,"d"],[9402,1,"e"],[9403,1,"f"],[9404,1,"g"],[9405,1,"h"],[9406,1,"i"],[9407,1,"j"],[9408,1,"k"],[9409,1,"l"],[9410,1,"m"],[9411,1,"n"],[9412,1,"o"],[9413,1,"p"],[9414,1,"q"],[9415,1,"r"],[9416,1,"s"],[9417,1,"t"],[9418,1,"u"],[9419,1,"v"],[9420,1,"w"],[9421,1,"x"],[9422,1,"y"],[9423,1,"z"],[9424,1,"a"],[9425,1,"b"],[9426,1,"c"],[9427,1,"d"],[9428,1,"e"],[9429,1,"f"],[9430,1,"g"],[9431,1,"h"],[9432,1,"i"],[9433,1,"j"],[9434,1,"k"],[9435,1,"l"],[9436,1,"m"],[9437,1,"n"],[9438,1,"o"],[9439,1,"p"],[9440,1,"q"],[9441,1,"r"],[9442,1,"s"],[9443,1,"t"],[9444,1,"u"],[9445,1,"v"],[9446,1,"w"],[9447,1,"x"],[9448,1,"y"],[9449,1,"z"],[9450,1,"0"],[[9451,9470],2],[9471,2],[[9472,9621],2],[[9622,9631],2],[[9632,9711],2],[[9712,9719],2],[[9720,9727],2],[[9728,9747],2],[[9748,9749],2],[[9750,9751],2],[9752,2],[9753,2],[[9754,9839],2],[[9840,9841],2],[[9842,9853],2],[[9854,9855],2],[[9856,9865],2],[[9866,9873],2],[[9874,9884],2],[9885,2],[[9886,9887],2],[[9888,9889],2],[[9890,9905],2],[9906,2],[[9907,9916],2],[[9917,9919],2],[[9920,9923],2],[[9924,9933],2],[9934,2],[[9935,9953],2],[9954,2],[9955,2],[[9956,9959],2],[[9960,9983],2],[9984,2],[[9985,9988],2],[9989,2],[[9990,9993],2],[[9994,9995],2],[[9996,10023],2],[10024,2],[[10025,10059],2],[10060,2],[10061,2],[10062,2],[[10063,10066],2],[[10067,10069],2],[10070,2],[10071,2],[[10072,10078],2],[[10079,10080],2],[[10081,10087],2],[[10088,10101],2],[[10102,10132],2],[[10133,10135],2],[[10136,10159],2],[10160,2],[[10161,10174],2],[10175,2],[[10176,10182],2],[[10183,10186],2],[10187,2],[10188,2],[10189,2],[[10190,10191],2],[[10192,10219],2],[[10220,10223],2],[[10224,10239],2],[[10240,10495],2],[[10496,10763],2],[10764,1,"∫∫∫∫"],[[10765,10867],2],[10868,1,"::="],[10869,1,"=="],[10870,1,"==="],[[10871,10971],2],[10972,1,"⫝̸"],[[10973,11007],2],[[11008,11021],2],[[11022,11027],2],[[11028,11034],2],[[11035,11039],2],[[11040,11043],2],[[11044,11084],2],[[11085,11087],2],[[11088,11092],2],[[11093,11097],2],[[11098,11123],2],[[11124,11125],3],[[11126,11157],2],[11158,3],[11159,2],[[11160,11193],2],[[11194,11196],2],[[11197,11208],2],[11209,2],[[11210,11217],2],[11218,2],[[11219,11243],2],[[11244,11247],2],[[11248,11262],2],[11263,2],[11264,1,"ⰰ"],[11265,1,"ⰱ"],[11266,1,"ⰲ"],[11267,1,"ⰳ"],[11268,1,"ⰴ"],[11269,1,"ⰵ"],[11270,1,"ⰶ"],[11271,1,"ⰷ"],[11272,1,"ⰸ"],[11273,1,"ⰹ"],[11274,1,"ⰺ"],[11275,1,"ⰻ"],[11276,1,"ⰼ"],[11277,1,"ⰽ"],[11278,1,"ⰾ"],[11279,1,"ⰿ"],[11280,1,"ⱀ"],[11281,1,"ⱁ"],[11282,1,"ⱂ"],[11283,1,"ⱃ"],[11284,1,"ⱄ"],[11285,1,"ⱅ"],[11286,1,"ⱆ"],[11287,1,"ⱇ"],[11288,1,"ⱈ"],[11289,1,"ⱉ"],[11290,1,"ⱊ"],[11291,1,"ⱋ"],[11292,1,"ⱌ"],[11293,1,"ⱍ"],[11294,1,"ⱎ"],[11295,1,"ⱏ"],[11296,1,"ⱐ"],[11297,1,"ⱑ"],[11298,1,"ⱒ"],[11299,1,"ⱓ"],[11300,1,"ⱔ"],[11301,1,"ⱕ"],[11302,1,"ⱖ"],[11303,1,"ⱗ"],[11304,1,"ⱘ"],[11305,1,"ⱙ"],[11306,1,"ⱚ"],[11307,1,"ⱛ"],[11308,1,"ⱜ"],[11309,1,"ⱝ"],[11310,1,"ⱞ"],[11311,1,"ⱟ"],[[11312,11358],2],[11359,2],[11360,1,"ⱡ"],[11361,2],[11362,1,"ɫ"],[11363,1,"ᵽ"],[11364,1,"ɽ"],[[11365,11366],2],[11367,1,"ⱨ"],[11368,2],[11369,1,"ⱪ"],[11370,2],[11371,1,"ⱬ"],[11372,2],[11373,1,"ɑ"],[11374,1,"ɱ"],[11375,1,"ɐ"],[11376,1,"ɒ"],[11377,2],[11378,1,"ⱳ"],[11379,2],[11380,2],[11381,1,"ⱶ"],[[11382,11383],2],[[11384,11387],2],[11388,1,"j"],[11389,1,"v"],[11390,1,"ȿ"],[11391,1,"ɀ"],[11392,1,"ⲁ"],[11393,2],[11394,1,"ⲃ"],[11395,2],[11396,1,"ⲅ"],[11397,2],[11398,1,"ⲇ"],[11399,2],[11400,1,"ⲉ"],[11401,2],[11402,1,"ⲋ"],[11403,2],[11404,1,"ⲍ"],[11405,2],[11406,1,"ⲏ"],[11407,2],[11408,1,"ⲑ"],[11409,2],[11410,1,"ⲓ"],[11411,2],[11412,1,"ⲕ"],[11413,2],[11414,1,"ⲗ"],[11415,2],[11416,1,"ⲙ"],[11417,2],[11418,1,"ⲛ"],[11419,2],[11420,1,"ⲝ"],[11421,2],[11422,1,"ⲟ"],[11423,2],[11424,1,"ⲡ"],[11425,2],[11426,1,"ⲣ"],[11427,2],[11428,1,"ⲥ"],[11429,2],[11430,1,"ⲧ"],[11431,2],[11432,1,"ⲩ"],[11433,2],[11434,1,"ⲫ"],[11435,2],[11436,1,"ⲭ"],[11437,2],[11438,1,"ⲯ"],[11439,2],[11440,1,"ⲱ"],[11441,2],[11442,1,"ⲳ"],[11443,2],[11444,1,"ⲵ"],[11445,2],[11446,1,"ⲷ"],[11447,2],[11448,1,"ⲹ"],[11449,2],[11450,1,"ⲻ"],[11451,2],[11452,1,"ⲽ"],[11453,2],[11454,1,"ⲿ"],[11455,2],[11456,1,"ⳁ"],[11457,2],[11458,1,"ⳃ"],[11459,2],[11460,1,"ⳅ"],[11461,2],[11462,1,"ⳇ"],[11463,2],[11464,1,"ⳉ"],[11465,2],[11466,1,"ⳋ"],[11467,2],[11468,1,"ⳍ"],[11469,2],[11470,1,"ⳏ"],[11471,2],[11472,1,"ⳑ"],[11473,2],[11474,1,"ⳓ"],[11475,2],[11476,1,"ⳕ"],[11477,2],[11478,1,"ⳗ"],[11479,2],[11480,1,"ⳙ"],[11481,2],[11482,1,"ⳛ"],[11483,2],[11484,1,"ⳝ"],[11485,2],[11486,1,"ⳟ"],[11487,2],[11488,1,"ⳡ"],[11489,2],[11490,1,"ⳣ"],[[11491,11492],2],[[11493,11498],2],[11499,1,"ⳬ"],[11500,2],[11501,1,"ⳮ"],[[11502,11505],2],[11506,1,"ⳳ"],[11507,2],[[11508,11512],3],[[11513,11519],2],[[11520,11557],2],[11558,3],[11559,2],[[11560,11564],3],[11565,2],[[11566,11567],3],[[11568,11621],2],[[11622,11623],2],[[11624,11630],3],[11631,1,"ⵡ"],[11632,2],[[11633,11646],3],[11647,2],[[11648,11670],2],[[11671,11679],3],[[11680,11686],2],[11687,3],[[11688,11694],2],[11695,3],[[11696,11702],2],[11703,3],[[11704,11710],2],[11711,3],[[11712,11718],2],[11719,3],[[11720,11726],2],[11727,3],[[11728,11734],2],[11735,3],[[11736,11742],2],[11743,3],[[11744,11775],2],[[11776,11799],2],[[11800,11803],2],[[11804,11805],2],[[11806,11822],2],[11823,2],[11824,2],[11825,2],[[11826,11835],2],[[11836,11842],2],[[11843,11844],2],[[11845,11849],2],[[11850,11854],2],[11855,2],[[11856,11858],2],[[11859,11869],2],[[11870,11903],3],[[11904,11929],2],[11930,3],[[11931,11934],2],[11935,1,"母"],[[11936,12018],2],[12019,1,"龟"],[[12020,12031],3],[12032,1,"一"],[12033,1,"丨"],[12034,1,"丶"],[12035,1,"丿"],[12036,1,"乙"],[12037,1,"亅"],[12038,1,"二"],[12039,1,"亠"],[12040,1,"人"],[12041,1,"儿"],[12042,1,"入"],[12043,1,"八"],[12044,1,"冂"],[12045,1,"冖"],[12046,1,"冫"],[12047,1,"几"],[12048,1,"凵"],[12049,1,"刀"],[12050,1,"力"],[12051,1,"勹"],[12052,1,"匕"],[12053,1,"匚"],[12054,1,"匸"],[12055,1,"十"],[12056,1,"卜"],[12057,1,"卩"],[12058,1,"厂"],[12059,1,"厶"],[12060,1,"又"],[12061,1,"口"],[12062,1,"囗"],[12063,1,"土"],[12064,1,"士"],[12065,1,"夂"],[12066,1,"夊"],[12067,1,"夕"],[12068,1,"大"],[12069,1,"女"],[12070,1,"子"],[12071,1,"宀"],[12072,1,"寸"],[12073,1,"小"],[12074,1,"尢"],[12075,1,"尸"],[12076,1,"屮"],[12077,1,"山"],[12078,1,"巛"],[12079,1,"工"],[12080,1,"己"],[12081,1,"巾"],[12082,1,"干"],[12083,1,"幺"],[12084,1,"广"],[12085,1,"廴"],[12086,1,"廾"],[12087,1,"弋"],[12088,1,"弓"],[12089,1,"彐"],[12090,1,"彡"],[12091,1,"彳"],[12092,1,"心"],[12093,1,"戈"],[12094,1,"戶"],[12095,1,"手"],[12096,1,"支"],[12097,1,"攴"],[12098,1,"文"],[12099,1,"斗"],[12100,1,"斤"],[12101,1,"方"],[12102,1,"无"],[12103,1,"日"],[12104,1,"曰"],[12105,1,"月"],[12106,1,"木"],[12107,1,"欠"],[12108,1,"止"],[12109,1,"歹"],[12110,1,"殳"],[12111,1,"毋"],[12112,1,"比"],[12113,1,"毛"],[12114,1,"氏"],[12115,1,"气"],[12116,1,"水"],[12117,1,"火"],[12118,1,"爪"],[12119,1,"父"],[12120,1,"爻"],[12121,1,"爿"],[12122,1,"片"],[12123,1,"牙"],[12124,1,"牛"],[12125,1,"犬"],[12126,1,"玄"],[12127,1,"玉"],[12128,1,"瓜"],[12129,1,"瓦"],[12130,1,"甘"],[12131,1,"生"],[12132,1,"用"],[12133,1,"田"],[12134,1,"疋"],[12135,1,"疒"],[12136,1,"癶"],[12137,1,"白"],[12138,1,"皮"],[12139,1,"皿"],[12140,1,"目"],[12141,1,"矛"],[12142,1,"矢"],[12143,1,"石"],[12144,1,"示"],[12145,1,"禸"],[12146,1,"禾"],[12147,1,"穴"],[12148,1,"立"],[12149,1,"竹"],[12150,1,"米"],[12151,1,"糸"],[12152,1,"缶"],[12153,1,"网"],[12154,1,"羊"],[12155,1,"羽"],[12156,1,"老"],[12157,1,"而"],[12158,1,"耒"],[12159,1,"耳"],[12160,1,"聿"],[12161,1,"肉"],[12162,1,"臣"],[12163,1,"自"],[12164,1,"至"],[12165,1,"臼"],[12166,1,"舌"],[12167,1,"舛"],[12168,1,"舟"],[12169,1,"艮"],[12170,1,"色"],[12171,1,"艸"],[12172,1,"虍"],[12173,1,"虫"],[12174,1,"血"],[12175,1,"行"],[12176,1,"衣"],[12177,1,"襾"],[12178,1,"見"],[12179,1,"角"],[12180,1,"言"],[12181,1,"谷"],[12182,1,"豆"],[12183,1,"豕"],[12184,1,"豸"],[12185,1,"貝"],[12186,1,"赤"],[12187,1,"走"],[12188,1,"足"],[12189,1,"身"],[12190,1,"車"],[12191,1,"辛"],[12192,1,"辰"],[12193,1,"辵"],[12194,1,"邑"],[12195,1,"酉"],[12196,1,"釆"],[12197,1,"里"],[12198,1,"金"],[12199,1,"長"],[12200,1,"門"],[12201,1,"阜"],[12202,1,"隶"],[12203,1,"隹"],[12204,1,"雨"],[12205,1,"靑"],[12206,1,"非"],[12207,1,"面"],[12208,1,"革"],[12209,1,"韋"],[12210,1,"韭"],[12211,1,"音"],[12212,1,"頁"],[12213,1,"風"],[12214,1,"飛"],[12215,1,"食"],[12216,1,"首"],[12217,1,"香"],[12218,1,"馬"],[12219,1,"骨"],[12220,1,"高"],[12221,1,"髟"],[12222,1,"鬥"],[12223,1,"鬯"],[12224,1,"鬲"],[12225,1,"鬼"],[12226,1,"魚"],[12227,1,"鳥"],[12228,1,"鹵"],[12229,1,"鹿"],[12230,1,"麥"],[12231,1,"麻"],[12232,1,"黃"],[12233,1,"黍"],[12234,1,"黑"],[12235,1,"黹"],[12236,1,"黽"],[12237,1,"鼎"],[12238,1,"鼓"],[12239,1,"鼠"],[12240,1,"鼻"],[12241,1,"齊"],[12242,1,"齒"],[12243,1,"龍"],[12244,1,"龜"],[12245,1,"龠"],[[12246,12271],3],[[12272,12283],3],[[12284,12287],3],[12288,1," "],[12289,2],[12290,1,"."],[[12291,12292],2],[[12293,12295],2],[[12296,12329],2],[[12330,12333],2],[[12334,12341],2],[12342,1,"〒"],[12343,2],[12344,1,"十"],[12345,1,"卄"],[12346,1,"卅"],[12347,2],[12348,2],[12349,2],[12350,2],[12351,2],[12352,3],[[12353,12436],2],[[12437,12438],2],[[12439,12440],3],[[12441,12442],2],[12443,1," ゙"],[12444,1," ゚"],[[12445,12446],2],[12447,1,"より"],[12448,2],[[12449,12542],2],[12543,1,"コト"],[[12544,12548],3],[[12549,12588],2],[12589,2],[12590,2],[12591,2],[12592,3],[12593,1,"ᄀ"],[12594,1,"ᄁ"],[12595,1,"ᆪ"],[12596,1,"ᄂ"],[12597,1,"ᆬ"],[12598,1,"ᆭ"],[12599,1,"ᄃ"],[12600,1,"ᄄ"],[12601,1,"ᄅ"],[12602,1,"ᆰ"],[12603,1,"ᆱ"],[12604,1,"ᆲ"],[12605,1,"ᆳ"],[12606,1,"ᆴ"],[12607,1,"ᆵ"],[12608,1,"ᄚ"],[12609,1,"ᄆ"],[12610,1,"ᄇ"],[12611,1,"ᄈ"],[12612,1,"ᄡ"],[12613,1,"ᄉ"],[12614,1,"ᄊ"],[12615,1,"ᄋ"],[12616,1,"ᄌ"],[12617,1,"ᄍ"],[12618,1,"ᄎ"],[12619,1,"ᄏ"],[12620,1,"ᄐ"],[12621,1,"ᄑ"],[12622,1,"ᄒ"],[12623,1,"ᅡ"],[12624,1,"ᅢ"],[12625,1,"ᅣ"],[12626,1,"ᅤ"],[12627,1,"ᅥ"],[12628,1,"ᅦ"],[12629,1,"ᅧ"],[12630,1,"ᅨ"],[12631,1,"ᅩ"],[12632,1,"ᅪ"],[12633,1,"ᅫ"],[12634,1,"ᅬ"],[12635,1,"ᅭ"],[12636,1,"ᅮ"],[12637,1,"ᅯ"],[12638,1,"ᅰ"],[12639,1,"ᅱ"],[12640,1,"ᅲ"],[12641,1,"ᅳ"],[12642,1,"ᅴ"],[12643,1,"ᅵ"],[12644,7],[12645,1,"ᄔ"],[12646,1,"ᄕ"],[12647,1,"ᇇ"],[12648,1,"ᇈ"],[12649,1,"ᇌ"],[12650,1,"ᇎ"],[12651,1,"ᇓ"],[12652,1,"ᇗ"],[12653,1,"ᇙ"],[12654,1,"ᄜ"],[12655,1,"ᇝ"],[12656,1,"ᇟ"],[12657,1,"ᄝ"],[12658,1,"ᄞ"],[12659,1,"ᄠ"],[12660,1,"ᄢ"],[12661,1,"ᄣ"],[12662,1,"ᄧ"],[12663,1,"ᄩ"],[12664,1,"ᄫ"],[12665,1,"ᄬ"],[12666,1,"ᄭ"],[12667,1,"ᄮ"],[12668,1,"ᄯ"],[12669,1,"ᄲ"],[12670,1,"ᄶ"],[12671,1,"ᅀ"],[12672,1,"ᅇ"],[12673,1,"ᅌ"],[12674,1,"ᇱ"],[12675,1,"ᇲ"],[12676,1,"ᅗ"],[12677,1,"ᅘ"],[12678,1,"ᅙ"],[12679,1,"ᆄ"],[12680,1,"ᆅ"],[12681,1,"ᆈ"],[12682,1,"ᆑ"],[12683,1,"ᆒ"],[12684,1,"ᆔ"],[12685,1,"ᆞ"],[12686,1,"ᆡ"],[12687,3],[[12688,12689],2],[12690,1,"一"],[12691,1,"二"],[12692,1,"三"],[12693,1,"四"],[12694,1,"上"],[12695,1,"中"],[12696,1,"下"],[12697,1,"甲"],[12698,1,"乙"],[12699,1,"丙"],[12700,1,"丁"],[12701,1,"天"],[12702,1,"地"],[12703,1,"人"],[[12704,12727],2],[[12728,12730],2],[[12731,12735],2],[[12736,12751],2],[[12752,12771],2],[[12772,12773],2],[[12774,12782],3],[12783,3],[[12784,12799],2],[12800,1,"(ᄀ)"],[12801,1,"(ᄂ)"],[12802,1,"(ᄃ)"],[12803,1,"(ᄅ)"],[12804,1,"(ᄆ)"],[12805,1,"(ᄇ)"],[12806,1,"(ᄉ)"],[12807,1,"(ᄋ)"],[12808,1,"(ᄌ)"],[12809,1,"(ᄎ)"],[12810,1,"(ᄏ)"],[12811,1,"(ᄐ)"],[12812,1,"(ᄑ)"],[12813,1,"(ᄒ)"],[12814,1,"(가)"],[12815,1,"(나)"],[12816,1,"(다)"],[12817,1,"(라)"],[12818,1,"(마)"],[12819,1,"(바)"],[12820,1,"(사)"],[12821,1,"(아)"],[12822,1,"(자)"],[12823,1,"(차)"],[12824,1,"(카)"],[12825,1,"(타)"],[12826,1,"(파)"],[12827,1,"(하)"],[12828,1,"(주)"],[12829,1,"(오전)"],[12830,1,"(오후)"],[12831,3],[12832,1,"(一)"],[12833,1,"(二)"],[12834,1,"(三)"],[12835,1,"(四)"],[12836,1,"(五)"],[12837,1,"(六)"],[12838,1,"(七)"],[12839,1,"(八)"],[12840,1,"(九)"],[12841,1,"(十)"],[12842,1,"(月)"],[12843,1,"(火)"],[12844,1,"(水)"],[12845,1,"(木)"],[12846,1,"(金)"],[12847,1,"(土)"],[12848,1,"(日)"],[12849,1,"(株)"],[12850,1,"(有)"],[12851,1,"(社)"],[12852,1,"(名)"],[12853,1,"(特)"],[12854,1,"(財)"],[12855,1,"(祝)"],[12856,1,"(労)"],[12857,1,"(代)"],[12858,1,"(呼)"],[12859,1,"(学)"],[12860,1,"(監)"],[12861,1,"(企)"],[12862,1,"(資)"],[12863,1,"(協)"],[12864,1,"(祭)"],[12865,1,"(休)"],[12866,1,"(自)"],[12867,1,"(至)"],[12868,1,"問"],[12869,1,"幼"],[12870,1,"文"],[12871,1,"箏"],[[12872,12879],2],[12880,1,"pte"],[12881,1,"21"],[12882,1,"22"],[12883,1,"23"],[12884,1,"24"],[12885,1,"25"],[12886,1,"26"],[12887,1,"27"],[12888,1,"28"],[12889,1,"29"],[12890,1,"30"],[12891,1,"31"],[12892,1,"32"],[12893,1,"33"],[12894,1,"34"],[12895,1,"35"],[12896,1,"ᄀ"],[12897,1,"ᄂ"],[12898,1,"ᄃ"],[12899,1,"ᄅ"],[12900,1,"ᄆ"],[12901,1,"ᄇ"],[12902,1,"ᄉ"],[12903,1,"ᄋ"],[12904,1,"ᄌ"],[12905,1,"ᄎ"],[12906,1,"ᄏ"],[12907,1,"ᄐ"],[12908,1,"ᄑ"],[12909,1,"ᄒ"],[12910,1,"가"],[12911,1,"나"],[12912,1,"다"],[12913,1,"라"],[12914,1,"마"],[12915,1,"바"],[12916,1,"사"],[12917,1,"아"],[12918,1,"자"],[12919,1,"차"],[12920,1,"카"],[12921,1,"타"],[12922,1,"파"],[12923,1,"하"],[12924,1,"참고"],[12925,1,"주의"],[12926,1,"우"],[12927,2],[12928,1,"一"],[12929,1,"二"],[12930,1,"三"],[12931,1,"四"],[12932,1,"五"],[12933,1,"六"],[12934,1,"七"],[12935,1,"八"],[12936,1,"九"],[12937,1,"十"],[12938,1,"月"],[12939,1,"火"],[12940,1,"水"],[12941,1,"木"],[12942,1,"金"],[12943,1,"土"],[12944,1,"日"],[12945,1,"株"],[12946,1,"有"],[12947,1,"社"],[12948,1,"名"],[12949,1,"特"],[12950,1,"財"],[12951,1,"祝"],[12952,1,"労"],[12953,1,"秘"],[12954,1,"男"],[12955,1,"女"],[12956,1,"適"],[12957,1,"優"],[12958,1,"印"],[12959,1,"注"],[12960,1,"項"],[12961,1,"休"],[12962,1,"写"],[12963,1,"正"],[12964,1,"上"],[12965,1,"中"],[12966,1,"下"],[12967,1,"左"],[12968,1,"右"],[12969,1,"医"],[12970,1,"宗"],[12971,1,"学"],[12972,1,"監"],[12973,1,"企"],[12974,1,"資"],[12975,1,"協"],[12976,1,"夜"],[12977,1,"36"],[12978,1,"37"],[12979,1,"38"],[12980,1,"39"],[12981,1,"40"],[12982,1,"41"],[12983,1,"42"],[12984,1,"43"],[12985,1,"44"],[12986,1,"45"],[12987,1,"46"],[12988,1,"47"],[12989,1,"48"],[12990,1,"49"],[12991,1,"50"],[12992,1,"1月"],[12993,1,"2月"],[12994,1,"3月"],[12995,1,"4月"],[12996,1,"5月"],[12997,1,"6月"],[12998,1,"7月"],[12999,1,"8月"],[13000,1,"9月"],[13001,1,"10月"],[13002,1,"11月"],[13003,1,"12月"],[13004,1,"hg"],[13005,1,"erg"],[13006,1,"ev"],[13007,1,"ltd"],[13008,1,"ア"],[13009,1,"イ"],[13010,1,"ウ"],[13011,1,"エ"],[13012,1,"オ"],[13013,1,"カ"],[13014,1,"キ"],[13015,1,"ク"],[13016,1,"ケ"],[13017,1,"コ"],[13018,1,"サ"],[13019,1,"シ"],[13020,1,"ス"],[13021,1,"セ"],[13022,1,"ソ"],[13023,1,"タ"],[13024,1,"チ"],[13025,1,"ツ"],[13026,1,"テ"],[13027,1,"ト"],[13028,1,"ナ"],[13029,1,"ニ"],[13030,1,"ヌ"],[13031,1,"ネ"],[13032,1,"ノ"],[13033,1,"ハ"],[13034,1,"ヒ"],[13035,1,"フ"],[13036,1,"ヘ"],[13037,1,"ホ"],[13038,1,"マ"],[13039,1,"ミ"],[13040,1,"ム"],[13041,1,"メ"],[13042,1,"モ"],[13043,1,"ヤ"],[13044,1,"ユ"],[13045,1,"ヨ"],[13046,1,"ラ"],[13047,1,"リ"],[13048,1,"ル"],[13049,1,"レ"],[13050,1,"ロ"],[13051,1,"ワ"],[13052,1,"ヰ"],[13053,1,"ヱ"],[13054,1,"ヲ"],[13055,1,"令和"],[13056,1,"アパート"],[13057,1,"アルファ"],[13058,1,"アンペア"],[13059,1,"アール"],[13060,1,"イニング"],[13061,1,"インチ"],[13062,1,"ウォン"],[13063,1,"エスクード"],[13064,1,"エーカー"],[13065,1,"オンス"],[13066,1,"オーム"],[13067,1,"カイリ"],[13068,1,"カラット"],[13069,1,"カロリー"],[13070,1,"ガロン"],[13071,1,"ガンマ"],[13072,1,"ギガ"],[13073,1,"ギニー"],[13074,1,"キュリー"],[13075,1,"ギルダー"],[13076,1,"キロ"],[13077,1,"キログラム"],[13078,1,"キロメートル"],[13079,1,"キロワット"],[13080,1,"グラム"],[13081,1,"グラムトン"],[13082,1,"クルゼイロ"],[13083,1,"クローネ"],[13084,1,"ケース"],[13085,1,"コルナ"],[13086,1,"コーポ"],[13087,1,"サイクル"],[13088,1,"サンチーム"],[13089,1,"シリング"],[13090,1,"センチ"],[13091,1,"セント"],[13092,1,"ダース"],[13093,1,"デシ"],[13094,1,"ドル"],[13095,1,"トン"],[13096,1,"ナノ"],[13097,1,"ノット"],[13098,1,"ハイツ"],[13099,1,"パーセント"],[13100,1,"パーツ"],[13101,1,"バーレル"],[13102,1,"ピアストル"],[13103,1,"ピクル"],[13104,1,"ピコ"],[13105,1,"ビル"],[13106,1,"ファラッド"],[13107,1,"フィート"],[13108,1,"ブッシェル"],[13109,1,"フラン"],[13110,1,"ヘクタール"],[13111,1,"ペソ"],[13112,1,"ペニヒ"],[13113,1,"ヘルツ"],[13114,1,"ペンス"],[13115,1,"ページ"],[13116,1,"ベータ"],[13117,1,"ポイント"],[13118,1,"ボルト"],[13119,1,"ホン"],[13120,1,"ポンド"],[13121,1,"ホール"],[13122,1,"ホーン"],[13123,1,"マイクロ"],[13124,1,"マイル"],[13125,1,"マッハ"],[13126,1,"マルク"],[13127,1,"マンション"],[13128,1,"ミクロン"],[13129,1,"ミリ"],[13130,1,"ミリバール"],[13131,1,"メガ"],[13132,1,"メガトン"],[13133,1,"メートル"],[13134,1,"ヤード"],[13135,1,"ヤール"],[13136,1,"ユアン"],[13137,1,"リットル"],[13138,1,"リラ"],[13139,1,"ルピー"],[13140,1,"ルーブル"],[13141,1,"レム"],[13142,1,"レントゲン"],[13143,1,"ワット"],[13144,1,"0点"],[13145,1,"1点"],[13146,1,"2点"],[13147,1,"3点"],[13148,1,"4点"],[13149,1,"5点"],[13150,1,"6点"],[13151,1,"7点"],[13152,1,"8点"],[13153,1,"9点"],[13154,1,"10点"],[13155,1,"11点"],[13156,1,"12点"],[13157,1,"13点"],[13158,1,"14点"],[13159,1,"15点"],[13160,1,"16点"],[13161,1,"17点"],[13162,1,"18点"],[13163,1,"19点"],[13164,1,"20点"],[13165,1,"21点"],[13166,1,"22点"],[13167,1,"23点"],[13168,1,"24点"],[13169,1,"hpa"],[13170,1,"da"],[13171,1,"au"],[13172,1,"bar"],[13173,1,"ov"],[13174,1,"pc"],[13175,1,"dm"],[13176,1,"dm2"],[13177,1,"dm3"],[13178,1,"iu"],[13179,1,"平成"],[13180,1,"昭和"],[13181,1,"大正"],[13182,1,"明治"],[13183,1,"株式会社"],[13184,1,"pa"],[13185,1,"na"],[13186,1,"μa"],[13187,1,"ma"],[13188,1,"ka"],[13189,1,"kb"],[13190,1,"mb"],[13191,1,"gb"],[13192,1,"cal"],[13193,1,"kcal"],[13194,1,"pf"],[13195,1,"nf"],[13196,1,"μf"],[13197,1,"μg"],[13198,1,"mg"],[13199,1,"kg"],[13200,1,"hz"],[13201,1,"khz"],[13202,1,"mhz"],[13203,1,"ghz"],[13204,1,"thz"],[13205,1,"μl"],[13206,1,"ml"],[13207,1,"dl"],[13208,1,"kl"],[13209,1,"fm"],[13210,1,"nm"],[13211,1,"μm"],[13212,1,"mm"],[13213,1,"cm"],[13214,1,"km"],[13215,1,"mm2"],[13216,1,"cm2"],[13217,1,"m2"],[13218,1,"km2"],[13219,1,"mm3"],[13220,1,"cm3"],[13221,1,"m3"],[13222,1,"km3"],[13223,1,"m∕s"],[13224,1,"m∕s2"],[13225,1,"pa"],[13226,1,"kpa"],[13227,1,"mpa"],[13228,1,"gpa"],[13229,1,"rad"],[13230,1,"rad∕s"],[13231,1,"rad∕s2"],[13232,1,"ps"],[13233,1,"ns"],[13234,1,"μs"],[13235,1,"ms"],[13236,1,"pv"],[13237,1,"nv"],[13238,1,"μv"],[13239,1,"mv"],[13240,1,"kv"],[13241,1,"mv"],[13242,1,"pw"],[13243,1,"nw"],[13244,1,"μw"],[13245,1,"mw"],[13246,1,"kw"],[13247,1,"mw"],[13248,1,"kω"],[13249,1,"mω"],[13250,3],[13251,1,"bq"],[13252,1,"cc"],[13253,1,"cd"],[13254,1,"c∕kg"],[13255,3],[13256,1,"db"],[13257,1,"gy"],[13258,1,"ha"],[13259,1,"hp"],[13260,1,"in"],[13261,1,"kk"],[13262,1,"km"],[13263,1,"kt"],[13264,1,"lm"],[13265,1,"ln"],[13266,1,"log"],[13267,1,"lx"],[13268,1,"mb"],[13269,1,"mil"],[13270,1,"mol"],[13271,1,"ph"],[13272,3],[13273,1,"ppm"],[13274,1,"pr"],[13275,1,"sr"],[13276,1,"sv"],[13277,1,"wb"],[13278,1,"v∕m"],[13279,1,"a∕m"],[13280,1,"1日"],[13281,1,"2日"],[13282,1,"3日"],[13283,1,"4日"],[13284,1,"5日"],[13285,1,"6日"],[13286,1,"7日"],[13287,1,"8日"],[13288,1,"9日"],[13289,1,"10日"],[13290,1,"11日"],[13291,1,"12日"],[13292,1,"13日"],[13293,1,"14日"],[13294,1,"15日"],[13295,1,"16日"],[13296,1,"17日"],[13297,1,"18日"],[13298,1,"19日"],[13299,1,"20日"],[13300,1,"21日"],[13301,1,"22日"],[13302,1,"23日"],[13303,1,"24日"],[13304,1,"25日"],[13305,1,"26日"],[13306,1,"27日"],[13307,1,"28日"],[13308,1,"29日"],[13309,1,"30日"],[13310,1,"31日"],[13311,1,"gal"],[[13312,19893],2],[[19894,19903],2],[[19904,19967],2],[[19968,40869],2],[[40870,40891],2],[[40892,40899],2],[[40900,40907],2],[40908,2],[[40909,40917],2],[[40918,40938],2],[[40939,40943],2],[[40944,40956],2],[[40957,40959],2],[[40960,42124],2],[[42125,42127],3],[[42128,42145],2],[[42146,42147],2],[[42148,42163],2],[42164,2],[[42165,42176],2],[42177,2],[[42178,42180],2],[42181,2],[42182,2],[[42183,42191],3],[[42192,42237],2],[[42238,42239],2],[[42240,42508],2],[[42509,42511],2],[[42512,42539],2],[[42540,42559],3],[42560,1,"ꙁ"],[42561,2],[42562,1,"ꙃ"],[42563,2],[42564,1,"ꙅ"],[42565,2],[42566,1,"ꙇ"],[42567,2],[42568,1,"ꙉ"],[42569,2],[42570,1,"ꙋ"],[42571,2],[42572,1,"ꙍ"],[42573,2],[42574,1,"ꙏ"],[42575,2],[42576,1,"ꙑ"],[42577,2],[42578,1,"ꙓ"],[42579,2],[42580,1,"ꙕ"],[42581,2],[42582,1,"ꙗ"],[42583,2],[42584,1,"ꙙ"],[42585,2],[42586,1,"ꙛ"],[42587,2],[42588,1,"ꙝ"],[42589,2],[42590,1,"ꙟ"],[42591,2],[42592,1,"ꙡ"],[42593,2],[42594,1,"ꙣ"],[42595,2],[42596,1,"ꙥ"],[42597,2],[42598,1,"ꙧ"],[42599,2],[42600,1,"ꙩ"],[42601,2],[42602,1,"ꙫ"],[42603,2],[42604,1,"ꙭ"],[[42605,42607],2],[[42608,42611],2],[[42612,42619],2],[[42620,42621],2],[42622,2],[42623,2],[42624,1,"ꚁ"],[42625,2],[42626,1,"ꚃ"],[42627,2],[42628,1,"ꚅ"],[42629,2],[42630,1,"ꚇ"],[42631,2],[42632,1,"ꚉ"],[42633,2],[42634,1,"ꚋ"],[42635,2],[42636,1,"ꚍ"],[42637,2],[42638,1,"ꚏ"],[42639,2],[42640,1,"ꚑ"],[42641,2],[42642,1,"ꚓ"],[42643,2],[42644,1,"ꚕ"],[42645,2],[42646,1,"ꚗ"],[42647,2],[42648,1,"ꚙ"],[42649,2],[42650,1,"ꚛ"],[42651,2],[42652,1,"ъ"],[42653,1,"ь"],[42654,2],[42655,2],[[42656,42725],2],[[42726,42735],2],[[42736,42737],2],[[42738,42743],2],[[42744,42751],3],[[42752,42774],2],[[42775,42778],2],[[42779,42783],2],[[42784,42785],2],[42786,1,"ꜣ"],[42787,2],[42788,1,"ꜥ"],[42789,2],[42790,1,"ꜧ"],[42791,2],[42792,1,"ꜩ"],[42793,2],[42794,1,"ꜫ"],[42795,2],[42796,1,"ꜭ"],[42797,2],[42798,1,"ꜯ"],[[42799,42801],2],[42802,1,"ꜳ"],[42803,2],[42804,1,"ꜵ"],[42805,2],[42806,1,"ꜷ"],[42807,2],[42808,1,"ꜹ"],[42809,2],[42810,1,"ꜻ"],[42811,2],[42812,1,"ꜽ"],[42813,2],[42814,1,"ꜿ"],[42815,2],[42816,1,"ꝁ"],[42817,2],[42818,1,"ꝃ"],[42819,2],[42820,1,"ꝅ"],[42821,2],[42822,1,"ꝇ"],[42823,2],[42824,1,"ꝉ"],[42825,2],[42826,1,"ꝋ"],[42827,2],[42828,1,"ꝍ"],[42829,2],[42830,1,"ꝏ"],[42831,2],[42832,1,"ꝑ"],[42833,2],[42834,1,"ꝓ"],[42835,2],[42836,1,"ꝕ"],[42837,2],[42838,1,"ꝗ"],[42839,2],[42840,1,"ꝙ"],[42841,2],[42842,1,"ꝛ"],[42843,2],[42844,1,"ꝝ"],[42845,2],[42846,1,"ꝟ"],[42847,2],[42848,1,"ꝡ"],[42849,2],[42850,1,"ꝣ"],[42851,2],[42852,1,"ꝥ"],[42853,2],[42854,1,"ꝧ"],[42855,2],[42856,1,"ꝩ"],[42857,2],[42858,1,"ꝫ"],[42859,2],[42860,1,"ꝭ"],[42861,2],[42862,1,"ꝯ"],[42863,2],[42864,1,"ꝯ"],[[42865,42872],2],[42873,1,"ꝺ"],[42874,2],[42875,1,"ꝼ"],[42876,2],[42877,1,"ᵹ"],[42878,1,"ꝿ"],[42879,2],[42880,1,"ꞁ"],[42881,2],[42882,1,"ꞃ"],[42883,2],[42884,1,"ꞅ"],[42885,2],[42886,1,"ꞇ"],[[42887,42888],2],[[42889,42890],2],[42891,1,"ꞌ"],[42892,2],[42893,1,"ɥ"],[42894,2],[42895,2],[42896,1,"ꞑ"],[42897,2],[42898,1,"ꞓ"],[42899,2],[[42900,42901],2],[42902,1,"ꞗ"],[42903,2],[42904,1,"ꞙ"],[42905,2],[42906,1,"ꞛ"],[42907,2],[42908,1,"ꞝ"],[42909,2],[42910,1,"ꞟ"],[42911,2],[42912,1,"ꞡ"],[42913,2],[42914,1,"ꞣ"],[42915,2],[42916,1,"ꞥ"],[42917,2],[42918,1,"ꞧ"],[42919,2],[42920,1,"ꞩ"],[42921,2],[42922,1,"ɦ"],[42923,1,"ɜ"],[42924,1,"ɡ"],[42925,1,"ɬ"],[42926,1,"ɪ"],[42927,2],[42928,1,"ʞ"],[42929,1,"ʇ"],[42930,1,"ʝ"],[42931,1,"ꭓ"],[42932,1,"ꞵ"],[42933,2],[42934,1,"ꞷ"],[42935,2],[42936,1,"ꞹ"],[42937,2],[42938,1,"ꞻ"],[42939,2],[42940,1,"ꞽ"],[42941,2],[42942,1,"ꞿ"],[42943,2],[42944,1,"ꟁ"],[42945,2],[42946,1,"ꟃ"],[42947,2],[42948,1,"ꞔ"],[42949,1,"ʂ"],[42950,1,"ᶎ"],[42951,1,"ꟈ"],[42952,2],[42953,1,"ꟊ"],[42954,2],[42955,1,"ɤ"],[42956,1,"ꟍ"],[42957,2],[[42958,42959],3],[42960,1,"ꟑ"],[42961,2],[42962,3],[42963,2],[42964,3],[42965,2],[42966,1,"ꟗ"],[42967,2],[42968,1,"ꟙ"],[42969,2],[42970,1,"ꟛ"],[42971,2],[42972,1,"ƛ"],[[42973,42993],3],[42994,1,"c"],[42995,1,"f"],[42996,1,"q"],[42997,1,"ꟶ"],[42998,2],[42999,2],[43000,1,"ħ"],[43001,1,"œ"],[43002,2],[[43003,43007],2],[[43008,43047],2],[[43048,43051],2],[43052,2],[[43053,43055],3],[[43056,43065],2],[[43066,43071],3],[[43072,43123],2],[[43124,43127],2],[[43128,43135],3],[[43136,43204],2],[43205,2],[[43206,43213],3],[[43214,43215],2],[[43216,43225],2],[[43226,43231],3],[[43232,43255],2],[[43256,43258],2],[43259,2],[43260,2],[43261,2],[[43262,43263],2],[[43264,43309],2],[[43310,43311],2],[[43312,43347],2],[[43348,43358],3],[43359,2],[[43360,43388],2],[[43389,43391],3],[[43392,43456],2],[[43457,43469],2],[43470,3],[[43471,43481],2],[[43482,43485],3],[[43486,43487],2],[[43488,43518],2],[43519,3],[[43520,43574],2],[[43575,43583],3],[[43584,43597],2],[[43598,43599],3],[[43600,43609],2],[[43610,43611],3],[[43612,43615],2],[[43616,43638],2],[[43639,43641],2],[[43642,43643],2],[[43644,43647],2],[[43648,43714],2],[[43715,43738],3],[[43739,43741],2],[[43742,43743],2],[[43744,43759],2],[[43760,43761],2],[[43762,43766],2],[[43767,43776],3],[[43777,43782],2],[[43783,43784],3],[[43785,43790],2],[[43791,43792],3],[[43793,43798],2],[[43799,43807],3],[[43808,43814],2],[43815,3],[[43816,43822],2],[43823,3],[[43824,43866],2],[43867,2],[43868,1,"ꜧ"],[43869,1,"ꬷ"],[43870,1,"ɫ"],[43871,1,"ꭒ"],[[43872,43875],2],[[43876,43877],2],[[43878,43879],2],[43880,2],[43881,1,"ʍ"],[[43882,43883],2],[[43884,43887],3],[43888,1,"Ꭰ"],[43889,1,"Ꭱ"],[43890,1,"Ꭲ"],[43891,1,"Ꭳ"],[43892,1,"Ꭴ"],[43893,1,"Ꭵ"],[43894,1,"Ꭶ"],[43895,1,"Ꭷ"],[43896,1,"Ꭸ"],[43897,1,"Ꭹ"],[43898,1,"Ꭺ"],[43899,1,"Ꭻ"],[43900,1,"Ꭼ"],[43901,1,"Ꭽ"],[43902,1,"Ꭾ"],[43903,1,"Ꭿ"],[43904,1,"Ꮀ"],[43905,1,"Ꮁ"],[43906,1,"Ꮂ"],[43907,1,"Ꮃ"],[43908,1,"Ꮄ"],[43909,1,"Ꮅ"],[43910,1,"Ꮆ"],[43911,1,"Ꮇ"],[43912,1,"Ꮈ"],[43913,1,"Ꮉ"],[43914,1,"Ꮊ"],[43915,1,"Ꮋ"],[43916,1,"Ꮌ"],[43917,1,"Ꮍ"],[43918,1,"Ꮎ"],[43919,1,"Ꮏ"],[43920,1,"Ꮐ"],[43921,1,"Ꮑ"],[43922,1,"Ꮒ"],[43923,1,"Ꮓ"],[43924,1,"Ꮔ"],[43925,1,"Ꮕ"],[43926,1,"Ꮖ"],[43927,1,"Ꮗ"],[43928,1,"Ꮘ"],[43929,1,"Ꮙ"],[43930,1,"Ꮚ"],[43931,1,"Ꮛ"],[43932,1,"Ꮜ"],[43933,1,"Ꮝ"],[43934,1,"Ꮞ"],[43935,1,"Ꮟ"],[43936,1,"Ꮠ"],[43937,1,"Ꮡ"],[43938,1,"Ꮢ"],[43939,1,"Ꮣ"],[43940,1,"Ꮤ"],[43941,1,"Ꮥ"],[43942,1,"Ꮦ"],[43943,1,"Ꮧ"],[43944,1,"Ꮨ"],[43945,1,"Ꮩ"],[43946,1,"Ꮪ"],[43947,1,"Ꮫ"],[43948,1,"Ꮬ"],[43949,1,"Ꮭ"],[43950,1,"Ꮮ"],[43951,1,"Ꮯ"],[43952,1,"Ꮰ"],[43953,1,"Ꮱ"],[43954,1,"Ꮲ"],[43955,1,"Ꮳ"],[43956,1,"Ꮴ"],[43957,1,"Ꮵ"],[43958,1,"Ꮶ"],[43959,1,"Ꮷ"],[43960,1,"Ꮸ"],[43961,1,"Ꮹ"],[43962,1,"Ꮺ"],[43963,1,"Ꮻ"],[43964,1,"Ꮼ"],[43965,1,"Ꮽ"],[43966,1,"Ꮾ"],[43967,1,"Ꮿ"],[[43968,44010],2],[44011,2],[[44012,44013],2],[[44014,44015],3],[[44016,44025],2],[[44026,44031],3],[[44032,55203],2],[[55204,55215],3],[[55216,55238],2],[[55239,55242],3],[[55243,55291],2],[[55292,55295],3],[[55296,57343],3],[[57344,63743],3],[63744,1,"豈"],[63745,1,"更"],[63746,1,"車"],[63747,1,"賈"],[63748,1,"滑"],[63749,1,"串"],[63750,1,"句"],[[63751,63752],1,"龜"],[63753,1,"契"],[63754,1,"金"],[63755,1,"喇"],[63756,1,"奈"],[63757,1,"懶"],[63758,1,"癩"],[63759,1,"羅"],[63760,1,"蘿"],[63761,1,"螺"],[63762,1,"裸"],[63763,1,"邏"],[63764,1,"樂"],[63765,1,"洛"],[63766,1,"烙"],[63767,1,"珞"],[63768,1,"落"],[63769,1,"酪"],[63770,1,"駱"],[63771,1,"亂"],[63772,1,"卵"],[63773,1,"欄"],[63774,1,"爛"],[63775,1,"蘭"],[63776,1,"鸞"],[63777,1,"嵐"],[63778,1,"濫"],[63779,1,"藍"],[63780,1,"襤"],[63781,1,"拉"],[63782,1,"臘"],[63783,1,"蠟"],[63784,1,"廊"],[63785,1,"朗"],[63786,1,"浪"],[63787,1,"狼"],[63788,1,"郎"],[63789,1,"來"],[63790,1,"冷"],[63791,1,"勞"],[63792,1,"擄"],[63793,1,"櫓"],[63794,1,"爐"],[63795,1,"盧"],[63796,1,"老"],[63797,1,"蘆"],[63798,1,"虜"],[63799,1,"路"],[63800,1,"露"],[63801,1,"魯"],[63802,1,"鷺"],[63803,1,"碌"],[63804,1,"祿"],[63805,1,"綠"],[63806,1,"菉"],[63807,1,"錄"],[63808,1,"鹿"],[63809,1,"論"],[63810,1,"壟"],[63811,1,"弄"],[63812,1,"籠"],[63813,1,"聾"],[63814,1,"牢"],[63815,1,"磊"],[63816,1,"賂"],[63817,1,"雷"],[63818,1,"壘"],[63819,1,"屢"],[63820,1,"樓"],[63821,1,"淚"],[63822,1,"漏"],[63823,1,"累"],[63824,1,"縷"],[63825,1,"陋"],[63826,1,"勒"],[63827,1,"肋"],[63828,1,"凜"],[63829,1,"凌"],[63830,1,"稜"],[63831,1,"綾"],[63832,1,"菱"],[63833,1,"陵"],[63834,1,"讀"],[63835,1,"拏"],[63836,1,"樂"],[63837,1,"諾"],[63838,1,"丹"],[63839,1,"寧"],[63840,1,"怒"],[63841,1,"率"],[63842,1,"異"],[63843,1,"北"],[63844,1,"磻"],[63845,1,"便"],[63846,1,"復"],[63847,1,"不"],[63848,1,"泌"],[63849,1,"數"],[63850,1,"索"],[63851,1,"參"],[63852,1,"塞"],[63853,1,"省"],[63854,1,"葉"],[63855,1,"說"],[63856,1,"殺"],[63857,1,"辰"],[63858,1,"沈"],[63859,1,"拾"],[63860,1,"若"],[63861,1,"掠"],[63862,1,"略"],[63863,1,"亮"],[63864,1,"兩"],[63865,1,"凉"],[63866,1,"梁"],[63867,1,"糧"],[63868,1,"良"],[63869,1,"諒"],[63870,1,"量"],[63871,1,"勵"],[63872,1,"呂"],[63873,1,"女"],[63874,1,"廬"],[63875,1,"旅"],[63876,1,"濾"],[63877,1,"礪"],[63878,1,"閭"],[63879,1,"驪"],[63880,1,"麗"],[63881,1,"黎"],[63882,1,"力"],[63883,1,"曆"],[63884,1,"歷"],[63885,1,"轢"],[63886,1,"年"],[63887,1,"憐"],[63888,1,"戀"],[63889,1,"撚"],[63890,1,"漣"],[63891,1,"煉"],[63892,1,"璉"],[63893,1,"秊"],[63894,1,"練"],[63895,1,"聯"],[63896,1,"輦"],[63897,1,"蓮"],[63898,1,"連"],[63899,1,"鍊"],[63900,1,"列"],[63901,1,"劣"],[63902,1,"咽"],[63903,1,"烈"],[63904,1,"裂"],[63905,1,"說"],[63906,1,"廉"],[63907,1,"念"],[63908,1,"捻"],[63909,1,"殮"],[63910,1,"簾"],[63911,1,"獵"],[63912,1,"令"],[63913,1,"囹"],[63914,1,"寧"],[63915,1,"嶺"],[63916,1,"怜"],[63917,1,"玲"],[63918,1,"瑩"],[63919,1,"羚"],[63920,1,"聆"],[63921,1,"鈴"],[63922,1,"零"],[63923,1,"靈"],[63924,1,"領"],[63925,1,"例"],[63926,1,"禮"],[63927,1,"醴"],[63928,1,"隸"],[63929,1,"惡"],[63930,1,"了"],[63931,1,"僚"],[63932,1,"寮"],[63933,1,"尿"],[63934,1,"料"],[63935,1,"樂"],[63936,1,"燎"],[63937,1,"療"],[63938,1,"蓼"],[63939,1,"遼"],[63940,1,"龍"],[63941,1,"暈"],[63942,1,"阮"],[63943,1,"劉"],[63944,1,"杻"],[63945,1,"柳"],[63946,1,"流"],[63947,1,"溜"],[63948,1,"琉"],[63949,1,"留"],[63950,1,"硫"],[63951,1,"紐"],[63952,1,"類"],[63953,1,"六"],[63954,1,"戮"],[63955,1,"陸"],[63956,1,"倫"],[63957,1,"崙"],[63958,1,"淪"],[63959,1,"輪"],[63960,1,"律"],[63961,1,"慄"],[63962,1,"栗"],[63963,1,"率"],[63964,1,"隆"],[63965,1,"利"],[63966,1,"吏"],[63967,1,"履"],[63968,1,"易"],[63969,1,"李"],[63970,1,"梨"],[63971,1,"泥"],[63972,1,"理"],[63973,1,"痢"],[63974,1,"罹"],[63975,1,"裏"],[63976,1,"裡"],[63977,1,"里"],[63978,1,"離"],[63979,1,"匿"],[63980,1,"溺"],[63981,1,"吝"],[63982,1,"燐"],[63983,1,"璘"],[63984,1,"藺"],[63985,1,"隣"],[63986,1,"鱗"],[63987,1,"麟"],[63988,1,"林"],[63989,1,"淋"],[63990,1,"臨"],[63991,1,"立"],[63992,1,"笠"],[63993,1,"粒"],[63994,1,"狀"],[63995,1,"炙"],[63996,1,"識"],[63997,1,"什"],[63998,1,"茶"],[63999,1,"刺"],[64000,1,"切"],[64001,1,"度"],[64002,1,"拓"],[64003,1,"糖"],[64004,1,"宅"],[64005,1,"洞"],[64006,1,"暴"],[64007,1,"輻"],[64008,1,"行"],[64009,1,"降"],[64010,1,"見"],[64011,1,"廓"],[64012,1,"兀"],[64013,1,"嗀"],[[64014,64015],2],[64016,1,"塚"],[64017,2],[64018,1,"晴"],[[64019,64020],2],[64021,1,"凞"],[64022,1,"猪"],[64023,1,"益"],[64024,1,"礼"],[64025,1,"神"],[64026,1,"祥"],[64027,1,"福"],[64028,1,"靖"],[64029,1,"精"],[64030,1,"羽"],[64031,2],[64032,1,"蘒"],[64033,2],[64034,1,"諸"],[[64035,64036],2],[64037,1,"逸"],[64038,1,"都"],[[64039,64041],2],[64042,1,"飯"],[64043,1,"飼"],[64044,1,"館"],[64045,1,"鶴"],[64046,1,"郞"],[64047,1,"隷"],[64048,1,"侮"],[64049,1,"僧"],[64050,1,"免"],[64051,1,"勉"],[64052,1,"勤"],[64053,1,"卑"],[64054,1,"喝"],[64055,1,"嘆"],[64056,1,"器"],[64057,1,"塀"],[64058,1,"墨"],[64059,1,"層"],[64060,1,"屮"],[64061,1,"悔"],[64062,1,"慨"],[64063,1,"憎"],[64064,1,"懲"],[64065,1,"敏"],[64066,1,"既"],[64067,1,"暑"],[64068,1,"梅"],[64069,1,"海"],[64070,1,"渚"],[64071,1,"漢"],[64072,1,"煮"],[64073,1,"爫"],[64074,1,"琢"],[64075,1,"碑"],[64076,1,"社"],[64077,1,"祉"],[64078,1,"祈"],[64079,1,"祐"],[64080,1,"祖"],[64081,1,"祝"],[64082,1,"禍"],[64083,1,"禎"],[64084,1,"穀"],[64085,1,"突"],[64086,1,"節"],[64087,1,"練"],[64088,1,"縉"],[64089,1,"繁"],[64090,1,"署"],[64091,1,"者"],[64092,1,"臭"],[[64093,64094],1,"艹"],[64095,1,"著"],[64096,1,"褐"],[64097,1,"視"],[64098,1,"謁"],[64099,1,"謹"],[64100,1,"賓"],[64101,1,"贈"],[64102,1,"辶"],[64103,1,"逸"],[64104,1,"難"],[64105,1,"響"],[64106,1,"頻"],[64107,1,"恵"],[64108,1,"𤋮"],[64109,1,"舘"],[[64110,64111],3],[64112,1,"並"],[64113,1,"况"],[64114,1,"全"],[64115,1,"侀"],[64116,1,"充"],[64117,1,"冀"],[64118,1,"勇"],[64119,1,"勺"],[64120,1,"喝"],[64121,1,"啕"],[64122,1,"喙"],[64123,1,"嗢"],[64124,1,"塚"],[64125,1,"墳"],[64126,1,"奄"],[64127,1,"奔"],[64128,1,"婢"],[64129,1,"嬨"],[64130,1,"廒"],[64131,1,"廙"],[64132,1,"彩"],[64133,1,"徭"],[64134,1,"惘"],[64135,1,"慎"],[64136,1,"愈"],[64137,1,"憎"],[64138,1,"慠"],[64139,1,"懲"],[64140,1,"戴"],[64141,1,"揄"],[64142,1,"搜"],[64143,1,"摒"],[64144,1,"敖"],[64145,1,"晴"],[64146,1,"朗"],[64147,1,"望"],[64148,1,"杖"],[64149,1,"歹"],[64150,1,"殺"],[64151,1,"流"],[64152,1,"滛"],[64153,1,"滋"],[64154,1,"漢"],[64155,1,"瀞"],[64156,1,"煮"],[64157,1,"瞧"],[64158,1,"爵"],[64159,1,"犯"],[64160,1,"猪"],[64161,1,"瑱"],[64162,1,"甆"],[64163,1,"画"],[64164,1,"瘝"],[64165,1,"瘟"],[64166,1,"益"],[64167,1,"盛"],[64168,1,"直"],[64169,1,"睊"],[64170,1,"着"],[64171,1,"磌"],[64172,1,"窱"],[64173,1,"節"],[64174,1,"类"],[64175,1,"絛"],[64176,1,"練"],[64177,1,"缾"],[64178,1,"者"],[64179,1,"荒"],[64180,1,"華"],[64181,1,"蝹"],[64182,1,"襁"],[64183,1,"覆"],[64184,1,"視"],[64185,1,"調"],[64186,1,"諸"],[64187,1,"請"],[64188,1,"謁"],[64189,1,"諾"],[64190,1,"諭"],[64191,1,"謹"],[64192,1,"變"],[64193,1,"贈"],[64194,1,"輸"],[64195,1,"遲"],[64196,1,"醙"],[64197,1,"鉶"],[64198,1,"陼"],[64199,1,"難"],[64200,1,"靖"],[64201,1,"韛"],[64202,1,"響"],[64203,1,"頋"],[64204,1,"頻"],[64205,1,"鬒"],[64206,1,"龜"],[64207,1,"𢡊"],[64208,1,"𢡄"],[64209,1,"𣏕"],[64210,1,"㮝"],[64211,1,"䀘"],[64212,1,"䀹"],[64213,1,"𥉉"],[64214,1,"𥳐"],[64215,1,"𧻓"],[64216,1,"齃"],[64217,1,"龎"],[[64218,64255],3],[64256,1,"ff"],[64257,1,"fi"],[64258,1,"fl"],[64259,1,"ffi"],[64260,1,"ffl"],[[64261,64262],1,"st"],[[64263,64274],3],[64275,1,"մն"],[64276,1,"մե"],[64277,1,"մի"],[64278,1,"վն"],[64279,1,"մխ"],[[64280,64284],3],[64285,1,"יִ"],[64286,2],[64287,1,"ײַ"],[64288,1,"ע"],[64289,1,"א"],[64290,1,"ד"],[64291,1,"ה"],[64292,1,"כ"],[64293,1,"ל"],[64294,1,"ם"],[64295,1,"ר"],[64296,1,"ת"],[64297,1,"+"],[64298,1,"שׁ"],[64299,1,"שׂ"],[64300,1,"שּׁ"],[64301,1,"שּׂ"],[64302,1,"אַ"],[64303,1,"אָ"],[64304,1,"אּ"],[64305,1,"בּ"],[64306,1,"גּ"],[64307,1,"דּ"],[64308,1,"הּ"],[64309,1,"וּ"],[64310,1,"זּ"],[64311,3],[64312,1,"טּ"],[64313,1,"יּ"],[64314,1,"ךּ"],[64315,1,"כּ"],[64316,1,"לּ"],[64317,3],[64318,1,"מּ"],[64319,3],[64320,1,"נּ"],[64321,1,"סּ"],[64322,3],[64323,1,"ףּ"],[64324,1,"פּ"],[64325,3],[64326,1,"צּ"],[64327,1,"קּ"],[64328,1,"רּ"],[64329,1,"שּ"],[64330,1,"תּ"],[64331,1,"וֹ"],[64332,1,"בֿ"],[64333,1,"כֿ"],[64334,1,"פֿ"],[64335,1,"אל"],[[64336,64337],1,"ٱ"],[[64338,64341],1,"ٻ"],[[64342,64345],1,"پ"],[[64346,64349],1,"ڀ"],[[64350,64353],1,"ٺ"],[[64354,64357],1,"ٿ"],[[64358,64361],1,"ٹ"],[[64362,64365],1,"ڤ"],[[64366,64369],1,"ڦ"],[[64370,64373],1,"ڄ"],[[64374,64377],1,"ڃ"],[[64378,64381],1,"چ"],[[64382,64385],1,"ڇ"],[[64386,64387],1,"ڍ"],[[64388,64389],1,"ڌ"],[[64390,64391],1,"ڎ"],[[64392,64393],1,"ڈ"],[[64394,64395],1,"ژ"],[[64396,64397],1,"ڑ"],[[64398,64401],1,"ک"],[[64402,64405],1,"گ"],[[64406,64409],1,"ڳ"],[[64410,64413],1,"ڱ"],[[64414,64415],1,"ں"],[[64416,64419],1,"ڻ"],[[64420,64421],1,"ۀ"],[[64422,64425],1,"ہ"],[[64426,64429],1,"ھ"],[[64430,64431],1,"ے"],[[64432,64433],1,"ۓ"],[[64434,64449],2],[64450,2],[[64451,64466],3],[[64467,64470],1,"ڭ"],[[64471,64472],1,"ۇ"],[[64473,64474],1,"ۆ"],[[64475,64476],1,"ۈ"],[64477,1,"ۇٴ"],[[64478,64479],1,"ۋ"],[[64480,64481],1,"ۅ"],[[64482,64483],1,"ۉ"],[[64484,64487],1,"ې"],[[64488,64489],1,"ى"],[[64490,64491],1,"ئا"],[[64492,64493],1,"ئە"],[[64494,64495],1,"ئو"],[[64496,64497],1,"ئۇ"],[[64498,64499],1,"ئۆ"],[[64500,64501],1,"ئۈ"],[[64502,64504],1,"ئې"],[[64505,64507],1,"ئى"],[[64508,64511],1,"ی"],[64512,1,"ئج"],[64513,1,"ئح"],[64514,1,"ئم"],[64515,1,"ئى"],[64516,1,"ئي"],[64517,1,"بج"],[64518,1,"بح"],[64519,1,"بخ"],[64520,1,"بم"],[64521,1,"بى"],[64522,1,"بي"],[64523,1,"تج"],[64524,1,"تح"],[64525,1,"تخ"],[64526,1,"تم"],[64527,1,"تى"],[64528,1,"تي"],[64529,1,"ثج"],[64530,1,"ثم"],[64531,1,"ثى"],[64532,1,"ثي"],[64533,1,"جح"],[64534,1,"جم"],[64535,1,"حج"],[64536,1,"حم"],[64537,1,"خج"],[64538,1,"خح"],[64539,1,"خم"],[64540,1,"سج"],[64541,1,"سح"],[64542,1,"سخ"],[64543,1,"سم"],[64544,1,"صح"],[64545,1,"صم"],[64546,1,"ضج"],[64547,1,"ضح"],[64548,1,"ضخ"],[64549,1,"ضم"],[64550,1,"طح"],[64551,1,"طم"],[64552,1,"ظم"],[64553,1,"عج"],[64554,1,"عم"],[64555,1,"غج"],[64556,1,"غم"],[64557,1,"فج"],[64558,1,"فح"],[64559,1,"فخ"],[64560,1,"فم"],[64561,1,"فى"],[64562,1,"في"],[64563,1,"قح"],[64564,1,"قم"],[64565,1,"قى"],[64566,1,"قي"],[64567,1,"كا"],[64568,1,"كج"],[64569,1,"كح"],[64570,1,"كخ"],[64571,1,"كل"],[64572,1,"كم"],[64573,1,"كى"],[64574,1,"كي"],[64575,1,"لج"],[64576,1,"لح"],[64577,1,"لخ"],[64578,1,"لم"],[64579,1,"لى"],[64580,1,"لي"],[64581,1,"مج"],[64582,1,"مح"],[64583,1,"مخ"],[64584,1,"مم"],[64585,1,"مى"],[64586,1,"مي"],[64587,1,"نج"],[64588,1,"نح"],[64589,1,"نخ"],[64590,1,"نم"],[64591,1,"نى"],[64592,1,"ني"],[64593,1,"هج"],[64594,1,"هم"],[64595,1,"هى"],[64596,1,"هي"],[64597,1,"يج"],[64598,1,"يح"],[64599,1,"يخ"],[64600,1,"يم"],[64601,1,"يى"],[64602,1,"يي"],[64603,1,"ذٰ"],[64604,1,"رٰ"],[64605,1,"ىٰ"],[64606,1," ٌّ"],[64607,1," ٍّ"],[64608,1," َّ"],[64609,1," ُّ"],[64610,1," ِّ"],[64611,1," ّٰ"],[64612,1,"ئر"],[64613,1,"ئز"],[64614,1,"ئم"],[64615,1,"ئن"],[64616,1,"ئى"],[64617,1,"ئي"],[64618,1,"بر"],[64619,1,"بز"],[64620,1,"بم"],[64621,1,"بن"],[64622,1,"بى"],[64623,1,"بي"],[64624,1,"تر"],[64625,1,"تز"],[64626,1,"تم"],[64627,1,"تن"],[64628,1,"تى"],[64629,1,"تي"],[64630,1,"ثر"],[64631,1,"ثز"],[64632,1,"ثم"],[64633,1,"ثن"],[64634,1,"ثى"],[64635,1,"ثي"],[64636,1,"فى"],[64637,1,"في"],[64638,1,"قى"],[64639,1,"قي"],[64640,1,"كا"],[64641,1,"كل"],[64642,1,"كم"],[64643,1,"كى"],[64644,1,"كي"],[64645,1,"لم"],[64646,1,"لى"],[64647,1,"لي"],[64648,1,"ما"],[64649,1,"مم"],[64650,1,"نر"],[64651,1,"نز"],[64652,1,"نم"],[64653,1,"نن"],[64654,1,"نى"],[64655,1,"ني"],[64656,1,"ىٰ"],[64657,1,"ير"],[64658,1,"يز"],[64659,1,"يم"],[64660,1,"ين"],[64661,1,"يى"],[64662,1,"يي"],[64663,1,"ئج"],[64664,1,"ئح"],[64665,1,"ئخ"],[64666,1,"ئم"],[64667,1,"ئه"],[64668,1,"بج"],[64669,1,"بح"],[64670,1,"بخ"],[64671,1,"بم"],[64672,1,"به"],[64673,1,"تج"],[64674,1,"تح"],[64675,1,"تخ"],[64676,1,"تم"],[64677,1,"ته"],[64678,1,"ثم"],[64679,1,"جح"],[64680,1,"جم"],[64681,1,"حج"],[64682,1,"حم"],[64683,1,"خج"],[64684,1,"خم"],[64685,1,"سج"],[64686,1,"سح"],[64687,1,"سخ"],[64688,1,"سم"],[64689,1,"صح"],[64690,1,"صخ"],[64691,1,"صم"],[64692,1,"ضج"],[64693,1,"ضح"],[64694,1,"ضخ"],[64695,1,"ضم"],[64696,1,"طح"],[64697,1,"ظم"],[64698,1,"عج"],[64699,1,"عم"],[64700,1,"غج"],[64701,1,"غم"],[64702,1,"فج"],[64703,1,"فح"],[64704,1,"فخ"],[64705,1,"فم"],[64706,1,"قح"],[64707,1,"قم"],[64708,1,"كج"],[64709,1,"كح"],[64710,1,"كخ"],[64711,1,"كل"],[64712,1,"كم"],[64713,1,"لج"],[64714,1,"لح"],[64715,1,"لخ"],[64716,1,"لم"],[64717,1,"له"],[64718,1,"مج"],[64719,1,"مح"],[64720,1,"مخ"],[64721,1,"مم"],[64722,1,"نج"],[64723,1,"نح"],[64724,1,"نخ"],[64725,1,"نم"],[64726,1,"نه"],[64727,1,"هج"],[64728,1,"هم"],[64729,1,"هٰ"],[64730,1,"يج"],[64731,1,"يح"],[64732,1,"يخ"],[64733,1,"يم"],[64734,1,"يه"],[64735,1,"ئم"],[64736,1,"ئه"],[64737,1,"بم"],[64738,1,"به"],[64739,1,"تم"],[64740,1,"ته"],[64741,1,"ثم"],[64742,1,"ثه"],[64743,1,"سم"],[64744,1,"سه"],[64745,1,"شم"],[64746,1,"شه"],[64747,1,"كل"],[64748,1,"كم"],[64749,1,"لم"],[64750,1,"نم"],[64751,1,"نه"],[64752,1,"يم"],[64753,1,"يه"],[64754,1,"ـَّ"],[64755,1,"ـُّ"],[64756,1,"ـِّ"],[64757,1,"طى"],[64758,1,"طي"],[64759,1,"عى"],[64760,1,"عي"],[64761,1,"غى"],[64762,1,"غي"],[64763,1,"سى"],[64764,1,"سي"],[64765,1,"شى"],[64766,1,"شي"],[64767,1,"حى"],[64768,1,"حي"],[64769,1,"جى"],[64770,1,"جي"],[64771,1,"خى"],[64772,1,"خي"],[64773,1,"صى"],[64774,1,"صي"],[64775,1,"ضى"],[64776,1,"ضي"],[64777,1,"شج"],[64778,1,"شح"],[64779,1,"شخ"],[64780,1,"شم"],[64781,1,"شر"],[64782,1,"سر"],[64783,1,"صر"],[64784,1,"ضر"],[64785,1,"طى"],[64786,1,"طي"],[64787,1,"عى"],[64788,1,"عي"],[64789,1,"غى"],[64790,1,"غي"],[64791,1,"سى"],[64792,1,"سي"],[64793,1,"شى"],[64794,1,"شي"],[64795,1,"حى"],[64796,1,"حي"],[64797,1,"جى"],[64798,1,"جي"],[64799,1,"خى"],[64800,1,"خي"],[64801,1,"صى"],[64802,1,"صي"],[64803,1,"ضى"],[64804,1,"ضي"],[64805,1,"شج"],[64806,1,"شح"],[64807,1,"شخ"],[64808,1,"شم"],[64809,1,"شر"],[64810,1,"سر"],[64811,1,"صر"],[64812,1,"ضر"],[64813,1,"شج"],[64814,1,"شح"],[64815,1,"شخ"],[64816,1,"شم"],[64817,1,"سه"],[64818,1,"شه"],[64819,1,"طم"],[64820,1,"سج"],[64821,1,"سح"],[64822,1,"سخ"],[64823,1,"شج"],[64824,1,"شح"],[64825,1,"شخ"],[64826,1,"طم"],[64827,1,"ظم"],[[64828,64829],1,"اً"],[[64830,64831],2],[[64832,64847],2],[64848,1,"تجم"],[[64849,64850],1,"تحج"],[64851,1,"تحم"],[64852,1,"تخم"],[64853,1,"تمج"],[64854,1,"تمح"],[64855,1,"تمخ"],[[64856,64857],1,"جمح"],[64858,1,"حمي"],[64859,1,"حمى"],[64860,1,"سحج"],[64861,1,"سجح"],[64862,1,"سجى"],[[64863,64864],1,"سمح"],[64865,1,"سمج"],[[64866,64867],1,"سمم"],[[64868,64869],1,"صحح"],[64870,1,"صمم"],[[64871,64872],1,"شحم"],[64873,1,"شجي"],[[64874,64875],1,"شمخ"],[[64876,64877],1,"شمم"],[64878,1,"ضحى"],[[64879,64880],1,"ضخم"],[[64881,64882],1,"طمح"],[64883,1,"طمم"],[64884,1,"طمي"],[64885,1,"عجم"],[[64886,64887],1,"عمم"],[64888,1,"عمى"],[64889,1,"غمم"],[64890,1,"غمي"],[64891,1,"غمى"],[[64892,64893],1,"فخم"],[64894,1,"قمح"],[64895,1,"قمم"],[64896,1,"لحم"],[64897,1,"لحي"],[64898,1,"لحى"],[[64899,64900],1,"لجج"],[[64901,64902],1,"لخم"],[[64903,64904],1,"لمح"],[64905,1,"محج"],[64906,1,"محم"],[64907,1,"محي"],[64908,1,"مجح"],[64909,1,"مجم"],[64910,1,"مخج"],[64911,1,"مخم"],[[64912,64913],3],[64914,1,"مجخ"],[64915,1,"همج"],[64916,1,"همم"],[64917,1,"نحم"],[64918,1,"نحى"],[[64919,64920],1,"نجم"],[64921,1,"نجى"],[64922,1,"نمي"],[64923,1,"نمى"],[[64924,64925],1,"يمم"],[64926,1,"بخي"],[64927,1,"تجي"],[64928,1,"تجى"],[64929,1,"تخي"],[64930,1,"تخى"],[64931,1,"تمي"],[64932,1,"تمى"],[64933,1,"جمي"],[64934,1,"جحى"],[64935,1,"جمى"],[64936,1,"سخى"],[64937,1,"صحي"],[64938,1,"شحي"],[64939,1,"ضحي"],[64940,1,"لجي"],[64941,1,"لمي"],[64942,1,"يحي"],[64943,1,"يجي"],[64944,1,"يمي"],[64945,1,"ممي"],[64946,1,"قمي"],[64947,1,"نحي"],[64948,1,"قمح"],[64949,1,"لحم"],[64950,1,"عمي"],[64951,1,"كمي"],[64952,1,"نجح"],[64953,1,"مخي"],[64954,1,"لجم"],[64955,1,"كمم"],[64956,1,"لجم"],[64957,1,"نجح"],[64958,1,"جحي"],[64959,1,"حجي"],[64960,1,"مجي"],[64961,1,"فمي"],[64962,1,"بحي"],[64963,1,"كمم"],[64964,1,"عجم"],[64965,1,"صمم"],[64966,1,"سخي"],[64967,1,"نجي"],[[64968,64974],3],[64975,2],[[64976,65007],3],[65008,1,"صلے"],[65009,1,"قلے"],[65010,1,"الله"],[65011,1,"اكبر"],[65012,1,"محمد"],[65013,1,"صلعم"],[65014,1,"رسول"],[65015,1,"عليه"],[65016,1,"وسلم"],[65017,1,"صلى"],[65018,1,"صلى الله عليه وسلم"],[65019,1,"جل جلاله"],[65020,1,"ریال"],[65021,2],[[65022,65023],2],[[65024,65039],7],[65040,1,","],[65041,1,"、"],[65042,3],[65043,1,":"],[65044,1,";"],[65045,1,"!"],[65046,1,"?"],[65047,1,"〖"],[65048,1,"〗"],[65049,3],[[65050,65055],3],[[65056,65059],2],[[65060,65062],2],[[65063,65069],2],[[65070,65071],2],[65072,3],[65073,1,"—"],[65074,1,"–"],[[65075,65076],1,"_"],[65077,1,"("],[65078,1,")"],[65079,1,"{"],[65080,1,"}"],[65081,1,"〔"],[65082,1,"〕"],[65083,1,"【"],[65084,1,"】"],[65085,1,"《"],[65086,1,"》"],[65087,1,"〈"],[65088,1,"〉"],[65089,1,"「"],[65090,1,"」"],[65091,1,"『"],[65092,1,"』"],[[65093,65094],2],[65095,1,"["],[65096,1,"]"],[[65097,65100],1," ̅"],[[65101,65103],1,"_"],[65104,1,","],[65105,1,"、"],[65106,3],[65107,3],[65108,1,";"],[65109,1,":"],[65110,1,"?"],[65111,1,"!"],[65112,1,"—"],[65113,1,"("],[65114,1,")"],[65115,1,"{"],[65116,1,"}"],[65117,1,"〔"],[65118,1,"〕"],[65119,1,"#"],[65120,1,"&"],[65121,1,"*"],[65122,1,"+"],[65123,1,"-"],[65124,1,"<"],[65125,1,">"],[65126,1,"="],[65127,3],[65128,1,"\\\\"],[65129,1,"$"],[65130,1,"%"],[65131,1,"@"],[[65132,65135],3],[65136,1," ً"],[65137,1,"ـً"],[65138,1," ٌ"],[65139,2],[65140,1," ٍ"],[65141,3],[65142,1," َ"],[65143,1,"ـَ"],[65144,1," ُ"],[65145,1,"ـُ"],[65146,1," ِ"],[65147,1,"ـِ"],[65148,1," ّ"],[65149,1,"ـّ"],[65150,1," ْ"],[65151,1,"ـْ"],[65152,1,"ء"],[[65153,65154],1,"آ"],[[65155,65156],1,"أ"],[[65157,65158],1,"ؤ"],[[65159,65160],1,"إ"],[[65161,65164],1,"ئ"],[[65165,65166],1,"ا"],[[65167,65170],1,"ب"],[[65171,65172],1,"ة"],[[65173,65176],1,"ت"],[[65177,65180],1,"ث"],[[65181,65184],1,"ج"],[[65185,65188],1,"ح"],[[65189,65192],1,"خ"],[[65193,65194],1,"د"],[[65195,65196],1,"ذ"],[[65197,65198],1,"ر"],[[65199,65200],1,"ز"],[[65201,65204],1,"س"],[[65205,65208],1,"ش"],[[65209,65212],1,"ص"],[[65213,65216],1,"ض"],[[65217,65220],1,"ط"],[[65221,65224],1,"ظ"],[[65225,65228],1,"ع"],[[65229,65232],1,"غ"],[[65233,65236],1,"ف"],[[65237,65240],1,"ق"],[[65241,65244],1,"ك"],[[65245,65248],1,"ل"],[[65249,65252],1,"م"],[[65253,65256],1,"ن"],[[65257,65260],1,"ه"],[[65261,65262],1,"و"],[[65263,65264],1,"ى"],[[65265,65268],1,"ي"],[[65269,65270],1,"لآ"],[[65271,65272],1,"لأ"],[[65273,65274],1,"لإ"],[[65275,65276],1,"لا"],[[65277,65278],3],[65279,7],[65280,3],[65281,1,"!"],[65282,1,"\\""],[65283,1,"#"],[65284,1,"$"],[65285,1,"%"],[65286,1,"&"],[65287,1,"\'"],[65288,1,"("],[65289,1,")"],[65290,1,"*"],[65291,1,"+"],[65292,1,","],[65293,1,"-"],[65294,1,"."],[65295,1,"/"],[65296,1,"0"],[65297,1,"1"],[65298,1,"2"],[65299,1,"3"],[65300,1,"4"],[65301,1,"5"],[65302,1,"6"],[65303,1,"7"],[65304,1,"8"],[65305,1,"9"],[65306,1,":"],[65307,1,";"],[65308,1,"<"],[65309,1,"="],[65310,1,">"],[65311,1,"?"],[65312,1,"@"],[65313,1,"a"],[65314,1,"b"],[65315,1,"c"],[65316,1,"d"],[65317,1,"e"],[65318,1,"f"],[65319,1,"g"],[65320,1,"h"],[65321,1,"i"],[65322,1,"j"],[65323,1,"k"],[65324,1,"l"],[65325,1,"m"],[65326,1,"n"],[65327,1,"o"],[65328,1,"p"],[65329,1,"q"],[65330,1,"r"],[65331,1,"s"],[65332,1,"t"],[65333,1,"u"],[65334,1,"v"],[65335,1,"w"],[65336,1,"x"],[65337,1,"y"],[65338,1,"z"],[65339,1,"["],[65340,1,"\\\\"],[65341,1,"]"],[65342,1,"^"],[65343,1,"_"],[65344,1,"`"],[65345,1,"a"],[65346,1,"b"],[65347,1,"c"],[65348,1,"d"],[65349,1,"e"],[65350,1,"f"],[65351,1,"g"],[65352,1,"h"],[65353,1,"i"],[65354,1,"j"],[65355,1,"k"],[65356,1,"l"],[65357,1,"m"],[65358,1,"n"],[65359,1,"o"],[65360,1,"p"],[65361,1,"q"],[65362,1,"r"],[65363,1,"s"],[65364,1,"t"],[65365,1,"u"],[65366,1,"v"],[65367,1,"w"],[65368,1,"x"],[65369,1,"y"],[65370,1,"z"],[65371,1,"{"],[65372,1,"|"],[65373,1,"}"],[65374,1,"~"],[65375,1,"⦅"],[65376,1,"⦆"],[65377,1,"."],[65378,1,"「"],[65379,1,"」"],[65380,1,"、"],[65381,1,"・"],[65382,1,"ヲ"],[65383,1,"ァ"],[65384,1,"ィ"],[65385,1,"ゥ"],[65386,1,"ェ"],[65387,1,"ォ"],[65388,1,"ャ"],[65389,1,"ュ"],[65390,1,"ョ"],[65391,1,"ッ"],[65392,1,"ー"],[65393,1,"ア"],[65394,1,"イ"],[65395,1,"ウ"],[65396,1,"エ"],[65397,1,"オ"],[65398,1,"カ"],[65399,1,"キ"],[65400,1,"ク"],[65401,1,"ケ"],[65402,1,"コ"],[65403,1,"サ"],[65404,1,"シ"],[65405,1,"ス"],[65406,1,"セ"],[65407,1,"ソ"],[65408,1,"タ"],[65409,1,"チ"],[65410,1,"ツ"],[65411,1,"テ"],[65412,1,"ト"],[65413,1,"ナ"],[65414,1,"ニ"],[65415,1,"ヌ"],[65416,1,"ネ"],[65417,1,"ノ"],[65418,1,"ハ"],[65419,1,"ヒ"],[65420,1,"フ"],[65421,1,"ヘ"],[65422,1,"ホ"],[65423,1,"マ"],[65424,1,"ミ"],[65425,1,"ム"],[65426,1,"メ"],[65427,1,"モ"],[65428,1,"ヤ"],[65429,1,"ユ"],[65430,1,"ヨ"],[65431,1,"ラ"],[65432,1,"リ"],[65433,1,"ル"],[65434,1,"レ"],[65435,1,"ロ"],[65436,1,"ワ"],[65437,1,"ン"],[65438,1,"゙"],[65439,1,"゚"],[65440,7],[65441,1,"ᄀ"],[65442,1,"ᄁ"],[65443,1,"ᆪ"],[65444,1,"ᄂ"],[65445,1,"ᆬ"],[65446,1,"ᆭ"],[65447,1,"ᄃ"],[65448,1,"ᄄ"],[65449,1,"ᄅ"],[65450,1,"ᆰ"],[65451,1,"ᆱ"],[65452,1,"ᆲ"],[65453,1,"ᆳ"],[65454,1,"ᆴ"],[65455,1,"ᆵ"],[65456,1,"ᄚ"],[65457,1,"ᄆ"],[65458,1,"ᄇ"],[65459,1,"ᄈ"],[65460,1,"ᄡ"],[65461,1,"ᄉ"],[65462,1,"ᄊ"],[65463,1,"ᄋ"],[65464,1,"ᄌ"],[65465,1,"ᄍ"],[65466,1,"ᄎ"],[65467,1,"ᄏ"],[65468,1,"ᄐ"],[65469,1,"ᄑ"],[65470,1,"ᄒ"],[[65471,65473],3],[65474,1,"ᅡ"],[65475,1,"ᅢ"],[65476,1,"ᅣ"],[65477,1,"ᅤ"],[65478,1,"ᅥ"],[65479,1,"ᅦ"],[[65480,65481],3],[65482,1,"ᅧ"],[65483,1,"ᅨ"],[65484,1,"ᅩ"],[65485,1,"ᅪ"],[65486,1,"ᅫ"],[65487,1,"ᅬ"],[[65488,65489],3],[65490,1,"ᅭ"],[65491,1,"ᅮ"],[65492,1,"ᅯ"],[65493,1,"ᅰ"],[65494,1,"ᅱ"],[65495,1,"ᅲ"],[[65496,65497],3],[65498,1,"ᅳ"],[65499,1,"ᅴ"],[65500,1,"ᅵ"],[[65501,65503],3],[65504,1,"¢"],[65505,1,"£"],[65506,1,"¬"],[65507,1," ̄"],[65508,1,"¦"],[65509,1,"¥"],[65510,1,"₩"],[65511,3],[65512,1,"│"],[65513,1,"←"],[65514,1,"↑"],[65515,1,"→"],[65516,1,"↓"],[65517,1,"■"],[65518,1,"○"],[[65519,65528],3],[[65529,65531],3],[65532,3],[65533,3],[[65534,65535],3],[[65536,65547],2],[65548,3],[[65549,65574],2],[65575,3],[[65576,65594],2],[65595,3],[[65596,65597],2],[65598,3],[[65599,65613],2],[[65614,65615],3],[[65616,65629],2],[[65630,65663],3],[[65664,65786],2],[[65787,65791],3],[[65792,65794],2],[[65795,65798],3],[[65799,65843],2],[[65844,65846],3],[[65847,65855],2],[[65856,65930],2],[[65931,65932],2],[[65933,65934],2],[65935,3],[[65936,65947],2],[65948,2],[[65949,65951],3],[65952,2],[[65953,65999],3],[[66000,66044],2],[66045,2],[[66046,66175],3],[[66176,66204],2],[[66205,66207],3],[[66208,66256],2],[[66257,66271],3],[66272,2],[[66273,66299],2],[[66300,66303],3],[[66304,66334],2],[66335,2],[[66336,66339],2],[[66340,66348],3],[[66349,66351],2],[[66352,66368],2],[66369,2],[[66370,66377],2],[66378,2],[[66379,66383],3],[[66384,66426],2],[[66427,66431],3],[[66432,66461],2],[66462,3],[66463,2],[[66464,66499],2],[[66500,66503],3],[[66504,66511],2],[[66512,66517],2],[[66518,66559],3],[66560,1,"𐐨"],[66561,1,"𐐩"],[66562,1,"𐐪"],[66563,1,"𐐫"],[66564,1,"𐐬"],[66565,1,"𐐭"],[66566,1,"𐐮"],[66567,1,"𐐯"],[66568,1,"𐐰"],[66569,1,"𐐱"],[66570,1,"𐐲"],[66571,1,"𐐳"],[66572,1,"𐐴"],[66573,1,"𐐵"],[66574,1,"𐐶"],[66575,1,"𐐷"],[66576,1,"𐐸"],[66577,1,"𐐹"],[66578,1,"𐐺"],[66579,1,"𐐻"],[66580,1,"𐐼"],[66581,1,"𐐽"],[66582,1,"𐐾"],[66583,1,"𐐿"],[66584,1,"𐑀"],[66585,1,"𐑁"],[66586,1,"𐑂"],[66587,1,"𐑃"],[66588,1,"𐑄"],[66589,1,"𐑅"],[66590,1,"𐑆"],[66591,1,"𐑇"],[66592,1,"𐑈"],[66593,1,"𐑉"],[66594,1,"𐑊"],[66595,1,"𐑋"],[66596,1,"𐑌"],[66597,1,"𐑍"],[66598,1,"𐑎"],[66599,1,"𐑏"],[[66600,66637],2],[[66638,66717],2],[[66718,66719],3],[[66720,66729],2],[[66730,66735],3],[66736,1,"𐓘"],[66737,1,"𐓙"],[66738,1,"𐓚"],[66739,1,"𐓛"],[66740,1,"𐓜"],[66741,1,"𐓝"],[66742,1,"𐓞"],[66743,1,"𐓟"],[66744,1,"𐓠"],[66745,1,"𐓡"],[66746,1,"𐓢"],[66747,1,"𐓣"],[66748,1,"𐓤"],[66749,1,"𐓥"],[66750,1,"𐓦"],[66751,1,"𐓧"],[66752,1,"𐓨"],[66753,1,"𐓩"],[66754,1,"𐓪"],[66755,1,"𐓫"],[66756,1,"𐓬"],[66757,1,"𐓭"],[66758,1,"𐓮"],[66759,1,"𐓯"],[66760,1,"𐓰"],[66761,1,"𐓱"],[66762,1,"𐓲"],[66763,1,"𐓳"],[66764,1,"𐓴"],[66765,1,"𐓵"],[66766,1,"𐓶"],[66767,1,"𐓷"],[66768,1,"𐓸"],[66769,1,"𐓹"],[66770,1,"𐓺"],[66771,1,"𐓻"],[[66772,66775],3],[[66776,66811],2],[[66812,66815],3],[[66816,66855],2],[[66856,66863],3],[[66864,66915],2],[[66916,66926],3],[66927,2],[66928,1,"𐖗"],[66929,1,"𐖘"],[66930,1,"𐖙"],[66931,1,"𐖚"],[66932,1,"𐖛"],[66933,1,"𐖜"],[66934,1,"𐖝"],[66935,1,"𐖞"],[66936,1,"𐖟"],[66937,1,"𐖠"],[66938,1,"𐖡"],[66939,3],[66940,1,"𐖣"],[66941,1,"𐖤"],[66942,1,"𐖥"],[66943,1,"𐖦"],[66944,1,"𐖧"],[66945,1,"𐖨"],[66946,1,"𐖩"],[66947,1,"𐖪"],[66948,1,"𐖫"],[66949,1,"𐖬"],[66950,1,"𐖭"],[66951,1,"𐖮"],[66952,1,"𐖯"],[66953,1,"𐖰"],[66954,1,"𐖱"],[66955,3],[66956,1,"𐖳"],[66957,1,"𐖴"],[66958,1,"𐖵"],[66959,1,"𐖶"],[66960,1,"𐖷"],[66961,1,"𐖸"],[66962,1,"𐖹"],[66963,3],[66964,1,"𐖻"],[66965,1,"𐖼"],[66966,3],[[66967,66977],2],[66978,3],[[66979,66993],2],[66994,3],[[66995,67001],2],[67002,3],[[67003,67004],2],[[67005,67007],3],[[67008,67059],2],[[67060,67071],3],[[67072,67382],2],[[67383,67391],3],[[67392,67413],2],[[67414,67423],3],[[67424,67431],2],[[67432,67455],3],[67456,2],[67457,1,"ː"],[67458,1,"ˑ"],[67459,1,"æ"],[67460,1,"ʙ"],[67461,1,"ɓ"],[67462,3],[67463,1,"ʣ"],[67464,1,"ꭦ"],[67465,1,"ʥ"],[67466,1,"ʤ"],[67467,1,"ɖ"],[67468,1,"ɗ"],[67469,1,"ᶑ"],[67470,1,"ɘ"],[67471,1,"ɞ"],[67472,1,"ʩ"],[67473,1,"ɤ"],[67474,1,"ɢ"],[67475,1,"ɠ"],[67476,1,"ʛ"],[67477,1,"ħ"],[67478,1,"ʜ"],[67479,1,"ɧ"],[67480,1,"ʄ"],[67481,1,"ʪ"],[67482,1,"ʫ"],[67483,1,"ɬ"],[67484,1,"𝼄"],[67485,1,"ꞎ"],[67486,1,"ɮ"],[67487,1,"𝼅"],[67488,1,"ʎ"],[67489,1,"𝼆"],[67490,1,"ø"],[67491,1,"ɶ"],[67492,1,"ɷ"],[67493,1,"q"],[67494,1,"ɺ"],[67495,1,"𝼈"],[67496,1,"ɽ"],[67497,1,"ɾ"],[67498,1,"ʀ"],[67499,1,"ʨ"],[67500,1,"ʦ"],[67501,1,"ꭧ"],[67502,1,"ʧ"],[67503,1,"ʈ"],[67504,1,"ⱱ"],[67505,3],[67506,1,"ʏ"],[67507,1,"ʡ"],[67508,1,"ʢ"],[67509,1,"ʘ"],[67510,1,"ǀ"],[67511,1,"ǁ"],[67512,1,"ǂ"],[67513,1,"𝼊"],[67514,1,"𝼞"],[[67515,67583],3],[[67584,67589],2],[[67590,67591],3],[67592,2],[67593,3],[[67594,67637],2],[67638,3],[[67639,67640],2],[[67641,67643],3],[67644,2],[[67645,67646],3],[67647,2],[[67648,67669],2],[67670,3],[[67671,67679],2],[[67680,67702],2],[[67703,67711],2],[[67712,67742],2],[[67743,67750],3],[[67751,67759],2],[[67760,67807],3],[[67808,67826],2],[67827,3],[[67828,67829],2],[[67830,67834],3],[[67835,67839],2],[[67840,67861],2],[[67862,67865],2],[[67866,67867],2],[[67868,67870],3],[67871,2],[[67872,67897],2],[[67898,67902],3],[67903,2],[[67904,67967],3],[[67968,68023],2],[[68024,68027],3],[[68028,68029],2],[[68030,68031],2],[[68032,68047],2],[[68048,68049],3],[[68050,68095],2],[[68096,68099],2],[68100,3],[[68101,68102],2],[[68103,68107],3],[[68108,68115],2],[68116,3],[[68117,68119],2],[68120,3],[[68121,68147],2],[[68148,68149],2],[[68150,68151],3],[[68152,68154],2],[[68155,68158],3],[68159,2],[[68160,68167],2],[68168,2],[[68169,68175],3],[[68176,68184],2],[[68185,68191],3],[[68192,68220],2],[[68221,68223],2],[[68224,68252],2],[[68253,68255],2],[[68256,68287],3],[[68288,68295],2],[68296,2],[[68297,68326],2],[[68327,68330],3],[[68331,68342],2],[[68343,68351],3],[[68352,68405],2],[[68406,68408],3],[[68409,68415],2],[[68416,68437],2],[[68438,68439],3],[[68440,68447],2],[[68448,68466],2],[[68467,68471],3],[[68472,68479],2],[[68480,68497],2],[[68498,68504],3],[[68505,68508],2],[[68509,68520],3],[[68521,68527],2],[[68528,68607],3],[[68608,68680],2],[[68681,68735],3],[68736,1,"𐳀"],[68737,1,"𐳁"],[68738,1,"𐳂"],[68739,1,"𐳃"],[68740,1,"𐳄"],[68741,1,"𐳅"],[68742,1,"𐳆"],[68743,1,"𐳇"],[68744,1,"𐳈"],[68745,1,"𐳉"],[68746,1,"𐳊"],[68747,1,"𐳋"],[68748,1,"𐳌"],[68749,1,"𐳍"],[68750,1,"𐳎"],[68751,1,"𐳏"],[68752,1,"𐳐"],[68753,1,"𐳑"],[68754,1,"𐳒"],[68755,1,"𐳓"],[68756,1,"𐳔"],[68757,1,"𐳕"],[68758,1,"𐳖"],[68759,1,"𐳗"],[68760,1,"𐳘"],[68761,1,"𐳙"],[68762,1,"𐳚"],[68763,1,"𐳛"],[68764,1,"𐳜"],[68765,1,"𐳝"],[68766,1,"𐳞"],[68767,1,"𐳟"],[68768,1,"𐳠"],[68769,1,"𐳡"],[68770,1,"𐳢"],[68771,1,"𐳣"],[68772,1,"𐳤"],[68773,1,"𐳥"],[68774,1,"𐳦"],[68775,1,"𐳧"],[68776,1,"𐳨"],[68777,1,"𐳩"],[68778,1,"𐳪"],[68779,1,"𐳫"],[68780,1,"𐳬"],[68781,1,"𐳭"],[68782,1,"𐳮"],[68783,1,"𐳯"],[68784,1,"𐳰"],[68785,1,"𐳱"],[68786,1,"𐳲"],[[68787,68799],3],[[68800,68850],2],[[68851,68857],3],[[68858,68863],2],[[68864,68903],2],[[68904,68911],3],[[68912,68921],2],[[68922,68927],3],[[68928,68943],2],[68944,1,"𐵰"],[68945,1,"𐵱"],[68946,1,"𐵲"],[68947,1,"𐵳"],[68948,1,"𐵴"],[68949,1,"𐵵"],[68950,1,"𐵶"],[68951,1,"𐵷"],[68952,1,"𐵸"],[68953,1,"𐵹"],[68954,1,"𐵺"],[68955,1,"𐵻"],[68956,1,"𐵼"],[68957,1,"𐵽"],[68958,1,"𐵾"],[68959,1,"𐵿"],[68960,1,"𐶀"],[68961,1,"𐶁"],[68962,1,"𐶂"],[68963,1,"𐶃"],[68964,1,"𐶄"],[68965,1,"𐶅"],[[68966,68968],3],[[68969,68973],2],[68974,2],[[68975,68997],2],[[68998,69005],3],[[69006,69007],2],[[69008,69215],3],[[69216,69246],2],[69247,3],[[69248,69289],2],[69290,3],[[69291,69292],2],[69293,2],[[69294,69295],3],[[69296,69297],2],[[69298,69313],3],[[69314,69316],2],[[69317,69371],3],[69372,2],[[69373,69375],2],[[69376,69404],2],[[69405,69414],2],[69415,2],[[69416,69423],3],[[69424,69456],2],[[69457,69465],2],[[69466,69487],3],[[69488,69509],2],[[69510,69513],2],[[69514,69551],3],[[69552,69572],2],[[69573,69579],2],[[69580,69599],3],[[69600,69622],2],[[69623,69631],3],[[69632,69702],2],[[69703,69709],2],[[69710,69713],3],[[69714,69733],2],[[69734,69743],2],[[69744,69749],2],[[69750,69758],3],[69759,2],[[69760,69818],2],[[69819,69820],2],[69821,3],[[69822,69825],2],[69826,2],[[69827,69836],3],[69837,3],[[69838,69839],3],[[69840,69864],2],[[69865,69871],3],[[69872,69881],2],[[69882,69887],3],[[69888,69940],2],[69941,3],[[69942,69951],2],[[69952,69955],2],[[69956,69958],2],[69959,2],[[69960,69967],3],[[69968,70003],2],[[70004,70005],2],[70006,2],[[70007,70015],3],[[70016,70084],2],[[70085,70088],2],[[70089,70092],2],[70093,2],[[70094,70095],2],[[70096,70105],2],[70106,2],[70107,2],[70108,2],[[70109,70111],2],[70112,3],[[70113,70132],2],[[70133,70143],3],[[70144,70161],2],[70162,3],[[70163,70199],2],[[70200,70205],2],[70206,2],[[70207,70209],2],[[70210,70271],3],[[70272,70278],2],[70279,3],[70280,2],[70281,3],[[70282,70285],2],[70286,3],[[70287,70301],2],[70302,3],[[70303,70312],2],[70313,2],[[70314,70319],3],[[70320,70378],2],[[70379,70383],3],[[70384,70393],2],[[70394,70399],3],[70400,2],[[70401,70403],2],[70404,3],[[70405,70412],2],[[70413,70414],3],[[70415,70416],2],[[70417,70418],3],[[70419,70440],2],[70441,3],[[70442,70448],2],[70449,3],[[70450,70451],2],[70452,3],[[70453,70457],2],[70458,3],[70459,2],[[70460,70468],2],[[70469,70470],3],[[70471,70472],2],[[70473,70474],3],[[70475,70477],2],[[70478,70479],3],[70480,2],[[70481,70486],3],[70487,2],[[70488,70492],3],[[70493,70499],2],[[70500,70501],3],[[70502,70508],2],[[70509,70511],3],[[70512,70516],2],[[70517,70527],3],[[70528,70537],2],[70538,3],[70539,2],[[70540,70541],3],[70542,2],[70543,3],[[70544,70581],2],[70582,3],[[70583,70592],2],[70593,3],[70594,2],[[70595,70596],3],[70597,2],[70598,3],[[70599,70602],2],[70603,3],[[70604,70611],2],[[70612,70613],2],[70614,3],[[70615,70616],2],[[70617,70624],3],[[70625,70626],2],[[70627,70655],3],[[70656,70730],2],[[70731,70735],2],[[70736,70745],2],[70746,2],[70747,2],[70748,3],[70749,2],[70750,2],[70751,2],[[70752,70753],2],[[70754,70783],3],[[70784,70853],2],[70854,2],[70855,2],[[70856,70863],3],[[70864,70873],2],[[70874,71039],3],[[71040,71093],2],[[71094,71095],3],[[71096,71104],2],[[71105,71113],2],[[71114,71127],2],[[71128,71133],2],[[71134,71167],3],[[71168,71232],2],[[71233,71235],2],[71236,2],[[71237,71247],3],[[71248,71257],2],[[71258,71263],3],[[71264,71276],2],[[71277,71295],3],[[71296,71351],2],[71352,2],[71353,2],[[71354,71359],3],[[71360,71369],2],[[71370,71375],3],[[71376,71395],2],[[71396,71423],3],[[71424,71449],2],[71450,2],[[71451,71452],3],[[71453,71467],2],[[71468,71471],3],[[71472,71481],2],[[71482,71487],2],[[71488,71494],2],[[71495,71679],3],[[71680,71738],2],[71739,2],[[71740,71839],3],[71840,1,"𑣀"],[71841,1,"𑣁"],[71842,1,"𑣂"],[71843,1,"𑣃"],[71844,1,"𑣄"],[71845,1,"𑣅"],[71846,1,"𑣆"],[71847,1,"𑣇"],[71848,1,"𑣈"],[71849,1,"𑣉"],[71850,1,"𑣊"],[71851,1,"𑣋"],[71852,1,"𑣌"],[71853,1,"𑣍"],[71854,1,"𑣎"],[71855,1,"𑣏"],[71856,1,"𑣐"],[71857,1,"𑣑"],[71858,1,"𑣒"],[71859,1,"𑣓"],[71860,1,"𑣔"],[71861,1,"𑣕"],[71862,1,"𑣖"],[71863,1,"𑣗"],[71864,1,"𑣘"],[71865,1,"𑣙"],[71866,1,"𑣚"],[71867,1,"𑣛"],[71868,1,"𑣜"],[71869,1,"𑣝"],[71870,1,"𑣞"],[71871,1,"𑣟"],[[71872,71913],2],[[71914,71922],2],[[71923,71934],3],[71935,2],[[71936,71942],2],[[71943,71944],3],[71945,2],[[71946,71947],3],[[71948,71955],2],[71956,3],[[71957,71958],2],[71959,3],[[71960,71989],2],[71990,3],[[71991,71992],2],[[71993,71994],3],[[71995,72003],2],[[72004,72006],2],[[72007,72015],3],[[72016,72025],2],[[72026,72095],3],[[72096,72103],2],[[72104,72105],3],[[72106,72151],2],[[72152,72153],3],[[72154,72161],2],[72162,2],[[72163,72164],2],[[72165,72191],3],[[72192,72254],2],[[72255,72262],2],[72263,2],[[72264,72271],3],[[72272,72323],2],[[72324,72325],2],[[72326,72345],2],[[72346,72348],2],[72349,2],[[72350,72354],2],[[72355,72367],3],[[72368,72383],2],[[72384,72440],2],[[72441,72447],3],[[72448,72457],2],[[72458,72639],3],[[72640,72672],2],[72673,2],[[72674,72687],3],[[72688,72697],2],[[72698,72703],3],[[72704,72712],2],[72713,3],[[72714,72758],2],[72759,3],[[72760,72768],2],[[72769,72773],2],[[72774,72783],3],[[72784,72793],2],[[72794,72812],2],[[72813,72815],3],[[72816,72817],2],[[72818,72847],2],[[72848,72849],3],[[72850,72871],2],[72872,3],[[72873,72886],2],[[72887,72959],3],[[72960,72966],2],[72967,3],[[72968,72969],2],[72970,3],[[72971,73014],2],[[73015,73017],3],[73018,2],[73019,3],[[73020,73021],2],[73022,3],[[73023,73031],2],[[73032,73039],3],[[73040,73049],2],[[73050,73055],3],[[73056,73061],2],[73062,3],[[73063,73064],2],[73065,3],[[73066,73102],2],[73103,3],[[73104,73105],2],[73106,3],[[73107,73112],2],[[73113,73119],3],[[73120,73129],2],[[73130,73439],3],[[73440,73462],2],[[73463,73464],2],[[73465,73471],3],[[73472,73488],2],[73489,3],[[73490,73530],2],[[73531,73533],3],[[73534,73538],2],[[73539,73551],2],[[73552,73561],2],[73562,2],[[73563,73647],3],[73648,2],[[73649,73663],3],[[73664,73713],2],[[73714,73726],3],[73727,2],[[73728,74606],2],[[74607,74648],2],[74649,2],[[74650,74751],3],[[74752,74850],2],[[74851,74862],2],[74863,3],[[74864,74867],2],[74868,2],[[74869,74879],3],[[74880,75075],2],[[75076,77711],3],[[77712,77808],2],[[77809,77810],2],[[77811,77823],3],[[77824,78894],2],[78895,2],[[78896,78904],3],[[78905,78911],3],[[78912,78933],2],[[78934,78943],3],[[78944,82938],2],[[82939,82943],3],[[82944,83526],2],[[83527,90367],3],[[90368,90425],2],[[90426,92159],3],[[92160,92728],2],[[92729,92735],3],[[92736,92766],2],[92767,3],[[92768,92777],2],[[92778,92781],3],[[92782,92783],2],[[92784,92862],2],[92863,3],[[92864,92873],2],[[92874,92879],3],[[92880,92909],2],[[92910,92911],3],[[92912,92916],2],[92917,2],[[92918,92927],3],[[92928,92982],2],[[92983,92991],2],[[92992,92995],2],[[92996,92997],2],[[92998,93007],3],[[93008,93017],2],[93018,3],[[93019,93025],2],[93026,3],[[93027,93047],2],[[93048,93052],3],[[93053,93071],2],[[93072,93503],3],[[93504,93548],2],[[93549,93551],2],[[93552,93561],2],[[93562,93759],3],[93760,1,"𖹠"],[93761,1,"𖹡"],[93762,1,"𖹢"],[93763,1,"𖹣"],[93764,1,"𖹤"],[93765,1,"𖹥"],[93766,1,"𖹦"],[93767,1,"𖹧"],[93768,1,"𖹨"],[93769,1,"𖹩"],[93770,1,"𖹪"],[93771,1,"𖹫"],[93772,1,"𖹬"],[93773,1,"𖹭"],[93774,1,"𖹮"],[93775,1,"𖹯"],[93776,1,"𖹰"],[93777,1,"𖹱"],[93778,1,"𖹲"],[93779,1,"𖹳"],[93780,1,"𖹴"],[93781,1,"𖹵"],[93782,1,"𖹶"],[93783,1,"𖹷"],[93784,1,"𖹸"],[93785,1,"𖹹"],[93786,1,"𖹺"],[93787,1,"𖹻"],[93788,1,"𖹼"],[93789,1,"𖹽"],[93790,1,"𖹾"],[93791,1,"𖹿"],[[93792,93823],2],[[93824,93850],2],[[93851,93951],3],[[93952,94020],2],[[94021,94026],2],[[94027,94030],3],[94031,2],[[94032,94078],2],[[94079,94087],2],[[94088,94094],3],[[94095,94111],2],[[94112,94175],3],[94176,2],[94177,2],[94178,2],[94179,2],[94180,2],[[94181,94191],3],[[94192,94193],2],[[94194,94207],3],[[94208,100332],2],[[100333,100337],2],[[100338,100343],2],[[100344,100351],3],[[100352,101106],2],[[101107,101589],2],[[101590,101630],3],[101631,2],[[101632,101640],2],[[101641,110575],3],[[110576,110579],2],[110580,3],[[110581,110587],2],[110588,3],[[110589,110590],2],[110591,3],[[110592,110593],2],[[110594,110878],2],[[110879,110882],2],[[110883,110897],3],[110898,2],[[110899,110927],3],[[110928,110930],2],[[110931,110932],3],[110933,2],[[110934,110947],3],[[110948,110951],2],[[110952,110959],3],[[110960,111355],2],[[111356,113663],3],[[113664,113770],2],[[113771,113775],3],[[113776,113788],2],[[113789,113791],3],[[113792,113800],2],[[113801,113807],3],[[113808,113817],2],[[113818,113819],3],[113820,2],[[113821,113822],2],[113823,2],[[113824,113827],7],[[113828,117759],3],[[117760,117973],2],[117974,1,"a"],[117975,1,"b"],[117976,1,"c"],[117977,1,"d"],[117978,1,"e"],[117979,1,"f"],[117980,1,"g"],[117981,1,"h"],[117982,1,"i"],[117983,1,"j"],[117984,1,"k"],[117985,1,"l"],[117986,1,"m"],[117987,1,"n"],[117988,1,"o"],[117989,1,"p"],[117990,1,"q"],[117991,1,"r"],[117992,1,"s"],[117993,1,"t"],[117994,1,"u"],[117995,1,"v"],[117996,1,"w"],[117997,1,"x"],[117998,1,"y"],[117999,1,"z"],[118000,1,"0"],[118001,1,"1"],[118002,1,"2"],[118003,1,"3"],[118004,1,"4"],[118005,1,"5"],[118006,1,"6"],[118007,1,"7"],[118008,1,"8"],[118009,1,"9"],[[118010,118015],3],[[118016,118451],2],[[118452,118527],3],[[118528,118573],2],[[118574,118575],3],[[118576,118598],2],[[118599,118607],3],[[118608,118723],2],[[118724,118783],3],[[118784,119029],2],[[119030,119039],3],[[119040,119078],2],[[119079,119080],3],[119081,2],[[119082,119133],2],[119134,1,"𝅗𝅥"],[119135,1,"𝅘𝅥"],[119136,1,"𝅘𝅥𝅮"],[119137,1,"𝅘𝅥𝅯"],[119138,1,"𝅘𝅥𝅰"],[119139,1,"𝅘𝅥𝅱"],[119140,1,"𝅘𝅥𝅲"],[[119141,119154],2],[[119155,119162],7],[[119163,119226],2],[119227,1,"𝆹𝅥"],[119228,1,"𝆺𝅥"],[119229,1,"𝆹𝅥𝅮"],[119230,1,"𝆺𝅥𝅮"],[119231,1,"𝆹𝅥𝅯"],[119232,1,"𝆺𝅥𝅯"],[[119233,119261],2],[[119262,119272],2],[[119273,119274],2],[[119275,119295],3],[[119296,119365],2],[[119366,119487],3],[[119488,119507],2],[[119508,119519],3],[[119520,119539],2],[[119540,119551],3],[[119552,119638],2],[[119639,119647],3],[[119648,119665],2],[[119666,119672],2],[[119673,119807],3],[119808,1,"a"],[119809,1,"b"],[119810,1,"c"],[119811,1,"d"],[119812,1,"e"],[119813,1,"f"],[119814,1,"g"],[119815,1,"h"],[119816,1,"i"],[119817,1,"j"],[119818,1,"k"],[119819,1,"l"],[119820,1,"m"],[119821,1,"n"],[119822,1,"o"],[119823,1,"p"],[119824,1,"q"],[119825,1,"r"],[119826,1,"s"],[119827,1,"t"],[119828,1,"u"],[119829,1,"v"],[119830,1,"w"],[119831,1,"x"],[119832,1,"y"],[119833,1,"z"],[119834,1,"a"],[119835,1,"b"],[119836,1,"c"],[119837,1,"d"],[119838,1,"e"],[119839,1,"f"],[119840,1,"g"],[119841,1,"h"],[119842,1,"i"],[119843,1,"j"],[119844,1,"k"],[119845,1,"l"],[119846,1,"m"],[119847,1,"n"],[119848,1,"o"],[119849,1,"p"],[119850,1,"q"],[119851,1,"r"],[119852,1,"s"],[119853,1,"t"],[119854,1,"u"],[119855,1,"v"],[119856,1,"w"],[119857,1,"x"],[119858,1,"y"],[119859,1,"z"],[119860,1,"a"],[119861,1,"b"],[119862,1,"c"],[119863,1,"d"],[119864,1,"e"],[119865,1,"f"],[119866,1,"g"],[119867,1,"h"],[119868,1,"i"],[119869,1,"j"],[119870,1,"k"],[119871,1,"l"],[119872,1,"m"],[119873,1,"n"],[119874,1,"o"],[119875,1,"p"],[119876,1,"q"],[119877,1,"r"],[119878,1,"s"],[119879,1,"t"],[119880,1,"u"],[119881,1,"v"],[119882,1,"w"],[119883,1,"x"],[119884,1,"y"],[119885,1,"z"],[119886,1,"a"],[119887,1,"b"],[119888,1,"c"],[119889,1,"d"],[119890,1,"e"],[119891,1,"f"],[119892,1,"g"],[119893,3],[119894,1,"i"],[119895,1,"j"],[119896,1,"k"],[119897,1,"l"],[119898,1,"m"],[119899,1,"n"],[119900,1,"o"],[119901,1,"p"],[119902,1,"q"],[119903,1,"r"],[119904,1,"s"],[119905,1,"t"],[119906,1,"u"],[119907,1,"v"],[119908,1,"w"],[119909,1,"x"],[119910,1,"y"],[119911,1,"z"],[119912,1,"a"],[119913,1,"b"],[119914,1,"c"],[119915,1,"d"],[119916,1,"e"],[119917,1,"f"],[119918,1,"g"],[119919,1,"h"],[119920,1,"i"],[119921,1,"j"],[119922,1,"k"],[119923,1,"l"],[119924,1,"m"],[119925,1,"n"],[119926,1,"o"],[119927,1,"p"],[119928,1,"q"],[119929,1,"r"],[119930,1,"s"],[119931,1,"t"],[119932,1,"u"],[119933,1,"v"],[119934,1,"w"],[119935,1,"x"],[119936,1,"y"],[119937,1,"z"],[119938,1,"a"],[119939,1,"b"],[119940,1,"c"],[119941,1,"d"],[119942,1,"e"],[119943,1,"f"],[119944,1,"g"],[119945,1,"h"],[119946,1,"i"],[119947,1,"j"],[119948,1,"k"],[119949,1,"l"],[119950,1,"m"],[119951,1,"n"],[119952,1,"o"],[119953,1,"p"],[119954,1,"q"],[119955,1,"r"],[119956,1,"s"],[119957,1,"t"],[119958,1,"u"],[119959,1,"v"],[119960,1,"w"],[119961,1,"x"],[119962,1,"y"],[119963,1,"z"],[119964,1,"a"],[119965,3],[119966,1,"c"],[119967,1,"d"],[[119968,119969],3],[119970,1,"g"],[[119971,119972],3],[119973,1,"j"],[119974,1,"k"],[[119975,119976],3],[119977,1,"n"],[119978,1,"o"],[119979,1,"p"],[119980,1,"q"],[119981,3],[119982,1,"s"],[119983,1,"t"],[119984,1,"u"],[119985,1,"v"],[119986,1,"w"],[119987,1,"x"],[119988,1,"y"],[119989,1,"z"],[119990,1,"a"],[119991,1,"b"],[119992,1,"c"],[119993,1,"d"],[119994,3],[119995,1,"f"],[119996,3],[119997,1,"h"],[119998,1,"i"],[119999,1,"j"],[120000,1,"k"],[120001,1,"l"],[120002,1,"m"],[120003,1,"n"],[120004,3],[120005,1,"p"],[120006,1,"q"],[120007,1,"r"],[120008,1,"s"],[120009,1,"t"],[120010,1,"u"],[120011,1,"v"],[120012,1,"w"],[120013,1,"x"],[120014,1,"y"],[120015,1,"z"],[120016,1,"a"],[120017,1,"b"],[120018,1,"c"],[120019,1,"d"],[120020,1,"e"],[120021,1,"f"],[120022,1,"g"],[120023,1,"h"],[120024,1,"i"],[120025,1,"j"],[120026,1,"k"],[120027,1,"l"],[120028,1,"m"],[120029,1,"n"],[120030,1,"o"],[120031,1,"p"],[120032,1,"q"],[120033,1,"r"],[120034,1,"s"],[120035,1,"t"],[120036,1,"u"],[120037,1,"v"],[120038,1,"w"],[120039,1,"x"],[120040,1,"y"],[120041,1,"z"],[120042,1,"a"],[120043,1,"b"],[120044,1,"c"],[120045,1,"d"],[120046,1,"e"],[120047,1,"f"],[120048,1,"g"],[120049,1,"h"],[120050,1,"i"],[120051,1,"j"],[120052,1,"k"],[120053,1,"l"],[120054,1,"m"],[120055,1,"n"],[120056,1,"o"],[120057,1,"p"],[120058,1,"q"],[120059,1,"r"],[120060,1,"s"],[120061,1,"t"],[120062,1,"u"],[120063,1,"v"],[120064,1,"w"],[120065,1,"x"],[120066,1,"y"],[120067,1,"z"],[120068,1,"a"],[120069,1,"b"],[120070,3],[120071,1,"d"],[120072,1,"e"],[120073,1,"f"],[120074,1,"g"],[[120075,120076],3],[120077,1,"j"],[120078,1,"k"],[120079,1,"l"],[120080,1,"m"],[120081,1,"n"],[120082,1,"o"],[120083,1,"p"],[120084,1,"q"],[120085,3],[120086,1,"s"],[120087,1,"t"],[120088,1,"u"],[120089,1,"v"],[120090,1,"w"],[120091,1,"x"],[120092,1,"y"],[120093,3],[120094,1,"a"],[120095,1,"b"],[120096,1,"c"],[120097,1,"d"],[120098,1,"e"],[120099,1,"f"],[120100,1,"g"],[120101,1,"h"],[120102,1,"i"],[120103,1,"j"],[120104,1,"k"],[120105,1,"l"],[120106,1,"m"],[120107,1,"n"],[120108,1,"o"],[120109,1,"p"],[120110,1,"q"],[120111,1,"r"],[120112,1,"s"],[120113,1,"t"],[120114,1,"u"],[120115,1,"v"],[120116,1,"w"],[120117,1,"x"],[120118,1,"y"],[120119,1,"z"],[120120,1,"a"],[120121,1,"b"],[120122,3],[120123,1,"d"],[120124,1,"e"],[120125,1,"f"],[120126,1,"g"],[120127,3],[120128,1,"i"],[120129,1,"j"],[120130,1,"k"],[120131,1,"l"],[120132,1,"m"],[120133,3],[120134,1,"o"],[[120135,120137],3],[120138,1,"s"],[120139,1,"t"],[120140,1,"u"],[120141,1,"v"],[120142,1,"w"],[120143,1,"x"],[120144,1,"y"],[120145,3],[120146,1,"a"],[120147,1,"b"],[120148,1,"c"],[120149,1,"d"],[120150,1,"e"],[120151,1,"f"],[120152,1,"g"],[120153,1,"h"],[120154,1,"i"],[120155,1,"j"],[120156,1,"k"],[120157,1,"l"],[120158,1,"m"],[120159,1,"n"],[120160,1,"o"],[120161,1,"p"],[120162,1,"q"],[120163,1,"r"],[120164,1,"s"],[120165,1,"t"],[120166,1,"u"],[120167,1,"v"],[120168,1,"w"],[120169,1,"x"],[120170,1,"y"],[120171,1,"z"],[120172,1,"a"],[120173,1,"b"],[120174,1,"c"],[120175,1,"d"],[120176,1,"e"],[120177,1,"f"],[120178,1,"g"],[120179,1,"h"],[120180,1,"i"],[120181,1,"j"],[120182,1,"k"],[120183,1,"l"],[120184,1,"m"],[120185,1,"n"],[120186,1,"o"],[120187,1,"p"],[120188,1,"q"],[120189,1,"r"],[120190,1,"s"],[120191,1,"t"],[120192,1,"u"],[120193,1,"v"],[120194,1,"w"],[120195,1,"x"],[120196,1,"y"],[120197,1,"z"],[120198,1,"a"],[120199,1,"b"],[120200,1,"c"],[120201,1,"d"],[120202,1,"e"],[120203,1,"f"],[120204,1,"g"],[120205,1,"h"],[120206,1,"i"],[120207,1,"j"],[120208,1,"k"],[120209,1,"l"],[120210,1,"m"],[120211,1,"n"],[120212,1,"o"],[120213,1,"p"],[120214,1,"q"],[120215,1,"r"],[120216,1,"s"],[120217,1,"t"],[120218,1,"u"],[120219,1,"v"],[120220,1,"w"],[120221,1,"x"],[120222,1,"y"],[120223,1,"z"],[120224,1,"a"],[120225,1,"b"],[120226,1,"c"],[120227,1,"d"],[120228,1,"e"],[120229,1,"f"],[120230,1,"g"],[120231,1,"h"],[120232,1,"i"],[120233,1,"j"],[120234,1,"k"],[120235,1,"l"],[120236,1,"m"],[120237,1,"n"],[120238,1,"o"],[120239,1,"p"],[120240,1,"q"],[120241,1,"r"],[120242,1,"s"],[120243,1,"t"],[120244,1,"u"],[120245,1,"v"],[120246,1,"w"],[120247,1,"x"],[120248,1,"y"],[120249,1,"z"],[120250,1,"a"],[120251,1,"b"],[120252,1,"c"],[120253,1,"d"],[120254,1,"e"],[120255,1,"f"],[120256,1,"g"],[120257,1,"h"],[120258,1,"i"],[120259,1,"j"],[120260,1,"k"],[120261,1,"l"],[120262,1,"m"],[120263,1,"n"],[120264,1,"o"],[120265,1,"p"],[120266,1,"q"],[120267,1,"r"],[120268,1,"s"],[120269,1,"t"],[120270,1,"u"],[120271,1,"v"],[120272,1,"w"],[120273,1,"x"],[120274,1,"y"],[120275,1,"z"],[120276,1,"a"],[120277,1,"b"],[120278,1,"c"],[120279,1,"d"],[120280,1,"e"],[120281,1,"f"],[120282,1,"g"],[120283,1,"h"],[120284,1,"i"],[120285,1,"j"],[120286,1,"k"],[120287,1,"l"],[120288,1,"m"],[120289,1,"n"],[120290,1,"o"],[120291,1,"p"],[120292,1,"q"],[120293,1,"r"],[120294,1,"s"],[120295,1,"t"],[120296,1,"u"],[120297,1,"v"],[120298,1,"w"],[120299,1,"x"],[120300,1,"y"],[120301,1,"z"],[120302,1,"a"],[120303,1,"b"],[120304,1,"c"],[120305,1,"d"],[120306,1,"e"],[120307,1,"f"],[120308,1,"g"],[120309,1,"h"],[120310,1,"i"],[120311,1,"j"],[120312,1,"k"],[120313,1,"l"],[120314,1,"m"],[120315,1,"n"],[120316,1,"o"],[120317,1,"p"],[120318,1,"q"],[120319,1,"r"],[120320,1,"s"],[120321,1,"t"],[120322,1,"u"],[120323,1,"v"],[120324,1,"w"],[120325,1,"x"],[120326,1,"y"],[120327,1,"z"],[120328,1,"a"],[120329,1,"b"],[120330,1,"c"],[120331,1,"d"],[120332,1,"e"],[120333,1,"f"],[120334,1,"g"],[120335,1,"h"],[120336,1,"i"],[120337,1,"j"],[120338,1,"k"],[120339,1,"l"],[120340,1,"m"],[120341,1,"n"],[120342,1,"o"],[120343,1,"p"],[120344,1,"q"],[120345,1,"r"],[120346,1,"s"],[120347,1,"t"],[120348,1,"u"],[120349,1,"v"],[120350,1,"w"],[120351,1,"x"],[120352,1,"y"],[120353,1,"z"],[120354,1,"a"],[120355,1,"b"],[120356,1,"c"],[120357,1,"d"],[120358,1,"e"],[120359,1,"f"],[120360,1,"g"],[120361,1,"h"],[120362,1,"i"],[120363,1,"j"],[120364,1,"k"],[120365,1,"l"],[120366,1,"m"],[120367,1,"n"],[120368,1,"o"],[120369,1,"p"],[120370,1,"q"],[120371,1,"r"],[120372,1,"s"],[120373,1,"t"],[120374,1,"u"],[120375,1,"v"],[120376,1,"w"],[120377,1,"x"],[120378,1,"y"],[120379,1,"z"],[120380,1,"a"],[120381,1,"b"],[120382,1,"c"],[120383,1,"d"],[120384,1,"e"],[120385,1,"f"],[120386,1,"g"],[120387,1,"h"],[120388,1,"i"],[120389,1,"j"],[120390,1,"k"],[120391,1,"l"],[120392,1,"m"],[120393,1,"n"],[120394,1,"o"],[120395,1,"p"],[120396,1,"q"],[120397,1,"r"],[120398,1,"s"],[120399,1,"t"],[120400,1,"u"],[120401,1,"v"],[120402,1,"w"],[120403,1,"x"],[120404,1,"y"],[120405,1,"z"],[120406,1,"a"],[120407,1,"b"],[120408,1,"c"],[120409,1,"d"],[120410,1,"e"],[120411,1,"f"],[120412,1,"g"],[120413,1,"h"],[120414,1,"i"],[120415,1,"j"],[120416,1,"k"],[120417,1,"l"],[120418,1,"m"],[120419,1,"n"],[120420,1,"o"],[120421,1,"p"],[120422,1,"q"],[120423,1,"r"],[120424,1,"s"],[120425,1,"t"],[120426,1,"u"],[120427,1,"v"],[120428,1,"w"],[120429,1,"x"],[120430,1,"y"],[120431,1,"z"],[120432,1,"a"],[120433,1,"b"],[120434,1,"c"],[120435,1,"d"],[120436,1,"e"],[120437,1,"f"],[120438,1,"g"],[120439,1,"h"],[120440,1,"i"],[120441,1,"j"],[120442,1,"k"],[120443,1,"l"],[120444,1,"m"],[120445,1,"n"],[120446,1,"o"],[120447,1,"p"],[120448,1,"q"],[120449,1,"r"],[120450,1,"s"],[120451,1,"t"],[120452,1,"u"],[120453,1,"v"],[120454,1,"w"],[120455,1,"x"],[120456,1,"y"],[120457,1,"z"],[120458,1,"a"],[120459,1,"b"],[120460,1,"c"],[120461,1,"d"],[120462,1,"e"],[120463,1,"f"],[120464,1,"g"],[120465,1,"h"],[120466,1,"i"],[120467,1,"j"],[120468,1,"k"],[120469,1,"l"],[120470,1,"m"],[120471,1,"n"],[120472,1,"o"],[120473,1,"p"],[120474,1,"q"],[120475,1,"r"],[120476,1,"s"],[120477,1,"t"],[120478,1,"u"],[120479,1,"v"],[120480,1,"w"],[120481,1,"x"],[120482,1,"y"],[120483,1,"z"],[120484,1,"ı"],[120485,1,"ȷ"],[[120486,120487],3],[120488,1,"α"],[120489,1,"β"],[120490,1,"γ"],[120491,1,"δ"],[120492,1,"ε"],[120493,1,"ζ"],[120494,1,"η"],[120495,1,"θ"],[120496,1,"ι"],[120497,1,"κ"],[120498,1,"λ"],[120499,1,"μ"],[120500,1,"ν"],[120501,1,"ξ"],[120502,1,"ο"],[120503,1,"π"],[120504,1,"ρ"],[120505,1,"θ"],[120506,1,"σ"],[120507,1,"τ"],[120508,1,"υ"],[120509,1,"φ"],[120510,1,"χ"],[120511,1,"ψ"],[120512,1,"ω"],[120513,1,"∇"],[120514,1,"α"],[120515,1,"β"],[120516,1,"γ"],[120517,1,"δ"],[120518,1,"ε"],[120519,1,"ζ"],[120520,1,"η"],[120521,1,"θ"],[120522,1,"ι"],[120523,1,"κ"],[120524,1,"λ"],[120525,1,"μ"],[120526,1,"ν"],[120527,1,"ξ"],[120528,1,"ο"],[120529,1,"π"],[120530,1,"ρ"],[[120531,120532],1,"σ"],[120533,1,"τ"],[120534,1,"υ"],[120535,1,"φ"],[120536,1,"χ"],[120537,1,"ψ"],[120538,1,"ω"],[120539,1,"∂"],[120540,1,"ε"],[120541,1,"θ"],[120542,1,"κ"],[120543,1,"φ"],[120544,1,"ρ"],[120545,1,"π"],[120546,1,"α"],[120547,1,"β"],[120548,1,"γ"],[120549,1,"δ"],[120550,1,"ε"],[120551,1,"ζ"],[120552,1,"η"],[120553,1,"θ"],[120554,1,"ι"],[120555,1,"κ"],[120556,1,"λ"],[120557,1,"μ"],[120558,1,"ν"],[120559,1,"ξ"],[120560,1,"ο"],[120561,1,"π"],[120562,1,"ρ"],[120563,1,"θ"],[120564,1,"σ"],[120565,1,"τ"],[120566,1,"υ"],[120567,1,"φ"],[120568,1,"χ"],[120569,1,"ψ"],[120570,1,"ω"],[120571,1,"∇"],[120572,1,"α"],[120573,1,"β"],[120574,1,"γ"],[120575,1,"δ"],[120576,1,"ε"],[120577,1,"ζ"],[120578,1,"η"],[120579,1,"θ"],[120580,1,"ι"],[120581,1,"κ"],[120582,1,"λ"],[120583,1,"μ"],[120584,1,"ν"],[120585,1,"ξ"],[120586,1,"ο"],[120587,1,"π"],[120588,1,"ρ"],[[120589,120590],1,"σ"],[120591,1,"τ"],[120592,1,"υ"],[120593,1,"φ"],[120594,1,"χ"],[120595,1,"ψ"],[120596,1,"ω"],[120597,1,"∂"],[120598,1,"ε"],[120599,1,"θ"],[120600,1,"κ"],[120601,1,"φ"],[120602,1,"ρ"],[120603,1,"π"],[120604,1,"α"],[120605,1,"β"],[120606,1,"γ"],[120607,1,"δ"],[120608,1,"ε"],[120609,1,"ζ"],[120610,1,"η"],[120611,1,"θ"],[120612,1,"ι"],[120613,1,"κ"],[120614,1,"λ"],[120615,1,"μ"],[120616,1,"ν"],[120617,1,"ξ"],[120618,1,"ο"],[120619,1,"π"],[120620,1,"ρ"],[120621,1,"θ"],[120622,1,"σ"],[120623,1,"τ"],[120624,1,"υ"],[120625,1,"φ"],[120626,1,"χ"],[120627,1,"ψ"],[120628,1,"ω"],[120629,1,"∇"],[120630,1,"α"],[120631,1,"β"],[120632,1,"γ"],[120633,1,"δ"],[120634,1,"ε"],[120635,1,"ζ"],[120636,1,"η"],[120637,1,"θ"],[120638,1,"ι"],[120639,1,"κ"],[120640,1,"λ"],[120641,1,"μ"],[120642,1,"ν"],[120643,1,"ξ"],[120644,1,"ο"],[120645,1,"π"],[120646,1,"ρ"],[[120647,120648],1,"σ"],[120649,1,"τ"],[120650,1,"υ"],[120651,1,"φ"],[120652,1,"χ"],[120653,1,"ψ"],[120654,1,"ω"],[120655,1,"∂"],[120656,1,"ε"],[120657,1,"θ"],[120658,1,"κ"],[120659,1,"φ"],[120660,1,"ρ"],[120661,1,"π"],[120662,1,"α"],[120663,1,"β"],[120664,1,"γ"],[120665,1,"δ"],[120666,1,"ε"],[120667,1,"ζ"],[120668,1,"η"],[120669,1,"θ"],[120670,1,"ι"],[120671,1,"κ"],[120672,1,"λ"],[120673,1,"μ"],[120674,1,"ν"],[120675,1,"ξ"],[120676,1,"ο"],[120677,1,"π"],[120678,1,"ρ"],[120679,1,"θ"],[120680,1,"σ"],[120681,1,"τ"],[120682,1,"υ"],[120683,1,"φ"],[120684,1,"χ"],[120685,1,"ψ"],[120686,1,"ω"],[120687,1,"∇"],[120688,1,"α"],[120689,1,"β"],[120690,1,"γ"],[120691,1,"δ"],[120692,1,"ε"],[120693,1,"ζ"],[120694,1,"η"],[120695,1,"θ"],[120696,1,"ι"],[120697,1,"κ"],[120698,1,"λ"],[120699,1,"μ"],[120700,1,"ν"],[120701,1,"ξ"],[120702,1,"ο"],[120703,1,"π"],[120704,1,"ρ"],[[120705,120706],1,"σ"],[120707,1,"τ"],[120708,1,"υ"],[120709,1,"φ"],[120710,1,"χ"],[120711,1,"ψ"],[120712,1,"ω"],[120713,1,"∂"],[120714,1,"ε"],[120715,1,"θ"],[120716,1,"κ"],[120717,1,"φ"],[120718,1,"ρ"],[120719,1,"π"],[120720,1,"α"],[120721,1,"β"],[120722,1,"γ"],[120723,1,"δ"],[120724,1,"ε"],[120725,1,"ζ"],[120726,1,"η"],[120727,1,"θ"],[120728,1,"ι"],[120729,1,"κ"],[120730,1,"λ"],[120731,1,"μ"],[120732,1,"ν"],[120733,1,"ξ"],[120734,1,"ο"],[120735,1,"π"],[120736,1,"ρ"],[120737,1,"θ"],[120738,1,"σ"],[120739,1,"τ"],[120740,1,"υ"],[120741,1,"φ"],[120742,1,"χ"],[120743,1,"ψ"],[120744,1,"ω"],[120745,1,"∇"],[120746,1,"α"],[120747,1,"β"],[120748,1,"γ"],[120749,1,"δ"],[120750,1,"ε"],[120751,1,"ζ"],[120752,1,"η"],[120753,1,"θ"],[120754,1,"ι"],[120755,1,"κ"],[120756,1,"λ"],[120757,1,"μ"],[120758,1,"ν"],[120759,1,"ξ"],[120760,1,"ο"],[120761,1,"π"],[120762,1,"ρ"],[[120763,120764],1,"σ"],[120765,1,"τ"],[120766,1,"υ"],[120767,1,"φ"],[120768,1,"χ"],[120769,1,"ψ"],[120770,1,"ω"],[120771,1,"∂"],[120772,1,"ε"],[120773,1,"θ"],[120774,1,"κ"],[120775,1,"φ"],[120776,1,"ρ"],[120777,1,"π"],[[120778,120779],1,"ϝ"],[[120780,120781],3],[120782,1,"0"],[120783,1,"1"],[120784,1,"2"],[120785,1,"3"],[120786,1,"4"],[120787,1,"5"],[120788,1,"6"],[120789,1,"7"],[120790,1,"8"],[120791,1,"9"],[120792,1,"0"],[120793,1,"1"],[120794,1,"2"],[120795,1,"3"],[120796,1,"4"],[120797,1,"5"],[120798,1,"6"],[120799,1,"7"],[120800,1,"8"],[120801,1,"9"],[120802,1,"0"],[120803,1,"1"],[120804,1,"2"],[120805,1,"3"],[120806,1,"4"],[120807,1,"5"],[120808,1,"6"],[120809,1,"7"],[120810,1,"8"],[120811,1,"9"],[120812,1,"0"],[120813,1,"1"],[120814,1,"2"],[120815,1,"3"],[120816,1,"4"],[120817,1,"5"],[120818,1,"6"],[120819,1,"7"],[120820,1,"8"],[120821,1,"9"],[120822,1,"0"],[120823,1,"1"],[120824,1,"2"],[120825,1,"3"],[120826,1,"4"],[120827,1,"5"],[120828,1,"6"],[120829,1,"7"],[120830,1,"8"],[120831,1,"9"],[[120832,121343],2],[[121344,121398],2],[[121399,121402],2],[[121403,121452],2],[[121453,121460],2],[121461,2],[[121462,121475],2],[121476,2],[[121477,121483],2],[[121484,121498],3],[[121499,121503],2],[121504,3],[[121505,121519],2],[[121520,122623],3],[[122624,122654],2],[[122655,122660],3],[[122661,122666],2],[[122667,122879],3],[[122880,122886],2],[122887,3],[[122888,122904],2],[[122905,122906],3],[[122907,122913],2],[122914,3],[[122915,122916],2],[122917,3],[[122918,122922],2],[[122923,122927],3],[122928,1,"а"],[122929,1,"б"],[122930,1,"в"],[122931,1,"г"],[122932,1,"д"],[122933,1,"е"],[122934,1,"ж"],[122935,1,"з"],[122936,1,"и"],[122937,1,"к"],[122938,1,"л"],[122939,1,"м"],[122940,1,"о"],[122941,1,"п"],[122942,1,"р"],[122943,1,"с"],[122944,1,"т"],[122945,1,"у"],[122946,1,"ф"],[122947,1,"х"],[122948,1,"ц"],[122949,1,"ч"],[122950,1,"ш"],[122951,1,"ы"],[122952,1,"э"],[122953,1,"ю"],[122954,1,"ꚉ"],[122955,1,"ә"],[122956,1,"і"],[122957,1,"ј"],[122958,1,"ө"],[122959,1,"ү"],[122960,1,"ӏ"],[122961,1,"а"],[122962,1,"б"],[122963,1,"в"],[122964,1,"г"],[122965,1,"д"],[122966,1,"е"],[122967,1,"ж"],[122968,1,"з"],[122969,1,"и"],[122970,1,"к"],[122971,1,"л"],[122972,1,"о"],[122973,1,"п"],[122974,1,"с"],[122975,1,"у"],[122976,1,"ф"],[122977,1,"х"],[122978,1,"ц"],[122979,1,"ч"],[122980,1,"ш"],[122981,1,"ъ"],[122982,1,"ы"],[122983,1,"ґ"],[122984,1,"і"],[122985,1,"ѕ"],[122986,1,"џ"],[122987,1,"ҫ"],[122988,1,"ꙑ"],[122989,1,"ұ"],[[122990,123022],3],[123023,2],[[123024,123135],3],[[123136,123180],2],[[123181,123183],3],[[123184,123197],2],[[123198,123199],3],[[123200,123209],2],[[123210,123213],3],[123214,2],[123215,2],[[123216,123535],3],[[123536,123566],2],[[123567,123583],3],[[123584,123641],2],[[123642,123646],3],[123647,2],[[123648,124111],3],[[124112,124153],2],[[124154,124367],3],[[124368,124410],2],[[124411,124414],3],[124415,2],[[124416,124895],3],[[124896,124902],2],[124903,3],[[124904,124907],2],[124908,3],[[124909,124910],2],[124911,3],[[124912,124926],2],[124927,3],[[124928,125124],2],[[125125,125126],3],[[125127,125135],2],[[125136,125142],2],[[125143,125183],3],[125184,1,"𞤢"],[125185,1,"𞤣"],[125186,1,"𞤤"],[125187,1,"𞤥"],[125188,1,"𞤦"],[125189,1,"𞤧"],[125190,1,"𞤨"],[125191,1,"𞤩"],[125192,1,"𞤪"],[125193,1,"𞤫"],[125194,1,"𞤬"],[125195,1,"𞤭"],[125196,1,"𞤮"],[125197,1,"𞤯"],[125198,1,"𞤰"],[125199,1,"𞤱"],[125200,1,"𞤲"],[125201,1,"𞤳"],[125202,1,"𞤴"],[125203,1,"𞤵"],[125204,1,"𞤶"],[125205,1,"𞤷"],[125206,1,"𞤸"],[125207,1,"𞤹"],[125208,1,"𞤺"],[125209,1,"𞤻"],[125210,1,"𞤼"],[125211,1,"𞤽"],[125212,1,"𞤾"],[125213,1,"𞤿"],[125214,1,"𞥀"],[125215,1,"𞥁"],[125216,1,"𞥂"],[125217,1,"𞥃"],[[125218,125258],2],[125259,2],[[125260,125263],3],[[125264,125273],2],[[125274,125277],3],[[125278,125279],2],[[125280,126064],3],[[126065,126132],2],[[126133,126208],3],[[126209,126269],2],[[126270,126463],3],[126464,1,"ا"],[126465,1,"ب"],[126466,1,"ج"],[126467,1,"د"],[126468,3],[126469,1,"و"],[126470,1,"ز"],[126471,1,"ح"],[126472,1,"ط"],[126473,1,"ي"],[126474,1,"ك"],[126475,1,"ل"],[126476,1,"م"],[126477,1,"ن"],[126478,1,"س"],[126479,1,"ع"],[126480,1,"ف"],[126481,1,"ص"],[126482,1,"ق"],[126483,1,"ر"],[126484,1,"ش"],[126485,1,"ت"],[126486,1,"ث"],[126487,1,"خ"],[126488,1,"ذ"],[126489,1,"ض"],[126490,1,"ظ"],[126491,1,"غ"],[126492,1,"ٮ"],[126493,1,"ں"],[126494,1,"ڡ"],[126495,1,"ٯ"],[126496,3],[126497,1,"ب"],[126498,1,"ج"],[126499,3],[126500,1,"ه"],[[126501,126502],3],[126503,1,"ح"],[126504,3],[126505,1,"ي"],[126506,1,"ك"],[126507,1,"ل"],[126508,1,"م"],[126509,1,"ن"],[126510,1,"س"],[126511,1,"ع"],[126512,1,"ف"],[126513,1,"ص"],[126514,1,"ق"],[126515,3],[126516,1,"ش"],[126517,1,"ت"],[126518,1,"ث"],[126519,1,"خ"],[126520,3],[126521,1,"ض"],[126522,3],[126523,1,"غ"],[[126524,126529],3],[126530,1,"ج"],[[126531,126534],3],[126535,1,"ح"],[126536,3],[126537,1,"ي"],[126538,3],[126539,1,"ل"],[126540,3],[126541,1,"ن"],[126542,1,"س"],[126543,1,"ع"],[126544,3],[126545,1,"ص"],[126546,1,"ق"],[126547,3],[126548,1,"ش"],[[126549,126550],3],[126551,1,"خ"],[126552,3],[126553,1,"ض"],[126554,3],[126555,1,"غ"],[126556,3],[126557,1,"ں"],[126558,3],[126559,1,"ٯ"],[126560,3],[126561,1,"ب"],[126562,1,"ج"],[126563,3],[126564,1,"ه"],[[126565,126566],3],[126567,1,"ح"],[126568,1,"ط"],[126569,1,"ي"],[126570,1,"ك"],[126571,3],[126572,1,"م"],[126573,1,"ن"],[126574,1,"س"],[126575,1,"ع"],[126576,1,"ف"],[126577,1,"ص"],[126578,1,"ق"],[126579,3],[126580,1,"ش"],[126581,1,"ت"],[126582,1,"ث"],[126583,1,"خ"],[126584,3],[126585,1,"ض"],[126586,1,"ظ"],[126587,1,"غ"],[126588,1,"ٮ"],[126589,3],[126590,1,"ڡ"],[126591,3],[126592,1,"ا"],[126593,1,"ب"],[126594,1,"ج"],[126595,1,"د"],[126596,1,"ه"],[126597,1,"و"],[126598,1,"ز"],[126599,1,"ح"],[126600,1,"ط"],[126601,1,"ي"],[126602,3],[126603,1,"ل"],[126604,1,"م"],[126605,1,"ن"],[126606,1,"س"],[126607,1,"ع"],[126608,1,"ف"],[126609,1,"ص"],[126610,1,"ق"],[126611,1,"ر"],[126612,1,"ش"],[126613,1,"ت"],[126614,1,"ث"],[126615,1,"خ"],[126616,1,"ذ"],[126617,1,"ض"],[126618,1,"ظ"],[126619,1,"غ"],[[126620,126624],3],[126625,1,"ب"],[126626,1,"ج"],[126627,1,"د"],[126628,3],[126629,1,"و"],[126630,1,"ز"],[126631,1,"ح"],[126632,1,"ط"],[126633,1,"ي"],[126634,3],[126635,1,"ل"],[126636,1,"م"],[126637,1,"ن"],[126638,1,"س"],[126639,1,"ع"],[126640,1,"ف"],[126641,1,"ص"],[126642,1,"ق"],[126643,1,"ر"],[126644,1,"ش"],[126645,1,"ت"],[126646,1,"ث"],[126647,1,"خ"],[126648,1,"ذ"],[126649,1,"ض"],[126650,1,"ظ"],[126651,1,"غ"],[[126652,126703],3],[[126704,126705],2],[[126706,126975],3],[[126976,127019],2],[[127020,127023],3],[[127024,127123],2],[[127124,127135],3],[[127136,127150],2],[[127151,127152],3],[[127153,127166],2],[127167,2],[127168,3],[[127169,127183],2],[127184,3],[[127185,127199],2],[[127200,127221],2],[[127222,127231],3],[127232,3],[127233,1,"0,"],[127234,1,"1,"],[127235,1,"2,"],[127236,1,"3,"],[127237,1,"4,"],[127238,1,"5,"],[127239,1,"6,"],[127240,1,"7,"],[127241,1,"8,"],[127242,1,"9,"],[[127243,127244],2],[[127245,127247],2],[127248,1,"(a)"],[127249,1,"(b)"],[127250,1,"(c)"],[127251,1,"(d)"],[127252,1,"(e)"],[127253,1,"(f)"],[127254,1,"(g)"],[127255,1,"(h)"],[127256,1,"(i)"],[127257,1,"(j)"],[127258,1,"(k)"],[127259,1,"(l)"],[127260,1,"(m)"],[127261,1,"(n)"],[127262,1,"(o)"],[127263,1,"(p)"],[127264,1,"(q)"],[127265,1,"(r)"],[127266,1,"(s)"],[127267,1,"(t)"],[127268,1,"(u)"],[127269,1,"(v)"],[127270,1,"(w)"],[127271,1,"(x)"],[127272,1,"(y)"],[127273,1,"(z)"],[127274,1,"〔s〕"],[127275,1,"c"],[127276,1,"r"],[127277,1,"cd"],[127278,1,"wz"],[127279,2],[127280,1,"a"],[127281,1,"b"],[127282,1,"c"],[127283,1,"d"],[127284,1,"e"],[127285,1,"f"],[127286,1,"g"],[127287,1,"h"],[127288,1,"i"],[127289,1,"j"],[127290,1,"k"],[127291,1,"l"],[127292,1,"m"],[127293,1,"n"],[127294,1,"o"],[127295,1,"p"],[127296,1,"q"],[127297,1,"r"],[127298,1,"s"],[127299,1,"t"],[127300,1,"u"],[127301,1,"v"],[127302,1,"w"],[127303,1,"x"],[127304,1,"y"],[127305,1,"z"],[127306,1,"hv"],[127307,1,"mv"],[127308,1,"sd"],[127309,1,"ss"],[127310,1,"ppv"],[127311,1,"wc"],[[127312,127318],2],[127319,2],[[127320,127326],2],[127327,2],[[127328,127337],2],[127338,1,"mc"],[127339,1,"md"],[127340,1,"mr"],[[127341,127343],2],[[127344,127352],2],[127353,2],[127354,2],[[127355,127356],2],[[127357,127358],2],[127359,2],[[127360,127369],2],[[127370,127373],2],[[127374,127375],2],[127376,1,"dj"],[[127377,127386],2],[[127387,127404],2],[127405,2],[[127406,127461],3],[[127462,127487],2],[127488,1,"ほか"],[127489,1,"ココ"],[127490,1,"サ"],[[127491,127503],3],[127504,1,"手"],[127505,1,"字"],[127506,1,"双"],[127507,1,"デ"],[127508,1,"二"],[127509,1,"多"],[127510,1,"解"],[127511,1,"天"],[127512,1,"交"],[127513,1,"映"],[127514,1,"無"],[127515,1,"料"],[127516,1,"前"],[127517,1,"後"],[127518,1,"再"],[127519,1,"新"],[127520,1,"初"],[127521,1,"終"],[127522,1,"生"],[127523,1,"販"],[127524,1,"声"],[127525,1,"吹"],[127526,1,"演"],[127527,1,"投"],[127528,1,"捕"],[127529,1,"一"],[127530,1,"三"],[127531,1,"遊"],[127532,1,"左"],[127533,1,"中"],[127534,1,"右"],[127535,1,"指"],[127536,1,"走"],[127537,1,"打"],[127538,1,"禁"],[127539,1,"空"],[127540,1,"合"],[127541,1,"満"],[127542,1,"有"],[127543,1,"月"],[127544,1,"申"],[127545,1,"割"],[127546,1,"営"],[127547,1,"配"],[[127548,127551],3],[127552,1,"〔本〕"],[127553,1,"〔三〕"],[127554,1,"〔二〕"],[127555,1,"〔安〕"],[127556,1,"〔点〕"],[127557,1,"〔打〕"],[127558,1,"〔盗〕"],[127559,1,"〔勝〕"],[127560,1,"〔敗〕"],[[127561,127567],3],[127568,1,"得"],[127569,1,"可"],[[127570,127583],3],[[127584,127589],2],[[127590,127743],3],[[127744,127776],2],[[127777,127788],2],[[127789,127791],2],[[127792,127797],2],[127798,2],[[127799,127868],2],[127869,2],[[127870,127871],2],[[127872,127891],2],[[127892,127903],2],[[127904,127940],2],[127941,2],[[127942,127946],2],[[127947,127950],2],[[127951,127955],2],[[127956,127967],2],[[127968,127984],2],[[127985,127991],2],[[127992,127999],2],[[128000,128062],2],[128063,2],[128064,2],[128065,2],[[128066,128247],2],[128248,2],[[128249,128252],2],[[128253,128254],2],[128255,2],[[128256,128317],2],[[128318,128319],2],[[128320,128323],2],[[128324,128330],2],[[128331,128335],2],[[128336,128359],2],[[128360,128377],2],[128378,2],[[128379,128419],2],[128420,2],[[128421,128506],2],[[128507,128511],2],[128512,2],[[128513,128528],2],[128529,2],[[128530,128532],2],[128533,2],[128534,2],[128535,2],[128536,2],[128537,2],[128538,2],[128539,2],[[128540,128542],2],[128543,2],[[128544,128549],2],[[128550,128551],2],[[128552,128555],2],[128556,2],[128557,2],[[128558,128559],2],[[128560,128563],2],[128564,2],[[128565,128576],2],[[128577,128578],2],[[128579,128580],2],[[128581,128591],2],[[128592,128639],2],[[128640,128709],2],[[128710,128719],2],[128720,2],[[128721,128722],2],[[128723,128724],2],[128725,2],[[128726,128727],2],[[128728,128731],3],[128732,2],[[128733,128735],2],[[128736,128748],2],[[128749,128751],3],[[128752,128755],2],[[128756,128758],2],[[128759,128760],2],[128761,2],[128762,2],[[128763,128764],2],[[128765,128767],3],[[128768,128883],2],[[128884,128886],2],[[128887,128890],3],[[128891,128895],2],[[128896,128980],2],[[128981,128984],2],[128985,2],[[128986,128991],3],[[128992,129003],2],[[129004,129007],3],[129008,2],[[129009,129023],3],[[129024,129035],2],[[129036,129039],3],[[129040,129095],2],[[129096,129103],3],[[129104,129113],2],[[129114,129119],3],[[129120,129159],2],[[129160,129167],3],[[129168,129197],2],[[129198,129199],3],[[129200,129201],2],[[129202,129211],2],[[129212,129215],3],[[129216,129217],2],[[129218,129279],3],[[129280,129291],2],[129292,2],[[129293,129295],2],[[129296,129304],2],[[129305,129310],2],[129311,2],[[129312,129319],2],[[129320,129327],2],[129328,2],[[129329,129330],2],[[129331,129342],2],[129343,2],[[129344,129355],2],[129356,2],[[129357,129359],2],[[129360,129374],2],[[129375,129387],2],[[129388,129392],2],[129393,2],[129394,2],[[129395,129398],2],[[129399,129400],2],[129401,2],[129402,2],[129403,2],[[129404,129407],2],[[129408,129412],2],[[129413,129425],2],[[129426,129431],2],[[129432,129442],2],[[129443,129444],2],[[129445,129450],2],[[129451,129453],2],[[129454,129455],2],[[129456,129465],2],[[129466,129471],2],[129472,2],[[129473,129474],2],[[129475,129482],2],[129483,2],[129484,2],[[129485,129487],2],[[129488,129510],2],[[129511,129535],2],[[129536,129619],2],[[129620,129631],3],[[129632,129645],2],[[129646,129647],3],[[129648,129651],2],[129652,2],[[129653,129655],2],[[129656,129658],2],[[129659,129660],2],[[129661,129663],3],[[129664,129666],2],[[129667,129670],2],[[129671,129672],2],[129673,2],[[129674,129678],3],[129679,2],[[129680,129685],2],[[129686,129704],2],[[129705,129708],2],[[129709,129711],2],[[129712,129718],2],[[129719,129722],2],[[129723,129725],2],[129726,2],[129727,2],[[129728,129730],2],[[129731,129733],2],[129734,2],[[129735,129741],3],[[129742,129743],2],[[129744,129750],2],[[129751,129753],2],[[129754,129755],2],[129756,2],[[129757,129758],3],[129759,2],[[129760,129767],2],[129768,2],[129769,2],[[129770,129775],3],[[129776,129782],2],[[129783,129784],2],[[129785,129791],3],[[129792,129938],2],[129939,3],[[129940,129994],2],[[129995,130031],2],[130032,1,"0"],[130033,1,"1"],[130034,1,"2"],[130035,1,"3"],[130036,1,"4"],[130037,1,"5"],[130038,1,"6"],[130039,1,"7"],[130040,1,"8"],[130041,1,"9"],[[130042,131069],3],[[131070,131071],3],[[131072,173782],2],[[173783,173789],2],[[173790,173791],2],[[173792,173823],3],[[173824,177972],2],[[177973,177976],2],[177977,2],[[177978,177983],3],[[177984,178205],2],[[178206,178207],3],[[178208,183969],2],[[183970,183983],3],[[183984,191456],2],[[191457,191471],3],[[191472,192093],2],[[192094,194559],3],[194560,1,"丽"],[194561,1,"丸"],[194562,1,"乁"],[194563,1,"𠄢"],[194564,1,"你"],[194565,1,"侮"],[194566,1,"侻"],[194567,1,"倂"],[194568,1,"偺"],[194569,1,"備"],[194570,1,"僧"],[194571,1,"像"],[194572,1,"㒞"],[194573,1,"𠘺"],[194574,1,"免"],[194575,1,"兔"],[194576,1,"兤"],[194577,1,"具"],[194578,1,"𠔜"],[194579,1,"㒹"],[194580,1,"內"],[194581,1,"再"],[194582,1,"𠕋"],[194583,1,"冗"],[194584,1,"冤"],[194585,1,"仌"],[194586,1,"冬"],[194587,1,"况"],[194588,1,"𩇟"],[194589,1,"凵"],[194590,1,"刃"],[194591,1,"㓟"],[194592,1,"刻"],[194593,1,"剆"],[194594,1,"割"],[194595,1,"剷"],[194596,1,"㔕"],[194597,1,"勇"],[194598,1,"勉"],[194599,1,"勤"],[194600,1,"勺"],[194601,1,"包"],[194602,1,"匆"],[194603,1,"北"],[194604,1,"卉"],[194605,1,"卑"],[194606,1,"博"],[194607,1,"即"],[194608,1,"卽"],[[194609,194611],1,"卿"],[194612,1,"𠨬"],[194613,1,"灰"],[194614,1,"及"],[194615,1,"叟"],[194616,1,"𠭣"],[194617,1,"叫"],[194618,1,"叱"],[194619,1,"吆"],[194620,1,"咞"],[194621,1,"吸"],[194622,1,"呈"],[194623,1,"周"],[194624,1,"咢"],[194625,1,"哶"],[194626,1,"唐"],[194627,1,"啓"],[194628,1,"啣"],[[194629,194630],1,"善"],[194631,1,"喙"],[194632,1,"喫"],[194633,1,"喳"],[194634,1,"嗂"],[194635,1,"圖"],[194636,1,"嘆"],[194637,1,"圗"],[194638,1,"噑"],[194639,1,"噴"],[194640,1,"切"],[194641,1,"壮"],[194642,1,"城"],[194643,1,"埴"],[194644,1,"堍"],[194645,1,"型"],[194646,1,"堲"],[194647,1,"報"],[194648,1,"墬"],[194649,1,"𡓤"],[194650,1,"売"],[194651,1,"壷"],[194652,1,"夆"],[194653,1,"多"],[194654,1,"夢"],[194655,1,"奢"],[194656,1,"𡚨"],[194657,1,"𡛪"],[194658,1,"姬"],[194659,1,"娛"],[194660,1,"娧"],[194661,1,"姘"],[194662,1,"婦"],[194663,1,"㛮"],[194664,1,"㛼"],[194665,1,"嬈"],[[194666,194667],1,"嬾"],[194668,1,"𡧈"],[194669,1,"寃"],[194670,1,"寘"],[194671,1,"寧"],[194672,1,"寳"],[194673,1,"𡬘"],[194674,1,"寿"],[194675,1,"将"],[194676,1,"当"],[194677,1,"尢"],[194678,1,"㞁"],[194679,1,"屠"],[194680,1,"屮"],[194681,1,"峀"],[194682,1,"岍"],[194683,1,"𡷤"],[194684,1,"嵃"],[194685,1,"𡷦"],[194686,1,"嵮"],[194687,1,"嵫"],[194688,1,"嵼"],[194689,1,"巡"],[194690,1,"巢"],[194691,1,"㠯"],[194692,1,"巽"],[194693,1,"帨"],[194694,1,"帽"],[194695,1,"幩"],[194696,1,"㡢"],[194697,1,"𢆃"],[194698,1,"㡼"],[194699,1,"庰"],[194700,1,"庳"],[194701,1,"庶"],[194702,1,"廊"],[194703,1,"𪎒"],[194704,1,"廾"],[[194705,194706],1,"𢌱"],[194707,1,"舁"],[[194708,194709],1,"弢"],[194710,1,"㣇"],[194711,1,"𣊸"],[194712,1,"𦇚"],[194713,1,"形"],[194714,1,"彫"],[194715,1,"㣣"],[194716,1,"徚"],[194717,1,"忍"],[194718,1,"志"],[194719,1,"忹"],[194720,1,"悁"],[194721,1,"㤺"],[194722,1,"㤜"],[194723,1,"悔"],[194724,1,"𢛔"],[194725,1,"惇"],[194726,1,"慈"],[194727,1,"慌"],[194728,1,"慎"],[194729,1,"慌"],[194730,1,"慺"],[194731,1,"憎"],[194732,1,"憲"],[194733,1,"憤"],[194734,1,"憯"],[194735,1,"懞"],[194736,1,"懲"],[194737,1,"懶"],[194738,1,"成"],[194739,1,"戛"],[194740,1,"扝"],[194741,1,"抱"],[194742,1,"拔"],[194743,1,"捐"],[194744,1,"𢬌"],[194745,1,"挽"],[194746,1,"拼"],[194747,1,"捨"],[194748,1,"掃"],[194749,1,"揤"],[194750,1,"𢯱"],[194751,1,"搢"],[194752,1,"揅"],[194753,1,"掩"],[194754,1,"㨮"],[194755,1,"摩"],[194756,1,"摾"],[194757,1,"撝"],[194758,1,"摷"],[194759,1,"㩬"],[194760,1,"敏"],[194761,1,"敬"],[194762,1,"𣀊"],[194763,1,"旣"],[194764,1,"書"],[194765,1,"晉"],[194766,1,"㬙"],[194767,1,"暑"],[194768,1,"㬈"],[194769,1,"㫤"],[194770,1,"冒"],[194771,1,"冕"],[194772,1,"最"],[194773,1,"暜"],[194774,1,"肭"],[194775,1,"䏙"],[194776,1,"朗"],[194777,1,"望"],[194778,1,"朡"],[194779,1,"杞"],[194780,1,"杓"],[194781,1,"𣏃"],[194782,1,"㭉"],[194783,1,"柺"],[194784,1,"枅"],[194785,1,"桒"],[194786,1,"梅"],[194787,1,"𣑭"],[194788,1,"梎"],[194789,1,"栟"],[194790,1,"椔"],[194791,1,"㮝"],[194792,1,"楂"],[194793,1,"榣"],[194794,1,"槪"],[194795,1,"檨"],[194796,1,"𣚣"],[194797,1,"櫛"],[194798,1,"㰘"],[194799,1,"次"],[194800,1,"𣢧"],[194801,1,"歔"],[194802,1,"㱎"],[194803,1,"歲"],[194804,1,"殟"],[194805,1,"殺"],[194806,1,"殻"],[194807,1,"𣪍"],[194808,1,"𡴋"],[194809,1,"𣫺"],[194810,1,"汎"],[194811,1,"𣲼"],[194812,1,"沿"],[194813,1,"泍"],[194814,1,"汧"],[194815,1,"洖"],[194816,1,"派"],[194817,1,"海"],[194818,1,"流"],[194819,1,"浩"],[194820,1,"浸"],[194821,1,"涅"],[194822,1,"𣴞"],[194823,1,"洴"],[194824,1,"港"],[194825,1,"湮"],[194826,1,"㴳"],[194827,1,"滋"],[194828,1,"滇"],[194829,1,"𣻑"],[194830,1,"淹"],[194831,1,"潮"],[194832,1,"𣽞"],[194833,1,"𣾎"],[194834,1,"濆"],[194835,1,"瀹"],[194836,1,"瀞"],[194837,1,"瀛"],[194838,1,"㶖"],[194839,1,"灊"],[194840,1,"災"],[194841,1,"灷"],[194842,1,"炭"],[194843,1,"𠔥"],[194844,1,"煅"],[194845,1,"𤉣"],[194846,1,"熜"],[194847,1,"𤎫"],[194848,1,"爨"],[194849,1,"爵"],[194850,1,"牐"],[194851,1,"𤘈"],[194852,1,"犀"],[194853,1,"犕"],[194854,1,"𤜵"],[194855,1,"𤠔"],[194856,1,"獺"],[194857,1,"王"],[194858,1,"㺬"],[194859,1,"玥"],[[194860,194861],1,"㺸"],[194862,1,"瑇"],[194863,1,"瑜"],[194864,1,"瑱"],[194865,1,"璅"],[194866,1,"瓊"],[194867,1,"㼛"],[194868,1,"甤"],[194869,1,"𤰶"],[194870,1,"甾"],[194871,1,"𤲒"],[194872,1,"異"],[194873,1,"𢆟"],[194874,1,"瘐"],[194875,1,"𤾡"],[194876,1,"𤾸"],[194877,1,"𥁄"],[194878,1,"㿼"],[194879,1,"䀈"],[194880,1,"直"],[194881,1,"𥃳"],[194882,1,"𥃲"],[194883,1,"𥄙"],[194884,1,"𥄳"],[194885,1,"眞"],[[194886,194887],1,"真"],[194888,1,"睊"],[194889,1,"䀹"],[194890,1,"瞋"],[194891,1,"䁆"],[194892,1,"䂖"],[194893,1,"𥐝"],[194894,1,"硎"],[194895,1,"碌"],[194896,1,"磌"],[194897,1,"䃣"],[194898,1,"𥘦"],[194899,1,"祖"],[194900,1,"𥚚"],[194901,1,"𥛅"],[194902,1,"福"],[194903,1,"秫"],[194904,1,"䄯"],[194905,1,"穀"],[194906,1,"穊"],[194907,1,"穏"],[194908,1,"𥥼"],[[194909,194910],1,"𥪧"],[194911,1,"竮"],[194912,1,"䈂"],[194913,1,"𥮫"],[194914,1,"篆"],[194915,1,"築"],[194916,1,"䈧"],[194917,1,"𥲀"],[194918,1,"糒"],[194919,1,"䊠"],[194920,1,"糨"],[194921,1,"糣"],[194922,1,"紀"],[194923,1,"𥾆"],[194924,1,"絣"],[194925,1,"䌁"],[194926,1,"緇"],[194927,1,"縂"],[194928,1,"繅"],[194929,1,"䌴"],[194930,1,"𦈨"],[194931,1,"𦉇"],[194932,1,"䍙"],[194933,1,"𦋙"],[194934,1,"罺"],[194935,1,"𦌾"],[194936,1,"羕"],[194937,1,"翺"],[194938,1,"者"],[194939,1,"𦓚"],[194940,1,"𦔣"],[194941,1,"聠"],[194942,1,"𦖨"],[194943,1,"聰"],[194944,1,"𣍟"],[194945,1,"䏕"],[194946,1,"育"],[194947,1,"脃"],[194948,1,"䐋"],[194949,1,"脾"],[194950,1,"媵"],[194951,1,"𦞧"],[194952,1,"𦞵"],[194953,1,"𣎓"],[194954,1,"𣎜"],[194955,1,"舁"],[194956,1,"舄"],[194957,1,"辞"],[194958,1,"䑫"],[194959,1,"芑"],[194960,1,"芋"],[194961,1,"芝"],[194962,1,"劳"],[194963,1,"花"],[194964,1,"芳"],[194965,1,"芽"],[194966,1,"苦"],[194967,1,"𦬼"],[194968,1,"若"],[194969,1,"茝"],[194970,1,"荣"],[194971,1,"莭"],[194972,1,"茣"],[194973,1,"莽"],[194974,1,"菧"],[194975,1,"著"],[194976,1,"荓"],[194977,1,"菊"],[194978,1,"菌"],[194979,1,"菜"],[194980,1,"𦰶"],[194981,1,"𦵫"],[194982,1,"𦳕"],[194983,1,"䔫"],[194984,1,"蓱"],[194985,1,"蓳"],[194986,1,"蔖"],[194987,1,"𧏊"],[194988,1,"蕤"],[194989,1,"𦼬"],[194990,1,"䕝"],[194991,1,"䕡"],[194992,1,"𦾱"],[194993,1,"𧃒"],[194994,1,"䕫"],[194995,1,"虐"],[194996,1,"虜"],[194997,1,"虧"],[194998,1,"虩"],[194999,1,"蚩"],[195000,1,"蚈"],[195001,1,"蜎"],[195002,1,"蛢"],[195003,1,"蝹"],[195004,1,"蜨"],[195005,1,"蝫"],[195006,1,"螆"],[195007,1,"䗗"],[195008,1,"蟡"],[195009,1,"蠁"],[195010,1,"䗹"],[195011,1,"衠"],[195012,1,"衣"],[195013,1,"𧙧"],[195014,1,"裗"],[195015,1,"裞"],[195016,1,"䘵"],[195017,1,"裺"],[195018,1,"㒻"],[195019,1,"𧢮"],[195020,1,"𧥦"],[195021,1,"䚾"],[195022,1,"䛇"],[195023,1,"誠"],[195024,1,"諭"],[195025,1,"變"],[195026,1,"豕"],[195027,1,"𧲨"],[195028,1,"貫"],[195029,1,"賁"],[195030,1,"贛"],[195031,1,"起"],[195032,1,"𧼯"],[195033,1,"𠠄"],[195034,1,"跋"],[195035,1,"趼"],[195036,1,"跰"],[195037,1,"𠣞"],[195038,1,"軔"],[195039,1,"輸"],[195040,1,"𨗒"],[195041,1,"𨗭"],[195042,1,"邔"],[195043,1,"郱"],[195044,1,"鄑"],[195045,1,"𨜮"],[195046,1,"鄛"],[195047,1,"鈸"],[195048,1,"鋗"],[195049,1,"鋘"],[195050,1,"鉼"],[195051,1,"鏹"],[195052,1,"鐕"],[195053,1,"𨯺"],[195054,1,"開"],[195055,1,"䦕"],[195056,1,"閷"],[195057,1,"𨵷"],[195058,1,"䧦"],[195059,1,"雃"],[195060,1,"嶲"],[195061,1,"霣"],[195062,1,"𩅅"],[195063,1,"𩈚"],[195064,1,"䩮"],[195065,1,"䩶"],[195066,1,"韠"],[195067,1,"𩐊"],[195068,1,"䪲"],[195069,1,"𩒖"],[[195070,195071],1,"頋"],[195072,1,"頩"],[195073,1,"𩖶"],[195074,1,"飢"],[195075,1,"䬳"],[195076,1,"餩"],[195077,1,"馧"],[195078,1,"駂"],[195079,1,"駾"],[195080,1,"䯎"],[195081,1,"𩬰"],[195082,1,"鬒"],[195083,1,"鱀"],[195084,1,"鳽"],[195085,1,"䳎"],[195086,1,"䳭"],[195087,1,"鵧"],[195088,1,"𪃎"],[195089,1,"䳸"],[195090,1,"𪄅"],[195091,1,"𪈎"],[195092,1,"𪊑"],[195093,1,"麻"],[195094,1,"䵖"],[195095,1,"黹"],[195096,1,"黾"],[195097,1,"鼅"],[195098,1,"鼏"],[195099,1,"鼖"],[195100,1,"鼻"],[195101,1,"𪘀"],[[195102,196605],3],[[196606,196607],3],[[196608,201546],2],[[201547,201551],3],[[201552,205743],2],[[205744,262141],3],[[262142,262143],3],[[262144,327677],3],[[327678,327679],3],[[327680,393213],3],[[393214,393215],3],[[393216,458749],3],[[458750,458751],3],[[458752,524285],3],[[524286,524287],3],[[524288,589821],3],[[589822,589823],3],[[589824,655357],3],[[655358,655359],3],[[655360,720893],3],[[720894,720895],3],[[720896,786429],3],[[786430,786431],3],[[786432,851965],3],[[851966,851967],3],[[851968,917501],3],[[917502,917503],3],[917504,3],[917505,3],[[917506,917535],3],[[917536,917631],3],[[917632,917759],3],[[917760,917999],7],[[918000,983037],3],[[983038,983039],3],[[983040,1048573],3],[[1048574,1048575],3],[[1048576,1114109],3],[[1114110,1114111],3]]'); + /***/ }) /******/ }); @@ -27417,19 +57977,29685 @@ module.exports = parseParams /******/ return module.exports; /******/ } /******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __nccwpck_require__.m = __webpack_modules__; +/******/ /************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __nccwpck_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __nccwpck_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/create fake namespace object */ +/******/ (() => { +/******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__); +/******/ var leafPrototypes; +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 16: return value when it's Promise-like +/******/ // mode & 8|1: behave like require +/******/ __nccwpck_require__.t = function(value, mode) { +/******/ if(mode & 1) value = this(value); +/******/ if(mode & 8) return value; +/******/ if(typeof value === 'object' && value) { +/******/ if((mode & 4) && value.__esModule) return value; +/******/ if((mode & 16) && typeof value.then === 'function') return value; +/******/ } +/******/ var ns = Object.create(null); +/******/ __nccwpck_require__.r(ns); +/******/ var def = {}; +/******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)]; +/******/ for(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) { +/******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key]))); +/******/ } +/******/ def['default'] = () => (value); +/******/ __nccwpck_require__.d(ns, def); +/******/ return ns; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __nccwpck_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__nccwpck_require__.o(definition, key) && !__nccwpck_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/ensure chunk */ +/******/ (() => { +/******/ __nccwpck_require__.f = {}; +/******/ // This file contains only the entry chunk. +/******/ // The chunk loading function for additional chunks +/******/ __nccwpck_require__.e = (chunkId) => { +/******/ return Promise.all(Object.keys(__nccwpck_require__.f).reduce((promises, key) => { +/******/ __nccwpck_require__.f[key](chunkId, promises); +/******/ return promises; +/******/ }, [])); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/get javascript chunk filename */ +/******/ (() => { +/******/ // This function allow to reference async chunks +/******/ __nccwpck_require__.u = (chunkId) => { +/******/ // return url for filenames based on template +/******/ return "" + chunkId + ".index.js"; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __nccwpck_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __nccwpck_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ /******/ /* webpack/runtime/compat */ /******/ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = new URL('.', import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/) ? 1 : 0, -1) + "/"; /******/ +/******/ /* webpack/runtime/import chunk loading */ +/******/ (() => { +/******/ // no baseURI +/******/ +/******/ // object to store loaded and loading chunks +/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched +/******/ // [resolve, Promise] = chunk loading, 0 = chunk loaded +/******/ var installedChunks = { +/******/ 792: 0 +/******/ }; +/******/ +/******/ var installChunk = (data) => { +/******/ var {ids, modules, runtime} = data; +/******/ // add "modules" to the modules object, +/******/ // then flag all "ids" as loaded and fire callback +/******/ var moduleId, chunkId, i = 0; +/******/ for(moduleId in modules) { +/******/ if(__nccwpck_require__.o(modules, moduleId)) { +/******/ __nccwpck_require__.m[moduleId] = modules[moduleId]; +/******/ } +/******/ } +/******/ if(runtime) runtime(__nccwpck_require__); +/******/ for(;i < ids.length; i++) { +/******/ chunkId = ids[i]; +/******/ if(__nccwpck_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { +/******/ installedChunks[chunkId][0](); +/******/ } +/******/ installedChunks[ids[i]] = 0; +/******/ } +/******/ +/******/ } +/******/ +/******/ __nccwpck_require__.f.j = (chunkId, promises) => { +/******/ // import() chunk loading for javascript +/******/ var installedChunkData = __nccwpck_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; +/******/ if(installedChunkData !== 0) { // 0 means "already installed". +/******/ +/******/ // a Promise means "currently loading". +/******/ if(installedChunkData) { +/******/ promises.push(installedChunkData[1]); +/******/ } else { +/******/ if(true) { // all chunks have JS +/******/ // setup Promise in chunk cache +/******/ var promise = import("./" + __nccwpck_require__.u(chunkId)).then(installChunk, (e) => { +/******/ if(installedChunks[chunkId] !== 0) installedChunks[chunkId] = undefined; +/******/ throw e; +/******/ }); +/******/ var promise = Promise.race([promise, new Promise((resolve) => (installedChunkData = installedChunks[chunkId] = [resolve]))]) +/******/ promises.push(installedChunkData[1] = promise); +/******/ } +/******/ } +/******/ } +/******/ }; +/******/ +/******/ // no prefetching +/******/ +/******/ // no preloaded +/******/ +/******/ // no external install chunk +/******/ +/******/ // no on chunks loaded +/******/ })(); +/******/ /************************************************************************/ var __webpack_exports__ = {}; +// NAMESPACE OBJECT: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/validator.js +var validator_namespaceObject = {}; +__nccwpck_require__.r(validator_namespaceObject); +__nccwpck_require__.d(validator_namespaceObject, { + alternatives: () => (alternatives), + boolean: () => (validator_boolean), + list: () => (validator_list), + map: () => (map), + number: () => (validator_number), + optional: () => (validator_optional), + options: () => (options), + string: () => (validator_string), + tree: () => (tree) +}); + // EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js var core = __nccwpck_require__(7484); +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/Dev.js +var Dev; +(function (Dev) { + function assertDefined(value) { + if (value === undefined) { + throw new Error(`'${Dev.stringify(value)}' is 'undefined'`); + } + } + Dev.assertDefined = assertDefined; + function assertNever(value) { + throw new Error(`'${Dev.stringify(value)}' is not of type 'never'`); + } + Dev.assertNever = assertNever; + function assertTrue(value, message) { + if (!value) { + throw new Error(`Assertion failed: ${message}. '${Dev.stringify(value)}' should be true.`); + } + } + Dev.assertTrue = assertTrue; + /** + * @returns An estimate of the memory taken by the given value, assuming objects are stored as array-like structures instead of dictionaries in the V8 engine. + */ + function estimateMemoryUsage(value) { + const ByteToBits = 8; + const PointerSize = 8; + let ans = 0; + const calculatedObjects = new Set(); + const stack = [value]; + while (stack.length) { + const current = stack.pop(); + switch (typeof current) { + case 'bigint': { + const bits = Math.ceil(Math.log2(Number(current))); + ans += (2 + Math.ceil(bits / (ByteToBits * PointerSize))) * PointerSize; // https://stackoverflow.com/a/54298760 + break; + } + case 'boolean': + ans += PointerSize; // Aggressive alignment estimation. + break; + case 'number': + ans += 8; + break; + case 'object': + ans += PointerSize; // Reference pointer. + if (!current || calculatedObjects.has(current)) { + break; + } + ans += PointerSize; // Header pointer. + for (const value of Object.values(current)) { + stack.push(value); + ans += PointerSize; // Aggressive padding estimation. + } + calculatedObjects.add(current); + break; + case 'string': + ans += current.length * 2; + break; + case 'symbol': + ans += PointerSize; + break; + default: + break; + } + } + return ans; + } + Dev.estimateMemoryUsage = estimateMemoryUsage; + function stringify(value) { + if (value && typeof value === 'object') { + try { + const seen = new Set(); + return JSON.stringify(value, (_k, v) => { + if (v && typeof v === 'object') { + return seen.has(v) ? '[Circular]' : (seen.add(v), v); + } + else { + return v; + } + }); + } + catch (ignored) { + // Most likely "Maximum callstack size exceeded". + // Fall back to a shallow string representation. + return `{ ${Object.entries(value).map(([k, v]) => `'${k}': '${String(v)}'`).join(', ')} }`; + } + } + else if (typeof value === 'symbol') { + // JavaScript does not convert `Symbol`s to strings implicitly. + return String(value); + } + else { + return `${value}`; + } + } + Dev.stringify = stringify; +})(Dev || (Dev = {})); +//# sourceMappingURL=Dev.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/externals/downloader.js +var RemoteUriString; +(function (RemoteUriString) { + function is(value) { + return value.startsWith('http:') || value.startsWith('https:'); + } + RemoteUriString.is = is; +})(RemoteUriString || (RemoteUriString = {})); +var ExternalDownloader; +(function (ExternalDownloader) { + function mock(options) { + return new ExternalDownloaderMock(options); + } + ExternalDownloader.mock = mock; +})(ExternalDownloader || (ExternalDownloader = {})); +class ExternalDownloaderMock { + options; + constructor(options) { + this.options = options; + } + async get(uri) { + if (!this.options.fixtures[uri]) { + throw new Error(`404 not found: ${uri}`); + } + const fixture = this.options.fixtures[uri]; + if (fixture instanceof Uint8Array) { + return fixture; + } + else if (typeof fixture === 'string') { + return new TextEncoder().encode(fixture); + } + else { + return new TextEncoder().encode(JSON.stringify(fixture)); + } + } +} +//# sourceMappingURL=downloader.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/externals/index.js + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/Logger.js +var Logger; +(function (Logger) { + /* istanbul ignore next */ + /** + * @returns The built-in `console`. + * Do **not** use this implementation in language servers, as some clients cannot handle + * non-LSP stdout. (https://github.com/SpyglassMC/Spyglass/issues/845) + */ + function create() { + return console; + } + Logger.create = create; + /** + * @returns A logger that does nothing. + */ + function noop() { + return new NoopLogger(); + } + Logger.noop = noop; +})(Logger || (Logger = {})); +class NoopLogger { + error() { } + info() { } + log() { } + warn() { } +} +//# sourceMappingURL=Logger.js.map +// EXTERNAL MODULE: ./node_modules/binary-search/index.js +var binary_search = __nccwpck_require__(896); +// EXTERNAL MODULE: ./node_modules/rfdc/index.js +var rfdc = __nccwpck_require__(8825); +// EXTERNAL MODULE: ./node_modules/whatwg-url/index.js +var whatwg_url = __nccwpck_require__(8012); +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/util.js + + + +// Spyglass uses the URL class provided by the +// [spec](https://url.spec.whatwg.org/)-compliant `whatwg-url` package instead +// of the broken one shipped with browsers that do not parse non-special scheme +// URLs with hosts properly. +// +// * [Chromium bug](https://issues.chromium.org/issues/40587286) +// * [FireFox bug](https://bugzilla.mozilla.org/show_bug.cgi?id=1374505) +// +// We use the name "URI" instead of "URL" when possible, since it is what +// LSP has chosen to use for the string that uniquely identifies a file. +const Uri = whatwg_url/* URL */.k; +/** + * @param getKey A function that takes the actual arguments being passed into the decorated method, and returns anything. + * The result of this function will be used as the key to identify the `Promise`. By default the first element in the argument + * list will be used. + * + * This is a decorator for async methods. Decorated methods will return the same `Promise` for + * the same key, provided that the previously returned `Promise` is still pending. + */ +function SingletonPromise(getKey = (args) => args[0]) { + return (_target, _key, descripter) => { + const promises = new Map(); + const decoratedMethod = descripter.value; + // The `function` syntax is used to preserve `this` context from the decorated method. + descripter.value = function (...args) { + const key = getKey(args); + if (promises.has(key)) { + return promises.get(key); + } + const ans = decoratedMethod.apply(this, args).then((ans) => (promises.delete(key), ans), (e) => (promises.delete(key), Promise.reject(e))); + promises.set(key, ans); + return ans; + }; + return descripter; + }; +} +/** + * This is a decorator for methods. Decorated methods will return the same non-`undefined` value no matter what. + */ +const Singleton = (_target, _key, descripter) => { + let value; + const decoratedMethod = descripter.value; + // The `function` syntax is used to preserve `this` context from the decorated method. + descripter.value = function (...args) { + return (value ??= decoratedMethod.apply(this, args)); + }; + return descripter; +}; +/** + * @param getKey A function that takes the actual arguments being passed into the decorated method, and returns anything. + * The result of this function will be used as the key to cache the `Timeout`. By default the first element in the argument + * list will be used. + * + * Decorated methods will be scheduled to run after `ms` milliseconds. The timer will reset when the method is called again. + */ +function Delay(ms, getKey = (args) => args[0]) { + return (_target, _key, descripter) => { + const timeouts = new Map(); + const decoratedMethod = descripter.value; + // The `function` syntax is used to preserve `this` context from the decorated method. + descripter.value = function (...args) { + const key = getKey(args); + if (timeouts.has(key)) { + clearTimeout(timeouts.get(key)); + } + timeouts.set(key, setTimeout(() => { + timeouts.delete(key); + decoratedMethod.apply(this, args); + }, ms)); + }; + return descripter; + }; +} +var ResourceLocation; +(function (ResourceLocation) { + /** + * The prefix for tags. + */ + ResourceLocation.TagPrefix = '#'; + /** + * The seperator of namespace and path. + */ + ResourceLocation.NamespacePathSep = ':'; + /** + * The seperator between different path segments. + */ + ResourceLocation.PathSep = '/'; + ResourceLocation.DefaultNamespace = 'minecraft'; + function lengthen(value) { + switch (value.indexOf(ResourceLocation.NamespacePathSep)) { + case -1: + return `${ResourceLocation.DefaultNamespace}${ResourceLocation.NamespacePathSep}${value}`; + case 0: + return `${ResourceLocation.DefaultNamespace}${value}`; + default: + return value; + } + } + ResourceLocation.lengthen = lengthen; + function shorten(value) { + return value.replace(/^(?:minecraft)?:/, ''); + } + ResourceLocation.shorten = shorten; +})(ResourceLocation || (ResourceLocation = {})); +/** + * @returns The string value decoded from the buffer according to UTF-8. + * Byte order mark is correctly removed. + */ +function bufferToString(buffer) { + const ans = new TextDecoder().decode(buffer); + // if (ans.charCodeAt(0) === 0xFEFF) { + // return ans.slice(1) + // } + return ans; +} +var Arrayable; +(function (Arrayable) { + function is(value, isT) { + return Array.isArray(value) ? value.every((e) => isT(e)) : isT(value); + } + Arrayable.is = is; + function toArray(value) { + return Array.isArray(value) ? value : [value]; + } + Arrayable.toArray = toArray; +})(Arrayable || (Arrayable = {})); +var TypePredicates; +(function (TypePredicates) { + function isString(value) { + return typeof value === 'string'; + } + TypePredicates.isString = isString; +})(TypePredicates || (TypePredicates = {})); +function promisifyAsyncIterable(iterable, joiner) { + return (async () => { + const chunks = []; + for await (const chunk of iterable) { + chunks.push(chunk); + } + return joiner(chunks); + })(); +} +async function parseGzippedJson(externals, buffer) { + return JSON.parse(bufferToString(await externals.archive.gunzip(buffer))); +} +/** + * @returns Is Plain Old JavaScript Object (POJO). + */ +function isPojo(value) { + return !!value && typeof value === 'object' && !Array.isArray(value); +} +function merge(a, b) { + const ans = rfdc()(a); + for (const [key, value] of Object.entries(b)) { + if (isPojo(ans[key]) && isPojo(value)) { + ans[key] = merge(ans[key], value); + } + else if (value === undefined) { + delete ans[key]; + } + else { + ans[key] = value; + } + } + return ans; +} +var Lazy; +(function (Lazy) { + const LazyDiscriminator = Symbol('LazyDiscriminator'); + function create(getter) { + return { discriminator: LazyDiscriminator, getter }; + } + Lazy.create = create; + function isComplex(lazy) { + return lazy?.discriminator === LazyDiscriminator; + } + Lazy.isComplex = isComplex; + function isUnresolved(lazy) { + return isComplex(lazy) && !('value' in lazy); + } + Lazy.isUnresolved = isUnresolved; + function resolve(lazy) { + return isUnresolved(lazy) ? (lazy.value = lazy.getter()) : lazy; + } + Lazy.resolve = resolve; +})(Lazy || (Lazy = {})); +/** + * @param ids An array of block/fluid IDs, with or without the namespace. + * @returns A map from state names to the corresponding sets of values. The first element in the value array is the default + * value for that state. + */ +function getStates(category, ids, ctx) { + const ans = {}; + ids = ids.map(ResourceLocation.lengthen); + for (const id of ids) { + ctx.symbols.query(ctx.doc, category, id).forEachMember((state, stateQuery) => { + const values = Object.keys(stateQuery.visibleMembers); + const set = (ans[state] ??= new Set()); + const defaultValue = stateQuery.symbol?.relations?.default; + if (defaultValue) { + set.add(defaultValue.path[defaultValue.path.length - 1]); + } + for (const value of values) { + set.add(value); + } + }); + } + return Object.fromEntries(Object.entries(ans).map(([k, v]) => [k, [...v]])); +} +const binarySearch = binary_search; +function isIterable(value) { + return !!value[Symbol.iterator]; +} +// #region ESNext functions polyfill +function atArray(array, index) { + return index >= 0 ? array?.[index] : array?.[array.length + index]; +} +function emplaceMap(map, key, handler) { + if (map.has(key)) { + let value = map.get(key); + if (handler.update) { + value = handler.update(value, key, map); + map.set(key, value); + } + return value; + } + else if (handler.insert) { + const value = handler.insert(key, map); + map.set(key, value); + return value; + } + else { + throw new Error(`No key ${key} in map and no insert handler provided`); + } +} +// #endregion +/** + * @returns If `val` is an non-null object or a callable object (i.e. function). + */ +function isObject(val) { + return typeof val === 'function' || (!!val && typeof val === 'object'); +} +function normalizeUri(uri) { + const obj = new Uri(uri); + obj.pathname = obj.pathname.replace(/%3A/gi, ':'); + return obj.toString(); +} +//# sourceMappingURL=util.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/ReadonlyProxy.js + +var ReadonlyProxy; +(function (ReadonlyProxy) { + function create(obj) { + return new Proxy(obj, new ReadonlyProxyHandler()); + } + ReadonlyProxy.create = create; +})(ReadonlyProxy || (ReadonlyProxy = {})); +class ReadonlyProxyHandler { + map = new Map(); + get(target, p, receiver) { + const value = Reflect.get(target, p, receiver); + if (p !== 'prototype' && isObject(value)) { + return emplaceMap(this.map, p, { insert: () => ReadonlyProxy.create(value) }); + } + return value; + } + set(_target, p, _value, _receiver) { + throw new TypeError(`Cannot set property '${String(p)}' on a readonly proxy`); + } + deleteProperty(_target, p) { + throw new TypeError(`Cannot delete property '${String(p)}' on a readonly proxy`); + } +} +//# sourceMappingURL=ReadonlyProxy.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/Operations.js +class Operations { + parent; + constructor(parent) { + this.parent = parent; + } + undoOps = []; + redoOps = []; + addUndoOp(op) { + this.undoOps.push(op); + this.parent?.addUndoOp(op); + } + addRedoOp(op) { + this.redoOps.push(op); + this.parent?.addRedoOp(op); + } + set(obj, key, value, receiver = obj) { + const oldValue = Reflect.get(obj, key, receiver); + const op = () => { + Reflect.set(obj, key, value, receiver); + }; + const undoOp = () => { + Reflect.set(obj, key, oldValue, receiver); + }; + this.addRedoOp(op); + this.addUndoOp(undoOp); + op(); + } + undo() { + for (let i = this.undoOps.length - 1; i >= 0; i--) { + this.undoOps[i](); + } + } + redo() { + this.redoOps.forEach((op) => op()); + } +} +//# sourceMappingURL=Operations.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/StateProxy.js + + +const BranchOff = Symbol('StateBranchOff'); +const Is = Symbol('IsStateProxy'); +const Origin = Symbol('OriginState'); +const Redo = Symbol('RedoStateChanges'); +const Undo = Symbol('UndoStateChanges'); +var StateProxy; +(function (StateProxy) { + function branchOff(proxy) { + return proxy[BranchOff](); + } + StateProxy.branchOff = branchOff; + function create(obj) { + if (StateProxy.is(obj)) { + throw new TypeError('Cannot create a proxy over a proxy. You might want to use branchOff instead.'); + } + return _createStateProxy(obj, new Operations()); + } + StateProxy.create = create; + function dereference(value) { + return StateProxy.is(value) ? value[Origin] : value; + } + StateProxy.dereference = dereference; + function is(obj) { + return obj?.[Is]; + } + StateProxy.is = is; + function redoChanges(proxy) { + proxy[Redo](); + } + StateProxy.redoChanges = redoChanges; + function undoChanges(proxy) { + proxy[Undo](); + } + StateProxy.undoChanges = undoChanges; +})(StateProxy || (StateProxy = {})); +class StateProxyHandler { + rootOps; + map = new Map(); + constructor( + /** + * Shared across all handlers created for the same root state object under the same branch. + */ + rootOps) { + this.rootOps = rootOps; + } + #branchOff(target) { + return _createStateProxy(target, new Operations(this.rootOps)); + } + get(target, p, receiver) { + switch (p) { + case BranchOff: + return () => this.#branchOff(target); + case Is: + return true; + case Origin: + return target; + case Redo: + return () => this.rootOps.redo(); + case Undo: + return () => this.rootOps.undo(); + } + const value = Reflect.get(target, p, receiver); + if (p !== 'prototype' && isObject(value)) { + return emplaceMap(this.map, p, { insert: () => _createStateProxy(value, this.rootOps) }); + } + return value; + } + set(target, p, value, receiver) { + if (p === BranchOff || p === Is || p === Origin || p === Redo || p === Undo) { + throw new TypeError(`Cannot set ${String(p)}`); + } + this.rootOps.set(target, p, StateProxy.dereference(value), receiver); + return true; + } +} +function _createStateProxy(target, operations) { + return new Proxy(target, new StateProxyHandler(operations)); +} +//# sourceMappingURL=StateProxy.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/TwoWayMap.js +class TwoWayMap { + _map = new Map(); + _reversedMap = new Map(); + constructor(values = []) { + for (const [k, v] of values) { + this._map.set(k, v); + this._reversedMap.set(v, k); + } + } + get size() { + return this._map.size; + } + clear() { + this._map.clear(); + this._reversedMap.clear(); + } + delete(key) { + const value = this._map.get(key); + const ans = this._map.delete(key); + if (value !== undefined) { + this._reversedMap.delete(value); + } + return ans; + } + deleteValue(value) { + const key = this._reversedMap.get(value); + const ans = this._reversedMap.delete(value); + if (key !== undefined) { + this._map.delete(key); + } + return ans; + } + get(key) { + return this._map.get(key); + } + getKey(value) { + return this._reversedMap.get(value); + } + has(key) { + return this._map.has(key); + } + hasValue(value) { + return this._reversedMap.has(value); + } + set(key, value) { + this._map.set(key, value); + this._reversedMap.set(value, key); + return this; + } + forEach(callbackfn, thisArg) { + for (const [key, value] of this._map) { + callbackfn.apply(thisArg, [value, key, this]); + } + } + entries() { + return this._map.entries(); + } + keys() { + return this._map.keys(); + } + values() { + return this._map.values(); + } + [Symbol.iterator]() { + return this._map.entries(); + } + [Symbol.toStringTag] = 'TwoWayMap'; +} +//# sourceMappingURL=TwoWayMap.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/index.js + + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Source.js + + +const CRLF = '\r\n'; +const CR = '\r'; +const LF = '\n'; +const Whitespaces = Object.freeze([' ', '\n', '\r', '\t']); +class ReadonlySource { + string; + indexMap; + innerCursor = 0; + constructor(string, indexMap = []) { + this.string = string; + this.indexMap = indexMap; + } + get cursor() { + return IndexMap.toOuterOffset(this.indexMap, this.innerCursor); + } + /** + * @param offset The index to offset from cursor. Defaults to 0. + * + * @returns The range of the specified character. + * + * @example + * getCharRange(-1) // Returns the range of the character before cursor. + * getCharRange() // Returns the range of the character at cursor. + * getCharRange(1) // Returns the range of the character after cursor. + */ + getCharRange(offset = 0) { + return IndexMap.toOuterRange(this.indexMap, Range.create(this.innerCursor + offset, this.innerCursor + offset + 1)); + } + /** + * Returns a string that helps visualize this `Source`'s index map. + * Primarily intended for debugging purposes. + */ + visualizeIndexMap() { + let res = this.string; + const adjustments = []; + for (const { inner, outer } of this.indexMap) { + const innerLength = inner.end - inner.start; + const outerLength = outer.end - outer.start; + const { char, count } = outerLength > innerLength + ? { + count: outerLength - innerLength, + char: '\u2190', // ← + } + : { count: outer.start - inner.start, char: '\u2017' }; // ‗ + adjustments.push({ idx: inner.start, str: char.repeat(count) }); + } + for (const { idx, str } of adjustments.reverse()) { + res = `${res.slice(0, idx)}${str}${res.slice(idx)}`; + } + return res; + } + /** + * Peeks a substring from the current cursor. + * @param length The length of the substring. Defaults to 1 + * @param offset The index to offset from cursor. Defaults to 0 + */ + peek(length = 1, offset = 0) { + return this.string.slice(this.innerCursor + offset, this.innerCursor + offset + length); + } + canRead(length = 1) { + const needed = this.innerCursor + length; + const available = this.string.length; + return this.innerCursor + length <= this.string.length; + } + canReadInLine() { + return this.canRead() && this.peek() !== CR && this.peek() !== LF; + } + /** + * If the `expectedValue` is right after the cursor, returns `true`. Otherwise returns `false`. + * + * @param offset Defaults to 0. + * + * @see {@link Source.trySkip} + */ + tryPeek(expectedValue, offset = 0) { + return this.peek(expectedValue.length, offset) === expectedValue; + } + tryPeekAfterWhitespace(expectedValue) { + const maxOffset = this.string.length - this.innerCursor; + let offset = 0; + while (offset < maxOffset && Source.isWhitespace(this.peek(1, offset))) { + offset++; + } + return this.tryPeek(expectedValue, offset); + } + peekUntil(...terminators) { + let ans = ''; + for (let cursor = this.innerCursor; cursor < this.string.length; cursor++) { + const c = this.string.charAt(cursor); + if (terminators.includes(c)) { + return ans; + } + else { + ans += c; + } + } + return ans; + } + peekLine() { + return this.peekUntil(CR, LF); + } + peekRemaining(offset = 0) { + return this.string.slice(this.innerCursor + offset); + } + matchPattern(regex, offset = 0) { + return regex.test(this.peekRemaining(offset)); + } + /** + * If there is a non-space character between `cursor + offset` (inclusive) and the next newline, returns `true`. Otherwise returns `false`. + * + * @param offset Defaults to 0. + */ + hasNonSpaceAheadInLine(offset = 0) { + for (let cursor = this.innerCursor + offset; cursor < this.string.length; cursor++) { + const c = this.string.charAt(cursor); + if (Source.isNewline(c)) { + break; + } + if (!Source.isSpace(c)) { + return true; + } + } + return false; + } + slice(param0, end) { + if (typeof param0 === 'number') { + const innerStart = IndexMap.toInnerOffset(this.indexMap, param0); + const innerEnd = end !== undefined ? IndexMap.toInnerOffset(this.indexMap, end) : undefined; + return this.string.slice(innerStart, innerEnd); + } + const range = IndexMap.toInnerRange(this.indexMap, Range.get(param0)); + return this.string.slice(range.start, range.end); + } + sliceToCursor(start) { + const innerStart = IndexMap.toInnerOffset(this.indexMap, start); + return this.string.slice(innerStart, this.innerCursor); + } +} +class Source extends ReadonlySource { + string; + indexMap; + constructor(string, indexMap = []) { + super(string, indexMap); + this.string = string; + this.indexMap = indexMap; + } + get cursor() { + return super.cursor; + } + set cursor(cursor) { + this.innerCursor = IndexMap.toInnerOffset(this.indexMap, cursor); + } + clone() { + const ans = new Source(this.string, this.indexMap); + ans.innerCursor = this.innerCursor; + return ans; + } + read() { + return this.string.charAt(this.innerCursor++); + } + /** + * Skips the current character. + * @param step The step to skip. Defaults to 1 + */ + skip(step = 1) { + this.innerCursor += step; + return this; + } + /** + * If the `expectedValue` is right after the cursor, skips it and returns `true`. Otherwise returns `false`. + * + * This is a shortcut for the following piece of code: + * ```typescript + * declare const src: Source + * if (src.peek(expectedValue.length) === expectedValue) { + * src.skip(expectedValue.length) + * // Do something here. + * } + * ``` + * + * @see {@link Source.tryPeek} + */ + trySkip(expectedValue) { + if (this.peek(expectedValue.length) === expectedValue) { + this.skip(expectedValue.length); + return true; + } + return false; + } + /** + * Reads until the end of this line. + */ + readLine() { + return this.readUntil(CR, LF); + } + /** + * Skips until the end of this line. + */ + skipLine() { + this.readLine(); + return this; + } + /** + * Jumps to the beginning of the next line. + */ + nextLine() { + this.skipLine(); + if (this.peek(2) === CRLF) { + this.skip(2); + } + else if (this.peek() === CR || this.peek() === LF) { + this.skip(); + } + return this; + } + readSpace() { + const start = this.innerCursor; + this.skipSpace(); + return this.string.slice(start, this.innerCursor); + } + skipSpace() { + while (this.canRead() && Source.isSpace(this.peek())) { + this.skip(); + } + return this; + } + readWhitespace() { + const start = this.innerCursor; + this.skipWhitespace(); + return this.string.slice(start, this.innerCursor); + } + skipWhitespace() { + while (this.canRead() && Source.isWhitespace(this.peek())) { + this.skip(); + } + return this; + } + readIf(predicate) { + let ans = ''; + while (this.canRead()) { + const c = this.peek(); + if (predicate(c)) { + this.skip(); + ans += c; + } + else { + break; + } + } + return ans; + } + skipIf(predicate) { + this.readIf(predicate); + return this; + } + /** + * @param terminators Ending character. Will not be skipped or included in the result. + */ + readUntil(...terminators) { + let ans = ''; + while (this.canRead()) { + const c = this.peek(); + if (terminators.includes(c)) { + return ans; + } + else { + ans += c; + } + this.skip(); + } + return ans; + } + /** + * @param terminators Ending character. Will not be skipped. + */ + skipUntilOrEnd(...terminators) { + this.readUntil(...terminators); + return this; + } + readUntilLineEnd() { + return this.readUntil(CR, LF); + } + skipUntilLineEnd() { + return this.skipUntilOrEnd(CR, LF); + } + readRemaining() { + const start = this.innerCursor; + this.innerCursor = this.string.length; + return this.string.slice(start); + } + skipRemaining() { + this.readRemaining(); + return this; + } +} +(function (Source) { + function isDigit(c) { + return c >= '0' && c <= '9'; + } + Source.isDigit = isDigit; + function isBrigadierQuote(c) { + return c === '"' || c === "'"; + } + Source.isBrigadierQuote = isBrigadierQuote; + function isNewline(c) { + return c === '\r\n' || c === '\r' || c === '\n'; + } + Source.isNewline = isNewline; + function isSpace(c) { + return c === ' ' || c === '\t'; + } + Source.isSpace = isSpace; + function isWhitespace(c) { + return Source.isSpace(c) || Source.isNewline(c); + } + Source.isWhitespace = isWhitespace; +})(Source || (Source = {})); +//# sourceMappingURL=Source.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Offset.js + +var Offset; +(function (Offset) { + /** + * Get an offset from a `OffsetLike`. + * + * @returns + * - `number`: itself. + * - `Source`: its `cursor`. + */ + function get(offset) { + if (typeof offset === 'function') { + offset = offset(); + } + if (offset instanceof ReadonlySource) { + offset = offset.cursor; + } + return offset; + } + Offset.get = get; +})(Offset || (Offset = {})); +//# sourceMappingURL=Offset.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Range.js + +var Range; +(function (Range) { + /** + * Gets a range from `RangeLike`. + * + * @returns + * - `Range`: a clone of it. + * - `RangeContainer`: a clone of its range. + * - `OffsetLike`: a range with both positions set to the offset. + */ + function get(range) { + const evaluated = typeof range === 'function' ? range() : range; + if (Range.is(evaluated)) { + return Range.create(evaluated.start, evaluated.end); + } + if (RangeContainer.is(evaluated)) { + return Range.create(evaluated.range.start, evaluated.range.end); + } + return Range.create(evaluated); + } + Range.get = get; + /** + * Creates a range from `OffsetLike`. If only `start` is passed in, `end` will be the same value as `start`. + */ + function create(start, end) { + start = Offset.get(start); + return { start, end: end !== undefined ? Offset.get(end) : start }; + } + Range.create = create; + /** + * Creates a range that covers the area between `from.start` and `to.end`. + */ + function span(from, to) { + return { start: Range.get(from).start, end: Range.get(to).end }; + } + Range.span = span; + function is(obj) { + return (!!obj + && typeof obj === 'object' + && typeof obj.start === 'number' + && typeof obj.end === 'number'); + } + Range.is = is; + /** + * ```typescript + * { start: 0, end: 1 } + * ``` + */ + Range.Beginning = Object.freeze(Range.create(0, 1)); + /** + * ```typescript + * { start: 0, end: Infinity } + * ``` + */ + Range.Full = Object.freeze(Range.create(0, Number.POSITIVE_INFINITY)); + function toString(range) { + return `[${range.start}, ${range.end})`; + } + Range.toString = toString; + function contains(range, offset, endInclusive = false) { + range = get(range); + return (range.start <= offset && (endInclusive ? offset <= range.end : offset < range.end)); + } + Range.contains = contains; + function containsRange(a, b, endInclusive = false) { + a = get(a); + b = get(b); + return contains(a, b.start, endInclusive) && contains(a, b.end, true); + } + Range.containsRange = containsRange; + function intersects(a, b) { + return Range.contains(a, b.start) || Range.contains(b, a.start); + } + Range.intersects = intersects; + function equals(a, b) { + return a.start === b.start && a.end === b.end; + } + Range.equals = equals; + function endsBefore(range, target, endInclusive = false) { + return endInclusive + ? range.end < Range.get(target).start + : range.end <= Range.get(target).start; + } + Range.endsBefore = endsBefore; + function isEmpty(range) { + range = get(range); + return range.start === range.end; + } + Range.isEmpty = isEmpty; + function length(range) { + return range.end - range.start; + } + Range.length = length; + /** + * @returns Negative when `a` is before `b`, `0` if they intersect, and positive if it's after. + */ + function compare(a, b, endInclusive = false) { + if (endInclusive ? a.end < b.start : a.end <= b.start) { + return -1; + } + else if (endInclusive ? a.start > b.end : a.start >= b.end) { + return 1; + } + else { + return 0; + } + } + Range.compare = compare; + /** + * @returns Negative when `range` is before `offset`, `0` if it {@link contains} `offset`, and positive if it's after. + */ + function compareOffset(range, offset, endInclusive = false) { + if (endInclusive ? range.end < offset : range.end <= offset) { + return -1; + } + else if (range.start > offset) { + return 1; + } + else { + return 0; + } + } + Range.compareOffset = compareOffset; + /** + * @param startOffset The number to offset the start of the `range`. + * @param endOffset The number to offset the end of the `range`. Default: `startOffset`. + * @returns A copy of `range`. + */ + function translate(range, startOffset, endOffset = startOffset) { + range = get(range); + return { start: range.start + startOffset, end: range.end + endOffset }; + } + Range.translate = translate; +})(Range || (Range = {})); +var RangeContainer; +(function (RangeContainer) { + function is(obj) { + return (!!obj && typeof obj === 'object' && Range.is(obj.range)); + } + RangeContainer.is = is; +})(RangeContainer || (RangeContainer = {})); +//# sourceMappingURL=Range.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/IndexMap.js + +var IndexMap; +(function (IndexMap) { + function convertOffset(map, offset, from, to) { + let ans = offset; + for (const pair of map) { + if (Range.contains(pair[from], offset)) { + return pair[to].start; + } + else if (Range.endsBefore(pair[from], offset)) { + ans = offset - pair[from].end + pair[to].end; + } + else { + break; + } + } + return ans; + } + function toInnerOffset(map, offset) { + return convertOffset(map, offset, 'outer', 'inner'); + } + IndexMap.toInnerOffset = toInnerOffset; + function toInnerRange(map, outer) { + return Range.create(toInnerOffset(map, outer.start), toInnerOffset(map, outer.end)); + } + IndexMap.toInnerRange = toInnerRange; + function toOuterOffset(map, offset) { + return convertOffset(map, offset, 'inner', 'outer'); + } + IndexMap.toOuterOffset = toOuterOffset; + function toOuterRange(map, inner) { + return Range.create(toOuterOffset(map, inner.start), toOuterOffset(map, inner.end)); + } + IndexMap.toOuterRange = toOuterRange; +})(IndexMap || (IndexMap = {})); +//# sourceMappingURL=IndexMap.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Position.js +var Position; +(function (Position) { + function create(param1, param2) { + if (typeof param1 === 'object') { + return _createFromPartial(param1); + } + else { + return _createFromNumbers(param1, param2); + } + } + Position.create = create; + function _createFromPartial(partial) { + return { line: partial.line ?? 0, character: partial.character ?? 0 }; + } + function _createFromNumbers(line, character) { + return _createFromPartial({ line, character }); + } + /** + * ```typescript + * { line: 0, character: 0 } + * ``` + */ + Position.Beginning = Position.create(0, 0); + /** + * ```typescript + * { line: Infinity, character: Infinity } + * ``` + */ + Position.Infinity = Position.create(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY); + function toString(pos) { + return `<${pos.line}, ${pos.character}>`; + } + Position.toString = toString; + function isBefore(pos1, pos2) { + return (pos1.line < pos2.line || (pos1.line === pos2.line && pos1.character < pos2.character)); + } + Position.isBefore = isBefore; +})(Position || (Position = {})); +//# sourceMappingURL=Position.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/PositionRange.js + + +var PositionRange; +(function (PositionRange) { + function create(param1, param2, param3, param4) { + if (typeof param1 === 'number') { + return { + start: Position.create(param1, param2), + end: Position.create(param3, param4), + }; + } + else if (param2 !== undefined) { + return { + start: Position.create(param1), + end: Position.create(param2), + }; + } + else { + const partial = param1; + return { + start: Position.create(partial.start ?? {}), + end: Position.create(partial.end ?? {}), + }; + } + } + PositionRange.create = create; + /** + * @returns A `PositionRange` converted from a `RangeLike`. + */ + function from(rangeLike, doc) { + const range = Range.get(rangeLike); + const ans = { + start: doc.positionAt(range.start), + end: doc.positionAt(range.end), + }; + return ans; + } + PositionRange.from = from; + /** + * ```typescript + * { + * start: { line: 0, character: 0 }, + * end: { line: 0, character: 1 } + * } + * ``` + */ + PositionRange.Beginning = Object.freeze(PositionRange.create(0, 0, 0, 1)); + /** + * ```typescript + * { + * start: { line: 0, character: 0 }, + * end: { line: Infinity, character: Infinity } + * } + * ``` + */ + PositionRange.Full = Object.freeze(PositionRange.create(Position.Beginning, Position.Infinity)); + function toString(range) { + return `[${Position.toString(range.start)}, ${Position.toString(range.end)})`; + } + PositionRange.toString = toString; + function contains(range, pos) { + const { start, end } = range; + // Check range of line number. + if (pos.line < start.line || pos.line > end.line) { + return false; + } + if (start.line < pos.line && pos.line < end.line) { + return true; + } + // Now `pos` is in the same line as `start` and/or `end`. + return ((pos.line === start.line ? pos.character >= start.character : true) + && (pos.line === end.line ? pos.character < end.character : true)); + } + PositionRange.contains = contains; + function endsBefore(range, pos) { + return Position.isBefore(Position.create(range.end.line, range.end.character - 1), pos); + } + PositionRange.endsBefore = endsBefore; +})(PositionRange || (PositionRange = {})); +//# sourceMappingURL=PositionRange.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/LanguageError.js + +var LanguageError; +(function (LanguageError) { + function create(message, range, severity = 3 /* ErrorSeverity.Error */, info, source) { + const ans = { range, message, severity }; + if (info) { + ans.info = info; + } + if (source) { + ans.source = source; + } + return ans; + } + LanguageError.create = create; + /** + * @returns A {@link PosRangeLanguageError}. + */ + function withPosRange(error, doc) { + return { + posRange: PositionRange.from(error.range, doc), + message: error.message, + severity: error.severity, + ...(error.info && { info: error.info }), + ...(error.source && { source: error.source }), + }; + } + LanguageError.withPosRange = withPosRange; +})(LanguageError || (LanguageError = {})); +//# sourceMappingURL=LanguageError.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/Location.js + + +var Location; +(function (Location) { + function get(partial) { + return { + uri: partial.uri ?? '', + range: Range.get(partial.range ?? { start: 0, end: 0 }), + posRange: partial.posRange + ?? { start: { line: 0, character: 0 }, end: { line: 0, character: 0 } }, + }; + } + Location.get = get; + function create(doc, range) { + return Location.get({ uri: doc.uri, range, posRange: PositionRange.from(range, doc) }); + } + Location.create = create; +})(Location || (Location = {})); +//# sourceMappingURL=Location.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/source/index.js + + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/AstNode.js + + +var AstNode; +(function (AstNode) { + /* istanbul ignore next */ + function is(obj) { + return (!!obj + && typeof obj === 'object' + && typeof obj.type === 'string' + && Range.is(obj.range)); + } + AstNode.is = is; + function setParents(node) { + for (const child of node.children ?? []) { + child.parent = node; + setParents(child); + } + } + AstNode.setParents = setParents; + /** + * @param endInclusive Defaults to `false`. + */ + function findChildIndex(node, needle, endInclusive = false) { + if (!node.children) { + return -1; + } + const comparator = typeof needle === 'number' ? Range.compareOffset : Range.compare; + return binary_search(node.children, needle, (a, b) => comparator(a.range, b, endInclusive)); + } + AstNode.findChildIndex = findChildIndex; + /** + * @param endInclusive Defaults to `false`. + */ + function findChild(node, needle, endInclusive = false) { + return node.children?.[findChildIndex(node, needle, endInclusive)]; + } + AstNode.findChild = findChild; + /** + * Returns the index of the last child node that ends before the `needle`. + * + * @param endInclusive Defaults to `false`. + */ + function findLastChildIndex(node, needle, endInclusive = false) { + if (!node.children) { + return -1; + } + let ans = -1; + for (const [i, childNode] of node.children.entries()) { + if (Range.endsBefore(childNode.range, needle, endInclusive)) { + ans = i; + } + else { + break; + } + } + return ans; + } + AstNode.findLastChildIndex = findLastChildIndex; + /** + * @param endInclusive Defaults to `false`. + */ + function findLastChild(node, needle, endInclusive = false) { + return node.children?.[findLastChildIndex(node, needle, endInclusive)]; + } + AstNode.findLastChild = findLastChild; + function findDeepestChild({ node, needle, endInclusive = false, predicate = () => true }) { + let last; + let head = Range.contains(node, needle, endInclusive) ? node : undefined; + while (head && predicate(head)) { + last = head; + head = findChild(head, needle, endInclusive); + } + return last; + } + AstNode.findDeepestChild = findDeepestChild; + function findShallowestChild({ node, needle, endInclusive = false, predicate = () => true }) { + let head = Range.contains(node, needle, endInclusive) ? node : undefined; + while (head && !predicate(head)) { + head = findChild(head, needle, endInclusive); + } + return head; + } + AstNode.findShallowestChild = findShallowestChild; + function* getLocalsToRoot(node) { + let head = node; + while (head) { + if (head.locals) { + yield head.locals; + } + head = node.parent; + } + } + AstNode.getLocalsToRoot = getLocalsToRoot; + function* getLocalsToLeaves(node) { + if (node.locals) { + yield node.locals; + } + for (const child of node.children ?? []) { + yield* getLocalsToLeaves(child); + } + } + AstNode.getLocalsToLeaves = getLocalsToLeaves; +})(AstNode || (AstNode = {})); +//# sourceMappingURL=AstNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/BooleanNode.js + +var BooleanNode; +(function (BooleanNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'boolean'; + } + BooleanNode.is = is; + function mock(range) { + return { type: 'boolean', range: Range.get(range) }; + } + BooleanNode.mock = mock; +})(BooleanNode || (BooleanNode = {})); +//# sourceMappingURL=BooleanNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/CommentNode.js +var CommentNode; +(function (CommentNode) { + function is(obj) { + return obj?.type === 'comment'; + } + CommentNode.is = is; +})(CommentNode || (CommentNode = {})); +//# sourceMappingURL=CommentNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/ErrorNode.js +var ErrorNode; +(function (ErrorNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'error'; + } + ErrorNode.is = is; +})(ErrorNode || (ErrorNode = {})); +//# sourceMappingURL=ErrorNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/FileNode.js +var FileNode; +(function (FileNode) { + function getErrors(node) { + return [ + ...node.parserErrors, + ...(node.binderErrors ?? []), + ...(node.checkerErrors ?? []), + ...(node.linterErrors ?? []), + ]; + } + FileNode.getErrors = getErrors; +})(FileNode || (FileNode = {})); +//# sourceMappingURL=FileNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/FloatNode.js + +var FloatNode; +(function (FloatNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'float'; + } + FloatNode.is = is; + function mock(range) { + return { type: 'float', range: Range.get(range), value: 0 }; + } + FloatNode.mock = mock; +})(FloatNode || (FloatNode = {})); +//# sourceMappingURL=FloatNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/IntegerNode.js + +var IntegerNode; +(function (IntegerNode) { + function is(obj) { + return obj.type === 'integer'; + } + IntegerNode.is = is; + function mock(range) { + return { type: 'integer', range: Range.get(range), value: 0 }; + } + IntegerNode.mock = mock; +})(IntegerNode || (IntegerNode = {})); +//# sourceMappingURL=IntegerNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/ListNode.js +var ItemNode; +(function (ItemNode) { + function is(node) { + return node?.type === 'item'; + } + ItemNode.is = is; +})(ItemNode || (ItemNode = {})); +//# sourceMappingURL=ListNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/LiteralNode.js + +var LiteralNode; +(function (LiteralNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'literal'; + } + LiteralNode.is = is; + function mock(range, options) { + return { type: 'literal', range: Range.get(range), options, value: '' }; + } + LiteralNode.mock = mock; +})(LiteralNode || (LiteralNode = {})); +//# sourceMappingURL=LiteralNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/LongNode.js + +var LongNode; +(function (LongNode) { + function is(obj) { + return obj.type === 'long'; + } + LongNode.is = is; + function mock(range) { + return { type: 'long', range: Range.get(range), value: 0n }; + } + LongNode.mock = mock; +})(LongNode || (LongNode = {})); +//# sourceMappingURL=LongNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/PrefixedNode.js + + +var PrefixedNode; +(function (PrefixedNode) { + function is(obj) { + return obj.type === 'prefixed'; + } + PrefixedNode.is = is; + function mock(range, prefix, child) { + return { + type: 'prefixed', + range: Range.get(range), + prefix, + children: [ + LiteralNode.mock(range, { pool: [prefix] }), + child, + ], + }; + } + PrefixedNode.mock = mock; +})(PrefixedNode || (PrefixedNode = {})); +//# sourceMappingURL=PrefixedNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/RecordNode.js +var PairNode; +(function (PairNode) { + function is(node) { + return node?.type === 'pair'; + } + PairNode.is = is; +})(PairNode || (PairNode = {})); +//# sourceMappingURL=RecordNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/ResourceLocationNode.js + + +var ResourceLocationNode; +(function (ResourceLocationNode) { + /** + * The prefix for tags. + */ + const TagPrefix = ResourceLocation.TagPrefix; + /** + * The seperator of namespace and path. + */ + const NamespacePathSep = ResourceLocation.NamespacePathSep; + /** + * The seperator between different path segments. + */ + const PathSep = ResourceLocation.PathSep; + const DefaultNamespace = ResourceLocation.DefaultNamespace; + /* istanbul ignore next */ + function is(obj) { + return (obj?.type === 'resource_location'); + } + ResourceLocationNode.is = is; + function mock(range, options) { + return { type: 'resource_location', range: Range.get(range), options }; + } + ResourceLocationNode.mock = mock; + function toString(node, type = 'origin', includesTagPrefix = false) { + const path = node.path ? node.path.join(PathSep) : ''; + let id; + /* + * `node.namespace` has four statuses here: + * - `minecraft` + * - `` (yes, empty string) + * - undefined + * - any other namespaces. + * + * Whether `node.namespace !== undefined` or simply `node.namespace` is used in the condition is carefully selected. + */ + switch (type) { + case 'origin': + // Use `node.namespace !== undefined`, so that empty namespaces can be correctly restored to string. + id = node.namespace !== undefined ? `${node.namespace}${NamespacePathSep}${path}` : path; + break; + case 'full': + // Use `node.namespace` before `||`, so that both undefined and empty value can result in the default namespace. + // Use `||` instead of `??`, so that empty namespaces can be converted to the default namespace. + id = `${node.namespace || DefaultNamespace}${NamespacePathSep}${path}`; + break; + case 'short': + // Use `node.namespace` before `&&` for the same reason stated above. + id = node.namespace && node.namespace !== DefaultNamespace + ? `${node.namespace}${NamespacePathSep}${path}` + : path; + break; + } + return includesTagPrefix && node.isTag ? `${TagPrefix}${id}` : id; + } + ResourceLocationNode.toString = toString; +})(ResourceLocationNode || (ResourceLocationNode = {})); +//# sourceMappingURL=ResourceLocationNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/Sequence.js +const SequenceUtilDiscriminator = Symbol('SequenceUtilDiscriminator'); +var SequenceUtil; +(function (SequenceUtil) { + function is(obj) { + return !!obj && obj[SequenceUtilDiscriminator]; + } + SequenceUtil.is = is; +})(SequenceUtil || (SequenceUtil = {})); +//# sourceMappingURL=Sequence.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/StringNode.js + +const EscapeChars = (/* unused pure expression or super */ null && (['"', "'", '\\', 'b', 'f', 'n', 'r', 's', 't'])); +var EscapeChar; +(function (EscapeChar) { + /* istanbul ignore next */ + function is(expected, c) { + return expected ? expected.includes(c) : false; + } + EscapeChar.is = is; +})(EscapeChar || (EscapeChar = {})); +const EscapeTable = new Map([ + ['"', '"'], + ["'", "'"], + ['\\', '\\'], + ['b', '\b'], + ['f', '\f'], + ['n', '\n'], + ['r', '\r'], + ['s', ' '], + ['t', '\t'], +]); +var StringBaseNode; +(function (StringBaseNode) { + function is(obj) { + return Array.isArray(obj?.valueMap) + && typeof obj?.options === 'object'; + } + StringBaseNode.is = is; +})(StringBaseNode || (StringBaseNode = {})); +var StringNode; +(function (StringNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'string'; + } + StringNode.is = is; + function mock(range, options) { + range = Range.get(range); + return { + type: 'string', + range, + options, + value: '', + valueMap: [{ inner: Range.create(0), outer: Range.create(range.start) }], + }; + } + StringNode.mock = mock; +})(StringNode || (StringNode = {})); +//# sourceMappingURL=StringNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/SymbolNode.js + +var SymbolNode; +(function (SymbolNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'symbol'; + } + SymbolNode.is = is; + function mock(range, options) { + return { type: 'symbol', range: Range.get(range), options, value: '' }; + } + SymbolNode.mock = mock; +})(SymbolNode || (SymbolNode = {})); +//# sourceMappingURL=SymbolNode.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/node/index.js + + + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map +// EXTERNAL MODULE: ./node_modules/@spyglassmc/locales/lib/locales/en.js +var en = __nccwpck_require__(9272); +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/locales/lib/index.js +/* istanbul ignore file */ +// @ts-expect-error + +const Locales = { en: en["default"] }; +let language = 'en'; +/** + * @param key The locale key. + * @param params All parameters that will be filled into the locale string. + * If a string array is provided as a parameter, it will be converted to + * string by the `arrayToMessage` method with `quoted=true, conjunction='or'` arguments. + */ +function localize(key, ...params) { + const value = Locales[language][key] ?? Locales.en[key]; + return _resolveLocalePlaceholders(value, params) ?? key; +} +function localeQuote(content) { + return localize('punc.quote', content); +} +/** + * @param locale A case-insensitive language tag following the format of + * `\w+(-\w+)*` that should ideally correspond to the file name of one of the + * files under `locales/`. Defaults to `en`. + * @param dry @internal Don't actually change the locale. + * + * @returns The locale loaded. + */ +async function loadLocale(locale = 'en', dry = false) { + locale = locale.toLowerCase(); + if (locale === language) { + return locale; + } + try { + return await _setupLanguage(locale, dry); + } + catch (e) { + // Most likely due to unknown locale. + const lastDashIndex = locale.lastIndexOf('-'); + if (lastDashIndex === -1) { + // The locale has no subtags. No more locales to try. + throw e; + } + // Try again with the rightmost subtag removed. + return loadLocale(locale.slice(0, lastDashIndex), dry); + } +} +function _resolveLocalePlaceholders(val, params) { + return val?.replace(/%\d+%/g, (match) => { + const index = parseInt(match.slice(1, -1)); + let param = params[index]; + if (typeof param !== 'string' && param?.[Symbol.iterator]) { + param = arrayToMessage(param); + } + return `${param ?? match}`; + }); +} +async function _setupLanguage(code, dry = false) { + const locale = await __nccwpck_require__(3161)(`./${code}.js`); + if (!dry) { + Locales[code] = locale; + language = code; + } + return code; +} +/** + * Convert an array to human-readable message. + * @param quoted Whether or not to quote the parts. Defaults to `true` + * @param conjunction The conjunction to use. Defaults to `or`. + * @returns Human-readable message. + * @example // Using English + * arrayToMessage([]) // "nothing" + * arrayToMessage('foo') // "“foo”" + * arrayToMessage(['foo']) // "“foo”" + * arrayToMessage(['bar', 'foo']) // "“bar” or “foo”" + * arrayToMessage(['bar', 'baz', 'foo']) // "“bar”, “baz”, or “foo”" + * @example // Using Locale + * arrayToMessage([], false) // "{nothing}" + * arrayToMessage(['A'], false) // "A" + * arrayToMessage(['A', 'B'], false) // "A{conjunction.or_2}B" + * arrayToMessage(['A', 'B', 'C'], false) // "A{conjunction.or_3+_1}B{conjunction.or_3+_2}C" + */ +function arrayToMessage(param, quoted = true, conjunction = 'or') { + const getPart = (str) => (quoted ? localeQuote(str) : str); + const arr = (typeof param === 'string' ? [param] : Array.from(param)).map(getPart); + switch (arr.length) { + case 0: + return localize('nothing'); + case 1: + return arr[0]; + case 2: + return arr[0] + localize(`conjunction.${conjunction}_2`) + arr[1]; + default: + return `${arr.slice(0, -1).join(localize(`conjunction.${conjunction}_3+_1`))}${localize(`conjunction.${conjunction}_3+_2`)}${arr[arr.length - 1]}`; + } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/literal.js + + +function literal(...param) { + const options = getOptions(param); + return (src, ctx) => { + const ans = { type: 'literal', range: Range.create(src), options, value: '' }; + for (const expected of options.pool) { + if (src.trySkip(expected)) { + ans.value = expected; + ans.range.end = src.cursor; + return ans; + } + } + ctx.err.report(localize('expected', options.pool), ans); + return ans; + }; +} +function getOptions(param) { + let ans; + if (typeof param[0] === 'object') { + ans = param[0]; + } + else { + ans = { pool: param }; + } + // Sort the pool from longest to shortest. + ans.pool = ans.pool.sort((a, b) => b.length - a.length); + return ans; +} +//# sourceMappingURL=literal.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/symbol/Symbol.js + + + +// #region Mcdoc Categories +const McdocCategories = Object.freeze(['mcdoc', 'mcdoc/dispatcher']); +// #endregion +// #region Registry Categories +// Data in `java-edition/src/binder/index.ts` may need to be updated when this section is changed. +const RegistryCategories = Object.freeze([ + 'activity', + 'armor_material', // Removed + 'attribute', + 'block', + 'block_entity_type', + 'block_predicate_type', + 'block_type', + 'chunk_status', + 'command_argument_type', + 'consume_effect_type', + 'creative_mode_tab', + 'custom_stat', + 'data_component_predicate_type', + 'data_component_type', + 'decorated_pot_pattern', + 'decorated_pot_patterns', // Removed + 'dialog_action_type', + 'dialog_body_type', + 'dialog_type', + 'enchantment_effect_component_type', + 'enchantment_entity_effect_type', + 'enchantment_level_based_value_type', + 'enchantment_location_based_effect_type', + 'enchantment_provider_type', + 'enchantment_value_effect_type', + 'entity_sub_predicate_type', + 'entity_type', + 'float_provider_type', + 'fluid', + 'game_event', + 'height_provider_type', + 'input_control_type', + 'instrument', + 'int_provider_type', + 'item', + 'item_sub_predicate_type', // Removed + 'loot_condition_type', + 'loot_function_type', + 'loot_nbt_provider_type', + 'loot_number_provider_type', + 'loot_pool_entry_type', + 'loot_score_provider_type', + 'map_decoration_type', + 'memory_module_type', + 'menu', + 'mob_effect', + 'motive', // Removed + 'number_format_type', + 'particle_type', + 'point_of_interest_type', + 'pos_rule_test', + 'position_source_type', + 'potion', + 'recipe_book_category', + 'recipe_display', + 'recipe_serializer', + 'recipe_type', + 'rule_block_entity_modifier', + 'rule_test', + 'schedule', + 'sensor_type', + 'slot_display', + 'sound_event', + 'spawn_condition_type', + 'stat_type', + 'test_environment_definition_type', + 'test_function', + 'test_instance_type', + 'trigger_type', + 'ticket_type', + 'villager_profession', + 'villager_type', + 'worldgen/biome_source', + 'worldgen/block_placer_type', // Removed + 'worldgen/block_state_provider_type', + 'worldgen/carver', + 'worldgen/chunk_generator', + 'worldgen/decorator', // Removed + 'worldgen/density_function_type', + 'worldgen/feature', + 'worldgen/feature_size_type', + 'worldgen/foliage_placer_type', + 'worldgen/material_condition', + 'worldgen/material_rule', + 'worldgen/placement_modifier_type', + 'worldgen/pool_alias_binding', + 'worldgen/root_placer_type', + 'worldgen/structure_feature', // Removed + 'worldgen/structure_piece', + 'worldgen/structure_placement', + 'worldgen/structure_pool_element', + 'worldgen/structure_processor', + 'worldgen/structure_type', + 'worldgen/surface_builder', // Removed + 'worldgen/tree_decorator_type', + 'worldgen/trunk_placer_type', +]); +// #endregion +// #region Data Pack Categories +const NormalFileCategories = Object.freeze([ + 'advancement', + 'banner_pattern', + 'cat_variant', + 'chat_type', + 'chicken_variant', + 'cow_variant', + 'damage_type', + 'dialog', + 'dimension', + 'dimension_type', + 'enchantment', + 'enchantment_provider', + 'frog_variant', + 'function', + 'instrument', + 'item_modifier', + 'jukebox_song', + 'loot_table', + 'painting_variant', + 'pig_variant', + 'predicate', + 'recipe', + 'structure', + 'test_environment', + 'test_instance', + 'trial_spawner', + 'trim_material', + 'trim_pattern', + 'wolf_sound_variant', + 'wolf_variant', +]); +const WorldgenFileCategories = Object.freeze([ + 'worldgen/biome', + 'worldgen/configured_carver', + 'worldgen/configured_feature', + 'worldgen/configured_structure_feature', + 'worldgen/configured_surface_builder', + 'worldgen/density_function', + 'worldgen/flat_level_generator_preset', + 'worldgen/multi_noise_biome_source_parameter_list', + 'worldgen/noise', + 'worldgen/noise_settings', + 'worldgen/placed_feature', + 'worldgen/processor_list', + 'worldgen/structure', + 'worldgen/structure_set', + 'worldgen/template_pool', + 'worldgen/world_preset', +]); +const TaggableResourceLocationCategories = Object.freeze([...NormalFileCategories, ...RegistryCategories, ...WorldgenFileCategories]); +var TaggableResourceLocationCategory; +(function (TaggableResourceLocationCategory) { + function is(category) { + return TaggableResourceLocationCategories.includes(category); + } + TaggableResourceLocationCategory.is = is; +})(TaggableResourceLocationCategory || (TaggableResourceLocationCategory = {})); +const TagFileCategories = Object.freeze(TaggableResourceLocationCategories.map((key) => `tag/${key}`)); +const DataFileCategories = Object.freeze([...NormalFileCategories, ...TagFileCategories, ...WorldgenFileCategories]); +const DataMiscCategories = Object.freeze([ + 'attribute_modifier', + 'bossbar', + 'jigsaw_block_name', + 'random_sequence', + 'storage', +]); +const DatapackCategories = Object.freeze([ + 'attribute_modifier_uuid', + 'objective', + 'score_holder', + 'tag', + 'team', + ...DataFileCategories, + ...DataMiscCategories, +]); +// #endregion +// #region Resource Pack Categories +const AssetsFileCategories = Object.freeze([ + 'atlas', + 'block_definition', // blockstates + 'equipment', + 'font', + 'font/ttf', + 'font/otf', + 'font/unihex', + 'gpu_warnlist', + 'item_definition', // items + 'lang', + 'lang/deprecated', + 'model', + 'particle', + 'post_effect', + 'regional_compliancies', + 'shader', + 'shader/fragment', + 'shader/vertex', + 'sound', + 'sounds', // sounds.json + 'texture', + 'texture_meta', // *.png.mcmeta + 'waypoint_style', +]); +const AssetsMiscCategories = Object.freeze([ + 'texture_slot', + 'shader_target', + 'translation_key', +]); +const ResourcepackCategories = Object.freeze([ + ...AssetsMiscCategories, + ...AssetsFileCategories, +]); +// #endregion +const FileCategories = Object.freeze([...DataFileCategories, ...AssetsFileCategories]); +const AllCategories = Object.freeze([ + ...DatapackCategories, + ...ResourcepackCategories, + ...McdocCategories, + ...RegistryCategories, +]); +const ResourceLocationCategories = Object.freeze([ + 'mcdoc/dispatcher', + ...DataMiscCategories, + ...AssetsMiscCategories, + ...FileCategories, + ...RegistryCategories, +]); +var ResourceLocationCategory; +(function (ResourceLocationCategory) { + function is(category) { + return ResourceLocationCategories.includes(category); + } + ResourceLocationCategory.is = is; +})(ResourceLocationCategory || (ResourceLocationCategory = {})); +var SymbolPath; +(function (SymbolPath) { + function fromSymbol(symbol) { + return symbol ? { category: symbol.category, path: symbol.path } : undefined; + } + SymbolPath.fromSymbol = fromSymbol; + /** + * Equivalent {@link SymbolPath}s will always be serialized into the same string value. + */ + function toString(path) { + return JSON.stringify({ category: path.category, path: path.path }); + } + SymbolPath.toString = toString; + function fromString(value) { + return JSON.parse(value); + } + SymbolPath.fromString = fromString; +})(SymbolPath || (SymbolPath = {})); +class SymbolPathCollector { + #set = new Set(); + add(path) { + if (!path) { + return; + } + this.#set.add(SymbolPath.toString(path)); + } + has(path) { + return this.#set.has(SymbolPath.toString(path)); + } + collect() { + return [...this.#set].map(SymbolPath.fromString); + } +} +const SymbolUsageTypes = Object.freeze(['definition', 'declaration', 'implementation', 'reference', 'typeDefinition']); +var SymbolUsageType; +(function (SymbolUsageType) { + function is(value) { + return SymbolUsageTypes.includes(value); + } + SymbolUsageType.is = is; +})(SymbolUsageType || (SymbolUsageType = {})); +var Symbol_Symbol; +(function (Symbol) { + function get(table, category, ...path) { + if (isIterable(table)) { + for (const t of table) { + const result = get(t, category, ...path); + if (result) { + return result; + } + } + return undefined; + } + const map = table[category]; + for (const p of path) { + } + return undefined; + } + Symbol.get = get; +})(Symbol_Symbol || (Symbol_Symbol = {})); +var SymbolLocation; +(function (SymbolLocation) { + /* istanbul ignore next */ + function create(doc, range, fullRange, contributor, additional) { + return { + ...Location.create(doc, range), + ...(fullRange + ? { fullRange: Range.get(fullRange), fullPosRange: PositionRange.from(fullRange, doc) } + : {}), + ...(contributor ? { contributor } : {}), + ...(additional ? additional : {}), + }; + } + SymbolLocation.create = create; +})(SymbolLocation || (SymbolLocation = {})); +var SymbolTable; +(function (SymbolTable) { + /** + * The passed-in parameter `table` won't be mutated. + * + * @returns An identical symbol table where each Symbol's `parentMap` and `parentSymbol` properties + * are set properly. + */ + function link(table) { + const linkSymbol = (symbol, parentMap, parentSymbol, category, path) => { + symbol.category = category; + symbol.identifier = path[path.length - 1]; + symbol.path = path; + symbol.parentMap = parentMap; + if (parentSymbol) { + symbol.parentSymbol = parentSymbol; + } + if (symbol.members) { + linkSymbolMap(symbol.members, symbol, category, path); + } + }; + const linkSymbolMap = (map, parentSymbol, category, path) => { + for (const [identifier, childSymbol] of Object.entries(map)) { + linkSymbol(childSymbol, map, parentSymbol, category, [...path, identifier]); + } + }; + const ans = rfdc()(table); + for (const [category, map] of Object.entries(ans)) { + linkSymbolMap(map, undefined, category, []); + } + return ans; + } + SymbolTable.link = link; + /** + * The passed-in parameter `table` won't be mutated. + * + * @returns An identical symbol table where each Symbol's `parentMap` and `parentSymbol` properties + * are deleted. + */ + function unlink(table) { + const unlinkSymbol = (symbol) => { + delete symbol.category; + delete symbol.identifier; + delete symbol.parentMap; + delete symbol.parentSymbol; + delete symbol.path; + if (symbol.members) { + unlinkSymbolMap(symbol.members); + } + }; + const unlinkSymbolMap = (map) => { + for (const childSymbol of Object.values(map)) { + unlinkSymbol(childSymbol); + } + }; + const ans = rfdc({ circles: true })(table); + for (const map of Object.values(ans)) { + unlinkSymbolMap(map); + } + return ans; + } + SymbolTable.unlink = unlink; + /** + * @returns A serialized string representation of this symbol table. It can be turned back into + * a symbol table through the {@link deserialize} method. + */ + function serialize(table) { + return JSON.stringify(unlink(table)); + } + SymbolTable.serialize = serialize; + /** + * @returns The symbol table represented by the string returned by the {@link serialize} method. + */ + function deserialize(json) { + return link(JSON.parse(json)); + } + SymbolTable.deserialize = deserialize; +})(SymbolTable || (SymbolTable = {})); +// interface SymbolEvent { +// symbol: Symbol, +// } +// interface SymbolLocationEvent extends SymbolEvent { +// type: SymbolUsageType, +// location: SymbolLocation, +// } +// export class CachedSymbolTable extends TypedEmitter<{ +// symbolCreated: (e: SymbolEvent) => unknown, +// symbolAmended: (e: SymbolEvent) => unknown, +// symbolRemoved: (e: SymbolEvent) => unknown, +// symbolLocationCreated: (e: SymbolLocationEvent) => unknown, +// symbolLocationRemoved: (e: SymbolLocationEvent) => unknown, +// }> { +// constructor(public readonly table: SymbolTable) { +// super() +// } +// } +//# sourceMappingURL=Symbol.js.map +;// CONCATENATED MODULE: ./node_modules/vscode-languageserver-textdocument/lib/esm/main.js +/* -------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + * ------------------------------------------------------------------------------------------ */ + +class FullTextDocument { + constructor(uri, languageId, version, content) { + this._uri = uri; + this._languageId = languageId; + this._version = version; + this._content = content; + this._lineOffsets = undefined; + } + get uri() { + return this._uri; + } + get languageId() { + return this._languageId; + } + get version() { + return this._version; + } + getText(range) { + if (range) { + const start = this.offsetAt(range.start); + const end = this.offsetAt(range.end); + return this._content.substring(start, end); + } + return this._content; + } + update(changes, version) { + for (const change of changes) { + if (FullTextDocument.isIncremental(change)) { + // makes sure start is before end + const range = getWellformedRange(change.range); + // update content + const startOffset = this.offsetAt(range.start); + const endOffset = this.offsetAt(range.end); + this._content = this._content.substring(0, startOffset) + change.text + this._content.substring(endOffset, this._content.length); + // update the offsets + const startLine = Math.max(range.start.line, 0); + const endLine = Math.max(range.end.line, 0); + let lineOffsets = this._lineOffsets; + const addedLineOffsets = computeLineOffsets(change.text, false, startOffset); + if (endLine - startLine === addedLineOffsets.length) { + for (let i = 0, len = addedLineOffsets.length; i < len; i++) { + lineOffsets[i + startLine + 1] = addedLineOffsets[i]; + } + } + else { + if (addedLineOffsets.length < 10000) { + lineOffsets.splice(startLine + 1, endLine - startLine, ...addedLineOffsets); + } + else { // avoid too many arguments for splice + this._lineOffsets = lineOffsets = lineOffsets.slice(0, startLine + 1).concat(addedLineOffsets, lineOffsets.slice(endLine + 1)); + } + } + const diff = change.text.length - (endOffset - startOffset); + if (diff !== 0) { + for (let i = startLine + 1 + addedLineOffsets.length, len = lineOffsets.length; i < len; i++) { + lineOffsets[i] = lineOffsets[i] + diff; + } + } + } + else if (FullTextDocument.isFull(change)) { + this._content = change.text; + this._lineOffsets = undefined; + } + else { + throw new Error('Unknown change event received'); + } + } + this._version = version; + } + getLineOffsets() { + if (this._lineOffsets === undefined) { + this._lineOffsets = computeLineOffsets(this._content, true); + } + return this._lineOffsets; + } + positionAt(offset) { + offset = Math.max(Math.min(offset, this._content.length), 0); + const lineOffsets = this.getLineOffsets(); + let low = 0, high = lineOffsets.length; + if (high === 0) { + return { line: 0, character: offset }; + } + while (low < high) { + const mid = Math.floor((low + high) / 2); + if (lineOffsets[mid] > offset) { + high = mid; + } + else { + low = mid + 1; + } + } + // low is the least x for which the line offset is larger than the current offset + // or array.length if no line offset is larger than the current offset + const line = low - 1; + offset = this.ensureBeforeEOL(offset, lineOffsets[line]); + return { line, character: offset - lineOffsets[line] }; + } + offsetAt(position) { + const lineOffsets = this.getLineOffsets(); + if (position.line >= lineOffsets.length) { + return this._content.length; + } + else if (position.line < 0) { + return 0; + } + const lineOffset = lineOffsets[position.line]; + if (position.character <= 0) { + return lineOffset; + } + const nextLineOffset = (position.line + 1 < lineOffsets.length) ? lineOffsets[position.line + 1] : this._content.length; + const offset = Math.min(lineOffset + position.character, nextLineOffset); + return this.ensureBeforeEOL(offset, lineOffset); + } + ensureBeforeEOL(offset, lineOffset) { + while (offset > lineOffset && isEOL(this._content.charCodeAt(offset - 1))) { + offset--; + } + return offset; + } + get lineCount() { + return this.getLineOffsets().length; + } + static isIncremental(event) { + const candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range !== undefined && + (candidate.rangeLength === undefined || typeof candidate.rangeLength === 'number'); + } + static isFull(event) { + const candidate = event; + return candidate !== undefined && candidate !== null && + typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined; + } +} +var TextDocument; +(function (TextDocument) { + /** + * Creates a new text document. + * + * @param uri The document's uri. + * @param languageId The document's language Id. + * @param version The document's initial version number. + * @param content The document's content. + */ + function create(uri, languageId, version, content) { + return new FullTextDocument(uri, languageId, version, content); + } + TextDocument.create = create; + /** + * Updates a TextDocument by modifying its content. + * + * @param document the document to update. Only documents created by TextDocument.create are valid inputs. + * @param changes the changes to apply to the document. + * @param version the changes version for the document. + * @returns The updated TextDocument. Note: That's the same document instance passed in as first parameter. + * + */ + function update(document, changes, version) { + if (document instanceof FullTextDocument) { + document.update(changes, version); + return document; + } + else { + throw new Error('TextDocument.update: document must be created by TextDocument.create'); + } + } + TextDocument.update = update; + function applyEdits(document, edits) { + const text = document.getText(); + const sortedEdits = mergeSort(edits.map(getWellformedEdit), (a, b) => { + const diff = a.range.start.line - b.range.start.line; + if (diff === 0) { + return a.range.start.character - b.range.start.character; + } + return diff; + }); + let lastModifiedOffset = 0; + const spans = []; + for (const e of sortedEdits) { + const startOffset = document.offsetAt(e.range.start); + if (startOffset < lastModifiedOffset) { + throw new Error('Overlapping edit'); + } + else if (startOffset > lastModifiedOffset) { + spans.push(text.substring(lastModifiedOffset, startOffset)); + } + if (e.newText.length) { + spans.push(e.newText); + } + lastModifiedOffset = document.offsetAt(e.range.end); + } + spans.push(text.substr(lastModifiedOffset)); + return spans.join(''); + } + TextDocument.applyEdits = applyEdits; +})(TextDocument || (TextDocument = {})); +function mergeSort(data, compare) { + if (data.length <= 1) { + // sorted + return data; + } + const p = (data.length / 2) | 0; + const left = data.slice(0, p); + const right = data.slice(p); + mergeSort(left, compare); + mergeSort(right, compare); + let leftIdx = 0; + let rightIdx = 0; + let i = 0; + while (leftIdx < left.length && rightIdx < right.length) { + const ret = compare(left[leftIdx], right[rightIdx]); + if (ret <= 0) { + // smaller_equal -> take left to preserve order + data[i++] = left[leftIdx++]; + } + else { + // greater -> take right + data[i++] = right[rightIdx++]; + } + } + while (leftIdx < left.length) { + data[i++] = left[leftIdx++]; + } + while (rightIdx < right.length) { + data[i++] = right[rightIdx++]; + } + return data; +} +function computeLineOffsets(text, isAtLineStart, textOffset = 0) { + const result = isAtLineStart ? [textOffset] : []; + for (let i = 0; i < text.length; i++) { + const ch = text.charCodeAt(i); + if (isEOL(ch)) { + if (ch === 13 /* CharCode.CarriageReturn */ && i + 1 < text.length && text.charCodeAt(i + 1) === 10 /* CharCode.LineFeed */) { + i++; + } + result.push(textOffset + i + 1); + } + } + return result; +} +function isEOL(char) { + return char === 13 /* CharCode.CarriageReturn */ || char === 10 /* CharCode.LineFeed */; +} +function getWellformedRange(range) { + const start = range.start; + const end = range.end; + if (start.line > end.line || (start.line === end.line && start.character > end.character)) { + return { start: end, end: start }; + } + return range; +} +function getWellformedEdit(textEdit) { + const range = getWellformedRange(textEdit.range); + if (range !== textEdit.range) { + return { newText: textEdit.newText, range }; + } + return textEdit; +} + +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/symbol/SymbolUtil.js +var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; + + + +class SymbolUtil { + #global; + #eventEmitter; + #eventEmitterConstructor; + #trimmableSymbols = new Set(); + #cache = Object.create(null); + #currentContributor; + /** + * @internal + */ + _delayedOps = []; + /** + * @internal + */ + _inDelayMode; + get global() { + return this.#global; + } + constructor(global, eventEmitterConstructor, + /** @internal */ + _currentContributor, + /** @internal */ + _inDelayMode = false) { + this.#eventEmitter = new eventEmitterConstructor(); + this.#eventEmitterConstructor = eventEmitterConstructor; + this.#global = global; + this.#currentContributor = _currentContributor; + this._inDelayMode = _inDelayMode; + this.on('symbolCreated', ({ symbol }) => { + this.#trimmableSymbols.add(SymbolPath.toString(symbol)); + }).on('symbolRemoved', ({ symbol }) => { + this.#trimmableSymbols.delete(SymbolPath.toString(symbol)); + }).on('symbolLocationCreated', ({ symbol, location }) => { + const cache = (this.#cache[location.contributor ?? 'undefined'] ??= Object.create(null)); + const fileSymbols = (cache[location.uri] ??= new Set()); + const path = SymbolPath.toString(symbol); + fileSymbols.add(path); + this.#trimmableSymbols.delete(path); + }).on('symbolLocationRemoved', ({ symbol }) => { + const path = SymbolPath.toString(symbol); + this.#trimmableSymbols.add(path); + }); + } + on(event, callbackFn) { + this.#eventEmitter.on(event, callbackFn); + return this; + } + once(event, callbackFn) { + this.#eventEmitter.once(event, callbackFn); + return this; + } + emit(event, ...args) { + return this.#eventEmitter.emit(event, ...args); + } + /** + * Build the internal cache of the SymbolUtil according to the current global symbol table. + */ + buildCache() { + SymbolUtil.forEachSymbol(this.global, (symbol) => { + this.emit('symbolCreated', { symbol }); + SymbolUtil.forEachLocationOfSymbol(symbol, ({ type, location }) => { + this.emit('symbolLocationCreated', { symbol, type, location }); + }); + }); + } + /** + * @returns A clone of this SymbolUtil that is in delay mode: changes to the symbol table happened in the clone will + * not take effect until the {@link SymbolUtil.applyDelayedEdits} method is called on that clone. + * + * The clone shares the same reference of the global symbol table and symbol stacks, meaning that after + * `applyDelayedEdits` is called, the original SymbolUtil will also be modified. + */ + clone() { + return new SymbolUtil(this.#global, this.#eventEmitterConstructor, this.#currentContributor, true); + } + /** + * Apply edits done during the delay mode. + */ + applyDelayedEdits() { + this._delayedOps.forEach((f) => f()); + this._delayedOps = []; + this._inDelayMode = false; + } + contributeAs(contributor, fn) { + const originalValue = this.#currentContributor; + this.#currentContributor = contributor; + try { + fn(); + } + finally { + this.#currentContributor = originalValue; + } + return this; + } + async contributeAsAsync(contributor, fn) { + const originalValue = this.#currentContributor; + this.#currentContributor = contributor; + try { + await fn(); + } + finally { + this.#currentContributor = originalValue; + } + return this; + } + /** + * @param + * - `contributor` - clear symbol locations contributed by this contributor. Pass in `undefined` + * to select all symbol locations that don't have a contributor. + * - `uri` - clear symbol locations associated with this URI. + * - `predicate` - clear symbol locations matching this predicate + */ + clear({ uri, contributor, predicate = () => true }) { + const getCaches = () => { + if (contributor) { + return this.#cache[contributor] ? [this.#cache[contributor]] : []; + } + else { + return Object.values(this.#cache); + } + }; + const getPaths = () => { + const caches = getCaches(); + const sets = uri + ? caches.map((cache) => cache[uri] ?? new Set()) + : caches.map((cache) => Object.values(cache)).flat(); + return sets.map((s) => [...s]).flat().map(SymbolPath.fromString); + }; + const getTables = () => { + return uri ? [this.#global] : [this.#global]; + }; + const paths = getPaths(); + const tables = getTables(); + for (const table of tables) { + for (const path of paths) { + const { symbol } = SymbolUtil.lookupTable(table, path.category, path.path); + if (!symbol) { + continue; + } + this.removeLocationsFromSymbol(symbol, (data) => (!uri || data.location.uri === uri) + && (!contributor || data.location.contributor === contributor) + && predicate(data)); + } + this.trim(table); + } + } + lookup(category, path, node) { + while (node) { + if (node.locals) { + const result = SymbolUtil.lookupTable(node.locals, category, path); + if (result.symbol) { + return result; + } + } + node = node.parent; + } + return SymbolUtil.lookupTable(this.global, category, path); + } + query(doc, category, ...path) { + const uri = SymbolUtil.toUri(doc); + const { parentSymbol, parentMap, symbol } = this.lookup(category, path, isDocAndNode(doc) ? doc.node : undefined); + const visible = symbol ? SymbolUtil.isVisible(symbol, uri) : true; + return new SymbolQuery({ + category, + doc, + contributor: this.#currentContributor, + map: visible ? parentMap : undefined, + parentSymbol, + path, + symbol: visible ? symbol : undefined, + util: this, + }); + } + getVisibleSymbols(category, uri) { + const map = this.lookup(category, [], undefined).parentMap ?? undefined; + return SymbolUtil.filterVisibleSymbols(uri, map); + } + static toUri(uri) { + if (typeof uri === 'string') { + return uri; + } + if (isDocAndNode(uri)) { + return uri.doc.uri; + } + return uri.uri; + } + /** + * @see {@link SymbolUtil.trimMap} + */ + trim(table) { + const trimSymbol = (symbol) => { + if (!symbol) { + return; + } + if (SymbolUtil.isTrimmable(symbol)) { + delete symbol.parentMap[symbol.identifier]; + this.emit('symbolRemoved', { symbol }); + trimSymbol(symbol.parentSymbol); + } + }; + for (const pathString of this.#trimmableSymbols) { + const path = SymbolPath.fromString(pathString); + const { symbol } = SymbolUtil.lookupTable(table, path.category, path.path); + trimSymbol(symbol); + } + } + removeLocationsFromSymbol(symbol, predicate) { + for (const type of SymbolUsageTypes) { + if (!symbol[type]) { + continue; + } + symbol[type] = symbol[type].reduce((result, location) => { + if (predicate({ location, symbol, type })) { + this.emit('symbolLocationRemoved', { symbol, type, location }); + } + else { + result.push(location); + } + return result; + }, []); + } + } + enterMap(parentSymbol, map, category, path, identifier, addition, doc, contributor) { + let ans = map[identifier]; + if (ans) { + this.amendSymbol(ans, addition, doc, contributor); + } + else { + ans = this.createSymbol(category, parentSymbol, map, path, identifier, addition, doc, contributor); + } + this.emit('symbolAmended', { symbol: ans }); + return ans; + } + static lookupTable(table, category, path) { + let parentMap = table[category]; + let parentSymbol; + let symbol; + for (let i = 0; i < path.length; i++) { + symbol = parentMap?.[path[i]]; + if (!symbol) { + if (i !== path.length - 1) { + parentSymbol = undefined; + parentMap = undefined; + } + break; + } + if (i === path.length - 1) { + break; + } + parentSymbol = symbol; + parentMap = symbol.members; + } + return { parentSymbol, parentMap, symbol }; + } + static lookupTables(tables, category, path) { + let parentMap; + let parentSymbol; + // Traverse from the last table to the first one. + for (let i = tables.length - 1; i >= 0; i--) { + const table = tables[i]; + const result = this.lookupTable(table, category, path); + if (result.symbol) { + return result; + } + if (!parentSymbol && !parentMap && (result.parentSymbol || result.parentMap)) { + parentSymbol = result.parentSymbol; + parentMap = result.parentMap; + } + } + return { parentSymbol, parentMap, symbol: undefined }; + } + createSymbol(category, parentSymbol, parentMap, path, identifier, addition, doc, contributor) { + const ans = (parentMap[identifier] = { + category, + identifier, + ...(parentSymbol ? { parentSymbol } : {}), + parentMap, + path, + ...addition.data, + }); + this.emit('symbolCreated', { symbol: ans }); + this.amendSymbolUsage(ans, addition.usage, doc, contributor); + return ans; + } + amendSymbol(symbol, addition, doc, contributor) { + this.amendSymbolMetadata(symbol, addition.data); + this.amendSymbolUsage(symbol, addition.usage, doc, contributor); + } + amendSymbolMetadata(symbol, addition) { + if (addition) { + if ('data' in addition) { + symbol.data = addition.data; + } + if ('desc' in addition) { + symbol.desc = addition.desc; + } + if (addition.relations && Object.keys(addition.relations).length) { + symbol.relations ??= {}; + for (const relationship of Object.keys(addition.relations)) { + symbol.relations[relationship] = addition.relations[relationship]; + } + } + if ('subcategory' in addition) { + symbol.subcategory = addition.subcategory; + } + if ('visibility' in addition) { + // Visibility changes are only accepted if the change wouldn't result in the + // symbol being stored in a different symbol table. + const inGlobalTable = (v) => v === undefined || v === 2 /* SymbolVisibility.Public */ || v === 3 /* SymbolVisibility.Restricted */; + if (symbol.visibility === addition.visibility + || (inGlobalTable(symbol.visibility) && inGlobalTable(addition.visibility))) { + symbol.visibility = addition.visibility; + } + else { + throw new Error(`Cannot change visibility from ${symbol.visibility} to ${addition.visibility}: ${JSON.stringify(SymbolPath.fromSymbol(symbol))}`); + } + } + if (addition.visibilityRestriction?.length) { + symbol.visibilityRestriction = (symbol.visibilityRestriction ?? []).concat(addition.visibilityRestriction); + } + } + } + amendSymbolUsage(symbol, addition, doc, contributor) { + if (addition) { + const type = addition.type ?? 'reference'; + const arr = (symbol[type] ??= []); + const range = Range.get((SymbolAdditionUsageWithNode.is(addition) ? addition.node : addition.range) ?? 0); + const location = SymbolLocation.create(doc, range, addition.fullRange, contributor, { + accessType: addition.accessType, + skipRenaming: addition.skipRenaming, + }); + if (!doc.uri.startsWith('file:')) { + delete location.range; + delete location.posRange; + delete location.fullRange; + delete location.fullPosRange; + } + arr.push(location); + this.emit('symbolLocationCreated', { symbol, type, location }); + } + } + /** + * @returns The ultimate symbol being pointed by the passed-in `symbol`'s alias. + */ + resolveAlias(symbol) { + return symbol?.relations?.aliasOf + ? this.resolveAlias(this.lookup(symbol.relations.aliasOf.category, symbol.relations.aliasOf.path).symbol) + : symbol; + } + static filterVisibleSymbols(uri, map = {}) { + const ans = {}; + for (const [identifier, symbol] of Object.entries(map)) { + if (SymbolUtil.isVisible(symbol, uri)) { + ans[identifier] = symbol; + } + } + return ans; + } + static isTrimmable(symbol) { + return (!Object.keys(symbol.members ?? {}).length + && !symbol.declaration?.length + && !symbol.definition?.length + && !symbol.implementation?.length + && !symbol.reference?.length + && !symbol.typeDefinition?.length); + } + static isVisible(symbol, _uri) { + switch (symbol.visibility) { + case 3 /* SymbolVisibility.Restricted */: + return false; // FIXME: check with workspace root URIs. + case 0 /* SymbolVisibility.Block */: + case 1 /* SymbolVisibility.File */: + case 2 /* SymbolVisibility.Public */: + default: + return true; + } + } + /** + * @returns If the symbol has declarations or definitions. + */ + static isDeclared(symbol) { + return !!(symbol?.declaration?.length || symbol?.definition?.length); + } + /** + * @returns If the symbol has definitions, or declarations and implementations. + */ + static isDefined(symbol) { + return !!(symbol?.definition?.length + || (symbol?.definition?.length && symbol?.implementation?.length)); + } + /** + * @returns If the symbol has implementations or definitions. + */ + static isImplemented(symbol) { + return !!(symbol?.implementation?.length || symbol?.definition?.length); + } + /** + * @returns If the symbol has references. + */ + static isReferenced(symbol) { + return !!symbol?.reference?.length; + } + /** + * @returns If the symbol has type definitions. + */ + static isTypeDefined(symbol) { + return !!symbol?.typeDefinition?.length; + } + /** + * @throws If the symbol does not have any declarations or definitions. + */ + static getDeclaredLocation(symbol) { + return (symbol.declaration?.[0] ?? symbol.definition?.[0] ?? (() => { + throw new Error(`Cannot get declared location of ${JSON.stringify(SymbolPath.fromSymbol(symbol))}`); + })()); + } + static forEachSymbolInMap(map, fn) { + for (const symbol of Object.values(map)) { + fn(symbol); + if (symbol.members) { + this.forEachSymbolInMap(symbol.members, fn); + } + } + } + static forEachSymbol(table, fn) { + for (const map of Object.values(table)) { + this.forEachSymbolInMap(map, fn); + } + } + static forEachLocationOfSymbol(symbol, fn) { + for (const type of SymbolUsageTypes) { + symbol[type]?.forEach((location) => fn({ type, location })); + } + } + static isVisibilityInGlobal(v) { + return (v === undefined || v === 2 /* SymbolVisibility.Public */ || v === 3 /* SymbolVisibility.Restricted */); + } + static areVisibilitiesCompatible(v1, v2) { + return ((this.isVisibilityInGlobal(v1) && this.isVisibilityInGlobal(v2)) + || (v1 === 0 /* SymbolVisibility.Block */ && v2 === 0 /* SymbolVisibility.Block */) + || (v1 === 1 /* SymbolVisibility.File */ && v2 === 1 /* SymbolVisibility.File */)); + } +} +__decorate([ + DelayModeSupport() +], SymbolUtil.prototype, "clear", null); +__decorate([ + DelayModeSupport() +], SymbolUtil.prototype, "trim", null); +__decorate([ + DelayModeSupport() +], SymbolUtil.prototype, "removeLocationsFromSymbol", null); +var SymbolAdditionUsageWithRange; +(function (SymbolAdditionUsageWithRange) { + /* istanbul ignore next */ + function is(usage) { + return !!usage?.range; + } + SymbolAdditionUsageWithRange.is = is; +})(SymbolAdditionUsageWithRange || (SymbolAdditionUsageWithRange = {})); +var SymbolAdditionUsageWithNode; +(function (SymbolAdditionUsageWithNode) { + /* istanbul ignore next */ + function is(usage) { + return !!usage?.node; + } + SymbolAdditionUsageWithNode.is = is; +})(SymbolAdditionUsageWithNode || (SymbolAdditionUsageWithNode = {})); +/* istanbul ignore next */ +class SymbolQuery { + category; + path; + #doc; + #node; + /** + * If only a string URI (instead of a {@link TextDocument}) is provided when constructing this class. + * + * If this is `true`, {@link SymbolAdditionUsageWithRange.range} is ignored and treated as `[0, 0)` when entering symbols through this class. + */ + #createdWithUri; + #currentContributor; + #hasTriggeredIf = false; + /** + * The map where the queried symbol is stored. `undefined` if the map hasn't been created yet. + */ + #map; + #parentSymbol; + /** + * The queried symbol. `undefined` if the symbol hasn't been created yet. + */ + #symbol; + /** + * The {@link SymbolUtil} where this query was created. + */ + util; + get symbol() { + return this.#symbol; + } + get visibleMembers() { + return SymbolUtil.filterVisibleSymbols(this.#doc.uri, this.path.length === 0 ? this.#map : this.#symbol?.members); + } + constructor({ category, contributor, doc, map, parentSymbol, path, symbol, util }) { + this.category = category; + this.path = path; + if (typeof doc === 'string') { + doc = TextDocument.create(doc, '', 0, ''); + this.#createdWithUri = true; + } + else if (isDocAndNode(doc)) { + this.#node = doc.node; + doc = doc.doc; + } + this.#doc = doc; + this.#currentContributor = contributor; + this.#map = map; + this.#parentSymbol = parentSymbol; + this.#symbol = symbol; + this.util = util; + } + heyGimmeDaSymbol() { + return this.#symbol; + } + getData(predicate) { + const data = this.#symbol?.data; + return predicate(data) ? data : undefined; + } + with(fn) { + fn(this); + return this; + } + if(predicate, fn) { + if (predicate.call(this, this.#symbol, this)) { + fn.call(this, this.#symbol, this); + this.#hasTriggeredIf = true; + } + return this; + } + /** + * Calls `fn` if the queried symbol does not exist. + */ + ifUnknown(fn) { + return this.if((s) => s === undefined, fn); + } + /** + * Calls `fn` if the queried symbol exists (i.e. has any of declarations/definitions/implementations/references/typeDefinitions). + */ + ifKnown(fn) { + return this.if((s) => s !== undefined, fn); + } + /** + * Calls `fn` if the queried symbol has declarations or definitions. + */ + ifDeclared(fn) { + return this.if((s) => SymbolUtil.isDeclared(s), fn); + } + /** + * Calls `fn` if the queried symbol has definitions, or both declarations and implementations. + */ + ifDefined(fn) { + return this.if(SymbolUtil.isDefined, fn); + } + /** + * Calls `fn` if the queried symbol has implementations or definitions. + */ + ifImplemented(fn) { + return this.if(SymbolUtil.isImplemented, fn); + } + /** + * Calls `fn` if the queried symbol has references. + */ + ifReferenced(fn) { + return this.if(SymbolUtil.isReferenced, fn); + } + /** + * Calls `fn` if the queried symbol has type definitions. + */ + ifTypeDefined(fn) { + return this.if(SymbolUtil.isTypeDefined, fn); + } + /** + * Calls `fn` if none of the former `if` conditions are met. + */ + else(fn) { + if (!this.#hasTriggeredIf) { + fn.call(this, this.#symbol, this); + } + return this; + } + /** + * Enters the queried symbol if none of the former `if` conditions are met. + */ + elseEnter(symbol) { + return this.else(() => this.enter(symbol)); + } + /** + * Resolves the queried symbol if it is an alias and if none of the former `if` conditions are met. + * + * @throws If the current symbol points to an non-existent symbol. + */ + elseResolveAlias() { + return this.else(() => this.resolveAlias()); + } + _enter(addition) { + /** + * Get a proper visibility from the addition: + * * If the visibility is specified, use it. + * * If the visibility is `undefined`, use the visibility of the symbol, or `Public` if unapplicable. + */ + const getAdditionVisibility = (addition) => { + return (addition.data?.visibility ?? this.symbol?.visibility ?? 2 /* SymbolVisibility.Public */); + }; + const getMap = (addition) => { + const additionVisibility = getAdditionVisibility(addition); + if (this.#map + && SymbolUtil.areVisibilitiesCompatible(additionVisibility, this.#symbol?.visibility)) { + return this.#map; + } + if (this.path.length > 1) { + if (this.#parentSymbol) { + if (!SymbolUtil.areVisibilitiesCompatible(additionVisibility, this.#parentSymbol.visibility)) { + throw new Error(`Cannot enter member “${this.getPath()}” of ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility to parent of ${SymbolFormatter.stringifyVisibility(this.#parentSymbol.visibility)} visibility`); + } + return (this.#parentSymbol.members ??= {}); + } + } + else { + let table; + if (SymbolUtil.isVisibilityInGlobal(additionVisibility)) { + table = this.util.global; + } + else if (additionVisibility === 1 /* SymbolVisibility.File */) { + if (!this.#node) { + throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no node is supplied`); + } + let node = this.#node; + while (node) { + if (node.type === 'file') { + table = node.locals; + break; + } + node = node.parent; + } + if (!table) { + throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no file node is supplied`); + } + } + else { + if (!this.#node) { + throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no node is supplied`); + } + let node = this.#node; + while (node) { + if (node.locals) { + table = node.locals; + break; + } + node = node.parent; + } + if (!table) { + throw new Error(`Cannot enter “${this.getPath()}” with ${SymbolFormatter.stringifyVisibility(additionVisibility)} visibility as no node with locals is supplied`); + } + } + // TODO: Move part of symbol from global to table. + return (table[this.category] ??= {}); + } + throw new Error(`Cannot create the symbol map for “${this.getPath()}”`); + }; + // Treat `usage.range` as `[0, 0)` if this class was constructed with a string URI (instead of a `TextDocument`). + if (this.#createdWithUri && SymbolAdditionUsageWithRange.is(addition.usage)) { + addition.usage.range = Range.create(0, 0); + } + this.#map = getMap(addition); + this.#symbol = this.util.enterMap(this.#parentSymbol, this.#map, this.category, this.path, this.path[this.path.length - 1], addition, this.#doc, this.#currentContributor); + if (addition.usage?.node) { + addition.usage.node.symbol = this.#symbol; + } + } + /** + * Enters the queried symbol. + * + * @throws If the parent of this symbol doesn't exist either. + */ + enter(addition) { + this._enter(addition); + return this; + } + /** + * Amends the queried symbol if the queried symbol exists (i.e. has any of declarations/definitions/implementations/references/typeDefinitions) and is visible at the current scope. + * + * This is equivalent to calling + * ```typescript + * query.ifKnown(function () { + * this.enter(symbol) + * }) + * ``` + * + * Therefore, if the symbol is successfully amended, `elseX` methods afterwards will **not** be executed. + */ + amend(symbol) { + return this.ifKnown(() => this.enter(symbol)); + } + /** + * Resolves this symbol if it exists and is an alias. + * + * @throws If the current symbol points to an non-existent symbol. The state of this object will not be changed + * after the error is thrown. + */ + resolveAlias() { + if (this.#symbol) { + const result = this.util.resolveAlias(this.#symbol); + if (!result) { + throw new Error('The current symbol points to an non-existent symbol.'); + } + this.#symbol = result; + this.#map = result.parentMap; + this.#parentSymbol = result.parentSymbol; + this.path = result.path; + } + return this; + } + member() { + // Handle overloads. + let doc, identifier, fn; + if (arguments.length === 2) { + // Ensure the member query result will not unknowingly have a dummy TextDocument passed down from this class. + doc = this.#createdWithUri ? this.#doc.uri : this.#doc; + identifier = arguments[0]; + fn = arguments[1]; + } + else { + doc = arguments[0]; + identifier = arguments[1]; + fn = arguments[2]; + } + if (this.#symbol === undefined) { + throw new Error(`Tried to query member symbol “${identifier}” from an undefined symbol (path “${this.path.join('.')}”)`); + } + const memberDoc = typeof doc === 'string' && doc === this.#doc.uri && !this.#createdWithUri + ? this.#doc + : doc; + const memberMap = this.#symbol.members; + const memberSymbol = memberMap?.[identifier]; + const memberQueryResult = new SymbolQuery({ + category: this.category, + doc: memberDoc, + contributor: this.#currentContributor, + map: memberMap, + parentSymbol: this.#symbol, + path: [...this.path, identifier], + symbol: memberSymbol, + util: this.util, + }); + fn(memberQueryResult); + return this; + } + /** + * Do something with this query on each value in a given iterable. The query itself will be included + * in the callback function as the second parameter. + */ + onEach(values, fn) { + for (const value of values) { + fn.call(this, value, this); + } + return this; + } + forEachMember(fn) { + return this.onEach(Object.keys(this.visibleMembers), (identifier) => this.member(identifier, (query) => fn(identifier, query))); + } + getPath() { + return `${this.category}.${this.path.join('/')}`; + } +} +__decorate([ + DelayModeSupport((self) => self.util) +], SymbolQuery.prototype, "_enter", null); +/* istanbul ignore next */ +/** + * A series of methods for converting symbol structures to human-readable outputs. Mostly for debug purposes. + */ +var SymbolFormatter; +(function (SymbolFormatter) { + const IndentChar = '+ '; + function assertEqual(a, b) { + if (a !== b) { + throw new Error(`Assertion error: ${a} !== ${b}`); + } + } + function stringifySymbolStack(stack) { + return stack.map((table) => stringifySymbolTable(table)).join('\n------------\n'); + } + SymbolFormatter.stringifySymbolStack = stringifySymbolStack; + function stringifySymbolTable(table, indent = '') { + const ans = []; + for (const category of Object.keys(table)) { + const map = table[category]; + ans.push([category, stringifySymbolMap(map, `${indent}${IndentChar}`)]); + } + return (ans.map((v) => `CATEGORY ${v[0]}\n${v[1]}`).join(`\n${indent}------------\n`) + || 'EMPTY TABLE'); + } + SymbolFormatter.stringifySymbolTable = stringifySymbolTable; + function stringifySymbolMap(map, indent = '') { + if (!map) { + return 'undefined'; + } + const ans = []; + for (const identifier of Object.keys(map)) { + const symbol = map[identifier]; + assertEqual(identifier, symbol.identifier); + ans.push(stringifySymbol(symbol, indent)); + } + return ans.join(`\n${indent}------------\n`); + } + SymbolFormatter.stringifySymbolMap = stringifySymbolMap; + function stringifySymbol(symbol, indent = '') { + if (!symbol) { + return 'undefined'; + } + const ans = []; + assertEqual(symbol.path[symbol.path.length - 1], symbol.identifier); + ans.push(`SYMBOL ${symbol.path.join('.')}` + + ` {${symbol.category}${symbol.subcategory ? ` (${symbol.subcategory})` : ''}}` + + ` [${stringifyVisibility(symbol.visibility, symbol.visibilityRestriction)}]`); + if (symbol.data) { + ans.push(`${IndentChar}data: ${JSON.stringify(symbol.data)}`); + } + if (symbol.desc) { + ans.push(`${IndentChar}description: ${symbol.desc}`); + } + for (const type of SymbolUsageTypes) { + if (symbol[type]) { + ans.push(`${IndentChar}${type}:\n${symbol[type].map((v) => `${indent}${IndentChar.repeat(2)}${JSON.stringify(v)}`) + .join(`\n${indent}${IndentChar.repeat(2)}------------\n`)}`); + } + } + if (symbol.relations) { + ans.push(`${IndentChar}relations: ${JSON.stringify(symbol.relations)}`); + } + if (symbol.members) { + ans.push(`${IndentChar}members:\n${stringifySymbolMap(symbol.members, `${indent}${IndentChar.repeat(2)}`)}`); + } + return ans.map((v) => `${indent}${v}`).join('\n'); + } + SymbolFormatter.stringifySymbol = stringifySymbol; + function stringifyVisibility(visibility, visibilityRestriction) { + let stringVisibility; + // Const enums cannot be indexed even if `--preserveConstEnums` is on: https://github.com/microsoft/TypeScript/issues/31353 + switch (visibility) { + case 0 /* SymbolVisibility.Block */: + stringVisibility = 'Block'; + break; + case 1 /* SymbolVisibility.File */: + stringVisibility = 'File'; + break; + case 3 /* SymbolVisibility.Restricted */: + stringVisibility = 'Restricted'; + break; + default: + stringVisibility = 'Public'; + break; + } + return `${stringVisibility}${visibilityRestriction ? ` ${visibilityRestriction.map((v) => `“${v}”`).join(', ')}` : ''}`; + } + SymbolFormatter.stringifyVisibility = stringifyVisibility; + function stringifyLookupResult(result) { + return `parentSymbol: +${stringifySymbol(result.parentSymbol, IndentChar)} +parentMap: +${stringifySymbolMap(result.parentMap, IndentChar)} +symbol: +${stringifySymbol(result.symbol, IndentChar)}`; + } + SymbolFormatter.stringifyLookupResult = stringifyLookupResult; +})(SymbolFormatter || (SymbolFormatter = {})); +/** + * Make a method support delay mode: if the {@link SymbolUtil} is in delay mode, the actual invocation of the method will be + * stored to the {@link SymbolUtil._delayedOps} array. + * + * The decorated method MUST have return type `void`. + */ +function DelayModeSupport(getUtil = (self) => self) { + return (_target, _key, descripter) => { + const decoratedMethod = descripter.value; + // The `function` syntax is used to preserve `this` context from the decorated method. + descripter.value = function (...args) { + const util = getUtil(this); + if (util._inDelayMode) { + util._delayedOps.push(decoratedMethod.bind(this, ...args)); + } + else { + decoratedMethod.apply(this, args); + } + }; + return descripter; + }; +} +function isDocAndNode(doc) { + return !!doc.doc; +} +//# sourceMappingURL=SymbolUtil.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/symbol/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/fileUtil.js + +var fileUtil; +(function (fileUtil) { + /** + * Get the relative URI of `target` based from `base`. + * + * @returns The relative URI, or `undefined` if `target` is not under `base`. + */ + function getRelativeUriFromBase(target, base) { + const baseUri = new Uri(base); + const targetUri = new Uri(target); + if (baseUri.origin !== targetUri.origin) { + // Different scheme, hostname, and/or port + return undefined; + } + const baseComponents = baseUri.pathname.split('/').filter((v) => !!v); + const targetComponents = targetUri.pathname.split('/').filter((v) => !!v); + if (baseComponents.length > targetComponents.length + || baseComponents.some((bc, i) => decodeURIComponent(bc) !== decodeURIComponent(targetComponents[i]))) { + return undefined; + } + return targetComponents.slice(baseComponents.length).map(encodeURIComponent).join('/'); + } + fileUtil.getRelativeUriFromBase = getRelativeUriFromBase; + function isSubUriOf(uri, base) { + return getRelativeUriFromBase(uri, base) !== undefined; + } + fileUtil.isSubUriOf = isSubUriOf; + /** + * @param rootUris The root URIs. Each URI in this array must end with a slash (`/`). + * @param uri The target file URI. + * @returns The relative path from one of the `roots` to the `uri`, or `undefined` if the `uri` is not under any roots. + * The separation used in the relative path is always slash (`/`). + * @example + * getRels(['file:///root/foo/', 'file:///root/'], 'file:///root/foo/bar/qux.json') + * // -> 'bar/qux.json' + * // -> 'foo/bar/qux.json' + * // -> undefined + * + * getRels(['file:///root/foo/', 'file:///root/'], 'file:///outsider.json') + * // -> undefined + */ + function* getRels(uri, rootUris) { + for (const root of rootUris) { + const rel = getRelativeUriFromBase(uri, root); + if (rel !== undefined) { + yield rel; + } + } + return undefined; + } + fileUtil.getRels = getRels; + /** + * @see {@link getRels} + * @example + * getRel(['file:///root/foo/', 'file:///root/'], 'file:///root/foo/bar/qux.json') // -> 'bar/qux.json' + * getRel(['file:///root/foo/', 'file:///root/'], 'file:///outsider.json') // -> undefined + */ + function getRel(uri, rootUris) { + return getRels(uri, rootUris).next().value; + } + fileUtil.getRel = getRel; + function* getRoots(uri, rootUris) { + for (const root of rootUris) { + const rel = getRelativeUriFromBase(uri, root); + if (rel !== undefined) { + yield root; + } + } + return undefined; + } + fileUtil.getRoots = getRoots; + function getRoot(uri, rootUris) { + return getRoots(uri, rootUris).next().value; + } + fileUtil.getRoot = getRoot; + function isRootUri(uri) { + return uri.endsWith('/'); + } + fileUtil.isRootUri = isRootUri; + function ensureEndingSlash(uri) { + return isRootUri(uri) ? uri : `${uri}/`; + } + fileUtil.ensureEndingSlash = ensureEndingSlash; + function join(fromUri, toUri) { + return (ensureEndingSlash(fromUri) + (toUri.startsWith('/') ? toUri.slice(1) : toUri)); + } + fileUtil.join = join; + function isFileUri(uri) { + return uri.startsWith('file:'); + } + fileUtil.isFileUri = isFileUri; + /** + * @returns The part from the last `.` to the end of the URI, or `undefined` if no dots exist. No special treatment for leading dots. + */ + function extname(value) { + const i = value.lastIndexOf('.'); + return i >= 0 ? value.slice(i) : undefined; + } + fileUtil.extname = extname; + /** + * @returns The part from the last `/` to the end of the URI. + */ + function basename(uri) { + const i = uri.lastIndexOf('/'); + return i >= 0 ? uri.slice(i + 1) : uri; + } + fileUtil.basename = basename; + /** + * @returns The part from the beginning of the URI to the last `/`. + */ + function dirname(uri) { + const i = uri.lastIndexOf('/'); + return i >= 0 ? uri.slice(0, i) : uri; + } + fileUtil.dirname = dirname; + /* istanbul ignore next */ + function getParentOfFile(externals, path) { + return new Uri('.', path); + } + fileUtil.getParentOfFile = getParentOfFile; + /* istanbul ignore next */ + /** + * @throws + * + * @param mode Default to `0o777` (`rwxrwxrwx`) + */ + async function ensureDir(externals, path, mode = 0o777) { + try { + await externals.fs.mkdir(path, { mode, recursive: true }); + } + catch (e) { + if (!externals.error.isKind(e, 'EEXIST')) { + throw e; + } + } + } + fileUtil.ensureDir = ensureDir; + /* istanbul ignore next */ + /** + * @throws + * + * Ensures the parent directory of the path exists. + * + * @param mode Default to `0o777` (`rwxrwxrwx`) + */ + async function ensureParentOfFile(externals, path, mode = 0o777) { + return ensureDir(externals, getParentOfFile(externals, path), mode); + } + fileUtil.ensureParentOfFile = ensureParentOfFile; + async function chmod(externals, path, mode) { + return externals.fs.chmod(path, mode); + } + fileUtil.chmod = chmod; + async function ensureWritable(externals, path) { + try { + await chmod(externals, path, 0o666); + } + catch (e) { + if (!externals.error.isKind(e, 'ENOENT')) { + throw e; + } + } + } + fileUtil.ensureWritable = ensureWritable; + /** + * @returns An array of file URI strings. + */ + async function getAllFiles(externals, root, depth = Number.POSITIVE_INFINITY) { + async function walk(path, level) { + if (level > depth) { + return []; + } + const entries = await externals.fs.readdir(path); + return (await Promise.all(entries.map(async (e) => { + const entryPath = fileUtil.join(path.toString(), e.name); + if (e.isDirectory()) { + return await walk(entryPath, level + 1); + } + else if (e.isFile()) { + return entryPath; + } + else { + return []; + } + }))).flat(); + } + return walk(root, 0); + } + fileUtil.getAllFiles = getAllFiles; + async function markReadOnly(externals, path) { + return chmod(externals, path, 0o444); + } + fileUtil.markReadOnly = markReadOnly; + async function unlink(externals, path) { + return externals.fs.unlink(path); + } + fileUtil.unlink = unlink; + async function readFile(externals, path) { + return externals.fs.readFile(path); + } + fileUtil.readFile = readFile; + /* istanbul ignore next */ + /** + * @throws + * + * The directory of the file will be created recursively if it doesn't exist. + * + * The target file will be given permission `0o666` (`rw-rw-rw-`) before being written into, and changed back to the + * specified `mode`. + * + * * Encoding: `utf-8` + * * Mode: `0o666` (`rw-rw-rw-`) + * * Flag: `w` + */ + async function writeFile(externals, path, data, mode = 0o666) { + await ensureParentOfFile(externals, path); + await ensureWritable(externals, path); + return externals.fs.writeFile(path, data, { mode }); + } + fileUtil.writeFile = writeFile; + /* istanbul ignore next */ + /** + * @throws + */ + async function readJson(externals, path) { + return JSON.parse(bufferToString(await readFile(externals, path))); + } + fileUtil.readJson = readJson; + /* istanbul ignore next */ + /** + * @throws + * + * @see {@link writeFile} + */ + async function writeJson(externals, path, data) { + return writeFile(externals, path, JSON.stringify(data)); + } + fileUtil.writeJson = writeJson; + /** + * @throws + */ + async function readGzippedFile(externals, path) { + return externals.archive.gunzip(await readFile(externals, path)); + } + fileUtil.readGzippedFile = readGzippedFile; + /** + * @throws + */ + async function writeGzippedFile(externals, path, buffer) { + if (typeof buffer === 'string') { + buffer = new TextEncoder().encode(buffer); + } + return writeFile(externals, path, await externals.archive.gzip(buffer)); + } + fileUtil.writeGzippedFile = writeGzippedFile; + /** + * @throws + */ + async function readGzippedJson(externals, path) { + return JSON.parse(bufferToString(await readGzippedFile(externals, path))); + } + fileUtil.readGzippedJson = readGzippedJson; + /** + * @throws + */ + async function writeGzippedJson(externals, path, data) { + return writeGzippedFile(externals, path, JSON.stringify(data)); + } + fileUtil.writeGzippedJson = writeGzippedJson; +})(fileUtil || (fileUtil = {})); +//# sourceMappingURL=fileUtil.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/FileService.js +/* istanbul ignore file */ + + + +var FileService; +(function (FileService) { + function create(externals, cacheRoot) { + const virtualUrisRoot = fileUtil.ensureEndingSlash(new Uri('virtual-uris/', cacheRoot).toString()); + return new FileServiceImpl(externals, virtualUrisRoot); + } + FileService.create = create; +})(FileService || (FileService = {})); +class FileServiceImpl { + externals; + virtualUrisRoot; + supporters = new Map(); + /** + * A two-way map from mapped physical URIs to virtual URIs. + */ + map = new TwoWayMap(); + constructor(externals, virtualUrisRoot) { + this.externals = externals; + this.virtualUrisRoot = virtualUrisRoot; + } + register(protocol, supporter, force = false) { + if (!force && this.supporters.has(protocol)) { + throw new Error(`The protocol “${protocol}” is already associated with another supporter.`); + } + this.supporters.set(protocol, supporter); + } + unregister(protocol) { + this.supporters.delete(protocol); + } + /** + * @throws If the protocol of `uri` isn't supported. + * + * @returns The protocol if it's supported. + */ + getSupportedProtocol(uri) { + const protocol = new Uri(uri).protocol; + if (!this.supporters.has(protocol)) { + throw new Error(`The protocol “${protocol}” is unsupported.`); + } + return protocol; + } + /** + * @throws + */ + async hash(uri) { + const protocol = this.getSupportedProtocol(uri); + return this.supporters.get(protocol).hash(uri); + } + /** + * @throws + */ + readFile(uri) { + const protocol = this.getSupportedProtocol(uri); + return this.supporters.get(protocol).readFile(uri); + } + *listFiles() { + for (const supporter of this.supporters.values()) { + yield* supporter.listFiles(); + } + } + *listRoots() { + for (const supporter of this.supporters.values()) { + yield* supporter.listRoots(); + } + } + async mapToDisk(virtualUri) { + if (fileUtil.isFileUri(virtualUri)) { + return virtualUri; + } + if (!this.virtualUrisRoot) { + return undefined; + } + try { + let mappedUri = this.map.getKey(virtualUri); + if (mappedUri === undefined) { + mappedUri = `${this.virtualUrisRoot}${await this.externals.crypto.getSha1(virtualUri)}/${fileUtil.basename(virtualUri)}`; + // Delete old mapped file if it exists. This makes sure the + // readonly permission on the file is not removed by it being + // overwritten. + try { + await fileUtil.unlink(this.externals, mappedUri); + } + catch (e) { + if (!this.externals.error.isKind(e, 'ENOENT')) { + throw e; + } + } + const buffer = await this.readFile(virtualUri); + await fileUtil.writeFile(this.externals, mappedUri, buffer, 0o444); + this.map.set(mappedUri, virtualUri); + } + return mappedUri; + } + catch (e) { + // Ignored. + } + return undefined; + } + mapFromDisk(mappedUri) { + if (!this.virtualUrisRoot) { + return mappedUri; + } + return this.map.get(mappedUri) ?? mappedUri; + } +} +class FileUriSupporter { + externals; + roots; + files; + protocol = 'file:'; + constructor(externals, roots, files) { + this.externals = externals; + this.roots = roots; + this.files = files; + } + async hash(uri) { + return hashFile(this.externals, uri); + } + readFile(uri) { + return this.externals.fs.readFile(uri); + } + *listFiles() { + for (const files of this.files.values()) { + yield* files; + } + } + listRoots() { + return this.roots; + } + async mapToDisk(uri) { + return uri; + } + static async create(dependencies, externals, logger) { + const roots = []; + const files = new Map(); + for (let { uri } of dependencies) { + try { + if (fileUtil.isFileUri(uri) && (await externals.fs.stat(uri)).isDirectory()) { + uri = fileUtil.ensureEndingSlash(uri); + roots.push(uri); + files.set(uri, await fileUtil.getAllFiles(externals, uri)); + } + } + catch (e) { + logger.error(`[FileUriSupporter#create] Bad dependency ${uri}`, e); + } + } + return new FileUriSupporter(externals, roots, files); + } +} +class ArchiveUriSupporter { + externals; + logger; + entries; + static Protocol = 'archive:'; + static SupportedArchiveExtnames = ['.tar', '.tar.bz2', '.tar.gz', '.zip']; + protocol = ArchiveUriSupporter.Protocol; + /** + * @param entries A map from archive names to unzipped entries. + */ + constructor(externals, logger, entries) { + this.externals = externals; + this.logger = logger; + this.entries = entries; + } + async hash(uri) { + const { archiveName, pathInArchive } = ArchiveUriSupporter.decodeUri(new Uri(uri)); + if (!pathInArchive) { + // Hash the archive itself. + return hashFile(this.externals, archiveName); + } + else { + // Hash the corresponding file. + return this.externals.crypto.getSha1(this.getDataInArchive(archiveName, pathInArchive)); + } + } + async readFile(uri) { + const { archiveName, pathInArchive } = ArchiveUriSupporter.decodeUri(new Uri(uri)); + return this.getDataInArchive(archiveName, pathInArchive); + } + /** + * @throws + */ + getDataInArchive(archiveName, pathInArchive) { + const entries = this.entries.get(archiveName); + if (!entries) { + throw this.externals.error.createKind('ENOENT', `Archive “${archiveName}” has not been loaded into the memory`); + } + const entry = entries.get(pathInArchive); + if (!entry) { + throw this.externals.error.createKind('ENOENT', `Path “${pathInArchive}” does not exist in archive “${archiveName}”`); + } + if (entry.type !== 'file') { + throw this.externals.error.createKind('EISDIR', `Path “${pathInArchive}” in archive “${archiveName}” is not a file`); + } + return entry.data; + } + *listFiles() { + for (const [archiveName, entries] of this.entries.entries()) { + this.logger.info(`[ArchiveUriSupporter#listFiles] Listing ${entries.size} entries from ${archiveName}`); + for (const entry of entries.values()) { + if (entry.type === 'file') { + yield ArchiveUriSupporter.getUri(archiveName, entry.path); + } + } + } + } + *listRoots() { + for (const archiveName of this.entries.keys()) { + yield ArchiveUriSupporter.getUri(archiveName); + } + } + static getUri(archiveName, pathInArchive = '') { + return `${ArchiveUriSupporter.Protocol}//${archiveName}/${pathInArchive.replace(/\\/g, '/')}`; + } + /** + * @throws When `uri` has the wrong protocol or hostname. + */ + static decodeUri(uri) { + if (uri.protocol !== ArchiveUriSupporter.Protocol) { + throw new Error(`Expected protocol “${ArchiveUriSupporter.Protocol}” in ${uri}`); + } + const path = uri.pathname; + if (!path) { + throw new Error(`Missing path in archive uri ${uri}`); + } + return { archiveName: uri.host, pathInArchive: path.charAt(0) === '/' ? path.slice(1) : path }; + } + static async create(dependencies, externals, logger) { + const entries = new Map(); + for (const { uri, info } of dependencies) { + try { + if (uri.startsWith('file:') + && ArchiveUriSupporter.SupportedArchiveExtnames.some((ext) => uri.endsWith(ext)) + && (await externals.fs.stat(uri)).isFile()) { + const archiveName = fileUtil.basename(uri); + if (entries.has(archiveName)) { + throw new Error(`A different URI with ${archiveName} already exists`); + } + const files = await externals.archive.decompressBall(await externals.fs.readFile(uri), { stripLevel: typeof info?.startDepth === 'number' ? info.startDepth : 0 }); + /// Debug message for #1609 + logger.info(`[ArchiveUriSupporter#create] Extracted ${files.length} files from ${archiveName}`); + entries.set(archiveName, new Map(files.map((f) => [f.path.replace(/\\/g, '/'), f]))); + } + } + catch (e) { + logger.error(`[ArchiveUriSupporter#create] Bad dependency ${uri}`, e); + } + } + return new ArchiveUriSupporter(externals, logger, entries); + } +} +async function hashFile(externals, uri) { + return externals.crypto.getSha1(await externals.fs.readFile(uri)); +} +//# sourceMappingURL=FileService.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/CacheService.js + + + + +/** + * The format version of the cache. Should be increased when any changes that + * could invalidate the cache are introduced to the Spyglass codebase. + */ +const LatestCacheVersion = 6; +var Checksums; +(function (Checksums) { + function create() { + return { files: {}, roots: {}, symbolRegistrars: {} }; + } + Checksums.create = create; +})(Checksums || (Checksums = {})); +class CacheService { + cacheRoot; + project; + checksums = Checksums.create(); + errors = {}; + #hasValidatedFiles = false; + /** + * @param cacheRoot File path to the directory where cache files by Spyglass should be stored. + * @param project + */ + constructor(cacheRoot, project) { + this.cacheRoot = cacheRoot; + this.project = project; + this.project.on('documentUpdated', async ({ doc }) => { + if (!this.#hasValidatedFiles + // Do not save checksums for file schemes that we cannot map to disk (e.g. 'untitled:' + // for untitled files in VS Code) + || !(doc.uri.startsWith(ArchiveUriSupporter.Protocol) || doc.uri.startsWith('file:'))) { + return; + } + try { + // TODO: Don't update this for every single change. + this.checksums.files[doc.uri] = await this.project.externals.crypto.getSha1(doc.getText()); + } + catch (e) { + if (!this.project.externals.error.isKind(e, 'EISDIR')) { + this.project.logger.error(`[CacheService#hash-file] ${doc.uri}`); + } + } + }); + this.project.on('rootsUpdated', async ({ roots }) => { + if (!this.#hasValidatedFiles) { + return; + } + for (const root of roots) { + try { + this.checksums.roots[root] = await this.project.fs.hash(root); + } + catch (e) { + if (!this.project.externals.error.isKind(e, 'EISDIR')) { + this.project.logger.error(`[CacheService#hash-root] ${root}`); + } + } + } + }); + this.project.on('symbolRegistrarExecuted', ({ id, checksum }) => { + if (checksum !== undefined) { + this.checksums.symbolRegistrars[id] = checksum; + } + }); + this.project.on('documentErrored', ({ uri, errors }) => { + this.errors[uri] = errors; + }); + } + #cacheFilePath; + async getCacheFileUri() { + if (!this.#cacheFilePath) { + const sortedRoots = [...this.project.projectRoots].sort(); + const hash = await this.project.externals.crypto.getSha1(sortedRoots.join(':')); + this.#cacheFilePath = new Uri(`symbols/${hash}.json.gz`, this.cacheRoot).toString(); + } + return this.#cacheFilePath; + } + async load() { + const ans = { symbols: {} }; + if (this.project.projectRoots.length === 0) { + return ans; + } + const __profiler = this.project.profilers.get('cache#load'); + let filePath; + try { + filePath = await this.getCacheFileUri(); + this.project.logger.info(`[CacheService#load] symbolCachePath = ${filePath}`); + const cache = (await fileUtil.readGzippedJson(this.project.externals, filePath)); + __profiler.task('Read File'); + if (cache.version === LatestCacheVersion) { + this.checksums = cache.checksums; + this.errors = cache.errors; + ans.symbols = SymbolTable.link(cache.symbols); + __profiler.task('Link Symbols'); + } + else { + this.project.logger.info(`[CacheService#load] Unsupported cache format ${cache.version}; expected ${LatestCacheVersion}`); + } + } + catch (e) { + if (!this.project.externals.error.isKind(e, 'ENOENT')) { + this.project.logger.error('[CacheService#load] ', e); + } + } + __profiler.finalize(); + return ans; + } + async validate() { + const ans = { + addedFiles: [], + changedFiles: [], + removedFiles: [], + unchangedFiles: [], + }; + const unchangedRoots = []; + for (const [uri, checksum] of Object.entries(this.checksums.roots)) { + try { + const hash = await this.project.fs.hash(uri); + if (hash === checksum) { + unchangedRoots.push(uri); + } + } + catch (e) { + if (!this.project.externals.error.isKind(e, 'EISDIR')) { + this.project.logger.error(`[CacheService#hash-file] ${uri}`); + } + // Failed calculating hash. Assume the root has changed. + } + } + for (const [uri, checksum] of Object.entries(this.checksums.files)) { + if (unchangedRoots.some((root) => fileUtil.isSubUriOf(uri, root))) { + ans.unchangedFiles.push(uri); + continue; + } + if (this.project.shouldExclude(uri)) { + ans.removedFiles.push(uri); + continue; + } + try { + const hash = await this.project.fs.hash(uri); + if (hash === checksum) { + ans.unchangedFiles.push(uri); + } + else { + ans.changedFiles.push(uri); + } + } + catch (e) { + if (this.project.externals.error.isKind(e, 'ENOENT') + || this.project.externals.error.isKind(e, 'EISDIR')) { + ans.removedFiles.push(uri); + } + else { + this.project.logger.error(`[CacheService#validate] ${uri}`, e); + // Assume the file has changed. + ans.changedFiles.push(uri); + } + } + } + for (const uri of this.project.getTrackedFiles()) { + if (!(uri in this.checksums.files)) { + ans.addedFiles.push(uri); + } + } + this.#hasValidatedFiles = true; + return ans; + } + /** + * @returns If the cache file was saved successfully. + */ + async save() { + if (this.project.projectRoots.length === 0) { + return false; + } + const __profiler = this.project.profilers.get('cache#save'); + let filePath; + try { + filePath = await this.getCacheFileUri(); + const cache = { + version: LatestCacheVersion, + projectRoots: this.project.projectRoots, + checksums: this.checksums, + symbols: SymbolTable.unlink(this.project.symbols.global), + errors: this.errors, + }; + __profiler.task('Unlink Symbols'); + await fileUtil.writeGzippedJson(this.project.externals, filePath, cache); + __profiler.task('Write File').finalize(); + return true; + } + catch (e) { + this.project.logger.error(`[CacheService#save] path = ${filePath}`, e); + } + return false; + } + async hasFileChangedSinceCache(doc) { + return (this.checksums.files[doc.uri] + !== (await this.project.externals.crypto.getSha1(doc.getText()))); + } + reset() { + this.#hasValidatedFiles = false; + this.checksums = Checksums.create(); + this.errors = {}; + return { symbols: {} }; + } +} +//# sourceMappingURL=CacheService.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Config.js + + + +var LinterSeverity; +(function (LinterSeverity) { + function is(value) { + return (value === 'hint' + || value === 'information' + || value === 'warning' + || value === 'error'); + } + LinterSeverity.is = is; + function toErrorSeverity(value) { + switch (value) { + case 'error': + return 3 /* ErrorSeverity.Error */; + case 'hint': + return 0 /* ErrorSeverity.Hint */; + case 'information': + return 1 /* ErrorSeverity.Information */; + case 'warning': + return 2 /* ErrorSeverity.Warning */; + } + } + LinterSeverity.toErrorSeverity = toErrorSeverity; +})(LinterSeverity || (LinterSeverity = {})); +var LinterConfigValue; +(function (LinterConfigValue) { + function destruct(value) { + if (value === null || value === undefined) { + return undefined; + } + if (LinterSeverity.is(value)) { + return { ruleSeverity: LinterSeverity.toErrorSeverity(value), ruleValue: true }; + } + if (Array.isArray(value) && LinterSeverity.is(value[0])) { + return { ruleSeverity: LinterSeverity.toErrorSeverity(value[0]), ruleValue: value[1] }; + } + return { ruleSeverity: 2 /* ErrorSeverity.Warning */, ruleValue: value }; + } + LinterConfigValue.destruct = destruct; +})(LinterConfigValue || (LinterConfigValue = {})); +var SymbolLinterConfig; +(function (SymbolLinterConfig) { + function is(value) { + return Arrayable.is(value, Complex.is) || Action.is(value); + } + SymbolLinterConfig.is = is; + let Complex; + (function (Complex) { + function is(v) { + if (!v || typeof v !== 'object') { + return false; + } + const value = v; + return ((value.if === undefined || Arrayable.is(value.if, Condition.is)) + && (value.then === undefined || Action.is(value.then)) + && (value.override === undefined || Arrayable.is(value.override, Complex.is))); + } + Complex.is = is; + })(Complex = SymbolLinterConfig.Complex || (SymbolLinterConfig.Complex = {})); + let Condition; + (function (Condition) { + function is(v) { + if (!v || typeof v !== 'object') { + return false; + } + const value = v; + return ((value.category === undefined + || Arrayable.is(value.category, TypePredicates.isString)) + && (value.pattern === undefined || Arrayable.is(value.pattern, TypePredicates.isString)) + && (value.excludePattern === undefined + || Arrayable.is(value.excludePattern, TypePredicates.isString)) + && (value.namespace === undefined + || Arrayable.is(value.namespace, TypePredicates.isString)) + && (value.excludeNamespace === undefined + || Arrayable.is(value.excludeNamespace, TypePredicates.isString))); + } + Condition.is = is; + })(Condition = SymbolLinterConfig.Condition || (SymbolLinterConfig.Condition = {})); + let Action; + (function (Action) { + function isDeclare(value) { + return (value !== undefined + && ['block', 'file', 'public'].includes(value.declare)); + } + Action.isDeclare = isDeclare; + function isReport(value) { + return (value !== undefined + && ['inherit', 'hint', 'information', 'warning', 'error'].includes(value.report)); + } + Action.isReport = isReport; + function is(v) { + if (!v || typeof v !== 'object') { + return false; + } + const value = v; + return isDeclare(value) || isReport(value); + } + Action.is = is; + })(Action = SymbolLinterConfig.Action || (SymbolLinterConfig.Action = {})); +})(SymbolLinterConfig || (SymbolLinterConfig = {})); +/** + * Config which simulates the default vanilla command system. + */ +const VanillaConfig = { + env: { + dataSource: 'GitHub', + dependencies: ['@vanilla-datapack', '@vanilla-resourcepack', '@vanilla-mcdoc'], + exclude: [ + '.*/**', + '**/node_modules/**', + '**/__pycache__/**', + ], + customResources: {}, + feature: { + codeActions: true, + colors: true, + completions: true, + documentHighlighting: true, + documentLinks: true, + foldingRanges: true, + formatting: true, + hover: true, + inlayHint: { + enabledNodes: [ + 'boolean', + 'double', + 'float', + 'integer', + 'long', + 'mcfunction:coordinate', + 'mcfunction:vector', + 'mcfunction:command_child/unknown', + ], + }, + semanticColoring: true, + selectionRanges: true, + signatures: true, + }, + gameVersion: 'Auto', + language: 'Default', + permissionLevel: 2, + plugins: [], + mcmetaSummaryOverrides: {}, + enableMcdocCaching: false, + useFilePolling: false, + }, + format: { + blockStateBracketSpacing: { inside: 0 }, + blockStateCommaSpacing: { before: 0, after: 1 }, + blockStateEqualSpacing: { before: 0, after: 0 }, + blockStateTrailingComma: false, + eol: 'auto', + nbtArrayBracketSpacing: { inside: 0 }, + nbtArrayCommaSpacing: { before: 0, after: 1 }, + nbtArraySemicolonSpacing: { after: 1 }, + nbtArrayTrailingComma: false, + nbtByteSuffix: 'b', + nbtCompoundBracketSpacing: { inside: 0 }, + nbtCompoundColonSpacing: { before: 0, after: 1 }, + nbtCompoundCommaSpacing: { before: 0, after: 1 }, + nbtCompoundTrailingComma: false, + nbtDoubleOmitSuffix: false, + nbtDoubleSuffix: 'd', + nbtFloatSuffix: 'f', + nbtListBracketSpacing: { inside: 0 }, + nbtListCommaSpacing: { before: 0, after: 1 }, + nbtListTrailingComma: false, + nbtLongSuffix: 'L', + nbtShortSuffix: 's', + selectorBracketSpacing: { inside: 0 }, + selectorCommaSpacing: { before: 0, after: 1 }, + selectorEqualSpacing: { before: 0, after: 0 }, + selectorTrailingComma: false, + timeOmitTickUnit: false, + }, + lint: { + blockStateSortKeys: null, + nbtCompoundSortKeys: null, + selectorSortKeys: null, + commandStringQuote: null, + nbtKeyQuote: null, + nbtPathQuote: null, + nbtStringQuote: null, + selectorKeyQuote: null, + idOmitDefaultNamespace: null, + nameOfNbtKey: null, + nameOfObjective: null, + nameOfScoreHolder: null, + nameOfTag: null, + nameOfTeam: null, + nbtArrayLengthCheck: true, + nbtBoolean: null, + nbtListLengthCheck: null, + nbtTypeCheck: 'loosely', + undeclaredSymbol: [ + { + if: [ + { category: RegistryCategories, namespace: 'minecraft' }, + { category: [...DataFileCategories, 'bossbar', 'objective', 'team'] }, + ], + then: { report: 'warning' }, + }, + { + if: { category: ['attribute_modifier', 'attribute_modifier_uuid', 'tag'] }, + then: { declare: 'public' }, + }, + { + then: { declare: 'block' }, + }, + ], + }, + snippet: { + executeIfScoreSet: 'execute if score ${1:score_holder} ${2:objective} = ${1:score_holder} ${2:objective} $0', + summonAec: 'summon minecraft:area_effect_cloud ~ ~ ~ {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: ["${1:tag}"]}', + }, +}; +class ConfigService { + project; + defaultConfig; + static ConfigFileNames = Object.freeze(['spyglass.json', '.spyglassrc.json']); + #eventEmitter; + constructor(project, defaultConfig = VanillaConfig) { + this.project = project; + this.defaultConfig = defaultConfig; + this.#eventEmitter = new project.externals.event.EventEmitter(); + const handler = async ({ uri }) => { + if (ConfigService.isConfigFile(uri)) { + this.emit('changed', { config: await this.load() }); + } + }; + project.on('fileCreated', handler); + project.on('fileModified', handler); + project.on('fileDeleted', handler); + } + on(event, callbackFn) { + this.#eventEmitter.on(event, callbackFn); + return this; + } + once(event, callbackFn) { + this.#eventEmitter.once(event, callbackFn); + return this; + } + emit(event, ...args) { + return this.#eventEmitter.emit(event, ...args); + } + async load() { + const overrides = []; + for (const projectRoot of this.project.projectRoots) { + for (const name of ConfigService.ConfigFileNames) { + const uri = projectRoot + name; + try { + const contents = await this.project.externals.fs.readFile(uri); + overrides.push(JSON.parse(bufferToString(contents))); + } + catch (e) { + if (this.project.externals.error.isKind(e, 'ENOENT')) { + // File doesn't exist. + continue; + } + this.emit('error', { error: e, uri }); + } + break; + } + } + return ConfigService.merge(this.defaultConfig, ...overrides); + } + static isConfigFile(uri) { + return ConfigService.ConfigFileNames.some((n) => uri.endsWith(`/${n}`)); + } + static merge(base, ...overrides) { + return overrides.reduce(merge, rfdc()(base)); + } +} +//# sourceMappingURL=Config.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/binder/Binder.js +const IsAsync = Symbol('IsAsyncBinder'); +var SyncBinder; +(function (SyncBinder) { + function create(binder) { + return binder; + } + SyncBinder.create = create; + function is(binder) { + return !binder[IsAsync]; + } + SyncBinder.is = is; +})(SyncBinder || (SyncBinder = {})); +var AsyncBinder; +(function (AsyncBinder) { + function create(binder) { + return Object.assign(binder, { [IsAsync]: true }); + } + AsyncBinder.create = create; + function is(binder) { + return binder[IsAsync]; + } + AsyncBinder.is = is; +})(AsyncBinder || (AsyncBinder = {})); +//# sourceMappingURL=Binder.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/util.js +function traversePreOrder(node, shouldContinue, shouldCallFn, fn) { + traversePreOrderImpl(node, shouldContinue, shouldCallFn, fn, []); +} +function traversePreOrderImpl(node, shouldContinue, shouldCallFn, fn, parents) { + if (shouldCallFn(node, parents)) { + fn(node, parents); + } + if (!node.children || !shouldContinue(node, parents)) { + return; + } + for (const child of node.children ?? []) { + parents.unshift(node); + traversePreOrderImpl(child, shouldContinue, shouldCallFn, fn, parents); + parents.shift(); + } +} +//# sourceMappingURL=util.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/binder/builtin.js + + + + + + +function attempt(binder, node, ctx) { + const tempCtx = { + ...ctx, + err: new ErrorReporter(ctx.err.source), + symbols: ctx.symbols.clone(), + }; + const processAfterBinder = () => { + StateProxy.undoChanges(node); + const totalErrorSpan = tempCtx.err.errors.map((e) => e.range.end - e.range.start).reduce((a, b) => a + b, 0); + return { + errorAmount: tempCtx.err.errors.length, + totalErrorSpan, + updateNodeAndCtx: () => { + ctx.err.absorb(tempCtx.err); + StateProxy.redoChanges(node); + tempCtx.symbols.applyDelayedEdits(); + }, + }; + }; + if (SyncBinder.is(binder)) { + binder(node, tempCtx); + return processAfterBinder(); + } + else { + return (async () => { + await binder(node, tempCtx); + return processAfterBinder(); + })(); + } +} +function any(binders) { + if (binders.length === 0) { + throw new Error('Expected at least one binder'); + } + const attemptSorter = (a, b) => a.errorAmount - b.errorAmount || a.totalErrorSpan - b.totalErrorSpan; + if (binders.every(SyncBinder.is)) { + return SyncBinder.create((node, ctx) => { + const attempts = binders.map((binder) => attempt(binder, node, ctx)).sort(attemptSorter); + attempts[0].updateNodeAndCtx(); + }); + } + else { + return AsyncBinder.create(async (node, ctx) => { + const attempts = (await Promise.all(binders.map((binder) => attempt(binder, node, ctx)))) + .sort(attemptSorter); + attempts[0].updateNodeAndCtx(); + }); + } +} +/** + * No operation. + */ +const noop = SyncBinder.create(() => { }); +/** + * Use the shallowest children that have their own binder to validate. + */ +const fallback = AsyncBinder.create(async (node, ctx) => { + const promises = []; + traversePreOrder(node, (node) => !ctx.meta.hasBinder(node.type), (node) => ctx.meta.hasBinder(node.type), (node) => { + const binder = ctx.meta.getBinder(node.type); + const result = binder(node, ctx); + if (result instanceof Promise) { + promises.push(result); + } + }); + await Promise.all(promises); +}); +const fallbackSync = SyncBinder.create((node, ctx) => { + traversePreOrder(node, (node) => !ctx.meta.hasBinder(node.type), (node) => ctx.meta.hasBinder(node.type), (node) => { + const binder = ctx.meta.getBinder(node.type); + if (SyncBinder.is(binder)) { + binder(node, ctx); + } + else { + ctx.logger.warn(`[fallbackSync] Trying to run async binder for "${node.type}"`); + } + }); +}); +const dispatchSync = SyncBinder.create((node, ctx) => { + for (const child of node.children ?? []) { + if (ctx.meta.hasBinder(child.type)) { + const binder = ctx.meta.getBinder(child.type); + binder(child, ctx); + } + } +}); +const resourceLocation = SyncBinder.create((node, ctx) => { + const raw = ResourceLocationNode.toString(node, 'full'); + let sanitizedRaw = ResourceLocation.lengthen(node.options.namespacePathSep === '.' + ? raw.replace(/\./g, ResourceLocation.NamespacePathSep) + : raw); + if (node.options.implicitPath) { + const sepIndex = sanitizedRaw.indexOf(ResourceLocation.NamespacePathSep); + sanitizedRaw = sanitizedRaw.substring(0, sepIndex + 1) + node.options.implicitPath + + sanitizedRaw.substring(sepIndex + 1); + } + if (node.options.category) { + ctx.symbols.query(ctx.doc, node.isTag ? `tag/${node.options.category}` : node.options.category, sanitizedRaw).enter({ + usage: { type: node.options.usageType, node, accessType: node.options.accessType }, + }); + } + if (node.options.pool && !node.options.allowUnknown) { + if (!node.options.pool.includes(sanitizedRaw)) { + ctx.err.report(localize('expected', node.options.pool), node, 3 /* ErrorSeverity.Error */); + } + return; + } +}); +const symbol = SyncBinder.create((node, ctx) => { + if (node.value) { + const path = node.options.parentPath ? [...node.options.parentPath, node.value] : [node.value]; + ctx.symbols.query(ctx.doc, node.options.category, ...path).enter({ + data: { subcategory: node.options.subcategory }, + usage: { type: node.options.usageType, node, accessType: node.options.accessType }, + }); + } +}); +function registerBinders(meta) { + meta.registerBinder('resource_location', resourceLocation); + meta.registerBinder('symbol', symbol); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/binder/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/checker/builtin.js + + + +function builtin_attempt(checker, node, ctx) { + const tempCtx = { + ...ctx, + err: new ErrorReporter(ctx.err.source), + symbols: ctx.symbols.clone(), + }; + // FIXME: await + checker(node, tempCtx); + StateProxy.undoChanges(node); + const totalErrorSpan = tempCtx.err.errors.map((e) => e.range.end - e.range.start).reduce((a, b) => a + b, 0); + return { + errorAmount: tempCtx.err.errors.length, + totalErrorSpan, + updateNodeAndCtx: () => { + ctx.err.absorb(tempCtx.err); + StateProxy.redoChanges(node); + tempCtx.symbols.applyDelayedEdits(); + }, + }; +} +function builtin_any(checkers) { + if (checkers.length === 0) { + throw new Error('Expected at least one checker'); + } + return (node, ctx) => { + const attempts = checkers.map((checker) => builtin_attempt(checker, node, ctx)).sort((a, b) => a.errorAmount - b.errorAmount || a.totalErrorSpan - b.totalErrorSpan); + attempts[0].updateNodeAndCtx(); + }; +} +/** + * No operation. + */ +const builtin_noop = () => { }; +/** + * Use the shallowest children that have their own checker to validate. + */ +const builtin_fallback = async (node, ctx) => { + const promises = []; + traversePreOrder(node, (node) => !ctx.meta.hasChecker(node.type), (node) => ctx.meta.hasChecker(node.type), (node) => { + const checker = ctx.meta.getChecker(node.type); + const result = checker(node, ctx); + if (result instanceof Promise) { + promises.push(result); + } + }); + await Promise.all(promises); +}; +const builtin_fallbackSync = async (node, ctx) => { + const promises = []; + traversePreOrder(node, (node) => !ctx.meta.hasChecker(node.type), (node) => ctx.meta.hasChecker(node.type), (node) => { + const checker = ctx.meta.getChecker(node.type); + const result = checker(node, ctx); + if (result instanceof Promise) { + ctx.logger.warn(`[fallbackSync] Trying to run async checker for "${node.type}"`); + } + }); + await Promise.all(promises); +}; +const builtin_dispatchSync = (node, ctx) => { + for (const child of node.children ?? []) { + if (ctx.meta.hasChecker(child.type)) { + const checker = ctx.meta.getChecker(child.type); + checker(child, ctx); + } + } +}; +const builtin_resourceLocation = (node, ctx) => { + // const full = ResourceLocationNode.toString(node, 'full') + // if (node.options.pool) { + // if (!node.options.pool.includes(full)) { + // ctx.err.report(localize('expected', node.options.pool), node, ErrorSeverity.Error) + // } + // return + // } +}; +const builtin_symbol = (_node, _ctx) => { + // TODO +}; +function registerCheckers(meta) { + meta.registerChecker('resource_location', builtin_resourceLocation); + meta.registerChecker('symbol', builtin_symbol); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/checker/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/codeActions/builtin.js + + + +const codeActions_builtin_fallback = (node, ctx) => { + const ans = []; + traversePreOrder(node, (node) => Range.containsRange(node.range, ctx.range, true), (node) => ctx.meta.hasCodeActionProvider(node.type), (node) => ans.push(...ctx.meta.getCodeActionProvider(node.type)(node, ctx))); + return ans; +}; +const file = (node, ctx) => { + const ans = []; + for (const error of FileNode.getErrors(node)) { + const action = error.info?.codeAction; + if (!action) { + continue; + } + if (!Range.containsRange(error.range, ctx.range, true)) { + continue; + } + ans.push({ + ...action, + errors: [error], + }); + } + return ans; +}; +function registerProviders(meta) { + meta.registerCodeActionProvider('file', file); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/codeActions/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/ColorInfoProvider.js +var Color; +(function (Color) { + Color.NamedColors = new Map([ + ['aqua', 0x55ffff], + ['black', 0x000000], + ['blue', 0x5555ff], + ['dark_aqua', 0x00aaaa], + ['dark_blue', 0x0000aa], + ['dark_gray', 0x555555], + ['dark_green', 0x00aa00], + ['dark_purple', 0xaa00aa], + ['dark_red', 0xaa0000], + ['gold', 0xffaa00], + ['gray', 0xaaaaaa], + ['green', 0x55ff55], + ['light_purple', 0xff55ff], + ['red', 0xff5555], + ['white', 0xffffff], + ['yellow', 0xffff55], + ]); + Color.ColorNames = [...Color.NamedColors.keys()]; + function fromNamed(value) { + const composite = Color.NamedColors.get(value); + if (composite === undefined) { + return undefined; + } + return fromCompositeRGB(composite); + } + Color.fromNamed = fromNamed; + /** + * @param r A decimal within [0.0, 1.0]. + * @param g A decimal within [0.0, 1.0]. + * @param b A decimal within [0.0, 1.0]. + * @param a A decimal within [0.0, 1.0]. + */ + function fromDecRGBA(r, g, b, a) { + return [r, g, b, a]; + } + Color.fromDecRGBA = fromDecRGBA; + /** + * @param r A decimal within [0.0, 1.0]. + * @param g A decimal within [0.0, 1.0]. + * @param b A decimal within [0.0, 1.0]. + */ + function fromDecRGB(r, g, b) { + return fromDecRGBA(r, g, b, 1.0); + } + Color.fromDecRGB = fromDecRGB; + /** + * @param r An integer within [0, 255]. + * @param g An integer within [0, 255]. + * @param b An integer within [0, 255]. + * @param a An integer within [0, 255]. + */ + function fromIntRGBA(r, g, b, a) { + return fromDecRGBA(r / 255, g / 255, b / 255, a / 255); + } + Color.fromIntRGBA = fromIntRGBA; + /** + * @param r An integer within [0, 255]. + * @param g An integer within [0, 255]. + * @param b An integer within [0, 255]. + */ + function fromIntRGB(r, g, b) { + return fromIntRGBA(r, g, b, 255); + } + Color.fromIntRGB = fromIntRGB; + /** + * @param value A string in the format `#rrggbb` + */ + function fromHexRGB(value) { + var bigint = parseInt(value.slice(1), 16); + var r = (bigint >> 16) & 255; + var g = (bigint >> 8) & 255; + var b = bigint & 255; + return fromIntRGB(r, g, b); + } + Color.fromHexRGB = fromHexRGB; + /** + * @param value `R << 16 + G << 8 + B`. + */ + function fromCompositeRGB(value) { + const r = value >> 16 & 0xff; + const g = value >> 8 & 0xff; + const b = value & 0xff; + return fromIntRGB(r, g, b); + } + Color.fromCompositeRGB = fromCompositeRGB; + /** + * @param value `A << 24 + R << 16 + G << 8 + B`. + */ + function fromCompositeARGB(value) { + // Cast to signed 32-bit integer + value |= 0; + const a = (value >>> 24) & 0xff; + const r = (value >>> 16) & 0xff; + const g = (value >>> 8) & 0xff; + const b = value & 0xff; + return fromIntRGBA(r, g, b, a); + } + Color.fromCompositeARGB = fromCompositeARGB; +})(Color || (Color = {})); +var ColorFormat; +(function (ColorFormat) { + /** + * `1 0.6 0.2 1.0` + */ + ColorFormat[ColorFormat["DecRGBA"] = 0] = "DecRGBA"; + /** + * `1 0.6 0.2` + */ + ColorFormat[ColorFormat["DecRGB"] = 1] = "DecRGB"; + /** + * `255 153 51 25` + */ + ColorFormat[ColorFormat["IntRGBA"] = 2] = "IntRGBA"; + /** + * `255 153 51` + */ + ColorFormat[ColorFormat["IntRGB"] = 3] = "IntRGB"; + /** + * `#ff9933ff` + */ + ColorFormat[ColorFormat["HexRGBA"] = 4] = "HexRGBA"; + /** + * `#ff9933` + */ + ColorFormat[ColorFormat["HexRGB"] = 5] = "HexRGB"; + /** + * `16620441` + */ + ColorFormat[ColorFormat["CompositeRGB"] = 6] = "CompositeRGB"; + /** + * `4294945365` + */ + ColorFormat[ColorFormat["CompositeARGB"] = 7] = "CompositeARGB"; +})(ColorFormat || (ColorFormat = {})); +var ColorPresentation; +(function (ColorPresentation) { + function fromColorFormat(format, color, range) { + const presentation = colorPresentation(format, color); + return { label: presentation, text: presentation, range }; + } + ColorPresentation.fromColorFormat = fromColorFormat; + function colorPresentation(format, color) { + const round = (num) => parseFloat(num.toFixed(3)); + switch (format) { + case ColorFormat.DecRGBA: + return color.map((c) => round(c)).join(' '); + case ColorFormat.DecRGB: + return color.slice(0, 3).map((c) => round(c)).join(' '); + case ColorFormat.IntRGBA: + return color.map((c) => Math.round(c * 255)).join(' '); + case ColorFormat.IntRGB: + return color.slice(0, 3).map((c) => Math.round(c * 255)).join(' '); + case ColorFormat.HexRGBA: + return `#${Math.round((((color[0] * 255) << 24) + ((color[1] * 255) << 16) + color[2] * 255) + << (8 + color[3] * 255)).toString(16).padStart(8, '0')}`; + case ColorFormat.HexRGB: + return `#${Math.round(((color[0] * 255) << 16) + ((color[1] * 255) << 8) + color[2] * 255) + .toString(16).padStart(6, '0')}`; + case ColorFormat.CompositeRGB: + return `${Math.round(((color[0] * 255) << 16) + ((color[1] * 255) << 8) + color[2] * 255)}`; + case ColorFormat.CompositeARGB: + return `${Number((BigInt(Math.round(color[3] * 255)) << 24n) + + (BigInt(Math.round(color[0] * 255)) << 16n) + + (BigInt(Math.round(color[1] * 255)) << 8n) + + BigInt(Math.round(color[2] * 255))) << 0 // Convert to signed 32-bit integer + }`; + } + } +})(ColorPresentation || (ColorPresentation = {})); +//# sourceMappingURL=ColorInfoProvider.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/colorizer/Colorizer.js + +var ColorToken; +(function (ColorToken) { + /* istanbul ignore next */ + function create(range, type, modifiers) { + return { range: Range.get(range), type, modifiers }; + } + ColorToken.create = create; + /** + * @returns An array of color tokens that cover the whole range of `targetRange`, with gaps in `tokens` filled + * with tokens created from the specified `type` and `modifiers`. + */ + function fillGap(tokens, targetRange, type, modifiers) { + const ans = []; + let nextStart = Math.min(targetRange.start, tokens[0]?.range.start ?? Infinity); + for (const t of tokens) { + if (t.range.start > nextStart) { + ans.push(ColorToken.create(Range.create(nextStart, t.range.start), type, modifiers)); + } + ans.push(t); + nextStart = t.range.end; + } + if (nextStart < targetRange.end) { + ans.push(ColorToken.create(Range.create(nextStart, targetRange.end), type, modifiers)); + } + return ans; + } + ColorToken.fillGap = fillGap; +})(ColorToken || (ColorToken = {})); +// Built-in LSP semantic tokens: https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#textDocument_semanticTokens +/* + * Hint: during development, the `Developer: Inspect Editor Tokens and Scopes` command in VS Code helps a lot with deciding on the color for nodes. + */ +const ColorTokenTypes = Object.freeze([ + 'comment', + 'enum', + 'enumMember', + 'escape', + 'function', + 'keyword', + 'modifier', + 'number', + 'property', + 'string', + 'struct', + 'type', + 'variable', + // Below are custom types. + 'error', + 'literal', + 'operator', + 'resourceLocation', + 'vector', +]); +const ColorTokenModifiers = Object.freeze([ + 'declaration', + 'defaultLibrary', + 'definition', + 'deprecated', + 'documentation', + 'modification', + 'readonly', + // Below are custom modifiers. +]); +//# sourceMappingURL=Colorizer.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/colorizer/builtin.js + + + +/** + * Use the shallowest children that have their own colorizers to provide the color tokens. + */ +const colorizer_builtin_fallback = (node, ctx) => { + const ans = []; + traversePreOrder(node, (node) => !ctx.meta.hasColorizer(node.type) + && (!ctx.range || Range.intersects(node.range, ctx.range)), (node) => ctx.meta.hasColorizer(node.type), (node) => { + const colorizer = ctx.meta.getColorizer(node.type); + const result = colorizer(node, ctx); + ans.push(...result); + }); + return Object.freeze(ans); +}; +const builtin_boolean = (node) => { + return [ColorToken.create(node, 'literal')]; +}; +const comment = (node) => { + return [ColorToken.create(node, 'comment')]; +}; +const error = (node) => { + // return [ColorToken.create(node, 'error')] + return []; +}; +const builtin_literal = (node) => { + return [ColorToken.create(node, node.options.colorTokenType ?? 'literal')]; +}; +const number = (node) => { + return [ColorToken.create(node, 'number')]; +}; +const colorizer_builtin_resourceLocation = (node, _ctx) => { + let type; + switch (node.options.category) { + case 'function': + case 'tag/function': + type = 'function'; + break; + default: + type = 'resourceLocation'; + break; + } + return [ColorToken.create(node, type)]; +}; +const string = (node, ctx) => { + if (node.children) { + const colorizer = ctx.meta.getColorizer(node.children[0].type); + const result = colorizer(node.children[0], ctx); + // TODO: Fill the gap between the last token and the ending quote with errors. + return ColorToken.fillGap(result, node.range, node.options.colorTokenType ?? 'string'); + } + else { + return [ColorToken.create(node, node.options.colorTokenType ?? 'string')]; + } +}; +const colorizer_builtin_symbol = (node) => { + // TODO: Set the modifiers according to `node.symbol`. + return [ColorToken.create(node, 'variable')]; +}; +function registerColorizers(meta) { + meta.registerColorizer('boolean', builtin_boolean); + meta.registerColorizer('comment', comment); + meta.registerColorizer('error', error); + meta.registerColorizer('float', number); + meta.registerColorizer('integer', number); + meta.registerColorizer('long', number); + meta.registerColorizer('literal', builtin_literal); + meta.registerColorizer('resource_location', colorizer_builtin_resourceLocation); + meta.registerColorizer('string', string); + meta.registerColorizer('symbol', colorizer_builtin_symbol); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/colorizer/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/completer/Completer.js + +var CompletionItem; +(function (CompletionItem) { + /* istanbul ignore next */ + /** + * If no `insertText` is provided in `other`, the value of `label` will be escaped for TextMate purposes + * (@see {@link escape}) and used as the insert text. + * + * @example + * create('foo', range) // insertText = 'foo' + * create('\\ $ }', range) // insertText = '\\\\ \\$ \\}' + * create('foo', range, { insertText: '\\ $ }' }) // insertText = '\\ $ }' + */ + function create(label, range, other) { + const shouldEscape = other?.insertText === undefined && needsEscape(label); + return { + ...other, + label, + range: Range.get(range), + ...(shouldEscape ? { insertText: escape(label) } : {}), + }; + } + CompletionItem.create = create; + /** + * Returns if `textToInsert` contains any characters that need to be escaped for TextMate (`$`, `\`, or `}`) + */ + function needsEscape(textToInsert) { + return /[\\$}]/.test(textToInsert); + } + CompletionItem.needsEscape = needsEscape; + /** + * Escape `$`, `\`, and `}` in `textToInsert` + */ + function escape(textToInsert) { + return textToInsert.replace(/([\\$}])/g, '\\$1'); + } + CompletionItem.escape = escape; + /** + * Un-escape `$`, `\`, and `}` in `textToInsert` + */ + function unescape(textToInsert) { + return textToInsert.replace(/\\([\\$}])/g, '$1'); + } + CompletionItem.unescape = unescape; +})(CompletionItem || (CompletionItem = {})); +class InsertTextBuilder { + #ans = ''; + #nextPlaceholder = 1; + literal(str) { + this.#ans += CompletionItem.escape(str); + return this; + } + placeholder(...defaultValues) { + if (defaultValues.length === 0) { + this.#ans += `$\{${this.#nextPlaceholder}}`; + } + else if (defaultValues.length === 1) { + this.#ans += `$\{${this.#nextPlaceholder}:${CompletionItem.escape(defaultValues[0])}}`; + } + else { + this.#ans += `$\{${this.#nextPlaceholder}|${defaultValues.map((v) => v.replace(/([\\$},|])/g, '\\$1')).join(',')}|}`; + } + this.#nextPlaceholder += 1; + return this; + } + exitPlace() { + this.#ans += '$0'; + return this; + } + build() { + return this.#ans; + } + if(condition, callback) { + if (condition) { + callback(this); + } + return this; + } +} +//# sourceMappingURL=Completer.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/completer/builtin.js + + + + + + + +/** + * Uses the shallowest selected node that has its own completer to provide the completion items. + */ +const dispatch = (node, ctx) => { + const child = AstNode.findShallowestChild({ + node: node, + needle: ctx.offset, + endInclusive: true, + predicate: (n) => ctx.meta.hasCompleter(n.type), + }); + return child ? ctx.meta.getCompleter(child.type)(child, ctx) : []; +}; +const completer_builtin_fallback = dispatch; +const completer_builtin_boolean = (node, ctx) => { + return [ + CompletionItem.create('false', node, { kind: 21 /* CompletionKind.Constant */ }), + CompletionItem.create('true', node, { kind: 21 /* CompletionKind.Constant */ }), + ]; +}; +/** + * Dispatches to the corresponding file for the language. + */ +const builtin_file = (node, ctx) => { + const completer = ctx.meta.getCompleterForLanguageID(ctx.doc.languageId); + return completer(node.children[0], ctx); +}; +const completer_builtin_literal = (node) => { + const kind = new Map([ + ['enum', 13 /* CompletionKind.Enum */], + ['enumMember', 20 /* CompletionKind.EnumMember */], + ['function', 3 /* CompletionKind.Function */], + ['keyword', 14 /* CompletionKind.Keyword */], + ['literal', 14 /* CompletionKind.Keyword */], + ['number', 21 /* CompletionKind.Constant */], + ['operator', 24 /* CompletionKind.Operator */], + ['property', 10 /* CompletionKind.Property */], + ['resourceLocation', 17 /* CompletionKind.File */], + ['variable', 6 /* CompletionKind.Variable */], + ]).get(node.options.colorTokenType ?? 'keyword') ?? 14 /* CompletionKind.Keyword */; + return (node.options.pool.map((v) => CompletionItem.create(v, node, { kind })) ?? []); +}; +const completer_builtin_noop = () => []; +const prefixed = (node, ctx) => { + const child = node.children.find(c => c.type !== 'literal'); + if (!child) { + return [CompletionItem.create('!', node)]; + } + const childItems = dispatch(child, ctx); + return childItems.map(item => ({ + ...item, + label: node.prefix + item.label, + filterText: node.prefix + (item.filterText ?? item.label), + insertText: node.prefix + (item.insertText ?? item.label), + })); +}; +function record(o) { + return (node, ctx) => { + if (!node.innerRange || !Range.contains(node.innerRange, ctx.offset, true)) { + return []; + } + const completeKeys = (pair) => o.key(node, pair, ctx, pair?.key ?? ctx.offset, false, false, existingKeys); + const completePairs = (pair) => o.key(node, pair, ctx, pair ?? ctx.offset, true, hasNextPair || !!pair?.end, existingKeys); + const existingKeys = node.children.filter((n) => !!n.key).map((n) => n.key); + const index = binary_search(node.children, ctx.offset, (n, o) => n.end + ? Range.compareOffset(Range.translate(n, 0, -1), o, true) + : Range.compareOffset(n.range, o, true)); + const pair = index >= 0 ? node.children[index] : undefined; + const hasNextPair = !!node.children.find((n) => n.range.start > ctx.offset); + if (!pair) { + return completePairs(undefined); + } + const { key, sep, value } = pair; + if (!key && !sep && !value) { + return completePairs(undefined); + } + if ((key && Range.contains(key, ctx.offset, true)) || (sep && ctx.offset <= sep.start)) { + // Selected key. + if (!value || Range.isEmpty(value.range)) { + return completePairs(pair); + } + return completeKeys(pair); + } + if (value && ctx.offset < value.range.start) { + return o.value(node, pair, ctx, ctx.offset); + } + if ((value && Range.contains(value, ctx.offset, true)) + || (sep && ctx.offset >= sep.end) + || (key && ctx.offset > key.range.end)) { + // Selected value. + return o.value(node, pair, ctx, value ?? ctx.offset); + } + return []; + }; +} +const completer_builtin_resourceLocation = (node, ctx) => { + const config = LinterConfigValue.destruct(ctx.config.lint.idOmitDefaultNamespace); + const includeEmptyNamespace = !node.options.requireCanonical && node.namespace === ''; + const includeDefaultNamespace = node.options.requireCanonical || config?.ruleValue !== true; + const excludeDefaultNamespace = !node.options.requireCanonical && config?.ruleValue !== false; + const getPool = (category) => { + const symbols = ctx.symbols.getVisibleSymbols(category, ctx.doc.uri); + const declarations = Object.entries(symbols).flatMap(([key, symbol]) => SymbolUtil.isDeclared(symbol) ? [key] : []); + return optimizePool(declarations); + }; + const optimizePool = (pool) => { + const defaultNsPrefix = ResourceLocation.DefaultNamespace + ResourceLocation.NamespacePathSep; + const defaultNsIds = []; + const otherIds = []; + for (const id of filterPool(pool)) { + if (id.startsWith(defaultNsPrefix)) { + defaultNsIds.push(id); + } + else { + otherIds.push(id); + } + } + const ans = [ + ...otherIds, + ...(includeDefaultNamespace ? defaultNsIds : []), + ...(excludeDefaultNamespace + ? defaultNsIds.map((id) => id.slice(defaultNsPrefix.length)) + : []), + ...(includeEmptyNamespace + ? defaultNsIds.map((id) => id.slice(ResourceLocation.DefaultNamespace.length)) + : []), + ]; + if (node.options.namespacePathSep === '.') { + return ans.map((v) => v.replace(ResourceLocation.NamespacePathSep, '.')); + } + return ans; + }; + const filterPool = (pool) => { + if (!node.options.implicitPath) { + return pool; + } + const ans = []; + for (const id of pool) { + const sep = id.indexOf(ResourceLocation.NamespacePathSep); + const path = id.slice(sep + 1); + if (path.startsWith(node.options.implicitPath)) { + ans.push(id.slice(0, sep + 1) + path.slice(node.options.implicitPath.length)); + } + } + return ans; + }; + const pool = node.options.pool + ? optimizePool(node.options.pool) + : [ + ...(!node.options.requireTag + ? getPool(node.options.category) + : []), + ...(node.options.allowTag + ? getPool(`tag/${node.options.category}`).map((v) => `${ResourceLocation.TagPrefix}${v}`) + : []), + ]; + const items = pool.map((v) => CompletionItem.create(v, node, { kind: 3 /* CompletionKind.Function */ })); + if (node.options.category) { + const symbols = ctx.symbols.getVisibleSymbols(node.options.category, ctx.doc.uri); + const thisKey = Object.entries(symbols).flatMap(([key, symbol]) => { + if ((symbol.declaration?.[0] ?? symbol.definition?.[0])?.uri === ctx.doc.uri) { + return [key]; + } + return []; + }); + if (thisKey.length > 0) { + items.push(CompletionItem.create('THIS', node, { + kind: 15 /* CompletionKind.Snippet */, + insertText: thisKey[0], + detail: thisKey[0], + })); + } + } + return items; +}; +const builtin_string = (node, ctx) => { + if (node.children?.length) { + return dispatch(node.children[0], ctx).map(item => ({ + ...item, + filterText: escapeString(item.filterText ?? item.label, node.quote), + insertText: escapeString(item.insertText ?? item.label, node.quote), + })); + } + if (node.options.quotes && node.value === '') { + return node.options.quotes.map((q) => CompletionItem.create(`${q}${q}`, node, { + insertText: `${q}$1${q}`, + kind: 12 /* CompletionKind.Value */, + })); + } + return []; +}; +function escapeString(value, quote) { + if (!quote) { + return value; + } + // Un-escape and then re-escape completion + value = CompletionItem.unescape(value); + value = value.replaceAll('\\', '\\\\').replaceAll(quote, '\\"'); + return CompletionItem.escape(value); +} +const completer_builtin_symbol = (node, ctx) => { + const path = node.options.parentPath ?? []; + const symbols = ctx.symbols.query(ctx.doc, node.options.category, ...path).visibleMembers; + return Object.entries(symbols) + .filter(([k, v]) => SymbolUtil.isDeclared(v)) + .map(([k, v]) => CompletionItem.create(k, node, { kind: 6 /* CompletionKind.Variable */ })); +}; +function registerCompleters(meta) { + meta.registerCompleter('boolean', completer_builtin_boolean); + meta.registerCompleter('comment', completer_builtin_noop); + meta.registerCompleter('float', completer_builtin_noop); + meta.registerCompleter('integer', completer_builtin_noop); + meta.registerCompleter('long', completer_builtin_noop); + meta.registerCompleter('literal', completer_builtin_literal); + meta.registerCompleter('prefixed', prefixed); + meta.registerCompleter('resource_location', completer_builtin_resourceLocation); + meta.registerCompleter('string', builtin_string); + meta.registerCompleter('symbol', completer_builtin_symbol); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/completer/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/formatter/builtin.js + +const formatter_builtin_fallback = (node) => { + throw new Error(`No formatter registered for type ${node.type}`); +}; +const builtin_error = (node) => { + return ''; +}; +const formatter_builtin_file = (node, ctx) => { + return node.children.map((child) => { + return ctx.meta.getFormatter(child.type)(child, ctx); + }).join(''); +}; +const formatter_builtin_boolean = (node) => { + return node.value ? 'true' : 'false'; +}; +const builtin_comment = (node) => { + return node.prefix + node.comment; +}; +const builtin_float = (node) => { + return node.value.toString(); +}; +const integer = (node) => { + return node.value.toFixed(); +}; +const formatter_builtin_literal = (node) => { + return node.value; +}; +const builtin_long = (node) => { + return node.value.toString(); +}; +const formatter_builtin_resourceLocation = (node) => { + return ResourceLocationNode.toString(node, 'origin', true); +}; +const formatter_builtin_string = (node) => { + // FIXME: escape this value according to the node's IndexMap and context + return `"${node.value}"`; +}; +function registerFormatters(meta) { + meta.registerFormatter('error', builtin_error); + meta.registerFormatter('file', formatter_builtin_file); + meta.registerFormatter('boolean', formatter_builtin_boolean); + meta.registerFormatter('comment', builtin_comment); + meta.registerFormatter('float', builtin_float); + meta.registerFormatter('integer', integer); + meta.registerFormatter('long', builtin_long); + meta.registerFormatter('literal', formatter_builtin_literal); + meta.registerFormatter('resource_location', formatter_builtin_resourceLocation); + meta.registerFormatter('string', formatter_builtin_string); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/formatter/Formatter.js +function formatterContextIndentation(ctx, additionalLevels = 0) { + const total = ctx.indentLevel + additionalLevels; + return ctx.insertSpaces ? ' '.repeat(total * ctx.tabSize) : '\t'.repeat(total); +} +function indentFormatter(ctx, additionalLevels = 1) { + return { + ...ctx, + indentLevel: ctx.indentLevel + additionalLevels, + indent(additionalLevels) { + return formatterContextIndentation(this, additionalLevels); + }, + }; +} +//# sourceMappingURL=Formatter.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/formatter/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/linter/builtin/undeclaredSymbol.js + + + + +const undeclaredSymbol = (node, ctx) => { + if (!node.symbol || SymbolUtil.isDeclared(node.symbol)) { + return; + } + const action = getAction(ctx.ruleValue, node.symbol, ctx); + if (SymbolLinterConfig.Action.isDeclare(action)) { + ctx.symbols.query({ doc: ctx.doc, node }, node.symbol.category, ...node.symbol.path).amend({ + data: { visibility: getVisibility(action.declare) }, + usage: { type: 'declaration', node }, + }); + } + if (SymbolLinterConfig.Action.isReport(action)) { + const info = {}; + const uriBuilder = ctx.meta.getUriBuilder(node.symbol.category); + if (uriBuilder) { + const uri = uriBuilder(node.symbol.identifier, ctx); + if (uri) { + info.codeAction = { + title: localize('code-action.create-undeclared-file', node.symbol.category, localeQuote(node.symbol.identifier)), + changes: [{ type: 'create', uri }], + }; + } + } + const severityOverride = action.report === 'inherit' + ? undefined + : LinterSeverity.toErrorSeverity(action.report); + ctx.err.lint(localize('linter.undeclared-symbol.message', node.symbol.category, localeQuote(node.symbol.identifier)), node, info, severityOverride); + } +}; +function getAction(config, symbol, ctx) { + if (SymbolLinterConfig.Action.is(config)) { + return config; + } + function test(conditions) { + function testSingleCondition(condition) { + const resourceLocation = ResourceLocation.lengthen(symbol.identifier); + const namespace = resourceLocation.slice(0, resourceLocation.indexOf(ResourceLocation.NamespacePathSep)); + return ((condition.category + ? Arrayable.toArray(condition.category).includes(symbol.category) + : true) + && (condition.namespace + ? Arrayable.toArray(condition.namespace).includes(namespace) + : true) + && (condition.excludeNamespace + ? !Arrayable.toArray(condition.excludeNamespace).includes(namespace) + : true) + && (condition.pattern + ? Arrayable.toArray(condition.pattern).some((p) => new RegExp(p).test(symbol.identifier)) + : true) + && (condition.excludePattern + ? !Arrayable.toArray(condition.excludePattern).some((p) => new RegExp(p).test(symbol.identifier)) + : true)); + } + try { + return Arrayable.toArray(conditions).some(testSingleCondition); + } + catch (e) { + // Illegal RegExp. + ctx.logger.error('[undeclaredSymbol#getAction] Likely encountered an illegal regular expression in the config', e); + return false; + } + } + function evaluateComplexes(complexes) { + for (const complex of Arrayable.toArray(complexes)) { + if (complex.if && !test(complex.if)) { + continue; + } + return complex.override + ? evaluateComplexes(complex.override) ?? complex.then + : complex.then; + } + return undefined; + } + return evaluateComplexes(config); +} +function getVisibility(input) { + switch (input) { + case 'block': + return 0 /* SymbolVisibility.Block */; + case 'file': + return 1 /* SymbolVisibility.File */; + case 'public': + return 2 /* SymbolVisibility.Public */; + } +} +//# sourceMappingURL=undeclaredSymbol.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/linter/builtin.js + + + + + +const linter_builtin_noop = () => { }; +/** + * @param key The name of the key on the {@link AstNode} that contains the value to be validated. + */ +function nameConvention(key) { + return (node, ctx) => { + if (typeof node[key] !== 'string') { + throw new Error(`Trying to access property "${key}" of node type "${node.type}"`); + } + const name = node[key]; + try { + // SECURITY: ReDoS attack. The risk is acceptable at the moment. + const regex = new RegExp(ctx.ruleValue); + if (!name.match(regex)) { + ctx.err.lint(localize('linter.name-convention.illegal', localeQuote(name), localeQuote(ctx.ruleValue)), node); + } + } + catch (e) { + ctx.logger.error(`[nameConvention linter] The value “${ctx.ruleValue}” set for rule “${ctx.ruleName}” is not a valid regular expression.`, e); + } + }; +} +const quote = (node, ctx) => { + const config = ctx.ruleValue; + const mustValueBeQuoted = node.options.unquotable + ? [...node.value].some((c) => !isAllowedCharacter(c, node.options.unquotable)) + : true; + const isQuoteRequired = config.always || mustValueBeQuoted; + const isQuoteProhibited = config.always === false && !mustValueBeQuoted; + const firstChar = ctx.src.slice(node.range.start, node.range.start + 1); + const isFirstCharQuote = !!node.options.quotes?.includes(firstChar); + if (isQuoteRequired) { + if (isFirstCharQuote) { + // TODO: Check type + config.avoidEscape; + config.type; + } + else { + // TODO: Error quote expected + } + } + else if (isQuoteProhibited && isFirstCharQuote) { + // TODO: Error no quote expected + } +}; +var configValidator; +(function (configValidator) { + function getDocLink(name) { + return `https://spyglassmc.com/user/lint/${name}`; + } + function wrapError(name, msg) { + return `[Invalid Linter Config] [${name}] ${localize('linter-config-validator.wrapper', msg, getDocLink(name))}`; + } + function nameConvention(name, val, logger) { + if (typeof val !== 'string') { + logger.error(wrapError(name, localize('linter-config-validator.name-convention.type'))); + return false; + } + try { + // SECURITY: ReDoS attack. The risk is acceptable at the moment. + new RegExp(val); + } + catch (e) { + logger.error(wrapError(name, localize('')), e); + return false; + } + return true; + } + configValidator.nameConvention = nameConvention; + function symbolLinterConfig(_name, value, _logger) { + return SymbolLinterConfig.is(value); + } + configValidator.symbolLinterConfig = symbolLinterConfig; +})(configValidator || (configValidator = {})); +function registerLinters(meta) { + meta.registerLinter('nameOfObjective', { + configValidator: configValidator.nameConvention, + linter: nameConvention('value'), + nodePredicate: (n) => n.symbol && n.symbol.category === 'objective', + }); + meta.registerLinter('nameOfScoreHolder', { + configValidator: configValidator.nameConvention, + linter: nameConvention('value'), + nodePredicate: (n) => n.symbol && n.symbol.category === 'score_holder', + }); + meta.registerLinter('nameOfTag', { + configValidator: configValidator.nameConvention, + linter: nameConvention('value'), + nodePredicate: (n) => n.symbol && n.symbol.category === 'tag', + }); + meta.registerLinter('nameOfTeam', { + configValidator: configValidator.nameConvention, + linter: nameConvention('value'), + nodePredicate: (n) => n.symbol && n.symbol.category === 'team', + }); + meta.registerLinter('undeclaredSymbol', { + configValidator: configValidator.symbolLinterConfig, + linter: undeclaredSymbol, + nodePredicate: (n) => n.symbol && !McdocCategories.includes(n.symbol.category), + }); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/linter/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/processor/index.js + + + + + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/ErrorReporter.js + + +class ErrorReporter { + source; + errors = []; + constructor(source) { + this.source = source; + } + /** + * Reports a new error. + */ + report(message, range, severity = 3 /* ErrorSeverity.Error */, info) { + if (message.trim() === '') { + throw new Error('Tried to report an error with no message'); + } + this.errors.push(LanguageError.create(message, Range.get(range), severity, info, this.source)); + } + /** + * @returns All reported errors, and then clears the error stack. + */ + dump() { + const ans = Object.freeze(this.errors); + this.errors = []; + return ans; + } + /** + * Adds all errors from another reporter's error stack to the current reporter. + * This method does not affect the passed-in reporter. + */ + absorb(reporter) { + this.errors.push(...reporter.errors); + } +} +class LinterErrorReporter extends ErrorReporter { + ruleName; + ruleSeverity; + constructor(ruleName, ruleSeverity, source) { + super(source); + this.ruleName = ruleName; + this.ruleSeverity = ruleSeverity; + } + lint(message, range, info, severityOverride) { + return this.report(localize('linter.diagnostic-message-wrapper', message, this.ruleName), range, severityOverride ?? this.ruleSeverity, info); + } + static fromErrorReporter(reporter, ruleName, ruleSeverity) { + const ans = new LinterErrorReporter(ruleName, ruleSeverity, reporter.source); + ans.errors = reporter.errors; + return ans; + } +} +//# sourceMappingURL=ErrorReporter.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Context.js +/* istanbul ignore file */ + + + +var ContextBase; +(function (ContextBase) { + function create(project) { + return { + fs: project.fs, + isDebugging: project.isDebugging, + logger: project.logger, + meta: project.meta, + profilers: project.profilers, + roots: project.roots, + project: project.ctx, + }; + } + ContextBase.create = create; +})(ContextBase || (ContextBase = {})); +var ParserContext; +(function (ParserContext) { + function create(project, opts) { + return { + ...ContextBase.create(project), + config: project.config, + doc: opts.doc, + err: opts.err ?? new ErrorReporter(project.ctx['errorSource']), + }; + } + ParserContext.create = create; +})(ParserContext || (ParserContext = {})); +var ProcessorContext; +(function (ProcessorContext) { + function create(project, opts) { + return { + ...ContextBase.create(project), + config: project.config, + doc: opts.doc, + src: opts.src ?? new ReadonlySource(opts.doc.getText()), + symbols: project.symbols, + }; + } + ProcessorContext.create = create; +})(ProcessorContext || (ProcessorContext = {})); +var ProcessorWithRangeContext; +(function (ProcessorWithRangeContext) { + function create(project, opts) { + return { ...ProcessorContext.create(project, opts), range: opts.range }; + } + ProcessorWithRangeContext.create = create; +})(ProcessorWithRangeContext || (ProcessorWithRangeContext = {})); +var ProcessorWithOffsetContext; +(function (ProcessorWithOffsetContext) { + function create(project, opts) { + return { ...ProcessorContext.create(project, opts), offset: opts.offset }; + } + ProcessorWithOffsetContext.create = create; +})(ProcessorWithOffsetContext || (ProcessorWithOffsetContext = {})); +var BinderContext; +(function (BinderContext) { + function create(project, opts) { + return { + ...ProcessorContext.create(project, opts), + err: opts.err ?? new ErrorReporter(project.ctx['errorSource']), + ensureBindingStarted: project.ensureBindingStarted?.bind(project), + }; + } + BinderContext.create = create; +})(BinderContext || (BinderContext = {})); +var CheckerContext; +(function (CheckerContext) { + function create(project, opts) { + return { + ...ProcessorContext.create(project, opts), + err: opts.err ?? new ErrorReporter(project.ctx['errorSource']), + ensureBindingStarted: project.ensureBindingStarted?.bind(project), + }; + } + CheckerContext.create = create; +})(CheckerContext || (CheckerContext = {})); +var LinterContext; +(function (LinterContext) { + function create(project, opts) { + return { + ...ProcessorContext.create(project, opts), + err: opts.err, + ruleName: opts.ruleName, + ruleValue: opts.ruleValue, + }; + } + LinterContext.create = create; +})(LinterContext || (LinterContext = {})); +var FormatterContext; +(function (FormatterContext) { + function create(project, opts) { + return { + ...ProcessorContext.create(project, opts), + ...opts, + indentLevel: 0, + indent(additionalLevels) { + return formatterContextIndentation(this, additionalLevels); + }, + }; + } + FormatterContext.create = create; +})(FormatterContext || (FormatterContext = {})); +var CodeActionProviderContext; +(function (CodeActionProviderContext) { + function create(project, opts) { + return { ...ProcessorContext.create(project, opts), range: opts.range }; + } + CodeActionProviderContext.create = create; +})(CodeActionProviderContext || (CodeActionProviderContext = {})); +var ColorizerContext; +(function (ColorizerContext) { + function create(project, opts) { + return ProcessorWithRangeContext.create(project, opts); + } + ColorizerContext.create = create; +})(ColorizerContext || (ColorizerContext = {})); +var CompleterContext; +(function (CompleterContext) { + function create(project, opts) { + return { + ...ProcessorContext.create(project, opts), + offset: opts.offset, + triggerCharacter: opts.triggerCharacter, + }; + } + CompleterContext.create = create; +})(CompleterContext || (CompleterContext = {})); +var SignatureHelpProviderContext; +(function (SignatureHelpProviderContext) { + function create(project, opts) { + return ProcessorWithOffsetContext.create(project, opts); + } + SignatureHelpProviderContext.create = create; +})(SignatureHelpProviderContext || (SignatureHelpProviderContext = {})); +var UriBinderContext; +(function (UriBinderContext) { + function create(project) { + return { ...ContextBase.create(project), config: project.config, symbols: project.symbols }; + } + UriBinderContext.create = create; +})(UriBinderContext || (UriBinderContext = {})); +var UriPredicateContext; +(function (UriPredicateContext) { + function create(project) { + return { ...ContextBase.create(project) }; + } + UriPredicateContext.create = create; +})(UriPredicateContext || (UriPredicateContext = {})); +//# sourceMappingURL=Context.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Dependency.js +var DependencyKey; +(function (DependencyKey) { + function is(value) { + return value.startsWith('@'); + } + DependencyKey.is = is; +})(DependencyKey || (DependencyKey = {})); +//# sourceMappingURL=Dependency.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Downloader.js + + +class Downloader { + cacheRoot; + externals; + logger; + #memoryCache = new Map(); + constructor(cacheRoot, externals, logger) { + this.cacheRoot = cacheRoot; + this.externals = externals; + this.logger = logger; + } + async download(job, out = {}) { + const { id, cache, uri, options, transformer, ttl } = job; + if (ttl && this.#memoryCache.has(uri)) { + const memoryCacheEntry = this.#memoryCache.get(uri); + const { buffer, time, cacheUri, checksum } = memoryCacheEntry; + if (performance.now() <= time + ttl) { + this.logger.info(`[Downloader] [${id}] Skipped thanks to valid cache in memory`); + out.cacheUri = cacheUri; + out.checksum = checksum; + return await transformer(buffer); + } + else { + this.#memoryCache.delete(uri); + } + } + let checksum; + let cacheUri; + let cacheChecksumUri; + if (cache) { + const { checksumJob, checksumExtension } = cache; + out.cacheUri = cacheUri = new Uri(`downloader/${id}`, this.cacheRoot).toString(); + cacheChecksumUri = new Uri(`downloader/${id}${checksumExtension}`, this.cacheRoot) + .toString(); + try { + out.checksum = checksum = await this.download({ + ...checksumJob, + id: id + checksumExtension, + }); + try { + const cacheChecksum = bufferToString(await fileUtil.readFile(this.externals, cacheChecksumUri)).slice(0, -1); // Remove ending newline + if (checksum === cacheChecksum) { + try { + const cachedBuffer = await fileUtil.readFile(this.externals, cacheUri); + if (ttl) { + this.#memoryCache.set(uri, { + buffer: cachedBuffer, + cacheUri, + checksum, + time: performance.now(), + }); + } + const deserializer = cache.deserializer ?? ((b) => b); + const ans = await transformer(deserializer(cachedBuffer)); + this.logger.info(`[Downloader] [${id}] Skipped downloading thanks to cache ${cacheChecksum} (${cachedBuffer.length} bytes)`); + return ans; + } + catch (e) { + this.logger.error(`[Downloader] [${id}] Loading cached file ${cacheUri}`, e); + if (this.externals.error.isKind(e, 'ENOENT')) { + // Cache checksum exists, but cached file doesn't. + // Remove the invalid cache checksum. + try { + await this.externals.fs.unlink(cacheChecksumUri); + } + catch (e) { + this.logger.error(`[Downloader] [${id}] Removing invalid cache checksum ${cacheChecksumUri}`, e); + } + } + } + } + } + catch (e) { + if (!this.externals.error.isKind(e, 'ENOENT')) { + this.logger.error(`[Downloader] [${id}] Loading cache checksum ${cacheChecksumUri}`, e); + } + } + } + catch (e) { + this.logger.error(`[Downloader] [${id}] Fetching latest checksum ${checksumJob.uri}`, e); + } + } + try { + const buffer = await this.externals.downloader.get(uri, options); + if (ttl) { + this.#memoryCache.set(uri, { buffer, time: performance.now() }); + } + if (cache && cacheUri && cacheChecksumUri) { + if (checksum) { + try { + await fileUtil.writeFile(this.externals, cacheChecksumUri, `${checksum}\n`); + } + catch (e) { + this.logger.error(`[Downloader] [${id}] Saving cache checksum ${cacheChecksumUri}`, e); + } + } + try { + const serializer = cache.serializer ?? ((b) => b); + await fileUtil.writeFile(this.externals, cacheUri, serializer(buffer)); + } + catch (e) { + this.logger.error(`[Downloader] [${id}] Caching file ${cacheUri}`, e); + } + } + this.logger.info(`[Downloader] [${id}] Downloaded from ${uri} (${buffer.length} bytes)`); + return await transformer(buffer); + } + catch (e) { + this.logger.error(`[Downloader] [${id}] Downloading ${uri}`, e); + if (cache && cacheUri) { + try { + const cachedBuffer = await fileUtil.readFile(this.externals, cacheUri); + const deserializer = cache.deserializer ?? ((b) => b); + const ans = await transformer(deserializer(cachedBuffer)); + this.logger.warn(`[Downloader] [${id}] Fell back to cached file ${cacheUri} (${cachedBuffer.length} bytes)`); + return ans; + } + catch (e) { + this.logger.error(`[Downloader] [${id}] Fallback: loading cached file ${cacheUri}`, e); + } + } + } + return undefined; + } +} +//# sourceMappingURL=Downloader.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Hover.js + +var Hover; +(function (Hover) { + /* istanbul ignore next */ + function create(range, markdown) { + return { range: Range.get(range), markdown }; + } + Hover.create = create; +})(Hover || (Hover = {})); +//# sourceMappingURL=Hover.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/MetaRegistry.js + + +/* istanbul ignore next */ +/** + * The meta registry of Spyglass. You can register new parsers, processors, and languages here. + */ +class MetaRegistry { + /** + * A map from language IDs to language options. + */ + #languages = new Map(); + #binders = new Map(); + #checkers = new Map(); + #colorizers = new Map(); + #codeActionProviders = new Map(); + #completers = new Map(); + #dependencyProviders = new Map(); + #formatters = new Map(); + #inlayHintProviders = new Set(); + #linters = new Map(); + #parsers = new Map(); + #signatureHelpProviders = new Set(); + #symbolRegistrars = new Map(); + #custom = new Map(); + #uriBinders = new Set(); + #uriBuilders = new Map(); + #uriSorter = () => 0; + constructor() { + registerBinders(this); + registerCheckers(this); + registerProviders(this); + registerColorizers(this); + registerCompleters(this); + registerFormatters(this); + registerLinters(this); + } + /** + * Registers a new language. + * @param languageID The language ID. e.g. `"mcfunction"` + * @param options The language options for this language. + */ + registerLanguage(languageID, options) { + this.#languages.set(languageID, options); + } + /** + * An array of all registered language IDs. + */ + getLanguages() { + return Array.from(this.#languages.keys()); + } + getLanguageOptions(language) { + return this.#languages.get(language); + } + /** + * An array of characters that trigger a completion request. + */ + getTriggerCharacters() { + return Array.from(this.#languages.values()).flatMap((v) => v.triggerCharacters ?? []); + } + /** + * @param fileExtension The file extension including the leading dot. e.g. `".mcfunction"`. + * @returns The language ID registered for the file extension, or `undefined`. + */ + getLanguageID(fileExtension) { + for (const [languageID, { extensions }] of this.#languages) { + if (extensions.includes(fileExtension)) { + return languageID; + } + } + return undefined; + } + hasBinder(type) { + return this.#binders.has(type); + } + getBinder(type) { + return this.#binders.get(type) ?? fallback; + } + registerBinder(type, binder) { + this.#binders.set(type, binder); + } + hasChecker(type) { + return this.#checkers.has(type); + } + getChecker(type) { + return this.#checkers.get(type) ?? builtin_fallback; + } + registerChecker(type, checker) { + this.#checkers.set(type, checker); + } + hasCodeActionProvider(type) { + return this.#codeActionProviders.has(type); + } + getCodeActionProvider(type) { + return this.#codeActionProviders.get(type) ?? codeActions_builtin_fallback; + } + registerCodeActionProvider(type, codeActionProvider) { + this.#codeActionProviders.set(type, codeActionProvider); + } + hasColorizer(type) { + return this.#colorizers.has(type); + } + getColorizer(type) { + return this.#colorizers.get(type) ?? colorizer_builtin_fallback; + } + registerColorizer(type, colorizer) { + this.#colorizers.set(type, colorizer); + } + hasCompleter(type) { + return this.#completers.has(type); + } + getCompleter(type) { + return this.#completers.get(type) ?? completer_builtin_fallback; + } + registerCompleter(type, completer) { + this.#completers.set(type, completer); + } + shouldComplete(languageID, triggerCharacter) { + const language = this.#languages.get(languageID); + return (!triggerCharacter || !!language?.triggerCharacters?.includes(triggerCharacter)); + } + getCompleterForLanguageID(languageID) { + return this.#languages.get(languageID)?.completer ?? completer_builtin_fallback; + } + getDependencyProvider(key) { + return this.#dependencyProviders.get(key); + } + registerDependencyProvider(key, provider) { + this.#dependencyProviders.set(key, provider); + } + hasFormatter(type) { + return this.#formatters.has(type); + } + getFormatter(type) { + return this.#formatters.get(type) ?? formatter_builtin_fallback; + } + registerFormatter(type, formatter) { + this.#formatters.set(type, formatter); + } + registerInlayHintProvider(provider) { + this.#inlayHintProviders.add(provider); + } + get inlayHintProviders() { + return this.#inlayHintProviders; + } + getLinter(ruleName) { + return (this.#linters.get(ruleName) + ?? { configValidator: () => false, linter: linter_builtin_noop, nodePredicate: () => false }); + } + registerLinter(ruleName, options) { + this.#linters.set(ruleName, options); + } + hasParser(id) { + return this.#parsers.has(id); + } + getParser(id) { + const ans = this.#parsers.get(id); + if (!ans) { + throw new Error(`There is no parser '${id}'`); + } + return ans; + } + getParserLazily(id) { + return Lazy.create(() => this.getParser(id)); + } + registerParser(id, parser) { + this.#parsers.set(id, parser); + } + /** + * @returns The corresponding `Parser` for the language ID. + * @throws If there's no such language in the registry. + */ + getParserForLanguageId(languageID) { + if (this.#languages.has(languageID)) { + return this.#languages.get(languageID).parser; + } + throw new Error(`There is no parser registered for language ID '${languageID}'`); + } + registerSignatureHelpProvider(provider) { + this.#signatureHelpProviders.add(provider); + } + get signatureHelpProviders() { + return this.#signatureHelpProviders; + } + registerSymbolRegistrar(id, registrar) { + this.#symbolRegistrars.set(id, registrar); + } + get symbolRegistrars() { + return this.#symbolRegistrars; + } + registerCustom(group, id, object) { + let groupRegistry = this.#custom.get(group); + if (!groupRegistry) { + groupRegistry = new Map(); + this.#custom.set(group, groupRegistry); + } + groupRegistry.set(id, object); + } + getCustom(group) { + return this.#custom.get(group); + } + registerUriBinder(uriBinder) { + this.#uriBinders.add(uriBinder); + } + get uriBinders() { + return this.#uriBinders; + } + hasUriBuilder(category) { + return this.#uriBuilders.has(category); + } + getUriBuilder(category) { + return this.#uriBuilders.get(category); + } + registerUriBuilder(category, builder) { + this.#uriBuilders.set(category, builder); + } + setUriSorter(uriSorter) { + const nextSorter = this.#uriSorter; + this.#uriSorter = (a, b) => uriSorter(a, b, nextSorter); + } + get uriSorter() { + return this.#uriSorter; + } +} +//# sourceMappingURL=MetaRegistry.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Profiler.js + +class TopNImpl { + id; + logger; + n; + #finalized = false; + #startTime; + #lastTime; + #taskCount = 0; + #topTasks = []; + #minTime = Infinity; + #maxTime = 0; + constructor(id, logger, n) { + this.id = id; + this.logger = logger; + this.n = n; + this.#startTime = this.#lastTime = performance.now(); + } + task(name) { + if (this.#finalized) { + throw new Error('The profiler has already been finalized'); + } + this.#taskCount++; + const time = performance.now(); + const duration = time - this.#lastTime; + this.#lastTime = time; + this.#minTime = Math.min(this.#minTime, duration); + this.#maxTime = Math.max(this.#maxTime, duration); + this.#topTasks.push([name, duration]); + this.#topTasks.sort((a, b) => b[1] - a[1]); + if (this.#topTasks.length > this.n) { + this.#topTasks = this.#topTasks.slice(0, -1); + } + return this; + } + finalize() { + this.#finalized = true; + const longestTaskNameLength = this.#topTasks.reduce((length, [name]) => Math.max(length, name.length), 0); + const totalDuration = this.#lastTime - this.#startTime; + this.logger.info(`[Profiler: ${this.id}] == Summary ==`); + this.logger.info(`[Profiler: ${this.id}] Total tasks: ${this.#taskCount} done in ${totalDuration} ms`); + this.logger.info(`[Profiler: ${this.id}] Min/Avg/Max: ${this.#minTime} / ${totalDuration / this.#taskCount} / ${this.#maxTime} ms`); + this.logger.info(`[Profiler: ${this.id}] Top ${Math.min(this.n, this.#topTasks.length)} task(s):`); + for (const [name, time] of this.#topTasks) { + this.logger.info(`[Profiler: ${this.id}] ${name}${' '.repeat(longestTaskNameLength - name.length)} - ${time} ms (${(time / totalDuration) * 100}%)`); + } + } +} +const TotalTaskName = 'Total'; +class TotalImpl { + id; + logger; + #finalized = false; + #startTime; + #lastTime; + #tasks = []; + #longestTaskNameLength = 0; + constructor(id, logger) { + this.id = id; + this.logger = logger; + this.#startTime = this.#lastTime = performance.now(); + } + task(name) { + if (this.#finalized) { + throw new Error('The profiler is finalized.'); + } + const time = performance.now(); + const duration = time - this.#lastTime; + this.#lastTime = time; + this.#tasks.push([name, duration]); + this.#longestTaskNameLength = Math.max(this.#longestTaskNameLength, name.length); + this.logger.info(`[Profiler: ${this.id}] Done: ${name} in ${duration} ms`); + return this; + } + finalize() { + this.#finalized = true; + this.#tasks.push([TotalTaskName, this.#lastTime - this.#startTime]); + this.#longestTaskNameLength = Math.max(this.#longestTaskNameLength, TotalTaskName.length); + this.logger.info(`[Profiler: ${this.id}] == Summary ==`); + for (const [name, time] of this.#tasks) { + this.logger.info(`[Profiler: ${this.id}] ${name}${' '.repeat(this.#longestTaskNameLength - name.length)} - ${time} ms`); + } + } +} +class NoopImpl { + task() { + return this; + } + finalize() { } +} +class ProfilerFactory { + logger; + #enabledProfilers; + constructor(logger, enabledProfilers) { + this.logger = logger; + this.#enabledProfilers = new Set(enabledProfilers); + } + get(id, style = 'total', n) { + if (this.#enabledProfilers.has(id)) { + switch (style) { + case 'top-n': + return new TopNImpl(id, this.logger, n); + case 'total': + return new TotalImpl(id, this.logger); + default: + return Dev.assertNever(style); + } + } + else { + return new NoopImpl(); + } + } + static noop() { + return new ProfilerFactory(Logger.noop(), []); + } +} +//# sourceMappingURL=Profiler.js.map +// EXTERNAL MODULE: ./node_modules/picomatch/index.js +var picomatch = __nccwpck_require__(4006); +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Project.js +var Project_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; + + + + + + + + + + + + + + + + + + +const CacheAutoSaveInterval = 600_000; // 10 Minutes. +/* istanbul ignore next */ +/** + * Manage all tracked documents and errors. + * + * The four stages of processing a document: + * 1. `read` - read the file from the external file system as a `TextDocument`. + * 2. `parse` - Parse the `TextDocument` into an `AstNode`. + * 3. `bind` - Bind the `AstNode` and populate both the global symbol table and the local symbol tables on the nodes. + * 4. `check` (includes `lint`) - Check the `AstNode` with information from the symbol tables. + * + * **Caching** + * + * The global symbol table along with a list of file URIs and checksums is cached in memory and is periodically saved to disk. + * + * The `TextDocument`s and file `AstNode`s (including their local symbol tables) managed by the client are stored in memory until the client sends a `didClose` notification. + * + * Some `TextDocument`s may be cached to avoid excessive reading from the file system. + * + * **INIT and READY** + * + * When a new instance of the {@link Project} class is constructed, its INIT and READY processes are immediately started in serial. + * + * During the INIT process of the project, the config and language feature initialization are processed. + * The Promise returned by the {@link init} function resolves when the INIT process is complete. + * + * During the READY process of the project, the whole project is analyzed mainly to populate the global symbol table. + * The Promise returned by the {@link ready} function resolves when the READY process is complete. + * + * The following generally happens during the READY process: + * 1. A list of file URIs under the project is obtained. + * 2. The global symbol cache, if available, is loaded and validated against the know list of files. + * A list of files that need to be (re)processed is returned in this step. + * 3. For each files in the new list, the file is read, parsed, bound, and checked. + * + * **EDITING** + * + * After the READY process is complete, editing text documents as signaled by the client or the file watcher results in the file being re-processed. + */ +class Project { + static RootSuffix = '/pack.mcmeta'; + /** Prevent circular binding. */ + #bindingInProgressUris = new Set(); + #cacheSaverIntervalId; + cacheService; + /** URI of files that are currently managed by the language client. */ + #clientManagedUris = new Set(); + #clientManagedDocAndNodes = new Map(); + #configService; + #symbolUpToDateUris = new Set(); + #eventEmitter; + #initializers; + #initPromise; + #readyPromise; + #watchedFiles = new Set(); + #watcher; + #watcherReady = false; + #isReady = false; + get isReady() { + return this.#isReady; + } + config; + downloader; + externals; + fs; + isDebugging; + logger; + meta = new MetaRegistry(); + profilers; + projectRoots; + symbols; + #dependencyRoots; + #dependencyFiles; + #roots = []; + /** + * All tracked root URIs. Each URI in this array is guaranteed to end with a slash (`/`). + * + * Includes the roots of all dependencies, the project root, and all data pack roots identified + * by `pack.mcmeta` files. + * + * Some URIs in the array may overlap with each other. In such cases, the deeper ones are guaranteed to come + * before the shallower ones (e.g. `file:///foo/bar/` will come before `file:///foo/`). + */ + get roots() { + return this.#roots; + } + #ctx; + /** + * Arbitrary information that will be included in the `project` property of all `Context`s. + */ + get ctx() { + return this.#ctx; + } + #cacheRoot; + /** + * File URI to a directory where all cache files of Spyglass should be stored. + */ + get cacheRoot() { + return this.#cacheRoot; + } + updateRoots() { + const rawRoots = [...this.#dependencyRoots ?? [], ...this.projectRoots]; + const ans = new Set(rawRoots); + // Identify roots indicated by `pack.mcmeta`. + for (const file of this.getTrackedFiles()) { + if (file.endsWith(Project.RootSuffix) && rawRoots.some((r) => file.startsWith(r))) { + ans.add(file.slice(0, 1 - Project.RootSuffix.length)); + } + } + this.#roots = [...ans].sort((a, b) => b.length - a.length); + this.emit('rootsUpdated', { roots: this.#roots }); + } + on(event, callbackFn) { + this.#eventEmitter.on(event, callbackFn); + return this; + } + once(event, callbackFn) { + this.#eventEmitter.once(event, callbackFn); + return this; + } + emit(event, ...args) { + return this.#eventEmitter.emit(event, ...args); + } + /** + * Get all files that are tracked and supported. + * + * Files in cached archives may not show up in the result as those files + * are not loaded into the memory. + */ + getTrackedFiles() { + const supportedFiles = [...this.#dependencyFiles ?? [], ...this.#watchedFiles]; + this.logger.info(`[Project#getTrackedFiles] Listed ${supportedFiles.length} supported files`); + return supportedFiles; + } + constructor({ cacheRoot, defaultConfig, downloader, externals, fs = FileService.create(externals, cacheRoot), initializers = [], isDebugging = false, logger = Logger.create(), profilers = ProfilerFactory.noop(), projectRoots, }) { + this.#cacheRoot = cacheRoot; + this.#eventEmitter = new externals.event.EventEmitter(); + this.externals = externals; + this.fs = fs; + this.#initializers = initializers; + this.isDebugging = isDebugging; + this.logger = logger; + this.profilers = profilers; + this.projectRoots = projectRoots; + this.cacheService = new CacheService(cacheRoot, this); + this.#configService = new ConfigService(this, defaultConfig); + this.downloader = downloader ?? new Downloader(cacheRoot, externals, logger); + this.symbols = new SymbolUtil({}, externals.event.EventEmitter); + this.#ctx = {}; + this.logger.info(`[Project] [init] cacheRoot = ${cacheRoot}`); + this.logger.info(`[Project] [init] projectRoots = ${projectRoots.join(' ')}`); + this.#configService.on('changed', ({ config }) => { + this.config = config; + this.logger.info('[Project] [Config] Changed'); + }).on('error', ({ error, uri }) => this.logger.error(`[Project] [Config] Failed loading ${uri}`, error)); + this.setInitPromise(); + this.setReadyPromise(); + this.#cacheSaverIntervalId = setInterval(() => this.cacheService.save(), CacheAutoSaveInterval); + this.on('documentUpdated', ({ doc, node }) => { + // if (!this.#isReady) { + // return + // } + this.emit('documentErrored', { + errors: FileNode.getErrors(node).map((e) => LanguageError.withPosRange(e, doc)), + uri: doc.uri, + version: doc.version, + }); + }).on('documentRemoved', ({ uri }) => { + this.emit('documentErrored', { errors: [], uri }); + }).on('fileCreated', async ({ uri }) => { + if (uri.endsWith(Project.RootSuffix)) { + this.updateRoots(); + } + this.bindUri(uri); + return this.ensureBindingStarted(uri); + }).on('fileModified', async ({ uri }) => { + this.#symbolUpToDateUris.delete(uri); + if (this.isOnlyWatched(uri)) { + await this.ensureBindingStarted(uri); + } + }).on('fileDeleted', ({ uri }) => { + if (uri.endsWith(Project.RootSuffix)) { + this.updateRoots(); + } + this.#symbolUpToDateUris.delete(uri); + this.symbols.clear({ uri }); + this.tryClearingCache(uri); + }).on('ready', () => { + this.#isReady = true; + // Recheck client managed files after the READY process, as they may have incomplete results and are user-facing. + const promises = []; + for (const { doc, node } of this.#clientManagedDocAndNodes.values()) { + promises.push(this.check(doc, node)); + } + Promise.all(promises).catch(e => this.logger.error('[Project#ready] Error occurred when rechecking client managed files after READY', e)); + }); + } + setInitPromise() { + const callIntializers = async () => { + const initCtx = { + cacheRoot: this.cacheRoot, + config: this.config, + downloader: this.downloader, + externals: this.externals, + isDebugging: this.isDebugging, + logger: this.logger, + meta: this.meta, + projectRoots: this.projectRoots, + }; + const results = await Promise.allSettled(this.#initializers.map((init) => init(initCtx))); + let ctx = {}; + results.forEach(async (r, i) => { + if (r.status === 'rejected') { + this.logger.error(`[Project] [callInitializers] [${i}] “${this.#initializers[i].name}”`, r.reason); + } + else if (r.value) { + ctx = { ...ctx, ...r.value }; + } + }); + this.#ctx = ctx; + }; + const init = async () => { + const __profiler = this.profilers.get('project#init'); + const { symbols } = await this.cacheService.load(); + this.symbols = new SymbolUtil(symbols, this.externals.event.EventEmitter); + this.symbols.buildCache(); + __profiler.task('Load Cache'); + this.config = await this.#configService.load(); + __profiler.task('Load Config'); + await callIntializers(); + __profiler.task('Initialize').finalize(); + }; + this.#initPromise = init(); + } + setReadyPromise() { + const getDependencies = async () => { + const ans = []; + for (const dependency of this.config.env.dependencies) { + if (DependencyKey.is(dependency)) { + const provider = this.meta.getDependencyProvider(dependency); + if (provider) { + try { + ans.push(await provider()); + this.logger.info(`[Project] [getDependencies] Executed provider “${dependency}”`); + } + catch (e) { + this.logger.error(`[Project] [getDependencies] Bad provider “${dependency}”`, e); + } + } + else { + this.logger.error(`[Project] [getDependencies] Bad dependency “${dependency}”: no associated provider`); + } + } + else { + ans.push({ uri: dependency }); + } + } + return ans; + }; + const listDependencyFiles = async () => { + const dependencies = await getDependencies(); + const fileUriSupporter = await FileUriSupporter.create(dependencies, this.externals, this.logger); + const archiveUriSupporter = await ArchiveUriSupporter.create(dependencies, this.externals, this.logger); + this.fs.register('file:', fileUriSupporter, true); + this.fs.register(ArchiveUriSupporter.Protocol, archiveUriSupporter, true); + }; + const listProjectFiles = () => new Promise((resolve) => { + if (this.projectRoots.length === 0) { + resolve(); + return; + } + this.#watchedFiles.clear(); + this.#watcherReady = false; + this.#watcher = this.externals.fs.watch(this.projectRoots, { + usePolling: this.config.env.useFilePolling, + }).once('ready', () => { + this.#watcherReady = true; + resolve(); + }).on('add', (uri) => { + if (this.shouldExclude(uri)) { + return; + } + this.#watchedFiles.add(uri); + if (this.#watcherReady) { + this.emit('fileCreated', { uri }); + } + }).on('change', (uri) => { + if (this.shouldExclude(uri)) { + return; + } + if (this.#watcherReady) { + this.emit('fileModified', { uri }); + } + }).on('unlink', (uri) => { + if (this.shouldExclude(uri)) { + return; + } + this.#watchedFiles.delete(uri); + if (this.#watcherReady) { + this.emit('fileDeleted', { uri }); + } + }).on('error', (e) => { + this.logger.error('[Project] [chokidar]', e); + }); + }); + const ready = async () => { + await this.init(); + const __profiler = this.profilers.get('project#ready'); + await Promise.all([listDependencyFiles(), listProjectFiles()]); + this.#dependencyFiles = new Set([...this.fs.listFiles()] + .filter((uri) => !this.shouldExclude(uri))); + this.#dependencyRoots = new Set(this.fs.listRoots()); + this.updateRoots(); + __profiler.task('List URIs'); + for (const [id, { checksum, registrar }] of this.meta.symbolRegistrars) { + const cacheChecksum = this.cacheService.checksums.symbolRegistrars[id]; + if (cacheChecksum === undefined || checksum !== cacheChecksum) { + this.symbols.clear({ contributor: `symbol_registrar/${id}` }); + this.symbols.contributeAs(`symbol_registrar/${id}`, () => { + registrar(this.symbols, { logger: this.logger }); + }); + this.emit('symbolRegistrarExecuted', { id, checksum }); + } + else { + this.logger.info(`[SymbolRegistrar] Skipped “${id}” thanks to cache ${checksum}`); + } + } + __profiler.task('Register Symbols'); + for (const [uri, values] of Object.entries(this.cacheService.errors)) { + this.emit('documentErrored', { errors: values, uri }); + } + __profiler.task('Pop Errors'); + const { addedFiles, changedFiles, removedFiles } = await this.cacheService.validate(); + for (const uri of removedFiles) { + this.emit('fileDeleted', { uri }); + } + __profiler.task('Validate Cache'); + if (addedFiles.length > 0) { + this.bindUri(addedFiles); + } + __profiler.task('Bind URIs'); + const files = [...addedFiles, ...changedFiles].sort(this.meta.uriSorter); + __profiler.task('Sort URIs'); + const fileCountByExtension = new Map(); + for (const file of files) { + const ext = fileUtil.extname(file)?.replace(/^\./, ''); + if (ext) { + fileCountByExtension.set(ext, (fileCountByExtension.get(ext) ?? 0) + 1); + } + } + this.logger.info(`[Project#ready] == Files to bind ==`); + for (const [ext, count] of fileCountByExtension.entries()) { + this.logger.info(`[Project#ready] File extension ${ext}: ${count}`); + } + const __bindProfiler = this.profilers.get('project#ready#bind', 'top-n', 50); + for (const uri of files) { + await this.ensureBindingStarted(uri); + __bindProfiler.task(uri); + } + __bindProfiler.finalize(); + __profiler.task('Bind Files'); + __profiler.finalize(); + this.emit('ready', {}); + }; + this.#isReady = false; + this.#readyPromise = ready(); + } + /** + * Load the config file and initialize parsers and processors. + */ + async init() { + await this.#initPromise; + return this; + } + /** + * Finish the initial run of parsing, binding, and checking the entire project. + */ + async ready() { + await this.#readyPromise; + return this; + } + /** + * Behavior of the `Project` instance is undefined after this function has settled. + */ + async close() { + clearInterval(this.#cacheSaverIntervalId); + await this.#watcher.close(); + await this.cacheService.save(); + } + async restart() { + try { + await this.#watcher.close(); + this.#bindingInProgressUris.clear(); + this.#symbolUpToDateUris.clear(); + this.setReadyPromise(); + await this.ready(); + } + catch (e) { + this.logger.error('[Project#reset]', e); + } + } + resetCache() { + this.logger.info('[Project#resetCache] Initiated...'); + // Clear existing errors. + for (const uri of Object.keys(this.cacheService.errors)) { + this.emit('documentErrored', { errors: [], uri }); + } + // Reset cache. + const { symbols } = this.cacheService.reset(); + this.symbols = new SymbolUtil(symbols, this.externals.event.EventEmitter); + this.symbols.buildCache(); + return this.restart(); + } + normalizeUri(uri) { + return this.fs.mapFromDisk(normalizeUri(uri)); + } + static TextDocumentCacheMaxLength = 268435456; + #textDocumentCache = new Map(); + #textDocumentCacheLength = 0; + removeCachedTextDocument(uri) { + const doc = this.#textDocumentCache.get(uri); + if (doc && !(doc instanceof Promise)) { + this.#textDocumentCacheLength -= doc.getText().length; + } + this.#textDocumentCache.delete(uri); + } + async read(uri) { + const createTextDocument = async (uri) => { + const languageId = this.guessLanguageID(uri); + if (!this.isSupportedLanguage(uri, languageId)) { + return undefined; + } + try { + const content = bufferToString(await this.fs.readFile(uri)); + return TextDocument.create(uri, languageId, -1, content); + } + catch (e) { + this.logger.warn(`[Project] [read] Failed creating TextDocument for ${uri}`, e); + return undefined; + } + }; + const trimCache = () => { + const iterator = this.#textDocumentCache.keys(); + while (this.#textDocumentCacheLength > Project.TextDocumentCacheMaxLength) { + const result = iterator.next(); + if (result.done) { + throw new Error(`[Project] [read] Cache is too large with length ${this.#textDocumentCacheLength} even though it's empty; make sure to call 'removeCachedTextDocument()' instead of 'this.#textDocumentCache.delete()'`); + } + this.removeCachedTextDocument(result.value); + } + }; + const getCacheHandlingPromise = async (uri) => { + if (this.#textDocumentCache.has(uri)) { + const ans = this.#textDocumentCache.get(uri); + // Move the entry to the end of the cache. + // The goal is that more-frequently-used entries are preferably not trimmed. + this.#textDocumentCache.delete(uri); + this.#textDocumentCache.set(uri, ans); + return ans; + } + else { + const promise = createTextDocument(uri); + this.#textDocumentCache.set(uri, promise); + // We replace the Promise in the cache with the TextDocument after it resolves, + // or removes it from the cache if it resolves to undefined. + const doc = await promise; + if (this.#textDocumentCache.get(uri) === promise) { + // The Promise in the cache is the same as the one we created earlier. + // This check is to make sure we don't set a wrong TextDocument to the cache in case the cache was modified elsewhere. + if (doc) { + this.#textDocumentCache.set(uri, doc); + this.#textDocumentCacheLength += doc.getText().length; + trimCache(); + } + else { + this.#textDocumentCache.delete(uri); + } + } + return doc; + } + }; + uri = this.normalizeUri(uri); + if (this.#clientManagedUris.has(uri)) { + const result = this.#clientManagedDocAndNodes.get(uri); + if (result) { + return result.doc; + } + throw new Error(`[Project] [read] Client-managed URI ${uri} does not have a TextDocument in the cache`); + } + return getCacheHandlingPromise(uri); + } + parse(doc) { + const ctx = ParserContext.create(this, { doc }); + const parser = ctx.meta.getParserForLanguageId(ctx.doc.languageId); + if (!parser) { + return { + type: 'file', + range: Range.create(0), + children: [], + locals: Object.create(null), + parserErrors: [], + }; + } + const src = new Source(doc.getText()); + return file_file(parser)(src, ctx); + } + async bind(doc, node) { + if (node.binderErrors) { + return; + } + try { + this.#bindingInProgressUris.add(doc.uri); + const binder = this.meta.getBinder(node.type); + const ctx = BinderContext.create(this, { doc }); + ctx.symbols.clear({ contributor: 'binder', uri: doc.uri }); + await ctx.symbols.contributeAsAsync('binder', async () => { + const proxy = StateProxy.create(node); + await binder(proxy, ctx); + node.binderErrors = ctx.err.dump(); + }); + this.#bindingInProgressUris.delete(doc.uri); + this.#symbolUpToDateUris.add(doc.uri); + } + catch (e) { + this.logger.error(`[Project] [bind] Failed for ${doc.uri} # ${doc.version}`, e); + } + } + async check(doc, node) { + if (node.checkerErrors) { + return; + } + try { + const checker = this.meta.getChecker(node.type); + const ctx = CheckerContext.create(this, { doc }); + ctx.symbols.clear({ contributor: 'checker', uri: doc.uri }); + await ctx.symbols.contributeAsAsync('checker', async () => { + await checker(StateProxy.create(node), ctx); + node.checkerErrors = ctx.err.dump(); + this.lint(doc, node); + }); + } + catch (e) { + this.logger.error(`[Project] [check] Failed for ${doc.uri} # ${doc.version}`, e); + } + } + lint(doc, node) { + if (node.linterErrors) { + return; + } + node.linterErrors = []; + try { + for (const [ruleName, rawValue] of Object.entries(this.config.lint)) { + const result = LinterConfigValue.destruct(rawValue); + if (!result) { + // Rule is disabled (i.e. set to `null`) in the config. + continue; + } + const { ruleSeverity, ruleValue } = result; + const { configValidator, linter, nodePredicate } = this.meta.getLinter(ruleName); + if (!configValidator(ruleName, ruleValue, this.logger)) { + // Config value is invalid. + continue; + } + const ctx = LinterContext.create(this, { + doc, + err: new LinterErrorReporter(ruleName, ruleSeverity, this.ctx['errorSource']), + ruleName, + ruleValue, + }); + traversePreOrder(node, () => true, () => true, (node) => { + if (nodePredicate(node)) { + const proxy = StateProxy.create(node); + linter(proxy, ctx); + } + }); + node.linterErrors.push(...ctx.err.dump()); + } + } + catch (e) { + this.logger.error(`[Project] [lint] Failed for ${doc.uri} # ${doc.version}`, e); + } + } + // @SingletonPromise() + async ensureBindingStarted(uri) { + uri = this.normalizeUri(uri); + if (this.#symbolUpToDateUris.has(uri) || this.#bindingInProgressUris.has(uri)) { + return; + } + this.#bindingInProgressUris.add(uri); + const doc = await this.read(uri); + if (!doc || !(await this.cacheService.hasFileChangedSinceCache(doc))) { + return; + } + const node = this.parse(doc); + await this.bind(doc, node); + this.emit('documentUpdated', { doc, node }); + } + bindUri(param) { + const ctx = UriBinderContext.create(this); + if (typeof param === 'string') { + ctx.symbols.clear({ contributor: 'uri_binder', uri: param }); + } + ctx.symbols.contributeAs('uri_binder', () => { + const uris = Array.isArray(param) ? param : [param]; + for (const binder of this.meta.uriBinders) { + binder(uris, ctx); + } + }); + } + /** + * Notify that a new document was opened in the editor. + */ + async onDidOpen(uri, languageID, version, content) { + uri = this.normalizeUri(uri); + if (uri.startsWith(ArchiveUriSupporter.Protocol)) { + return; // We do not accept `archive:` scheme for client-managed URIs. + } + if (this.shouldExclude(uri, languageID)) { + return; + } + const doc = TextDocument.create(uri, languageID, version, content); + const node = this.parse(doc); + this.#clientManagedUris.add(uri); + this.#clientManagedDocAndNodes.set(uri, { doc, node }); + if (this.#isReady) { + await this.bind(doc, node); + await this.check(doc, node); + } + } + /** + * Notify that an existing document was changed in the editor. + * @throws If there is no `TextDocument` corresponding to the URI. + */ + async onDidChange(uri, changes, version) { + uri = this.normalizeUri(uri); + this.#symbolUpToDateUris.delete(uri); + if (uri.startsWith(ArchiveUriSupporter.Protocol)) { + return; // We do not accept `archive:` scheme for client-managed URIs. + } + const doc = this.#clientManagedDocAndNodes.get(uri)?.doc; + if (!doc || this.shouldExclude(uri, doc.languageId)) { + // If doc is undefined, it means the document was previously excluded by onDidOpen() + // based on the language ID supplied by the client, in which case we should return early. + // Otherwise, we perform the shouldExclude() check with the URI and the saved language ID + // as usual. + return; + } + TextDocument.update(doc, changes, version); + const node = this.parse(doc); + this.#clientManagedDocAndNodes.set(uri, { doc, node }); + if (this.#isReady) { + await this.bind(doc, node); + await this.check(doc, node); + } + } + /** + * Notify that an existing document was closed in the editor. + */ + onDidClose(uri) { + uri = this.normalizeUri(uri); + if (uri.startsWith(ArchiveUriSupporter.Protocol)) { + return; // We do not accept `archive:` scheme for client-managed URIs. + } + this.#clientManagedUris.delete(uri); + this.#clientManagedDocAndNodes.delete(uri); + this.tryClearingCache(uri); + } + async ensureClientManagedChecked(uri) { + uri = this.normalizeUri(uri); + const result = this.#clientManagedDocAndNodes.get(uri); + if (result) { + const { doc, node } = result; + if (this.#isReady) { + await this.bind(doc, node); + await this.check(doc, node); + this.emit('documentUpdated', result); + } + return result; + } + return undefined; + } + getClientManaged(uri) { + uri = this.normalizeUri(uri); + return this.#clientManagedDocAndNodes.get(uri); + } + async showCacheRoot() { + if (!this.#cacheRoot) { + return; + } + try { + await fileUtil.ensureDir(this.externals, this.#cacheRoot); + await this.externals.fs.showFile(this.#cacheRoot); + } + catch (e) { + this.logger.error('[Service#showCacheRoot]', e); + } + } + /** + * Returns true iff the URI should be excluded from all Spyglass language support. + * + * @param language Optional. If ommitted, a language will be derived from the URI according to + * its file extension. + */ + shouldExclude(uri, language) { + return !this.isSupportedLanguage(uri, language) || this.isUserExcluded(uri); + } + isSupportedLanguage(uri, language) { + language ??= this.guessLanguageID(uri); + const languageOptions = this.meta.getLanguageOptions(language); + if (!languageOptions) { + // Unsupported language. + return false; + } + const { uriPredicate } = languageOptions; + return uriPredicate?.(uri, UriPredicateContext.create(this)) ?? true; + } + /** + * Guess a language ID from a URI. The guessed language ID may or may not actually be supported. + */ + guessLanguageID(uri) { + const ext = fileUtil.extname(uri) ?? '.spyglassmc-unknown'; + return this.meta.getLanguageID(ext) ?? ext.slice(1); + } + isUserExcluded(uri) { + if (this.config.env.exclude.length === 0) { + return false; + } + for (const rel of fileUtil.getRels(uri, this.projectRoots)) { + if (picomatch(this.config.env.exclude, { dot: true, posixSlashes: false })(rel)) { + return true; + } + } + return false; + } + tryClearingCache(uri) { + if (this.shouldRemove(uri)) { + this.removeCachedTextDocument(uri); + this.emit('documentRemoved', { uri }); + } + } + shouldRemove(uri) { + return (!this.#clientManagedUris.has(uri) + && !this.#dependencyFiles?.has(uri) + && !this.#watchedFiles.has(uri)); + } + isOnlyWatched(uri) { + return (this.#watchedFiles.has(uri) + && !this.#clientManagedUris.has(uri) + && !this.#dependencyFiles?.has(uri)); + } +} +Project_decorate([ + SingletonPromise() +], Project.prototype, "bind", null); +Project_decorate([ + SingletonPromise() +], Project.prototype, "check", null); +Project_decorate([ + SingletonPromise() +], Project.prototype, "ensureClientManagedChecked", null); +//# sourceMappingURL=Project.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/SymbolLocations.js + +var SymbolLocations; +(function (SymbolLocations) { + /* istanbul ignore next */ + function create(range, locations) { + return { range: Range.get(range), locations }; + } + SymbolLocations.create = create; +})(SymbolLocations || (SymbolLocations = {})); +//# sourceMappingURL=SymbolLocations.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/Service.js + + + + + + + + + + +/* istanbul ignore next */ +class Service { + isDebugging; + logger; + profilers; + project; + constructor({ isDebugging = false, logger, profilers = ProfilerFactory.noop(), project }) { + this.isDebugging = isDebugging; + this.logger = logger; + this.profilers = profilers; + this.project = new Project({ isDebugging, logger, profilers, ...project }); + } + debug(message) { + if (this.isDebugging) { + this.logger.info(`[DEBUG] ${message}`); + } + } + colorize(node, doc, range) { + try { + this.debug(`Colorizing ${doc.uri} # ${doc.version}`); + const colorizer = this.project.meta.getColorizer(node.type); + return colorizer(node, ColorizerContext.create(this.project, { doc, range })); + } + catch (e) { + this.logger.error(`[Service] [colorize] Failed for ${doc.uri} # ${doc.version}`, e); + } + return []; + } + getCodeActions(node, doc, range) { + try { + this.debug(`Getting code actions ${doc.uri} # ${doc.version} @ ${Range.toString(range)}`); + const codeActionProvider = this.project.meta.getCodeActionProvider(node.type); + const ctx = CodeActionProviderContext.create(this.project, { doc, range }); + return codeActionProvider(node, ctx); + } + catch (e) { + this.logger.error(`[Service] [getCodeActions] Failed for ${doc.uri} # ${doc.version}`, e); + } + return []; + } + getColorInfo(node, doc) { + try { + this.debug(`Getting color info for ${doc.uri} # ${doc.version}`); + const ans = []; + traversePreOrder(node, (_) => true, (node) => node.color, (node) => ans.push({ + color: Array.isArray(node.color) ? node.color : node.color.value, + range: Array.isArray(node.color) ? node.range : node.color.range ?? node.range, + })); + return ans; + } + catch (e) { + this.logger.error(`[Service] [getColorInfo] Failed for ${doc.uri} # ${doc.version}`, e); + } + return []; + } + getColorPresentation(file, doc, range, color) { + try { + this.debug(`Getting color presentation for ${doc.uri} # ${doc.version} @ ${Range.toString(range)}`); + let node = AstNode.findDeepestChild({ node: file, needle: range.start }); + while (node) { + const nodeColor = node.color; + if (nodeColor && !Array.isArray(nodeColor)) { + const colorRange = nodeColor.range ?? node.range; + return nodeColor.format.map((format) => ColorPresentation.fromColorFormat(format, color, colorRange)); + } + node = node.parent; + } + } + catch (e) { + this.logger.error(`[Service] [getColorPresentation] Failed for ${doc.uri} # ${doc.version}`, e); + } + return []; + } + complete(node, doc, offset, triggerCharacter) { + try { + this.debug(`Getting completion for ${doc.uri} # ${doc.version} @ ${offset}`); + const shouldComplete = this.project.meta.shouldComplete(doc.languageId, triggerCharacter); + if (shouldComplete) { + return builtin_file(node, CompleterContext.create(this.project, { doc, offset, triggerCharacter })); + } + } + catch (e) { + this.logger.error(`[Service] [complete] Failed for ${doc.uri} # ${doc.version}`, e); + } + return []; + } + dataHackPubify(initialism) { + const Secrets = [ + // data hack pub + // —— Skylinerw, 2020 https://discord.com/channels/154777837382008833/154777837382008833/736313565291741355 + ['ata', 'ack', 'ub', 'elper', 'lus'], + // Dah Huh Pew Helpa Plush + // —— DoubleFelix, 2021 https://discord.com/channels/154777837382008833/154777837382008833/842070090828087308 + ['ah', 'uh', 'ew', 'elpa', 'lush'], + ]; + const secrets = Secrets[Math.floor(Math.random() * Secrets.length)]; + // Punctuation should not be treated differently from any other characters, per example: + // Hata &ack Sub + // —— Skylinerw, 2022 https://discord.com/channels/154777837382008833/734106483104415856/955521761351454741 + return [...initialism].map((c, i) => `${c.toUpperCase()}${secrets[i % secrets.length]}`).join(' '); + } + format(node, doc, tabSize, insertSpaces) { + try { + this.debug(`Formatting ${doc.uri} # ${doc.version}`); + const formatter = this.project.meta.getFormatter(node.type); + return formatter(node, FormatterContext.create(this.project, { doc, tabSize, insertSpaces })); + } + catch (e) { + this.logger.error(`[Service] [format] Failed for ${doc.uri} # ${doc.version}`, e); + throw e; + } + } + getHover(file, doc, offset) { + try { + this.debug(`Getting hover for ${doc.uri} # ${doc.version} @ ${offset}`); + let node = AstNode.findDeepestChild({ node: file, needle: offset }); + while (node) { + const symbol = this.project.symbols.resolveAlias(node.symbol); + if (symbol) { + const hover = `\`\`\`typescript\n(${symbol.category}${symbol.subcategory ? `/${symbol.subcategory}` : ''}) ${symbol.identifier}\n\`\`\`` + (symbol.desc ? `\n******\n${symbol.desc}` : ''); + return Hover.create(node.range, hover); + } + if (node.hover) { + return Hover.create(node.range, node.hover); + } + node = node.parent; + } + } + catch (e) { + this.logger.error(`[Service] [getHover] Failed for ${doc.uri} # ${doc.version}`, e); + } + return undefined; + } + getInlayHints(node, doc, range) { + try { + // TODO: `range` argument is not used. + this.debug(`Getting inlay hints for ${doc.uri} # ${doc.version}`); + const ans = []; + const ctx = ProcessorContext.create(this.project, { doc }); + for (const provider of this.project.meta.inlayHintProviders) { + ans.push(...provider(node, ctx)); + } + return ans; + } + catch (e) { + this.logger.error(`[Service] [getInlayHints] Failed for ${doc.uri} # ${doc.version}`, e); + } + return []; + } + getSignatureHelp(node, doc, offset) { + try { + this.debug(`Getting signature help for ${doc.uri} # ${doc.version} @ ${offset}`); + const ctx = SignatureHelpProviderContext.create(this.project, { doc, offset }); + for (const provider of this.project.meta.signatureHelpProviders) { + const result = provider(node, ctx); + if (result) { + return result; + } + } + } + catch (e) { + this.logger.error(`[Service] [getSignatureHelp] Failed for ${doc.uri} # ${doc.version}`, e); + } + return undefined; + } + /** + * @param searchedUsages Type of symbol usages that should be included in the result. Defaults to all usages. + * @param currentFileOnly Whether only symbol locations in the current file should be returned. + * + * @returns Symbol locations of the selected symbol at `offset`, or `undefined` if there's no symbol at `offset`. + */ + async getSymbolLocations(file, doc, offset, searchedUsages = SymbolUsageTypes, currentFileOnly = false) { + try { + this.debug(`Getting symbol locations of usage '${searchedUsages.join(',')}' for ${doc.uri} # ${doc.version} @ ${offset} with currentFileOnly=${currentFileOnly}`); + let node = AstNode.findDeepestChild({ node: file, needle: offset }); + while (node) { + const symbol = this.project.symbols.resolveAlias(node.symbol); + if (symbol) { + const rawLocations = []; + for (const usage of searchedUsages) { + let locs = symbol[usage] ?? []; + if (currentFileOnly) { + locs = locs.filter((l) => l.uri === doc.uri); + } + rawLocations.push(...locs); + } + const locations = []; + for (const loc of rawLocations) { + const mappedUri = fileUtil.isFileUri(loc.uri) + ? loc.uri + : await this.project.fs.mapToDisk(loc.uri); + if (mappedUri) { + locations.push({ ...loc, uri: mappedUri }); + } + } + return SymbolLocations.create(node.range, locations.length ? locations : undefined); + } + node = node.parent; + } + } + catch (e) { + this.logger.error(`[Service] [getSymbolLocations] Failed for ${doc.uri} # ${doc.version}`, e); + } + return undefined; + } +} +//# sourceMappingURL=Service.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/service/index.js +/* istanbul ignore file */ + + + + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/Parser.js +const Parser_Failure = Symbol('Failure'); +//# sourceMappingURL=Parser.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/util.js + + + + + +function util_attempt(parser, src, ctx) { + const tmpSrc = src.clone(); + const tmpCtx = { ...ctx, err: new ErrorReporter(ctx.err.source) }; + const result = parser(tmpSrc, tmpCtx); + return { + result, + endCursor: tmpSrc.cursor, + errorAmount: tmpCtx.err.errors.length, + updateSrcAndCtx: () => { + src.innerCursor = tmpSrc.innerCursor; + ctx.err.absorb(tmpCtx.err); + }, + }; +} +function sequence(parsers, parseGap) { + return (src, ctx) => { + const ans = { + [SequenceUtilDiscriminator]: true, + children: [], + range: Range.create(src), + }; + for (const [i, p] of parsers.entries()) { + const parser = typeof p === 'function' ? p : p.get(ans); + if (parser === undefined) { + continue; + } + if (i > 0 && parseGap) { + ans.children.push(...parseGap(src, ctx)); + } + const result = parser(src, ctx); + if (result === Parser_Failure) { + return Parser_Failure; + } + else if (result === undefined) { + continue; + } + else if (SequenceUtil.is(result)) { + ans.children.push(...result.children); + } + else { + ans.children.push(result); + } + } + ans.range.end = src.cursor; + return ans; + }; +} +function repeat(parser, parseGap) { + return (src, ctx) => { + const ans = { + [SequenceUtilDiscriminator]: true, + children: [], + range: Range.create(src), + }; + while (src.canRead()) { + if (parseGap) { + ans.children.push(...parseGap(src, ctx)); + } + const { result, updateSrcAndCtx } = util_attempt(parser, src, ctx); + if (result === Parser_Failure) { + break; + } + updateSrcAndCtx(); + if (SequenceUtil.is(result)) { + ans.children.push(...result.children); + } + else { + ans.children.push(result); + } + } + ans.range.end = src.cursor; + return ans; + }; +} +function util_any(parsers, out) { + return (src, ctx) => { + const results = parsers.map((parser, i) => ({ attempt: util_attempt(parser, src, ctx), index: i })).filter(({ attempt }) => attempt.result !== Parser_Failure).sort((a, b) => b.attempt.endCursor - a.attempt.endCursor || a.attempt.errorAmount - b.attempt.errorAmount); + if (results.length === 0) { + if (out) { + out.index = -1; + } + return Parser_Failure; + } + results[0].attempt.updateSrcAndCtx(); + if (out) { + out.index = results[0].index; + } + return results[0].attempt.result; + }; +} +/** + * @returns A parser that fails when the passed-in parser didn't move the cursor at all. + */ +function failOnEmpty(parser) { + return (src, ctx) => { + const start = src.cursor; + const { endCursor, updateSrcAndCtx, result } = util_attempt(parser, src, ctx); + if (endCursor - start > 0) { + updateSrcAndCtx(); + return result; + } + return Parser_Failure; + }; +} +/** + * @returns A parser that fails when the passed-in parser produced any errors. + */ +function failOnError(parser) { + return (src, ctx) => { + const start = src.cursor; + const { errorAmount, updateSrcAndCtx, result } = util_attempt(parser, src, ctx); + if (!errorAmount) { + updateSrcAndCtx(); + return result; + } + return Parser_Failure; + }; +} +function optional(parser) { + return ((src, ctx) => { + const { result, updateSrcAndCtx } = util_attempt(parser, src, ctx); + if (result === Parser_Failure) { + return undefined; + } + else { + updateSrcAndCtx(); + return result; + } + }); +} +function recover(parser, defaultValue) { + return (src, ctx) => { + const result = parser(src, ctx); + if (result === Failure) { + const ans = defaultValue(src, ctx); + return ans; + } + return result; + }; +} +function util_select(cases) { + return (src, ctx) => { + for (const { predicate, prefix, parser, regex } of cases) { + if (predicate?.(src) + ?? (prefix !== undefined ? src.tryPeek(prefix) : undefined) + ?? (regex && src.matchPattern(regex)) + ?? true) { + const callableParser = typeof parser === 'object' ? parser.get() : parser; + return callableParser(src, ctx); + } + } + throw new Error('The select parser util was called with non-exhaustive cases'); + }; +} +function util_map(parser, fn) { + return (src, ctx) => { + const result = parser(src, ctx); + if (result === Parser_Failure) { + return Parser_Failure; + } + const ans = fn(result, src, ctx); + return ans; + }; +} +function setType(type, parser) { + return util_map(parser, (res) => { + const { type: _type, ...restResult } = res; + const ans = { type, ...restResult }; + delete ans[SequenceUtilDiscriminator]; + return ans; + }); +} +function validate(parser, validator, message, severity) { + return util_map(parser, (res, src, ctx) => { + const isLegal = validator(res, src, ctx); + if (!isLegal) { + ctx.err.report(message, res.range, severity); + } + return res; + }); +} +function stopBefore(parser, ...terminators) { + const flatTerminators = terminators.flat(); + return (src, ctx) => { + const tmpSrc = src.clone(); + // Cut tmpSrc.string before the nearest terminator. + tmpSrc.string = tmpSrc.string.slice(0, flatTerminators.reduce((p, c) => { + const index = tmpSrc.string.indexOf(c, tmpSrc.innerCursor); + return Math.min(p, index === -1 ? Infinity : index); + }, Infinity)); + const ans = parser(tmpSrc, ctx); + src.cursor = tmpSrc.cursor; + return ans; + }; +} +function concatOnTrailingBackslash(parser) { + return (src, ctx) => { + let wrappedStr = src.sliceToCursor(0); + const wrappedSrcCursor = wrappedStr.length; + const indexMap = []; + while (src.canRead()) { + wrappedStr += src.readUntil('\\'); + if (!src.canRead()) { + break; + } + // If we get here, then `src.cursor` is at a backslash + if (src.hasNonSpaceAheadInLine(1)) { + wrappedStr += src.read(); + continue; + } + // Create an index map that skips from the trailing backslash to the + // next line's first non-whitespace character + const from = src.getCharRange(); + src.nextLine(); + // Minecraft raises a `Line continuation at end of file` if a backslash + // (+ optional whitespace to the next line) is right before the end of the file + if (!src.canRead()) { + const ans = { type: 'error', range: Range.span(from, src) }; + ctx.err.report(localize('parser.line-continuation-end-of-file'), ans); + } + src.skipSpace(); + const to = src.getCharRange(-1); + indexMap.push({ inner: Range.create(wrappedStr.length), outer: Range.span(from, to) }); + } + const wrappedSrc = new Source(wrappedStr, indexMap); + wrappedSrc.innerCursor = wrappedSrcCursor; + const ans = parser(wrappedSrc, ctx); + src.cursor = wrappedSrc.cursor; + return ans; + }; +} +function acceptOnly(parser, ...characters) { + const set = new Set(characters.flat()); + return (src, ctx) => { + const tmpSrc = src.clone(); + // Cut tmpSrc.string before the nearest unacceptable character. + for (let i = tmpSrc.innerCursor; i < tmpSrc.string.length; i++) { + if (!set.has(tmpSrc.string.charAt(i))) { + tmpSrc.string = tmpSrc.string.slice(0, i); + break; + } + } + const ans = parser(tmpSrc, ctx); + src.cursor = tmpSrc.cursor; + return ans; + }; +} +function acceptIf(parser, predicate) { + return ((src, ctx) => { + const tmpSrc = src.clone(); + // Cut tmpSrc.string before the nearest unacceptable character. + for (let i = tmpSrc.innerCursor; i < tmpSrc.string.length; i++) { + if (!predicate(tmpSrc.string.charAt(i))) { + tmpSrc.string = tmpSrc.string.slice(0, i); + break; + } + } + const ans = parser(tmpSrc, ctx); + src.innerCursor = tmpSrc.innerCursor; + return ans; + }); +} +/** + * @returns A parser that dumps any parser errors after it finishes parsing. + */ +function dumpErrors(parser) { + return ((src, ctx) => { + const ans = parser(src, ctx); + ctx.err.dump(); + return ans; + }); +} +//# sourceMappingURL=util.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/boolean.js + + +const boolean_boolean = util_map(literal('false', 'true'), (res) => ({ + type: 'boolean', + range: res.range, + value: res.value === '' ? undefined : res.value === 'true', +})); +//# sourceMappingURL=boolean.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/comment.js + + +/** + * `Failure` when three isn't a comment. + */ +function comment_comment({ singleLinePrefixes, includesEol }) { + return (src, _ctx) => { + const start = src.cursor; + const ans = { + type: 'comment', + range: Range.create(start), + comment: '', + prefix: '', + }; + for (const prefix of singleLinePrefixes) { + if (src.peek(prefix.length) === prefix) { + if (includesEol) { + src.nextLine(); + } + else { + src.skipLine(); + } + ans.range.end = src.cursor; + ans.comment = src.sliceToCursor(start + prefix.length); + ans.prefix = prefix; + return ans; + } + } + return Parser_Failure; + }; +} +//# sourceMappingURL=comment.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/error.js + + +/** + * Returns an error node containing all the remaining text (including whitespace), + * or returns `undefined` if the `Source` has already reached its end. + */ +const error_error = (src, ctx) => { + if (!src.canRead()) { + return undefined; + } + const ans = { type: 'error', range: Range.create(src, () => src.skipRemaining()) }; + ctx.err.report(localize('error.unparseable-content'), ans); + return ans; +}; +//# sourceMappingURL=error.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/file.js + + + + +/** + * Dispatches to the corresponding parser for the language. + * @throws If there's no parser registered for this language ID. + */ +function file_file(parser) { + return (src, ctx) => { + const fullRange = Range.create(src, src.string.length); + const ans = { + type: 'file', + range: fullRange, + children: [], + locals: Object.create(null), + parserErrors: [], + }; + src.skipWhitespace(); + const result = parser(src, ctx); + if (result && result !== Parser_Failure) { + ans.children.push(result); + } + if (src.skipWhitespace().canRead()) { + ans.children.push(error_error(src, ctx)); + } + AstNode.setParents(ans); + ans.parserErrors = ctx.err.dump(); + return ans; + }; +} +//# sourceMappingURL=file.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/float.js + + + +const fallbackOnOutOfRange = (ans, _src, ctx, options) => { + ctx.err.report(localize('expected', localize('float.between', options.min ?? '-∞', options.max ?? '+∞')), ans, 3 /* ErrorSeverity.Error */); +}; +function float_float(options) { + return (src, ctx) => { + const ans = { type: 'float', range: Range.create(src), value: 0 }; + if (src.peek() === '-' || src.peek() === '+') { + src.skip(); + } + while (src.canRead() && Source.isDigit(src.peek())) { + src.skip(); + } + if (src.trySkip('.')) { + while (src.canRead() && Source.isDigit(src.peek())) { + src.skip(); + } + } + if (src.peek().toLowerCase() === 'e') { + src.skip(); + if (src.peek() === '-' || src.peek() === '+') { + src.skip(); + } + while (src.canRead() && Source.isDigit(src.peek())) { + src.skip(); + } + } + ans.range.end = src.cursor; + const raw = src.sliceToCursor(ans.range.start); + ans.value = parseFloat(raw) || 0; + if (!raw) { + if (options.failsOnEmpty) { + return Parser_Failure; + } + ctx.err.report(localize('expected', localize('float')), ans); + } + else if (!options.pattern.test(raw)) { + ctx.err.report(localize('parser.float.illegal', options.pattern), ans); + } + else if ((options.min && ans.value < options.min) || (options.max && ans.value > options.max)) { + const onOutOfRange = options.onOutOfRange ?? fallbackOnOutOfRange; + onOutOfRange(ans, src, ctx, options); + } + return ans; + }; +} +//# sourceMappingURL=float.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/integer.js + + + +const integer_fallbackOnOutOfRange = (ans, _src, ctx, options) => { + ctx.err.report(localize('expected', localize('integer.between', options.min ?? '-∞', options.max ?? '+∞')), ans, 3 /* ErrorSeverity.Error */); +}; +function integer_integer(options) { + return (src, ctx) => { + const ans = { type: 'integer', range: Range.create(src), value: 0 }; + if (src.peek() === '-' || src.peek() === '+') { + src.skip(); + } + while (src.canRead() && Source.isDigit(src.peek())) { + src.skip(); + } + ans.range.end = src.cursor; + const raw = src.sliceToCursor(ans.range.start); + const isOnlySign = raw === '-' || raw === '+'; + if (!isOnlySign) { + ans.value = Number(raw); + } + if (!raw) { + if (options.failsOnEmpty) { + return Parser_Failure; + } + ctx.err.report(localize('expected', localize('integer')), ans); + } + else if (!options.pattern.test(raw) || isOnlySign) { + ctx.err.report(localize('parser.integer.illegal', options.pattern), ans); + } + else if ((options.min !== undefined && ans.value < options.min) + || (options.max !== undefined && ans.value > options.max)) { + const onOutOfRange = options.onOutOfRange ?? integer_fallbackOnOutOfRange; + onOutOfRange(ans, src, ctx, options); + } + return ans; + }; +} +//# sourceMappingURL=integer.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/list.js + + + + +function list({ start, value, sep, trailingSep, end }) { + return (src, ctx) => { + const ans = { type: 'list', range: Range.create(src), children: [] }; + if (src.trySkip(start)) { + src.skipWhitespace(); + let requiresValueSep = false; + let hasValueSep = false; + while (src.canRead() && src.peek(end.length) !== end) { + const itemStart = src.cursor; + let valueNode; + // Item sep of the last item. + if (requiresValueSep && !hasValueSep) { + ctx.err.report(localize('expected', localeQuote(sep)), src); + } + // Value. + src.skipWhitespace(); + const { result, endCursor, updateSrcAndCtx } = util_attempt(value, src, ctx); + if (result === Parser_Failure || endCursor === src.cursor) { + ctx.err.report(localize('expected', localize('parser.list.value')), Range.create(src, () => src.skipUntilOrEnd(sep, end, '\r', '\n'))); + } + else { + updateSrcAndCtx(); + valueNode = result; + } + // Item sep. + let sepRange = undefined; + src.skipWhitespace(); + requiresValueSep = true; + if ((hasValueSep = src.peek(sep.length) === sep)) { + sepRange = Range.create(src, () => src.skip(sep.length)); + } + // Create item. + ans.children.push({ + type: 'item', + range: Range.create(itemStart, src), + ...(valueNode ? { children: [valueNode] } : {}), + value: valueNode, + sep: sepRange, + }); + src.skipWhitespace(); + } + // Trailing item sep. + if (hasValueSep && !trailingSep) { + const trailingRange = ans.children[ans.children.length - 1].sep; + ctx.err.report(localize('parser.list.trailing-sep'), trailingRange, 3 /* ErrorSeverity.Error */, { + codeAction: { + title: localize('code-action.remove-trailing-separation'), + isPreferred: true, + changes: [ + { + type: 'edit', + range: trailingRange, + text: '', + }, + ], + }, + }); + } + // End. + if (!src.trySkip(end)) { + ctx.err.report(localize('expected', localeQuote(end)), src); + } + } + else { + ctx.err.report(localize('expected', localeQuote(start)), src); + } + ans.range.end = src.cursor; + return ans; + }; +} +//# sourceMappingURL=list.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/long.js + + + +const long_fallbackOnOutOfRange = (ans, _src, ctx, options) => { + ctx.err.report(localize('expected', localize('long.between', options.min ?? '-∞', options.max ?? '+∞')), ans, 3 /* ErrorSeverity.Error */); +}; +function long_long(options) { + return (src, ctx) => { + const ans = { type: 'long', range: Range.create(src), value: 0n }; + if (src.peek() === '-' || src.peek() === '+') { + src.skip(); + } + while (src.canRead() && Source.isDigit(src.peek())) { + src.skip(); + } + ans.range.end = src.cursor; + const raw = src.sliceToCursor(ans.range.start); + let isOnlySign = false; + try { + ans.value = BigInt(raw); + } + catch (_) { + // `raw` might be "+" or "-" here. + isOnlySign = true; + } + if (!raw) { + if (options.failsOnEmpty) { + return Parser_Failure; + } + ctx.err.report(localize('expected', localize('long')), ans); + } + else if (!options.pattern.test(raw) || isOnlySign) { + ctx.err.report(localize('parser.long.illegal', options.pattern), ans); + } + else if ((options.min && ans.value < options.min) || (options.max && ans.value > options.max)) { + const onOutOfRange = options.onOutOfRange ?? long_fallbackOnOutOfRange; + onOutOfRange(ans, src, ctx, options); + } + return ans; + }; +} +//# sourceMappingURL=long.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/prefixed.js + + + +function prefixed_prefixed(options) { + return (src, ctx) => { + const ans = { + type: 'prefixed', + range: Range.create(src), + prefix: options.prefix, + children: [], + }; + const prefix = literal(options.prefix)(src, ctx); + ans.children.push(prefix); + ans.range.end = src.cursor; + const child = options.child(src, ctx); + if (child !== Parser_Failure) { + ans.children.push(child); + } + ans.range.end = src.cursor; + return ans; + }; +} +//# sourceMappingURL=prefixed.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/record.js + + + + +/** + * @returns A parser that parses something coming in a key-value pair form. e.g. SNBT objects, entity selector arguments. + */ +function record_record({ start, pair, end }) { + return (src, ctx) => { + const ans = { type: 'record', range: Range.create(src), children: [] }; + if (src.trySkip(start)) { + ans.innerRange = Range.create(src); + src.skipWhitespace(); + let requiresPairEnd = false; + let hasPairEnd = false; + while (src.canRead() && src.peek(end.length) !== end) { + const pairStart = src.cursor; + let key; + let value; + // Pair end of the last pair. + if (requiresPairEnd && !hasPairEnd) { + ctx.err.report(localize('expected', localeQuote(pair.end)), src); + } + // Key. + const keyStart = src.cursor; + const { result: keyResult, updateSrcAndCtx: updateForKey, endCursor: keyEnd } = util_attempt(pair.key, src, ctx); + if (keyResult === Parser_Failure + || (keyEnd - keyStart === 0 + && ![pair.sep, pair.end, end, '\r', '\n', '\t', ' '].includes(src.peek()))) { + ctx.err.report(localize('expected', localize('parser.record.key')), Range.create(src, () => src.skipUntilOrEnd(pair.sep, pair.end, end, '\r', '\n'))); + } + else { + updateForKey(); + key = keyResult; + } + // K-V sep. + let sepCharRange = undefined; + src.skipWhitespace(); + if (src.peek(pair.sep.length) === pair.sep) { + sepCharRange = Range.create(src, () => src.skip(pair.sep.length)); + } + else { + ctx.err.report(localize('expected', localeQuote(pair.sep)), src); + } + // Value. + src.skipWhitespace(); + const valueParser = typeof pair.value === 'function' + ? pair.value + : pair.value.get(ans, key); + const valueStart = src.cursor; + const { result: valueResult, updateSrcAndCtx: updateForValue, endCursor: valueEnd } = util_attempt(valueParser, src, ctx); + if (valueResult === Parser_Failure + || (valueEnd - valueStart === 0 + && ![pair.sep, pair.end, end, '\r', '\n', '\t', ' '].includes(src.peek()))) { + ctx.err.report(localize('expected', localize('parser.record.value')), Range.create(src, () => src.skipUntilOrEnd(pair.sep, pair.end, end, '\r', '\n'))); + } + else { + updateForValue(); + value = valueResult; + } + // Pair end. + let endCharRange = undefined; + src.skipWhitespace(); + requiresPairEnd = true; + if ((hasPairEnd = src.peek(pair.end.length) === pair.end)) { + endCharRange = Range.create(src, () => src.skip(pair.end.length)); + } + // Create pair. + ans.children.push({ + type: 'pair', + range: Range.create(pairStart, src), + ...(key || value + ? { children: [key, value].filter((v) => !!v) } + : {}), + key, + sep: sepCharRange, + value, + end: endCharRange, + }); + src.skipWhitespace(); + } + // Trailing pair end. + if (hasPairEnd && !pair.trailingEnd) { + const trailingRange = ans.children[ans.children.length - 1].end; + ctx.err.report(localize('parser.record.trailing-end'), trailingRange, 3 /* ErrorSeverity.Error */, { + codeAction: { + title: localize('code-action.remove-trailing-separation'), + isPreferred: true, + changes: [ + { + type: 'edit', + range: trailingRange, + text: '', + }, + ], + }, + }); + } + // End. + ans.innerRange.end = src.cursor; + if (!src.trySkip(end)) { + ctx.err.report(localize('expected', localeQuote(end)), src); + } + } + else { + ctx.err.report(localize('expected', localeQuote(start)), src); + } + ans.range.end = src.cursor; + return ans; + }; +} +//# sourceMappingURL=record.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/resourceLocation.js + + + +const Terminators = new Set([ + ' ', + '\r', + '\n', + '=', + '~', + ',', + '"', + "'", + '{', + '}', + '[', + ']', + '(', + ')', + ';', + '|', +]); +const LegalResourceLocationCharacters = new Set([ + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + '_', + '-', + '.', +]); +function resourceLocation_resourceLocation(options) { + return (src, ctx) => { + const ans = { + type: 'resource_location', + range: Range.create(src), + options, + }; + if (src.trySkip(ResourceLocation.TagPrefix)) { + ans.isTag = true; + } + const start = src.cursor; + while (src.canReadInLine() && !Terminators.has(src.peek())) { + src.skip(); + } + const raw = src.sliceToCursor(start); + ans.range.end = src.cursor; + if (raw.length === 0) { + ctx.err.report(localize('expected', localize('resource-location')), ans); + } + else { + const sepIndex = raw.indexOf(options.namespacePathSep ?? ResourceLocation.NamespacePathSep); + if (sepIndex >= 0) { + ans.namespace = raw.slice(0, sepIndex); + } + const rawPath = raw.slice(sepIndex + 1); + ans.path = rawPath.split(ResourceLocation.PathSep); + // Check characters. + /* istanbul ignore next */ + const illegalChars = [ + ...new Set([ + ...[...(ans.namespace ?? [])].filter((c) => !LegalResourceLocationCharacters.has(c)), + ...[...rawPath].filter((c) => c !== '/' && !LegalResourceLocationCharacters.has(c)), + ]), + ]; + if (illegalChars.length) { + ctx.err.report(localize('parser.resource-location.illegal', arrayToMessage(illegalChars, true, 'and')), ans); + } + if (ans.isTag && !options.allowTag) { + ctx.err.report(localize('parser.resource-location.tag-disallowed'), ans); + } + if (!ans.isTag && options.requireTag) { + ctx.err.report(localize('parser.resource-location.tag-required'), ans); + } + if (!ans.namespace && options.requireCanonical) { + ctx.err.report(localize('parser.resource-location.namespace-expected'), ans, 3 /* ErrorSeverity.Error */, { + codeAction: { + title: localize('code-action.add-default-namespace'), + isPreferred: true, + changes: [ + { + type: 'edit', + range: Range.create(start), + text: ResourceLocation.DefaultNamespace + + ResourceLocation.NamespacePathSep, + }, + ], + }, + }); + } + } + return ans; + }; +} +//# sourceMappingURL=resourceLocation.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/string.js + + + + + +function string_string(options) { + return (src, ctx) => { + const ans = { + type: 'string', + range: Range.create(src), + options, + value: '', + valueMap: [], + }; + let start; + if (options.quotes?.length && (src.peek() === '"' || src.peek() === "'")) { + const currentQuote = src.read(); + ans.quote = currentQuote; + let cStart = src.cursor; + start = cStart; + while (src.canRead() && src.peek() !== currentQuote) { + const c = src.peek(); + if (options.escapable && c === '\\') { + src.skip(); + const c2 = src.read(); + if (c2 === '\\' + || c2 === currentQuote + || EscapeChar.is(options.escapable.characters, c2)) { + ans.valueMap.push({ + inner: Range.create(ans.value.length, ans.value.length + 1), + outer: Range.create(cStart, src), + }); + ans.value += EscapeTable.get(c2); + } + else if (options.escapable.unicode && c2 === 'u') { + const hex = src.peek(4); + if (/^[0-9a-f]{4}$/i.test(hex)) { + src.skip(4); + ans.valueMap.push({ + inner: Range.create(ans.value.length, ans.value.length + 1), + outer: Range.create(cStart, src), + }); + ans.value += String.fromCharCode(parseInt(hex, 16)); + } + else { + ctx.err.report(localize('parser.string.illegal-unicode-escape'), Range.create(src, src.getCharRange(3).end)); + ans.valueMap.push({ + inner: Range.create(ans.value.length, ans.value.length + 1), + outer: Range.create(cStart, src), + }); + ans.value += c2; + } + } + else { + if (!options.escapable.allowUnknown) { + ctx.err.report(localize('parser.string.illegal-escape', localeQuote(c2)), src.getCharRange(-1)); + } + ans.valueMap.push({ + inner: Range.create(ans.value.length, ans.value.length + 1), + outer: Range.create(cStart, src), + }); + ans.value += c2; + } + cStart = src.cursor; + } + else { + src.skip(); + const cEnd = src.cursor; + if (cEnd - cStart > 1) { + ans.valueMap.push({ + inner: Range.create(ans.value.length, ans.value.length + 1), + outer: Range.create(cStart, cEnd), + }); + } + ans.value += c; + cStart = cEnd; + } + } + if (!src.trySkip(currentQuote)) { + ctx.err.report(localize('expected', localeQuote(currentQuote)), src); + } + if (!options.quotes.includes(currentQuote)) { + ctx.err.report(localize('parser.string.illegal-quote', options.quotes), ans); + } + } + else if (options.unquotable) { + start = src.cursor; + while (src.canRead() && isAllowedCharacter(src.peek(), options.unquotable)) { + ans.value += src.read(); + } + if (!ans.value && !options.unquotable.allowEmpty) { + ctx.err.report(localize('expected', localize('string')), src); + } + } + else { + start = src.cursor; + ctx.err.report(localize('expected', options.quotes), src); + } + ans.valueMap.unshift({ inner: Range.create(0), outer: Range.create(start) }); + if (options.value?.parser) { + const valueResult = parseStringValue(options.value.parser, ans.value, ans.valueMap, ctx); + /* istanbul ignore else */ + if (valueResult !== Parser_Failure) { + ans.children = [valueResult]; + } + } + ans.range.end = src.cursor; + return ans; + }; +} +function parseStringValue(parser, value, map, ctx) { + const valueSrc = new Source(value, map); + const valueCtx = { + ...ctx, + doc: TextDocument.create(ctx.doc.uri, ctx.doc.languageId, ctx.doc.version, value), + }; + // TODO: Mark trailing string as errors. + return parser(valueSrc, valueCtx); +} +const BrigadierUnquotableCharacters = Object.freeze([ + '0', + '1', + '2', + '3', + '4', + '5', + '6', + '7', + '8', + '9', + 'A', + 'B', + 'C', + 'D', + 'E', + 'F', + 'G', + 'H', + 'I', + 'J', + 'K', + 'L', + 'M', + 'N', + 'O', + 'P', + 'Q', + 'R', + 'S', + 'T', + 'U', + 'V', + 'W', + 'X', + 'Y', + 'Z', + 'a', + 'b', + 'c', + 'd', + 'e', + 'f', + 'g', + 'h', + 'i', + 'j', + 'k', + 'l', + 'm', + 'n', + 'o', + 'p', + 'q', + 'r', + 's', + 't', + 'u', + 'v', + 'w', + 'x', + 'y', + 'z', + '_', + '.', + '+', + '-', +]); +const BrigadierUnquotableCharacterSet = new Set(BrigadierUnquotableCharacters); +const BrigadierUnquotablePattern = /^[0-9A-Za-z_\.\+\-]*$/; +const BrigadierUnquotableOption = { + allowEmpty: true, + allowList: BrigadierUnquotableCharacterSet, +}; +const BrigadierStringOptions = { + escapable: {}, + quotes: ['"', "'"], + unquotable: BrigadierUnquotableOption, +}; +const brigadierString = string_string(BrigadierStringOptions); +function isAllowedCharacter(c, options) { + return options.allowList?.has(c) ?? !options.blockList?.has(c); +} +//# sourceMappingURL=string.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/symbol.js + +function symbol_symbol(param) { + const options = symbol_getOptions(param); + return (src, _ctx) => { + const ans = { + type: 'symbol', + range: Range.create(src), + options, + value: src.readRemaining(), + }; + ans.range.end = src.cursor; + return ans; + }; +} +function symbol_getOptions(param) { + if (typeof param === 'string') { + return { category: param }; + } + else { + return param; + } +} +//# sourceMappingURL=symbol.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/parser/index.js +/* istanbul ignore file */ + + + + + + + + + + + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/index.js + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/node/index.js + +var ModuleNode; +(function (ModuleNode) { + function is(node) { + return node?.type === 'mcdoc:module'; + } + ModuleNode.is = is; +})(ModuleNode || (ModuleNode = {})); +var TopLevelNode; +(function (TopLevelNode) { + function is(node) { + return (CommentNode.is(node) + || DispatchStatementNode.is(node) + || EnumNode.is(node) + || InjectionNode.is(node) + || StructNode.is(node) + || TypeAliasNode.is(node) + || UseStatementNode.is(node)); + } + TopLevelNode.is = is; +})(TopLevelNode || (TopLevelNode = {})); +var DispatchStatementNode; +(function (DispatchStatementNode) { + function destruct(node) { + return { + attributes: node.children.filter(AttributeNode.is), + location: node.children.find(ResourceLocationNode.is), + index: node.children.find(IndexBodyNode.is), + target: node.children.find(TypeNode.is), + typeParams: node.children.find(TypeParamBlockNode.is), + }; + } + DispatchStatementNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:dispatch_statement'); + } + DispatchStatementNode.is = is; +})(DispatchStatementNode || (DispatchStatementNode = {})); +var node_LiteralNode; +(function (LiteralNode) { + function is(node) { + return node?.type === 'mcdoc:literal'; + } + LiteralNode.is = is; +})(node_LiteralNode || (node_LiteralNode = {})); +var IndexBodyNode; +(function (IndexBodyNode) { + function destruct(node) { + return { parallelIndices: node.children.filter(IndexNode.is) }; + } + IndexBodyNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:index_body'; + } + IndexBodyNode.is = is; +})(IndexBodyNode || (IndexBodyNode = {})); +var IndexNode; +(function (IndexNode) { + function is(node) { + return StaticIndexNode.is(node) || DynamicIndexNode.is(node); + } + IndexNode.is = is; +})(IndexNode || (IndexNode = {})); +var StaticIndexNode; +(function (StaticIndexNode) { + function is(node) { + return (node_LiteralNode.is(node) + || IdentifierNode.is(node) + || StringNode.is(node) + || ResourceLocationNode.is(node)); + } + StaticIndexNode.is = is; +})(StaticIndexNode || (StaticIndexNode = {})); +var IdentifierNode; +(function (IdentifierNode) { + function is(node) { + return node?.type === 'mcdoc:identifier'; + } + IdentifierNode.is = is; +})(IdentifierNode || (IdentifierNode = {})); +var DynamicIndexNode; +(function (DynamicIndexNode) { + function destruct(node) { + return { keys: node.children.filter(AccessorKeyNode.is) }; + } + DynamicIndexNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:dynamic_index'); + } + DynamicIndexNode.is = is; +})(DynamicIndexNode || (DynamicIndexNode = {})); +var AccessorKeyNode; +(function (AccessorKeyNode) { + function is(node) { + return (node_LiteralNode.is(node) || IdentifierNode.is(node) || StringNode.is(node)); + } + AccessorKeyNode.is = is; +})(AccessorKeyNode || (AccessorKeyNode = {})); +var TypeNode; +(function (TypeNode) { + function is(node) { + return (AnyTypeNode.is(node) + || BooleanTypeNode.is(node) + || StringTypeNode.is(node) + || LiteralTypeNode.is(node) + || NumericTypeNode.is(node) + || PrimitiveArrayTypeNode.is(node) + || ListTypeNode.is(node) + || TupleTypeNode.is(node) + || EnumNode.is(node) + || StructNode.is(node) + || ReferenceTypeNode.is(node) + || DispatcherTypeNode.is(node) + || UnionTypeNode.is(node)); + } + TypeNode.is = is; +})(TypeNode || (TypeNode = {})); +var TypeBaseNode; +(function (TypeBaseNode) { + function destruct(node) { + return { + appendixes: node.children.filter((n) => IndexBodyNode.is(n) || TypeArgBlockNode.is(n)), + attributes: node.children.filter(AttributeNode.is), + }; + } + TypeBaseNode.destruct = destruct; +})(TypeBaseNode || (TypeBaseNode = {})); +var AttributeNode; +(function (AttributeNode) { + function destruct(node) { + return { + name: node.children.find(IdentifierNode.is), + value: node.children.find(AttributeValueNode.is), + }; + } + AttributeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:attribute'; + } + AttributeNode.is = is; +})(AttributeNode || (AttributeNode = {})); +var AttributeValueNode; +(function (AttributeValueNode) { + function is(node) { + return TypeNode.is(node) || AttributeTreeNode.is(node); + } + AttributeValueNode.is = is; +})(AttributeValueNode || (AttributeValueNode = {})); +var AttributeTreeNode; +(function (AttributeTreeNode) { + function destruct(node) { + return { + positional: node.children.find(AttributeTreePosValuesNode.is), + named: node.children.find(AttributeTreeNamedValuesNode.is), + }; + } + AttributeTreeNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:attribute/tree'); + } + AttributeTreeNode.is = is; +})(AttributeTreeNode || (AttributeTreeNode = {})); +var AttributeTreePosValuesNode; +(function (AttributeTreePosValuesNode) { + function destruct(node) { + return { values: node.children.filter(AttributeValueNode.is) }; + } + AttributeTreePosValuesNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:attribute/tree/pos'); + } + AttributeTreePosValuesNode.is = is; +})(AttributeTreePosValuesNode || (AttributeTreePosValuesNode = {})); +var AttributeTreeNamedValuesNode; +(function (AttributeTreeNamedValuesNode) { + function destruct(node) { + const ans = { values: [] }; + let key; + for (const child of node.children) { + if (CommentNode.is(child)) { + continue; + } + if (IdentifierNode.is(child) || StringNode.is(child)) { + key = child; + } + else if (key) { + ans.values.push({ key, value: child }); + key = undefined; + } + } + return ans; + } + AttributeTreeNamedValuesNode.destruct = destruct; + function is(node) { + return (node?.type + === 'mcdoc:attribute/tree/named'); + } + AttributeTreeNamedValuesNode.is = is; +})(AttributeTreeNamedValuesNode || (AttributeTreeNamedValuesNode = {})); +var TypeArgBlockNode; +(function (TypeArgBlockNode) { + function destruct(node) { + return { args: node.children.filter(TypeNode.is) }; + } + TypeArgBlockNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:type_arg_block'); + } + TypeArgBlockNode.is = is; +})(TypeArgBlockNode || (TypeArgBlockNode = {})); +var AnyTypeNode; +(function (AnyTypeNode) { + function is(node) { + return node?.type === 'mcdoc:type/any'; + } + AnyTypeNode.is = is; +})(AnyTypeNode || (AnyTypeNode = {})); +var BooleanTypeNode; +(function (BooleanTypeNode) { + function is(node) { + return node?.type === 'mcdoc:type/boolean'; + } + BooleanTypeNode.is = is; +})(BooleanTypeNode || (BooleanTypeNode = {})); +var IntRangeNode; +(function (IntRangeNode) { + function destruct(node) { + return destructRangeNode(node); + } + IntRangeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:int_range'; + } + IntRangeNode.is = is; +})(IntRangeNode || (IntRangeNode = {})); +var LiteralTypeNode; +(function (LiteralTypeNode) { + function destruct(node) { + return { value: node.children.find(LiteralTypeValueNode.is) }; + } + LiteralTypeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:type/literal'; + } + LiteralTypeNode.is = is; +})(LiteralTypeNode || (LiteralTypeNode = {})); +var LiteralTypeValueNode; +(function (LiteralTypeValueNode) { + function is(node) { + return (node_LiteralNode.is(node) || TypedNumberNode.is(node) || StringNode.is(node)); + } + LiteralTypeValueNode.is = is; +})(LiteralTypeValueNode || (LiteralTypeValueNode = {})); +var TypedNumberNode; +(function (TypedNumberNode) { + function destruct(node) { + return { + value: node.children.find(FloatNode.is) ?? node.children.find(IntegerNode.is), + suffix: node.children.find(node_LiteralNode.is), + }; + } + TypedNumberNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:typed_number'; + } + TypedNumberNode.is = is; +})(TypedNumberNode || (TypedNumberNode = {})); +var NumericTypeNode; +(function (NumericTypeNode) { + function destruct(node) { + return { + numericKind: node.children.find(node_LiteralNode.is), + valueRange: node.children.find(FloatRangeNode.is) || node.children.find(IntRangeNode.is), + }; + } + NumericTypeNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:type/numeric_type'); + } + NumericTypeNode.is = is; +})(NumericTypeNode || (NumericTypeNode = {})); +const RangeExclusiveChar = '<'; +var RangeKind; +(function (RangeKind) { + function isLeftExclusive(rangeKind) { + return (rangeKind & 0b10) !== 0; + } + RangeKind.isLeftExclusive = isLeftExclusive; + function isRightExclusive(rangeKind) { + return (rangeKind & 0b01) !== 0; + } + RangeKind.isRightExclusive = isRightExclusive; +})(RangeKind || (RangeKind = {})); +function getRangeDelimiter(kind) { + const prefix = kind & 0b10 ? RangeExclusiveChar : ''; + const suffix = kind & 0b01 ? RangeExclusiveChar : ''; + return `${prefix}..${suffix}`; +} +function destructRangeNode(node) { + let kind; + let min; + let max; + if (node.children.length === 1) { + // a + kind = 0b00; + min = max = node.children[0]; + } + else if (node.children.length === 3) { + // a..b + kind = getKind(node.children[1]); + min = node.children[0]; + max = node.children[2]; + } + else if (node_LiteralNode.is(node.children[0])) { + // ..b + kind = getKind(node.children[0]); + max = node.children[1]; + } + else { + // a.. + kind = getKind(node.children[1]); + min = node.children[0]; + } + return { kind, min, max }; + function getKind(delimiter) { + let ans = 0b00; + if (delimiter.value.startsWith(RangeExclusiveChar)) { + ans |= 0b10; + } + if (delimiter.value.endsWith(RangeExclusiveChar)) { + ans |= 0b01; + } + return ans; + } +} +var FloatRangeNode; +(function (FloatRangeNode) { + function destruct(node) { + return destructRangeNode(node); + } + FloatRangeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:float_range'; + } + FloatRangeNode.is = is; +})(FloatRangeNode || (FloatRangeNode = {})); +var PrimitiveArrayTypeNode; +(function (PrimitiveArrayTypeNode) { + function destruct(node) { + let lengthRange; + let valueRange; + let afterBrackets = false; + for (const child of node.children) { + if (node_LiteralNode.is(child) && child.value === '[]') { + afterBrackets = true; + } + else if (IntRangeNode.is(child)) { + if (afterBrackets) { + lengthRange = child; + } + else { + valueRange = child; + } + } + } + return { arrayKind: node.children.find(node_LiteralNode.is), lengthRange, valueRange }; + } + PrimitiveArrayTypeNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:type/primitive_array'); + } + PrimitiveArrayTypeNode.is = is; +})(PrimitiveArrayTypeNode || (PrimitiveArrayTypeNode = {})); +var ListTypeNode; +(function (ListTypeNode) { + function destruct(node) { + return { + item: node.children.find(TypeNode.is), + lengthRange: node.children.find(IntRangeNode.is), + }; + } + ListTypeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:type/list'; + } + ListTypeNode.is = is; +})(ListTypeNode || (ListTypeNode = {})); +var StringTypeNode; +(function (StringTypeNode) { + function destruct(node) { + return { lengthRange: node.children.find(IntRangeNode.is) }; + } + StringTypeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:type/string'; + } + StringTypeNode.is = is; +})(StringTypeNode || (StringTypeNode = {})); +var TupleTypeNode; +(function (TupleTypeNode) { + function destruct(node) { + return { items: node.children.filter(TypeNode.is) }; + } + TupleTypeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:type/tuple'; + } + TupleTypeNode.is = is; +})(TupleTypeNode || (TupleTypeNode = {})); +var EnumNode; +(function (EnumNode) { + EnumNode.Kinds = new Set(['byte', 'short', 'int', 'long', 'float', 'double', 'string']); + function destruct(node) { + return { + block: node.children.find(EnumBlockNode.is), + docComments: node.children.find(DocCommentsNode.is), + enumKind: getEnumKind(node), + identifier: node.children.find(IdentifierNode.is), + keyword: node.children.find(node_LiteralNode.is), + }; + function getEnumKind(node) { + for (const literal of node.children.filter(node_LiteralNode.is)) { + if (EnumNode.Kinds.has(literal.value)) { + return literal.value; + } + } + return undefined; + } + } + EnumNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:enum'; + } + EnumNode.is = is; +})(EnumNode || (EnumNode = {})); +var DocCommentsNode; +(function (DocCommentsNode) { + /** + * @returns The text content of this doc comment block. + */ + function asText(node) { + if (!node) { + return undefined; + } + let comments = node.children.map((doc) => doc.comment); + // If every comment contains a leading space or is empty, stripe the leading spaces off. + // e.g. /// This is an example doc comment. + // /// + // /// Another line. + // should be converted to "This is an example doc comment.\n\nAnother line." + if (comments.every((s) => s.length === 0 || s.startsWith(' '))) { + comments = comments.map((s) => s.slice(1)); + } + return comments.join('\n'); + } + DocCommentsNode.asText = asText; + function is(node) { + return node?.type === 'mcdoc:doc_comments'; + } + DocCommentsNode.is = is; +})(DocCommentsNode || (DocCommentsNode = {})); +var EnumBlockNode; +(function (EnumBlockNode) { + function destruct(node) { + return { fields: node.children.filter(EnumFieldNode.is) }; + } + EnumBlockNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:enum/block'; + } + EnumBlockNode.is = is; +})(EnumBlockNode || (EnumBlockNode = {})); +var EnumFieldNode; +(function (EnumFieldNode) { + function destruct(node) { + return { + attributes: node.children.filter(AttributeNode.is), + docComments: node.children.find(DocCommentsNode.is), + identifier: node.children.find(IdentifierNode.is), + value: node.children.find(EnumValueNode.is), + }; + } + EnumFieldNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:enum/field'; + } + EnumFieldNode.is = is; +})(EnumFieldNode || (EnumFieldNode = {})); +var EnumValueNode; +(function (EnumValueNode) { + function is(node) { + return TypedNumberNode.is(node) || StringNode.is(node); + } + EnumValueNode.is = is; +})(EnumValueNode || (EnumValueNode = {})); +var PrelimNode; +(function (PrelimNode) { + function is(node) { + return AttributeNode.is(node) || DocCommentsNode.is(node); + } + PrelimNode.is = is; +})(PrelimNode || (PrelimNode = {})); +var StructNode; +(function (StructNode) { + function destruct(node) { + return { + block: node.children.find(StructBlockNode.is), + docComments: node.children.find(DocCommentsNode.is), + identifier: node.children.find(IdentifierNode.is), + keyword: node.children.find(node_LiteralNode.is), + }; + } + StructNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:struct'; + } + StructNode.is = is; +})(StructNode || (StructNode = {})); +var ReferenceTypeNode; +(function (ReferenceTypeNode) { + function destruct(node) { + return { path: node.children.find(PathNode.is) }; + } + ReferenceTypeNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:type/reference'); + } + ReferenceTypeNode.is = is; +})(ReferenceTypeNode || (ReferenceTypeNode = {})); +var TypeParamBlockNode; +(function (TypeParamBlockNode) { + function destruct(node) { + return { params: node.children.filter(TypeParamNode.is) }; + } + TypeParamBlockNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:type_param_block'); + } + TypeParamBlockNode.is = is; +})(TypeParamBlockNode || (TypeParamBlockNode = {})); +var TypeParamNode; +(function (TypeParamNode) { + function destruct(node) { + return { + // constraint: node.children.find(TypeNode.is), + identifier: node.children.find(IdentifierNode.is), + }; + } + TypeParamNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:type_param'; + } + TypeParamNode.is = is; +})(TypeParamNode || (TypeParamNode = {})); +var PathNode; +(function (PathNode) { + function destruct(node) { + const lastChild = atArray(node?.children, -1); + return { + children: node?.children ?? [], + isAbsolute: node?.isAbsolute, + lastIdentifier: IdentifierNode.is(lastChild) ? lastChild : undefined, + }; + } + PathNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:path'; + } + PathNode.is = is; +})(PathNode || (PathNode = {})); +var StructBlockNode; +(function (StructBlockNode) { + function destruct(node) { + return { fields: node.children.filter(StructFieldNode.is) }; + } + StructBlockNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:struct/block'; + } + StructBlockNode.is = is; +})(StructBlockNode || (StructBlockNode = {})); +var StructFieldNode; +(function (StructFieldNode) { + function is(node) { + return StructPairFieldNode.is(node) || StructSpreadFieldNode.is(node); + } + StructFieldNode.is = is; +})(StructFieldNode || (StructFieldNode = {})); +var StructPairFieldNode; +(function (StructPairFieldNode) { + function destruct(node) { + return { + attributes: node.children.filter(AttributeNode.is), + docComments: node.children.find(DocCommentsNode.is), + key: node.children.find(StructKeyNode.is), + type: node.children.find(TypeNode.is), + isOptional: node.isOptional, + }; + } + StructPairFieldNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:struct/field/pair'); + } + StructPairFieldNode.is = is; +})(StructPairFieldNode || (StructPairFieldNode = {})); +var StructKeyNode; +(function (StructKeyNode) { + function is(node) { + return (StringNode.is(node) || IdentifierNode.is(node) || StructMapKeyNode.is(node)); + } + StructKeyNode.is = is; +})(StructKeyNode || (StructKeyNode = {})); +var StructMapKeyNode; +(function (StructMapKeyNode) { + function destruct(node) { + return { type: node.children.find(TypeNode.is) }; + } + StructMapKeyNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:struct/map_key'); + } + StructMapKeyNode.is = is; +})(StructMapKeyNode || (StructMapKeyNode = {})); +var StructSpreadFieldNode; +(function (StructSpreadFieldNode) { + function destruct(node) { + return { + attributes: node.children.filter(AttributeNode.is), + type: node.children.find(TypeNode.is), + }; + } + StructSpreadFieldNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:struct/field/spread'); + } + StructSpreadFieldNode.is = is; +})(StructSpreadFieldNode || (StructSpreadFieldNode = {})); +var DispatcherTypeNode; +(function (DispatcherTypeNode) { + function destruct(node) { + return { + location: node.children.find(ResourceLocationNode.is), + index: node.children.find(IndexBodyNode.is), + }; + } + DispatcherTypeNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:type/dispatcher'); + } + DispatcherTypeNode.is = is; +})(DispatcherTypeNode || (DispatcherTypeNode = {})); +var UnionTypeNode; +(function (UnionTypeNode) { + function destruct(node) { + return { members: node.children.filter(TypeNode.is) }; + } + UnionTypeNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:type/union'; + } + UnionTypeNode.is = is; +})(UnionTypeNode || (UnionTypeNode = {})); +var InjectionNode; +(function (InjectionNode) { + function destruct(node) { + return { injection: node.children.find(InjectionContentNode.is) }; + } + InjectionNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:injection'; + } + InjectionNode.is = is; +})(InjectionNode || (InjectionNode = {})); +var InjectionContentNode; +(function (InjectionContentNode) { + function is(node) { + return EnumInjectionNode.is(node) || StructInjectionNode.is(node); + } + InjectionContentNode.is = is; +})(InjectionContentNode || (InjectionContentNode = {})); +var EnumInjectionNode; +(function (EnumInjectionNode) { + function is(node) { + return (node?.type === 'mcdoc:injection/enum'); + } + EnumInjectionNode.is = is; +})(EnumInjectionNode || (EnumInjectionNode = {})); +var StructInjectionNode; +(function (StructInjectionNode) { + function is(node) { + return (node?.type === 'mcdoc:injection/struct'); + } + StructInjectionNode.is = is; +})(StructInjectionNode || (StructInjectionNode = {})); +var TypeAliasNode; +(function (TypeAliasNode) { + function destruct(node) { + return { + attributes: node.children.filter(AttributeNode.is), + docComments: node.children.find(DocCommentsNode.is), + identifier: node.children.find(IdentifierNode.is), + keyword: node.children.find(node_LiteralNode.is), + typeParams: node.children.find(TypeParamBlockNode.is), + rhs: node.children.find(TypeNode.is), + }; + } + TypeAliasNode.destruct = destruct; + function is(node) { + return node?.type === 'mcdoc:type_alias'; + } + TypeAliasNode.is = is; +})(TypeAliasNode || (TypeAliasNode = {})); +var UseStatementNode; +(function (UseStatementNode) { + function destruct(node) { + return { + binding: node.children.find(IdentifierNode.is), + path: node.children.find(PathNode.is), + }; + } + UseStatementNode.destruct = destruct; + function is(node) { + return (node?.type === 'mcdoc:use_statement'); + } + UseStatementNode.is = is; +})(UseStatementNode || (UseStatementNode = {})); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/binder/index.js + + + +var ModuleSymbolData; +(function (ModuleSymbolData) { + function is(data) { + return (!!data + && typeof data === 'object' + && typeof data.nextAnonymousIndex === 'number'); + } + ModuleSymbolData.is = is; +})(ModuleSymbolData || (ModuleSymbolData = {})); +var TypeDefSymbolData; +(function (TypeDefSymbolData) { + function is(data) { + return (!!data + && typeof data === 'object' + && typeof data.typeDef === 'object'); + } + TypeDefSymbolData.is = is; +})(TypeDefSymbolData || (TypeDefSymbolData = {})); +const fileModule = AsyncBinder.create(async (node, ctx) => { + const moduleIdentifier = uriToIdentifier(ctx.doc.uri, ctx); + if (!moduleIdentifier) { + ctx.err.report(localize('mcdoc.binder.out-of-root', localeQuote(ctx.doc.uri)), Range.Beginning, 0 /* ErrorSeverity.Hint */); + return; + } + const mcdocCtx = { ...ctx, moduleIdentifier }; + return module_(node, mcdocCtx); +}); +async function module_(node, ctx) { + const data = { nextAnonymousIndex: 0 }; + ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ctx.moduleIdentifier).amend({ + data: { data }, + }); + hoist(node, { ...ctx, isHoisting: true }); + for (const child of node.children) { + switch (child.type) { + case 'mcdoc:dispatch_statement': + await bindDispatchStatement(child, ctx); + break; + case 'mcdoc:enum': + bindEnum(child, ctx); + break; + case 'mcdoc:injection': + await bindInjection(child, ctx); + break; + case 'mcdoc:struct': + await bindStruct(child, ctx); + break; + case 'mcdoc:type_alias': + await bindTypeAlias(child, ctx); + break; + case 'mcdoc:use_statement': + await bindUseStatement(child, ctx); + break; + } + } +} +/** + * Hoist enums, structs, type aliases, and use statements under the module scope. + */ +function hoist(node, ctx) { + traversePreOrder(node, () => true, TopLevelNode.is, (child) => { + switch (child.type) { + case 'mcdoc:enum': + hoistEnum(child); + break; + case 'mcdoc:struct': + hoistStruct(child); + break; + case 'mcdoc:type_alias': + hoistTypeAlias(child); + break; + case 'mcdoc:use_statement': + hoistUseStatement(child); + break; + } + }); + function hoistEnum(node) { + hoistFor('enum', node, EnumNode.destruct, (n) => ({ typeDef: convertEnum(n, ctx) })); + } + function hoistStruct(node) { + hoistFor('struct', node, StructNode.destruct, (n) => ({ typeDef: convertStruct(n, ctx) })); + } + function hoistTypeAlias(node) { + hoistFor('type_alias', node, TypeAliasNode.destruct, (n) => { + const { attributes, rhs, typeParams } = TypeAliasNode.destruct(n); + if (!rhs) { + return undefined; + } + const ans = { typeDef: convertType(rhs, ctx) }; + if (typeParams) { + bindTypeParamBlock(node, typeParams, ans, ctx); + } + appendAttributes(ans.typeDef, attributes, ctx); + return ans; + }); + } + function hoistUseStatement(node) { + const { binding, path } = UseStatementNode.destruct(node); + if (!path) { + return; + } + const { lastIdentifier } = PathNode.destruct(path); + const identifier = binding ?? lastIdentifier; + if (!identifier) { + return; + } + // hoistUseStatement associates the AST node with the binding definition in the file symbol table, + // which will get overridden by bindUseStatement in the later stage as an reference to the imported symbol in the global symbol table. + // This way when the user tries to go to definition on the path in the use statement, + // they will go to the definition in the imported file. + const target = resolvePath(path, ctx); + ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', `${ctx.moduleIdentifier}::${identifier.value}`).ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, identifier)).elseEnter({ + data: { + subcategory: 'use_statement_binding', + visibility: 1 /* SymbolVisibility.File */, + data: target ? { target } : undefined, + }, + usage: { type: 'definition', node: identifier, fullRange: node }, + }); + } + function hoistFor(subcategory, node, destructor, getData) { + const { docComments, identifier, keyword } = destructor(node); + const name = identifier?.value ?? nextAnonymousIdentifier(node, ctx); + ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', `${ctx.moduleIdentifier}::${name}`) + .ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, identifier ?? node)) + .elseEnter({ + data: { data: getData(node), desc: DocCommentsNode.asText(docComments), subcategory }, + // If the current syntax structure is named, then the identifier node is entered as a definition; + // otherwise, an anonymous identifier is generated for the symbol and the keyword node is entered as a definition. + usage: { + type: 'definition', + node: identifier ?? keyword, + fullRange: identifier && node, + }, + }); + } + function nextAnonymousIndex(node, ctx) { + const data = ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ctx.moduleIdentifier).getData(ModuleSymbolData.is); + if (!data) { + throw new Error(`No symbol data for module '${ctx.moduleIdentifier}'`); + } + return data.nextAnonymousIndex++; + } + function nextAnonymousIdentifier(node, ctx) { + return ``; + } +} +/** + * Bind the type param block of a parent node, and modifies the `data` argument in-place to change its `typeDef` to be of template kind. + */ +function bindTypeParamBlock(node, typeParams, data, ctx) { + // Type parameters are added as local symbols on the type alias AST node. + // Thus we create a new local scope on the type alias statement node first. + node.locals = Object.create(null); + // They are also added to the type definition. + data.typeDef = { kind: 'template', child: data.typeDef, typeParams: [] }; + const { params } = TypeParamBlockNode.destruct(typeParams); + for (const param of params) { + const { identifier: paramIdentifier } = TypeParamNode.destruct(param); + if (paramIdentifier.value) { + // Add the type parameter as a local symbol. + const paramPath = `${ctx.moduleIdentifier}::${paramIdentifier.value}`; + ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', paramPath).ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, paramIdentifier)).elseEnter({ + data: { visibility: 0 /* SymbolVisibility.Block */ }, + usage: { type: 'declaration', node: paramIdentifier, fullRange: param }, + }); + // Also add it to the type definition. + data.typeDef.typeParams.push({ path: paramPath }); + } + // if (constraint) { + // await bindPath(constraint, ctx) + // } + } +} +async function bindDispatchStatement(node, ctx) { + const { attributes, location, index, target, typeParams } = DispatchStatementNode.destruct(node); + if (!(location && index && target)) { + return; + } + const locationStr = ResourceLocationNode.toString(location, 'full'); + ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr).enter({ + usage: { type: 'reference', node: location, fullRange: node }, + }); + const { parallelIndices } = IndexBodyNode.destruct(index); + if (parallelIndices.length) { + const data = { typeDef: convertType(target, ctx) }; + if (typeParams) { + bindTypeParamBlock(node, typeParams, data, ctx); + } + appendAttributes(data.typeDef, attributes, ctx); + for (const key of parallelIndices) { + if (DynamicIndexNode.is(key)) { + // Ignore dynamic indices in dispatch statements. + continue; + } + ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr, asString(key)).ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, key, { + localeString: 'mcdoc.binder.dispatcher-statement.duplicated-key', + })).elseEnter({ data: { data }, usage: { type: 'definition', node: key, fullRange: node } }); + } + } + await bindType(target, ctx); +} +async function bindType(node, ctx) { + if (DispatcherTypeNode.is(node)) { + await bindDispatcherType(node, ctx); + } + else if (EnumNode.is(node)) { + bindEnum(node, ctx); + } + else if (ListTypeNode.is(node)) { + const { item } = ListTypeNode.destruct(node); + await bindType(item, ctx); + } + else if (ReferenceTypeNode.is(node)) { + const { path } = ReferenceTypeNode.destruct(node); + await bindPath(path, ctx); + } + else if (StructNode.is(node)) { + await bindStruct(node, ctx); + } + else if (TupleTypeNode.is(node)) { + const { items } = TupleTypeNode.destruct(node); + for (const item of items) { + await bindType(item, ctx); + } + } + else if (UnionTypeNode.is(node)) { + const { members } = UnionTypeNode.destruct(node); + for (const member of members) { + await bindType(member, ctx); + } + } + const { appendixes } = TypeBaseNode.destruct(node); + for (const appendix of appendixes) { + if (TypeArgBlockNode.is(appendix)) { + const { args } = TypeArgBlockNode.destruct(appendix); + for (const arg of args) { + await bindType(arg, ctx); + } + } + } +} +async function bindDispatcherType(node, ctx) { + const { index, location } = DispatcherTypeNode.destruct(node); + const locationStr = ResourceLocationNode.toString(location, 'full'); + ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr).enter({ + usage: { type: 'reference', node: location, fullRange: node }, + }); + const { parallelIndices } = IndexBodyNode.destruct(index); + for (const key of parallelIndices) { + if (DynamicIndexNode.is(key)) { + // Although it is technically possible to bind some of the dynamic indices as references + // of struct keys, it is rather complicated to do so. We will ignore them for now. + continue; + } + ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', locationStr, asString(key)).enter({ + usage: { type: 'reference', node: key, fullRange: node }, + }); + } +} +async function bindPath(node, ctx) { + for (const { identifiers, node: identNode, indexRight } of resolvePathByStep(node, ctx, { + reportErrors: true, + })) { + if (!identifiers?.length) { + continue; + } + if (indexRight === 1) { + // The second last identifier in a path points to a file module. + const referencedModuleFile = pathArrayToString(identifiers); + const referencedModuleUri = identifierToUri(referencedModuleFile, ctx); + if (!referencedModuleUri) { + ctx.err.report(localize('mcdoc.binder.path.unknown-module', localeQuote(referencedModuleFile)), node, 2 /* ErrorSeverity.Warning */); + return; + } + await ctx.ensureBindingStarted(referencedModuleUri); + } + ctx.symbols.query({ doc: ctx.doc, node: identNode }, 'mcdoc', pathArrayToString(identifiers)) + .ifDeclared((_, query) => query.enter({ + usage: { + type: 'reference', + node: identNode, + fullRange: node, + skipRenaming: node_LiteralNode.is(identNode), + }, + })).else(() => { + if (indexRight === 0) { + ctx.err.report(localize('mcdoc.binder.path.unknown-identifier', localeQuote(atArray(identifiers, -1)), localeQuote(pathArrayToString(identifiers.slice(0, -1)))), node, 2 /* ErrorSeverity.Warning */); + } + }); + } +} +function bindEnum(node, ctx) { + const { block, identifier, keyword } = EnumNode.destruct(node); + const symbol = identifier?.symbol ?? keyword.symbol; + if (symbol?.subcategory !== 'enum') { + return; + } + const query = ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ...symbol.path); + Dev.assertDefined(query.symbol); + bindEnumBlock(block, ctx, query); +} +function bindEnumBlock(node, ctx, query, options = {}) { + const { fields } = EnumBlockNode.destruct(node); + for (const field of fields) { + const { identifier } = EnumFieldNode.destruct(field); + query.member(identifier.value, (fieldQuery) => fieldQuery.ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, identifier)) + .elseEnter({ usage: { type: 'definition', node: identifier, fullRange: field } })); + } +} +async function bindInjection(node, ctx) { + const { injection } = InjectionNode.destruct(node); + if (EnumInjectionNode.is(injection)) { + // TODO + // const { } = EnumInjectionNode.destruct(injection) + // bindEnumBlock(block, ctx, query, { extendsTypeDefData: true }) + } +} +async function bindStruct(node, ctx) { + const { block, identifier, keyword } = StructNode.destruct(node); + const symbol = identifier?.symbol ?? keyword.symbol; + if (symbol?.subcategory !== 'struct') { + return; + } + const query = ctx.symbols.query({ doc: ctx.doc, node }, 'mcdoc', ...symbol.path); + Dev.assertDefined(query.symbol); + await bindStructBlock(block, ctx, query); +} +async function bindStructBlock(node, ctx, query, options = {}) { + const { fields } = StructBlockNode.destruct(node); + for (const field of fields) { + if (StructPairFieldNode.is(field)) { + const { key, type } = StructPairFieldNode.destruct(field); + if (!StructMapKeyNode.is(key)) { + query.member(key.value, (fieldQuery) => fieldQuery.ifDeclared((symbol) => reportDuplicatedDeclaration(ctx, symbol, key)) + .elseEnter({ usage: { type: 'definition', node: key, fullRange: field } })); + } + await bindType(type, ctx); + } + else { + const { type } = StructSpreadFieldNode.destruct(field); + await bindType(type, ctx); + } + } +} +async function bindTypeAlias(node, ctx) { + const { identifier, rhs, typeParams } = TypeAliasNode.destruct(node); + if (!identifier?.value) { + return; + } + if (rhs) { + await bindType(rhs, ctx); + } +} +async function bindUseStatement(node, ctx) { + const { path } = UseStatementNode.destruct(node); + if (!path) { + return; + } + return bindPath(path, ctx); +} +function registerMcdocBinders(meta) { + meta.registerBinder('mcdoc:module', fileModule); +} +function reportDuplicatedDeclaration(ctx, symbol, range, options = { localeString: 'mcdoc.binder.duplicated-declaration' }) { + ctx.err.report(localize(options.localeString, localeQuote(symbol.identifier)), range, 2 /* ErrorSeverity.Warning */, { + related: [{ + location: SymbolUtil.getDeclaredLocation(symbol), + message: localize(`${options.localeString}.related`, localeQuote(symbol.identifier)), + }], + }); +} +function* resolvePathByStep(path, ctx, options = {}) { + const { children, isAbsolute } = PathNode.destruct(path); + let identifiers = isAbsolute ? [] : pathStringToArray(ctx.moduleIdentifier); + for (const [i, child] of children.entries()) { + const indexRight = children.length - 1 - i; + switch (child.type) { + case 'mcdoc:identifier': + // For a path node with `n` children, the first `n-1` child nodes specify + // the path of the module that contains the symbol. They will be pushed + // to the `identifiers` array and yielded as-is. The last node, however, + // may be created by a use statement and points to a global symbol + // in a different file. We will query the symbol table and rewrite + // the `identifiers` array to be the target path if needed. + identifiers.push(child.value); + if (indexRight === 0) { + ctx.symbols.query({ doc: ctx.doc, node: child }, 'mcdoc', pathArrayToString(identifiers)).ifDeclared((symbol) => { + const data = symbol.data; + if (data?.target) { + identifiers = [...data.target]; + } + }); + } + break; + case 'mcdoc:literal': + // super + if (identifiers.length === 0) { + if (options.reportErrors) { + ctx.err.report(localize('mcdoc.binder.path.super-from-root'), child); + } + return; + } + identifiers.pop(); + break; + default: + Dev.assertNever(child); + } + yield { identifiers, node: child, index: i, indexRight }; + } +} +function resolvePath(path, ctx, options = {}) { + return atArray([...resolvePathByStep(path, ctx, options)], -1)?.identifiers; +} +function identifierToUri(module, ctx) { + return ctx.symbols.global.mcdoc?.[module]?.definition?.[0]?.uri; +} +function uriToIdentifier(uri, ctx) { + return Object.values(ctx.symbols.global.mcdoc ?? {}).find((symbol) => { + return (symbol.subcategory === 'module' && symbol.definition?.some((loc) => loc.uri === uri)); + })?.identifier; +} +function pathArrayToString(path) { + return path ? `::${path.join('::')}` : undefined; +} +function pathStringToArray(path) { + if (!path.startsWith('::')) { + throw new Error('Only absolute paths are supported'); + } + return path.slice(2).split('::'); +} +function convertType(node, ctx) { + switch (node.type) { + case 'mcdoc:enum': + return convertEnum(node, ctx); + case 'mcdoc:struct': + return convertStruct(node, ctx); + case 'mcdoc:type/any': + return convertAny(node, ctx); + case 'mcdoc:type/boolean': + return convertBoolean(node, ctx); + case 'mcdoc:type/dispatcher': + return convertDispatcher(node, ctx); + case 'mcdoc:type/list': + return convertList(node, ctx); + case 'mcdoc:type/literal': + return convertLiteral(node, ctx); + case 'mcdoc:type/numeric_type': + return convertNumericType(node, ctx); + case 'mcdoc:type/primitive_array': + return convertPrimitiveArray(node, ctx); + case 'mcdoc:type/string': + return convertString(node, ctx); + case 'mcdoc:type/reference': + return convertReference(node, ctx); + case 'mcdoc:type/tuple': + return convertTuple(node, ctx); + case 'mcdoc:type/union': + return convertUnion(node, ctx); + default: + return Dev.assertNever(node); + } +} +function wrapType(node, type, ctx, options = {}) { + const { attributes, appendixes } = TypeBaseNode.destruct(node); + let ans = type; + for (const appendix of appendixes) { + if (IndexBodyNode.is(appendix)) { + if (options.skipFirstIndexBody) { + options.skipFirstIndexBody = false; + continue; + } + ans = { kind: 'indexed', child: ans, parallelIndices: convertIndexBody(appendix, ctx) }; + } + else { + ans = { kind: 'concrete', child: ans, typeArgs: convertTypeArgBlock(appendix, ctx) }; + } + } + ans.attributes = convertAttributes(attributes, ctx); + return ans; +} +function appendAttributes(typeDef, attributes, ctx) { + const convertedAttributes = convertAttributes(attributes, ctx); + if (convertedAttributes) { + if (typeDef.attributes) { + typeDef.attributes = [...typeDef.attributes, ...convertedAttributes]; + } + else { + typeDef.attributes = convertedAttributes; + } + } +} +function convertAttributes(nodes, ctx) { + return undefineEmptyArray(nodes.map((n) => convertAttribute(n, ctx))); +} +function undefineEmptyArray(array) { + return array.length ? array : undefined; +} +function convertAttribute(node, ctx) { + const { name, value } = AttributeNode.destruct(node); + return { name: name.value, value: value && convertAttributeValue(value, ctx) }; +} +function convertAttributeValue(node, ctx) { + if (node.type === 'mcdoc:attribute/tree') { + return { kind: 'tree', values: convertAttributeTree(node, ctx) }; + } + else { + return convertType(node, ctx); + } +} +function convertAttributeTree(node, ctx) { + const ans = {}; + const { named, positional } = AttributeTreeNode.destruct(node); + if (positional) { + const { values } = AttributeTreePosValuesNode.destruct(positional); + for (const [i, child] of values.entries()) { + ans[i] = convertAttributeValue(child, ctx); + } + } + if (named) { + const { values } = AttributeTreeNamedValuesNode.destruct(named); + for (const { key, value } of values) { + ans[key.value] = convertAttributeValue(value, ctx); + } + } + return ans; +} +function convertIndexBodies(nodes, ctx) { + return undefineEmptyArray(nodes.map((n) => convertIndexBody(n, ctx))); +} +function convertIndexBody(node, ctx) { + const { parallelIndices } = IndexBodyNode.destruct(node); + return parallelIndices.map((n) => convertIndex(n, ctx)); +} +function convertIndex(node, ctx) { + return StaticIndexNode.is(node) ? convertStaticIndex(node, ctx) : convertDynamicIndex(node, ctx); +} +function convertStaticIndex(node, ctx) { + return { kind: 'static', value: asString(node) }; +} +function convertDynamicIndex(node, ctx) { + const { keys } = DynamicIndexNode.destruct(node); + return { + kind: 'dynamic', + accessor: keys.map(key => { + if (node_LiteralNode.is(key) && key.value.startsWith('%')) { + return { keyword: key.value.slice(1) }; + } + return asString(key); + }), + }; +} +function convertTypeArgBlock(node, ctx) { + const { args } = TypeArgBlockNode.destruct(node); + return args.map((a) => convertType(a, ctx)); +} +function convertEnum(node, ctx) { + const { block, enumKind, identifier } = EnumNode.destruct(node); + // Return reference if the enum has been hoisted + if (identifier && !ctx.isHoisting) { + return wrapType(node, { + kind: 'reference', + path: `${ctx.moduleIdentifier}::${identifier.value}`, + }, ctx); + } + // Shortcut if the typeDef has been added to the enum symbol. + const symbol = identifier?.symbol ?? node.symbol; + if (symbol && TypeDefSymbolData.is(symbol.data) && symbol.data.typeDef.kind === 'enum') { + return symbol.data.typeDef; + } + return wrapType(node, { kind: 'enum', enumKind, values: convertEnumBlock(block, ctx) }, ctx); +} +function convertEnumBlock(node, ctx) { + const { fields } = EnumBlockNode.destruct(node); + return fields.map((n) => convertEnumField(n, ctx)); +} +function convertEnumField(node, ctx) { + const { attributes, docComments, identifier, value } = EnumFieldNode.destruct(node); + return { + attributes: convertAttributes(attributes, ctx), + desc: DocCommentsNode.asText(docComments), + identifier: identifier.value, + value: convertEnumValue(value, ctx), + }; +} +function convertEnumValue(node, ctx) { + if (TypedNumberNode.is(node)) { + const { value } = TypedNumberNode.destruct(node); + return value.value; + } + return node.value; +} +function convertStruct(node, ctx) { + const { block, identifier } = StructNode.destruct(node); + // Return reference if the struct has been hoisted + if (identifier && !ctx.isHoisting) { + return wrapType(node, { + kind: 'reference', + path: `${ctx.moduleIdentifier}::${identifier.value}`, + }, ctx); + } + // Shortcut if the typeDef has been added to the struct symbol. + const symbol = identifier?.symbol ?? node.symbol; + if (symbol && TypeDefSymbolData.is(symbol.data) && symbol.data.typeDef.kind === 'struct') { + return symbol.data.typeDef; + } + return wrapType(node, { kind: 'struct', fields: convertStructBlock(block, ctx) }, ctx); +} +function convertStructBlock(node, ctx) { + const { fields } = StructBlockNode.destruct(node); + return fields.map((n) => convertStructField(n, ctx)); +} +function convertStructField(node, ctx) { + return StructPairFieldNode.is(node) + ? convertStructPairField(node, ctx) + : convertStructSpreadField(node, ctx); +} +function convertStructPairField(node, ctx) { + const { attributes, docComments, key, type, isOptional } = StructPairFieldNode.destruct(node); + return { + kind: 'pair', + attributes: convertAttributes(attributes, ctx), + desc: DocCommentsNode.asText(docComments), + key: convertStructKey(key, ctx), + type: convertType(type, ctx), + optional: isOptional, + }; +} +function convertStructKey(node, ctx) { + if (StructMapKeyNode.is(node)) { + const { type } = StructMapKeyNode.destruct(node); + return convertType(type, ctx); + } + else { + return asString(node); + } +} +function convertStructSpreadField(node, ctx) { + const { attributes, type } = StructSpreadFieldNode.destruct(node); + return { + kind: 'spread', + attributes: convertAttributes(attributes, ctx), + type: convertType(type, ctx), + }; +} +function convertAny(node, ctx) { + return wrapType(node, { kind: 'any' }, ctx); +} +function convertBoolean(node, ctx) { + return wrapType(node, { kind: 'boolean' }, ctx); +} +function convertDispatcher(node, ctx) { + const { index, location } = DispatcherTypeNode.destruct(node); + return wrapType(node, { + kind: 'dispatcher', + parallelIndices: convertIndexBody(index, ctx), + registry: ResourceLocationNode.toString(location, 'full'), + }, ctx, { skipFirstIndexBody: true }); +} +function convertList(node, ctx) { + const { item, lengthRange } = ListTypeNode.destruct(node); + return wrapType(node, { + kind: 'list', + item: convertType(item, ctx), + lengthRange: convertRange(lengthRange, ctx), + }, ctx); +} +function convertRange(node, ctx) { + if (!node) { + return undefined; + } + const { kind, min, max } = FloatRangeNode.is(node) + ? FloatRangeNode.destruct(node) + : IntRangeNode.destruct(node); + return { kind, min: min?.value, max: max?.value }; +} +function convertLiteral(node, ctx) { + const { value } = LiteralTypeNode.destruct(node); + return wrapType(node, { kind: 'literal', value: convertLiteralValue(value, ctx) }, ctx); +} +function convertLiteralValue(node, ctx) { + if (node_LiteralNode.is(node)) { + return { kind: 'boolean', value: node.value === 'true' }; + } + else if (TypedNumberNode.is(node)) { + const { suffix, value } = TypedNumberNode.destruct(node); + return { + kind: convertLiteralNumberSuffix(suffix, ctx) + ?? (value.type === 'integer' ? 'int' : 'double'), + value: value.value, + }; + } + else { + return { kind: 'string', value: node.value }; + } +} +function convertLiteralNumberSuffix(node, ctx) { + const suffix = node?.value; + switch (suffix?.toLowerCase()) { + case 'b': + return 'byte'; + case 's': + return 'short'; + case 'l': + return 'long'; + case 'f': + return 'float'; + case 'd': + return 'double'; + default: + return undefined; + } +} +function convertNumericType(node, ctx) { + const { numericKind, valueRange } = NumericTypeNode.destruct(node); + return wrapType(node, { + kind: numericKind.value, + valueRange: convertRange(valueRange, ctx), + }, ctx); +} +function convertPrimitiveArray(node, ctx) { + const { arrayKind, lengthRange, valueRange } = PrimitiveArrayTypeNode.destruct(node); + return wrapType(node, { + kind: `${arrayKind.value}_array`, + lengthRange: convertRange(lengthRange, ctx), + valueRange: convertRange(valueRange, ctx), + }, ctx); +} +function convertString(node, ctx) { + const { lengthRange } = StringTypeNode.destruct(node); + return wrapType(node, { kind: 'string', lengthRange: convertRange(lengthRange, ctx) }, ctx); +} +function convertReference(node, ctx) { + const { path } = ReferenceTypeNode.destruct(node); + return wrapType(node, { kind: 'reference', path: pathArrayToString(resolvePath(path, ctx)) }, ctx); +} +function convertTuple(node, ctx) { + const { items } = TupleTypeNode.destruct(node); + return wrapType(node, { kind: 'tuple', items: items.map((n) => convertType(n, ctx)) }, ctx); +} +function convertUnion(node, ctx) { + const { members } = UnionTypeNode.destruct(node); + return wrapType(node, { kind: 'union', members: members.map((n) => convertType(n, ctx)) }, ctx); +} +function asString(node) { + if (ResourceLocationNode.is(node)) { + return ResourceLocationNode.toString(node, 'short'); + } + return node.value; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/colorizer/index.js + +const identifier = (node) => { + return [ColorToken.create(node, 'variable')]; +}; +const colorizer_literal = (node) => { + return [ColorToken.create(node, node.colorTokenType ?? 'literal')]; +}; +function registerMcdocColorizer(meta) { + meta.registerColorizer('mcdoc:literal', colorizer_literal); + meta.registerColorizer('mcdoc:identifier', identifier); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/type/index.js + + +var Attributes; +(function (Attributes) { + function equals(a, b) { + if (a?.length !== b?.length) { + return false; + } + if (!a || !b) { + return true; + } + for (let i = 0; i < a.length; i++) { + if (!Attribute.equals(a[i], b[i])) { + return false; + } + } + return true; + } + Attributes.equals = equals; +})(Attributes || (Attributes = {})); +var Attribute; +(function (Attribute) { + function equals(a, b) { + if (a.name !== b.name) { + return false; + } + if (a.value && b.value) { + return AttributeValue.equals(a.value, b.value); + } + return a.value === b.value; + } + Attribute.equals = equals; +})(Attribute || (Attribute = {})); +var AttributeValue; +(function (AttributeValue) { + function equals(a, b) { + if (a.kind !== b.kind) { + return false; + } + if (a.kind === 'tree') { + if (Object.keys(a.values).length !== Object.keys(b.values).length) { + return false; + } + for (const kvp of Object.entries(a.values)) { + const other = b.values[kvp[0]]; + if (!other) { + return false; + } + if (!equals(kvp[1], other)) { + return false; + } + } + return true; + } + else { + return McdocType.equals(a, b); + } + } + AttributeValue.equals = equals; +})(AttributeValue || (AttributeValue = {})); +var NumericRange; +(function (NumericRange) { + function isInRange(range, val) { + const { min = -Infinity, max = Infinity } = range; + if (RangeKind.isLeftExclusive(range.kind) ? val <= min : val < min) { + return false; + } + if (RangeKind.isRightExclusive(range.kind) ? val >= max : val > max) { + return false; + } + return true; + } + NumericRange.isInRange = isInRange; + function equals(a, b) { + return a.kind === b.kind + && a.min === b.min + && a.max === b.max; + } + NumericRange.equals = equals; + function intersect(a, b) { + const min = a.min !== undefined && b.min !== undefined + ? Math.max(a.min, b.min) + : a.min !== undefined + ? a.min + : b.min; + const max = a.max !== undefined && b.max !== undefined + ? Math.min(a.max, b.max) + : a.max !== undefined + ? a.max + : b.max; + let kind = 0b00; + if (min === a.min && RangeKind.isLeftExclusive(a.kind)) { + kind |= 0b10; + } + else if (min === b.min && RangeKind.isLeftExclusive(b.kind)) { + kind |= 0b10; + } + if (max === a.max && RangeKind.isRightExclusive(a.kind)) { + kind |= 0b01; + } + else if (max === b.max && RangeKind.isRightExclusive(b.kind)) { + kind |= 0b01; + } + return { kind: kind, min, max }; + } + NumericRange.intersect = intersect; + function toString({ kind, min, max }) { + return min === max && kind === 0b00 + ? min !== undefined ? `${min}` : getRangeDelimiter(kind) + : `${min ?? ''}${getRangeDelimiter(kind)}${max ?? ''}`; + } + NumericRange.toString = toString; +})(NumericRange || (NumericRange = {})); +const StaticIndexKeywords = Object.freeze(['fallback', 'none', 'unknown', 'spawnitem', 'blockitem']); +var ParallelIndices; +(function (ParallelIndices) { + function equals(a, b) { + if (a.length !== b.length) { + return false; + } + for (let i = 0; i < a.length; i++) { + const first = a[i]; + const second = b[i]; + if (first.kind !== second.kind) { + return false; + } + if (first.kind === 'static') { + return first.value !== second.value; + } + if (first.accessor.length !== second.accessor.length) { + return false; + } + for (let j = 0; j < first.accessor.length; j++) { + const firstAcc = first.accessor[j]; + const secondAcc = second.accessor[j]; + if (typeof firstAcc === 'string' || typeof secondAcc === 'string') { + if (firstAcc !== secondAcc) { + return false; + } + } + else if (firstAcc.keyword !== secondAcc.keyword) { + return false; + } + } + } + return true; + } + ParallelIndices.equals = equals; +})(ParallelIndices || (ParallelIndices = {})); +const EmptyUnion = Object.freeze({ kind: 'union', members: [] }); +function createEmptyUnion(attributes) { + return { + ...EmptyUnion, + // attributes, + }; +} +const NumericTypeIntKinds = Object.freeze(['byte', 'short', 'int', 'long']); +const NumericTypeFloatKinds = Object.freeze(['float', 'double']); +const NumericTypeKinds = Object.freeze([...NumericTypeIntKinds, ...NumericTypeFloatKinds]); +const PrimitiveArrayValueKinds = Object.freeze(['byte', 'int', 'long']); +const PrimitiveArrayKinds = Object.freeze(PrimitiveArrayValueKinds.map((kind) => `${kind}_array`)); +var McdocType; +(function (McdocType) { + function equals(a, b) { + if (a.kind !== b.kind) { + return false; + } + if (!Attributes.equals(a.attributes, b.attributes)) { + return false; + } + switch (a.kind) { + case 'literal': + return a.value.kind === b.value.kind + && a.value.value === b.value.value; + case 'byte': + case 'short': + case 'int': + case 'long': + case 'float': + case 'double': + return a.valueRange === b.valueRange; + case 'string': + return a.lengthRange === b.lengthRange; + case 'byte_array': + case 'int_array': + case 'long_array': + return a.lengthRange === b.lengthRange + && a.valueRange === b.valueRange; + case 'list': + return a.lengthRange === b.lengthRange + && equals(a.item, b.item); + case 'tuple': + if (a.items.length !== b.items.length) { + return false; + } + for (let i = 0; i < a.items.length; i++) { + if (!equals(a.items[i], b.items[i])) { + return false; + } + } + return true; + case 'struct': + return a.fields.length === b.fields.length && !a.fields.some(f => { + if (f.kind === 'pair') { + return !b.fields.some(of => of.kind === 'pair' + && f.optional === of.optional + && f.deprecated === of.deprecated + && Attributes.equals(f.attributes, of.attributes) + && (typeof f.key === 'string' || typeof of.key === 'string' + ? f.key === of.key + : equals(f.key, of.key)) + && equals(f.type, of.type)); + } + return !b.fields.some(of => of.kind === 'spread' + && Attributes.equals(f.attributes, of.attributes) + && equals(f.type, of.type)); + }); + case 'union': + if (a.members.length !== b.members.length) { + return false; + } + for (let i = 0; i < a.members.length; i++) { + if (!equals(a.members[i], b.members[i])) { + return false; + } + } + return true; + case 'enum': + if (a.enumKind !== b.enumKind + || a.values.length !== b.values.length) { + return false; + } + for (let i = 0; i < a.values.length; i++) { + const first = a.values[i]; + const second = b.values[i]; + if (first.identifier !== second.identifier || first.value !== second.value + || !Attributes.equals(first.attributes, second.attributes)) { + return false; + } + } + return true; + case 'reference': + return a.path === b.path; + case 'template': + if (a.typeParams.length !== b.typeParams.length) { + return false; + } + for (let i = 0; i < a.typeParams.length; i++) { + if (a.typeParams[i].path !== b.typeParams[i].path) { + return false; + } + } + return equals(a.child, b.child); + case 'concrete': + if (a.typeArgs.length !== b.typeArgs.length) { + return false; + } + for (let i = 0; i < a.typeArgs.length; i++) { + if (!equals(a.typeArgs[i], b.typeArgs[i])) { + return false; + } + } + return equals(a.child, b.child); + case 'indexed': + if (ParallelIndices.equals(a.parallelIndices, b.parallelIndices)) { + return false; + } + return equals(a.child, b.child); + case 'dispatcher': + if (a.registry !== b.registry) { + return false; + } + return ParallelIndices.equals(a.parallelIndices, b.parallelIndices); + case 'mapped': + if (Object.keys(a.mapping).length !== Object.keys(b.mapping).length) { + return false; + } + for (const kvp of Object.entries(a.mapping)) { + const other = b.mapping[kvp[0]]; + if (!other) { + return false; + } + if (!equals(kvp[1], other)) { + return false; + } + } + return equals(a.child, b.child); + default: + return true; + } + } + McdocType.equals = equals; + function toString(type) { + const rangeToString = (range) => { + return range ? ` @ ${NumericRange.toString(range)}` : ''; + }; + const indicesToString = (indices) => { + const strings = []; + for (const index of Arrayable.toArray(indices)) { + if (index === undefined) { + strings.push('()'); + } + else { + strings.push(index.kind === 'static' + ? `[${index.value}]` + : `[[${index.accessor.map((v) => (typeof v === 'string' ? v : v.keyword)).join('.')}]]`); + } + } + return `[${strings.join(', ')}]`; + }; + if (type === undefined) { + return ''; + } + let attributesString = ''; + if (type.attributes?.length) { + for (const attribute of type.attributes) { + attributesString += `#[${attribute.name}${attribute.value ? '=' : ''}] `; + } + } + let typeString; + switch (type.kind) { + case 'any': + case 'boolean': + typeString = type.kind; + break; + case 'byte': + typeString = `byte${rangeToString(type.valueRange)}`; + break; + case 'byte_array': + typeString = `byte${rangeToString(type.valueRange)}[]${rangeToString(type.lengthRange)}`; + break; + case 'concrete': + typeString = `${toString(type.child)}${type.typeArgs.length ? `<${type.typeArgs.map(toString).join(', ')}>` : ''}`; + break; + case 'dispatcher': + typeString = `${type.registry ?? 'spyglass:unknown'}[${indicesToString(type.parallelIndices)}]`; + break; + case 'double': + typeString = `double${rangeToString(type.valueRange)}`; + break; + case 'enum': + typeString = ''; + break; + case 'float': + typeString = `float${rangeToString(type.valueRange)}`; + break; + case 'indexed': + typeString = `${toString(type.child)}${indicesToString(type.parallelIndices)}`; + break; + case 'int': + typeString = `int${rangeToString(type.valueRange)}`; + break; + case 'int_array': + typeString = `int${rangeToString(type.valueRange)}[]${rangeToString(type.lengthRange)}`; + break; + case 'list': + typeString = `[${toString(type.item)}]${rangeToString(type.lengthRange)}`; + break; + case 'literal': + typeString = `${type.value.value}`; + break; + case 'long': + typeString = `long${rangeToString(type.valueRange)}`; + break; + case 'long_array': + typeString = `long${rangeToString(type.valueRange)}[]${rangeToString(type.lengthRange)}`; + break; + case 'mapped': + typeString = toString(type.child); + break; + case 'reference': + typeString = type.path ?? ''; + break; + case 'short': + typeString = `short${rangeToString(type.valueRange)}`; + break; + case 'string': + typeString = `string${rangeToString(type.lengthRange)}`; + break; + case 'struct': + typeString = ''; + break; + case 'template': + typeString = `${toString(type.child)}${type.typeParams.length + ? `<${type.typeParams.map((v) => `?${v.path}`).join(', ')}>` + : ''}`; + break; + case 'tuple': + typeString = `[${type.items.map((v) => toString(v)).join(',')}${type.items.length === 1 ? ',' : ''}]`; + break; + case 'union': + typeString = `(${type.members.map(toString).join(' | ')})`; + break; + case 'unsafe': + typeString = 'unsafe'; + break; + default: + Dev.assertNever(type); + } + return attributesString + typeString; + } + McdocType.toString = toString; +})(McdocType || (McdocType = {})); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/parser/index.js + + + + + +/** + * @returns A comment parser that accepts normal comments (`//`) and reports an error if it's a doc comment (`///`). + * + * `Failure` when there isn't a comment. + */ +const parser_comment = validate(comment_comment({ singleLinePrefixes: new Set(['//']) }), (res, src) => !src.slice(res).startsWith('///'), localize('mcdoc.parser.syntax.doc-comment-unexpected')); +/** + * @returns A parser that parses the gap between **SYNTAX** rules, which may contains whitespace and regular comments. + */ +function syntaxGap( +/* istanbul ignore next */ +delegatesDocComments = false) { + return (src, ctx) => { + const ans = []; + src.skipWhitespace(); + while (src.canRead() && src.peek(2) === '//' && (!delegatesDocComments || src.peek(3) !== '///')) { + const result = parser_comment(src, ctx); + ans.push(result); + src.skipWhitespace(); + } + return ans; + }; +} +function syntax(parsers, delegatesDocComments = false) { + return (src, ctx) => { + src.skipWhitespace(); + const ans = sequence(parsers, syntaxGap(delegatesDocComments))(src, ctx); + src.skipWhitespace(); + return ans; + }; +} +function syntaxRepeat(parser, delegatesDocComments = false) { + return repeat(parser, syntaxGap(delegatesDocComments)); +} +function parser_literal(literal, options) { + return (src, ctx) => { + const ans = { + type: 'mcdoc:literal', + range: Range.create(src), + value: '', + colorTokenType: options?.colorTokenType, + }; + ans.value = src.readIf((c) => options?.allowedChars?.has(c) ?? (options?.specialChars?.has(c) || /[a-z]/i.test(c))); + ans.range.end = src.cursor; + if (Arrayable.toArray(literal).every((l) => l !== ans.value)) { + ctx.err.report(localize('expected-got', arrayToMessage(literal), localeQuote(ans.value)), ans); + } + return ans; + }; +} +function keyword(keyword, options = { colorTokenType: 'keyword' }) { + return (src, ctx) => { + const result = parser_literal(keyword, options)(src, ctx); + if (!Arrayable.toArray(keyword).includes(result.value)) { + return Parser_Failure; + } + return result; + }; +} +function punctuation(punctuation) { + return (src, ctx) => { + src.skipWhitespace(); + if (!src.trySkip(punctuation)) { + ctx.err.report(localize('expected-got', localeQuote(punctuation), localeQuote(src.peek())), src); + } + return undefined; + }; +} +function marker(punctuation) { + return (src, _ctx) => { + src.skipWhitespace(); + if (!src.trySkip(punctuation)) { + return Parser_Failure; + } + return undefined; + }; +} +function resLoc(options) { + return validate(resourceLocation_resourceLocation(options), (res) => res.namespace !== undefined, localize('mcdoc.parser.resource-location.colon-expected', localeQuote(ResourceLocation.NamespacePathSep))); +} +const UnicodeControlCharacters = Object.freeze([ + '\x00', + '\x01', + '\x02', + '\x03', + '\x04', + '\x05', + '\x06', + '\x07', + '\x08', + '\x09', + '\x0A', + '\x0B', + '\x0C', + '\x0D', + '\x0E', + '\x0F', + '\x7F', +]); +const parser_string = stopBefore(string_string({ + escapable: { characters: ['b', 'f', 'n', 'r', 't', '\\', '"'], unicode: true }, + quotes: ['"'], +}), ...UnicodeControlCharacters); +const parser_identifier = (src, ctx) => { + // https://spyglassmc.com/user/mcdoc/#identifier + const IdentifierStart = /^[\p{L}\p{Nl}]$/u; + const IdentifierContinue = /^[\p{L}\p{Nl}\u200C\u200D\p{Mn}\p{Mc}\p{Nd}\p{Pc}]$/u; + const ReservedWords = new Set([ + 'any', + 'boolean', + 'byte', + 'double', + 'enum', + 'false', + 'float', + 'int', + 'long', + 'short', + 'string', + 'struct', + 'super', + 'true', + ]); + const ans = { + type: 'mcdoc:identifier', + range: Range.create(src), + options: { category: 'mcdoc' }, + value: '', + }; + const start = src.innerCursor; + if (IdentifierStart.test(src.peek())) { + src.skip(); + while (IdentifierContinue.test(src.peek())) { + src.skip(); + } + } + else { + ctx.err.report(localize('expected', localize('mcdoc.node.identifier')), src); + } + ans.value = src.string.slice(start, src.innerCursor); + ans.range.end = src.cursor; + if (ReservedWords.has(ans.value)) { + ctx.err.report(localize('mcdoc.parser.identifier.reserved-word', localeQuote(ans.value)), ans); + } + return ans; +}; +function indexBody(options) { + const accessorKey = util_select([ + { prefix: '%', parser: parser_literal(['%key', '%parent'], { specialChars: new Set(['%']) }) }, + { prefix: '"', parser: parser_string }, + { parser: parser_identifier }, + ]); + const dynamicIndex = setType('mcdoc:dynamic_index', syntax([ + punctuation('['), + accessorKey, + repeat(sequence([marker('.'), accessorKey])), + punctuation(']'), + ])); + const index = util_select([ + { + prefix: '%', + parser: parser_literal(StaticIndexKeywords.map((v) => `%${v}`), { specialChars: new Set(['%']) }), + }, + { prefix: '"', parser: parser_string }, + { + prefix: '[', + parser: options?.noDynamic + ? validate(dynamicIndex, () => false, localize('mcdoc.parser.index-body.dynamic-index-not-allowed')) + : dynamicIndex, + }, + { + parser: util_any([ + resLoc({ category: 'mcdoc/dispatcher', accessType: options?.accessType }), + parser_identifier, + ]), + }, + ]); + return setType('mcdoc:index_body', syntax([ + punctuation('['), + index, + syntaxRepeat(syntax([marker(','), failOnEmpty(index)])), + optional(marker(',')), + punctuation(']'), + ])); +} +const pathSegment = util_select([{ + prefix: 'super', + parser: parser_literal('super'), + }, { parser: parser_identifier }]); +const path = (src, ctx) => { + let isAbsolute; + if (src.trySkip('::')) { + isAbsolute = true; + } + return util_map(sequence([pathSegment, repeat(sequence([marker('::'), pathSegment]))]), (res) => { + const ans = { + type: 'mcdoc:path', + children: res.children, + range: res.range, + isAbsolute, + }; + return ans; + })(src, ctx); +}; +const attributeTreePosValues = setType('mcdoc:attribute/tree/pos', syntax([ + { get: () => attributeValue }, + syntaxRepeat(syntax([marker(','), { get: () => failOnEmpty(attributeValue) }], true), true), +], true)); +const attributeNamedValue = syntax([ + util_select([{ prefix: '"', parser: parser_string }, { parser: parser_identifier }]), + util_select([{ + prefix: '=', + parser: syntax([punctuation('='), { get: () => attributeValue }], true), + }, { parser: { get: () => attributeTree } }]), +], true); +const attributeTreeNamedValues = setType('mcdoc:attribute/tree/named', syntax([ + attributeNamedValue, + syntaxRepeat(syntax([marker(','), failOnEmpty(attributeNamedValue)], true), true), +], true)); +const treeBody = util_any([ + syntax([attributeTreeNamedValues, optional(marker(','))]), + syntax([ + attributeTreePosValues, + punctuation(','), + attributeTreeNamedValues, + optional(marker(',')), + ]), + syntax([attributeTreePosValues, optional(marker(','))]), +]); +const AttributeTreeClosure = Object.freeze({ '(': ')', '[': ']', '{': '}' }); +const attributeTree = (src, ctx) => { + const delim = src.trySkip('(') + ? '(' + : src.trySkip('[') + ? '[' + : src.trySkip('{') + ? '{' + : undefined; + if (!delim) { + return Parser_Failure; + } + const res = treeBody(src, ctx); + const ans = { + type: 'mcdoc:attribute/tree', + range: res.range, + children: res.children, + delim, + }; + src.trySkip(AttributeTreeClosure[delim]); + return ans; +}; +const attributeValue = util_select([{ + predicate: (src) => ['(', '[', '{'].includes(src.peek()), + parser: attributeTree, + }, { parser: { get: () => type } }]); +const attribute = setType('mcdoc:attribute', syntax([ + marker('#['), + parser_identifier, + util_select([{ + prefix: '=', + parser: syntax([punctuation('='), attributeValue, punctuation(']')], true), + }, { + predicate: (src) => ['(', '[', '{'].includes(src.peek()), + parser: syntax([attributeTree, punctuation(']')], true), + }, { parser: punctuation(']') }]), +], true)); +const attributes = repeat(attribute); +const typeParam = setType('mcdoc:type_param', syntax([ + parser_identifier, + // optional(syntax([failOnError(literal('extends')), { get: () => type }])), +])); +const typeParamBlock = setType('mcdoc:type_param_block', syntax([ + punctuation('<'), + util_select([{ prefix: '>', parser: punctuation('>') }, { + parser: syntax([ + typeParam, + syntaxRepeat(syntax([marker(','), failOnEmpty(typeParam)])), + optional(marker(',')), + punctuation('>'), + ]), + }]), +])); +const parser_noop = () => undefined; +const docComment = comment_comment({ + singleLinePrefixes: new Set(['///']), + includesEol: true, +}); +const docComments = setType('mcdoc:doc_comments', repeat(docComment, (src) => { + src.skipWhitespace(); + return []; +})); +const prelim = syntax([ + optional(failOnEmpty(docComments)), + attributes, +]); +const optionalTypeParamBlock = util_select([{ + prefix: '<', + parser: typeParamBlock, + }, { parser: parser_noop }]); +const dispatchStatement = setType('mcdoc:dispatch_statement', syntax([ + prelim, + keyword('dispatch'), + resLoc({ category: 'mcdoc/dispatcher', accessType: 1 /* SymbolAccessType.Write */ }), + indexBody({ noDynamic: true }), + optionalTypeParamBlock, + parser_literal('to'), + { get: () => type }, +], true)); +const enumType = parser_literal([ + 'byte', + 'short', + 'int', + 'long', + 'string', + 'float', + 'double', +], { colorTokenType: 'type' }); +const parser_float = float_float({ + pattern: /^[-+]?(?:[0-9]+(?:[eE][-+]?[0-9]+)?|[0-9]*\.[0-9]+(?:[eE][-+]?[0-9]+)?)$/, +}); +const parser_integer = integer_integer({ + pattern: /^(?:0|[-+]?[1-9][0-9]*)$/, +}); +const LiteralIntSuffixes = Object.freeze(['b', 's', 'l']); +const LiteralIntCaseInsensitiveSuffixes = Object.freeze([...LiteralIntSuffixes, 'B', 'S', 'L']); +const LiteralFloatSuffixes = Object.freeze(['f', 'd']); +const LiteralFloatCaseInsensitiveSuffixes = Object.freeze([...LiteralFloatSuffixes, 'F', 'D']); +const LiteralNumberSuffixes = Object.freeze([...LiteralIntSuffixes, ...LiteralFloatSuffixes]); +const LiteralNumberCaseInsensitiveSuffixes = Object.freeze([ + ...LiteralNumberSuffixes, + ...LiteralIntCaseInsensitiveSuffixes, + ...LiteralFloatCaseInsensitiveSuffixes, +]); +const typedNumber = setType('mcdoc:typed_number', util_select([{ + regex: /^(?:\+|-)?\d+(?!\d|[.dfe])/i, + parser: sequence([ + parser_integer, + optional(keyword(LiteralIntCaseInsensitiveSuffixes, { colorTokenType: 'keyword' })), + ]), + }, { + parser: sequence([ + parser_float, + optional(keyword(LiteralFloatCaseInsensitiveSuffixes, { colorTokenType: 'keyword' })), + ]), + }])); +const enumValue = util_select([{ prefix: '"', parser: parser_string }, { + parser: typedNumber, + }]); +const enumField = setType('mcdoc:enum/field', syntax([prelim, parser_identifier, punctuation('='), enumValue], true)); +const enumBlock = setType('mcdoc:enum/block', syntax([ + punctuation('{'), + util_select([{ prefix: '}', parser: punctuation('}') }, { + parser: syntax([ + enumField, + syntaxRepeat(syntax([marker(','), failOnEmpty(enumField)], true), true), + optional(marker(',')), + punctuation('}'), + ], true), + }]), +], true)); +const enum_ = setType('mcdoc:enum', syntax([ + prelim, + keyword('enum'), + punctuation('('), + enumType, + punctuation(')'), + optional(failOnError(parser_identifier)), + enumBlock, +], true)); +const structMapKey = setType('mcdoc:struct/map_key', syntax([punctuation('['), { get: () => type }, punctuation(']')], true)); +const structKey = util_select([{ prefix: '"', parser: parser_string }, { + prefix: '[', + parser: structMapKey, + }, { parser: parser_identifier }]); +const structPairField = (src, ctx) => { + let isOptional; + const result0 = syntax([prelim, structKey], true)(src, ctx); + if (src.trySkip('?')) { + isOptional = true; + } + const result1 = syntax([punctuation(':'), { get: () => type }], true)(src, ctx); + const ans = { + type: 'mcdoc:struct/field/pair', + children: [...result0.children, ...result1.children], + range: Range.span(result0, result1), + isOptional, + }; + return ans; +}; +const structSpreadField = setType('mcdoc:struct/field/spread', syntax([attributes, marker('...'), { get: () => type }], true)); +const structField = util_any([ + structSpreadField, + structPairField, +]); +const structBlock = setType('mcdoc:struct/block', syntax([ + punctuation('{'), + util_select([{ prefix: '}', parser: punctuation('}') }, { + parser: syntax([ + structField, + syntaxRepeat(syntax([marker(','), failOnEmpty(structField)], true), true), + optional(marker(',')), + punctuation('}'), + ], true), + }]), +], true)); +const struct = setType('mcdoc:struct', syntax([prelim, keyword('struct'), optional(failOnEmpty(parser_identifier)), structBlock], true)); +const enumInjection = setType('mcdoc:injection/enum', syntax([parser_literal('enum'), punctuation('('), enumType, punctuation(')'), path, enumBlock])); +const structInjection = setType('mcdoc:injection/struct', syntax([parser_literal('struct'), path, structBlock])); +const injection = setType('mcdoc:injection', syntax([ + keyword('inject'), + util_select([{ prefix: 'enum', parser: enumInjection }, { parser: structInjection }]), +])); +const typeAliasStatement = setType('mcdoc:type_alias', syntax([prelim, keyword('type'), parser_identifier, optionalTypeParamBlock, punctuation('='), { + get: () => type, + }], true)); +const useStatement = setType('mcdoc:use_statement', syntax([ + keyword('use'), + path, + util_select([{ prefix: 'as', parser: syntax([parser_literal('as'), parser_identifier]) }, { parser: parser_noop }]), +], true)); +const topLevel = util_any([ + parser_comment, + dispatchStatement, + enum_, + injection, + struct, + typeAliasStatement, + useStatement, +]); +const parser_module_ = setType('mcdoc:module', syntaxRepeat(topLevel, true)); +const typeArgBlock = setType('mcdoc:type_arg_block', syntax([ + marker('<'), + util_select([{ prefix: '>', parser: punctuation('>') }, { + parser: syntax([ + { get: () => type }, + syntaxRepeat(syntax([marker(','), { get: () => failOnEmpty(type) }], true), true), + optional(marker(',')), + punctuation('>'), + ], true), + }]), +])); +/* eslint-enable @typescript-eslint/indent */ +function typeBase(type, parser) { + return setType(type, syntax([ + attributes, + parser, + syntaxRepeat(util_select([{ prefix: '<', parser: typeArgBlock }, { parser: failOnError(indexBody()) }]), true), + ], true)); +} +const anyType = typeBase('mcdoc:type/any', keyword('any', { colorTokenType: 'type' })); +const booleanType = typeBase('mcdoc:type/boolean', keyword('boolean', { colorTokenType: 'type' })); +function range(type, number) { + const delimiterPredicate = (src) => src.tryPeek('..') || src.tryPeek(`${RangeExclusiveChar}..`); + const delimiterParser = parser_literal([ + '..', + `..${RangeExclusiveChar}`, + `${RangeExclusiveChar}..`, + `${RangeExclusiveChar}..${RangeExclusiveChar}`, + ], { allowedChars: new Set(['.', RangeExclusiveChar]) }); + return setType(type, util_select([{ predicate: delimiterPredicate, parser: sequence([delimiterParser, number]) }, { + parser: sequence([ + stopBefore(number, '..'), + util_select([{ + predicate: delimiterPredicate, + parser: sequence([delimiterParser, optional(failOnEmpty(number))]), + }, { parser: parser_noop }]), + ]), + }])); +} +const intRange = range('mcdoc:int_range', parser_integer); +const atIntRange = optional((src, ctx) => { + if (!src.trySkip('@')) { + return Parser_Failure; + } + src.skipWhitespace(); + return intRange(src, ctx); +}); +const stringType = typeBase('mcdoc:type/string', syntax([ + keyword('string', { colorTokenType: 'type' }), + atIntRange, +], true)); +const literalType = typeBase('mcdoc:type/literal', util_select([ + { + predicate: (src) => src.tryPeek('false') || src.tryPeek('true'), + parser: keyword(['false', 'true'], { colorTokenType: 'type' }), + }, + { prefix: '"', parser: failOnEmpty(parser_string) }, + { parser: failOnError(typedNumber) }, +])); +const floatRange = range('mcdoc:float_range', parser_float); +const atFloatRange = optional((src, ctx) => { + if (!src.trySkip('@')) { + return Parser_Failure; + } + src.skipWhitespace(); + return floatRange(src, ctx); +}); +const numericType = typeBase('mcdoc:type/numeric_type', util_select([{ + predicate: (src) => NumericTypeFloatKinds.some((k) => src.tryPeek(k)), + parser: syntax([keyword(NumericTypeFloatKinds, { colorTokenType: 'type' }), atFloatRange], true), + }, { + parser: syntax([keyword(NumericTypeIntKinds, { colorTokenType: 'type' }), atIntRange], true), + }])); +const primitiveArrayType = typeBase('mcdoc:type/primitive_array', syntax([ + parser_literal(PrimitiveArrayValueKinds), + atIntRange, + keyword('[]', { allowedChars: new Set(['[', ']']), colorTokenType: 'type' }), + atIntRange, +])); +const listType = typeBase('mcdoc:type/list', syntax([marker('['), { get: () => type }, punctuation(']'), atIntRange], true)); +const tupleType = typeBase('mcdoc:type/tuple', syntax([ + marker('['), + { get: () => type }, + marker(','), + util_select([{ prefix: ']', parser: punctuation(']') }, { + parser: syntax([ + { get: () => type }, + syntaxRepeat(syntax([marker(','), { get: () => failOnEmpty(type) }], true), true), + optional(marker(',')), + punctuation(']'), + ], true), + }]), +], true)); +const dispatcherType = typeBase('mcdoc:type/dispatcher', syntax([failOnError(resLoc({ category: 'mcdoc/dispatcher' })), indexBody()])); +const unionType = typeBase('mcdoc:type/union', syntax([ + marker('('), + util_select([{ prefix: ')', parser: punctuation(')') }, { + parser: syntax([ + { get: () => type }, + syntaxRepeat(syntax([marker('|'), { get: () => failOnEmpty(type) }], true), true), + optional(marker('|')), + punctuation(')'), + ], true), + }]), +])); +const referenceType = typeBase('mcdoc:type/reference', syntax([path])); +const type = util_any([ + anyType, + booleanType, + dispatcherType, + enum_, + listType, + literalType, + numericType, + primitiveArrayType, + stringType, + struct, + tupleType, + unionType, + referenceType, +]); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/formatter/index.js + + +// These formatters operate under the assumption that each AST node's children are in the same order as they appear when formatted. +// With the exception of comments, because those can be moved to the parent if they're at odd locations +// (for example a comment between the identifier and '{' of a struct will be moved to before the struct). +const nodeTypesAllowingComments = new Set([ + 'mcdoc:module', + 'mcdoc:struct/block', + 'mcdoc:enum/block', + 'mcdoc:doc_comments', + 'mcdoc:type/tuple', + 'mcdoc:type/union', +]); +const nodeTypesAllowingTrailingComments = new Set([ + 'mcdoc:module', + 'mcdoc:struct/block', + 'mcdoc:enum/block', + 'mcdoc:doc_comments', +]); +const prelimNodeTypes = new Set([ + 'mcdoc:attribute', + 'mcdoc:doc_comments', +]); +function formatChildren(node, ctx, childFormatInfo, excludeLastChildSuffix = false, onlyFormatPrelimType) { + const allowsComments = nodeTypesAllowingComments.has(node.type); + const allowsTrailingComments = nodeTypesAllowingTrailingComments.has(node.type); + const children = allowsComments ? liftChildComments(node.children) : node.children; + const lastNonComment = children.findLastIndex((child) => child.type !== 'comment'); + const lastFormattedChild = onlyFormatPrelimType !== undefined + ? children.findLastIndex((child) => child.type === onlyFormatPrelimType) + // Exclude trailing comments, so trailing comments don't change + // whether the node in front of the comments has the suffix + : children.findLastIndex((child) => child.type !== 'comment'); + const content = children.map((child, i) => { + // Only format prelim when it's supposed to be formatted + // and don't format other nodes when they're not supposed to be formatted. + if (onlyFormatPrelimType !== undefined && child.type !== onlyFormatPrelimType) { + return ''; + } + if (onlyFormatPrelimType === undefined && prelimNodeTypes.has(child.type)) { + return ''; + } + if (child.type === 'comment' && !allowsComments) { + // Don't format comments if the type doesn't allow them. + // A parent type that does allow comments should have already included them. + return ''; + } + if (i > lastNonComment && !allowsTrailingComments) { + // Don't format trailing comments if the type doesn't allow them. + // A parent type that does allow comments should have already included them. + return ''; + } + const info = childFormatInfo[child.type]; + const value = ctx.meta.getFormatter(child.type)(child, info?.indentSelf ? indentFormatter(ctx) : ctx); + const prefix = info?.prefix ?? ''; + const hasSuffix = info?.suffix !== undefined + && (!excludeLastChildSuffix || lastFormattedChild !== i); + const suffix = hasSuffix ? info.suffix : ''; + const formatted = `${prefix}${value}${suffix}`; + return formatted; + }).join(''); + return content; +} +const formatterIgnoreAttributeName = 'formatter_ignore'; +function shouldFormatterIgnore(node) { + return node.children?.some((child) => { + if (child.type !== 'mcdoc:attribute') { + return false; + } + return child.children.some((attributeChild) => { + return attributeChild.type === 'mcdoc:identifier' + && attributeChild.value === formatterIgnoreAttributeName; + }); + }) ?? false; +} +function getUnformatted(node, ctx) { + return ctx.doc.getText({ + start: ctx.doc.positionAt(node.range.start), + end: ctx.doc.positionAt(node.range.end), + }); +} +function hasMultilineChild(node, isRecursiveCall = false, alwaysIncludeComments = false) { + if (!node.children) { + return false; + } + for (let i = 0; i < node.children.length; i++) { + const child = node.children[i]; + if (child.type === 'comment') { + if (alwaysIncludeComments) { + return true; + } + if (nodeTypesAllowingComments.has(node.type)) { + if (nodeTypesAllowingTrailingComments.has(node.type)) { + return true; + } + // Only return true if there's a non-comment node after the comment, so + // the comment isn't moved outside the node. + // We only need to check whether i+1 is not a comment instead of checking + // all of the nodes after i, because even in the case where i+1 is a comment, + // but i+2 is a non-comment, the check will still succeed true in the next iteration. + if (i < node.children.length - 1 && node.children[i + 1].type !== 'comment') { + return true; + } + } + } + if (child.type === 'mcdoc:struct') { + return true; + } + if (child.type === 'mcdoc:enum') { + return true; + } + if (isRecursiveCall && child.type === 'mcdoc:attribute') { + // Attributes only count as multiline for a recursive call, because attributes found + // during the first call would be put in front of the node and not inside it. + return true; + } + if (hasMultilineChild(child, true, alwaysIncludeComments || i < node.children.length - 1)) { + return true; + } + } + return false; +} +const maxDynamicInlineLength = 80; // Kind of arbitrary +function formatDynamicMultiline(node, formatter) { + if (hasMultilineChild(node)) { + return formatter(true); + } + const inlineFormat = formatter(false); + if (inlineFormat.length > maxDynamicInlineLength) { + return formatter(true); + } + return inlineFormat; +} +function formatWithPrelim(node, ctx, putAttributesOnSeparateLine, putDocOnSeparateLine, contentFormatter) { + if (shouldFormatterIgnore(node)) { + return getUnformatted(node, ctx); + } + function attributeFormatter(doMultiline, attributeCtx) { + const childFormatInfo = { + 'mcdoc:attribute': { + suffix: doMultiline ? `\n${attributeCtx.indent()}` : ' ', + }, + }; + return formatChildren(node, attributeCtx, childFormatInfo, + // Last suffix is excluded, because it is specified separately through `putAttributesOnSeparateLine`. + // This makes it possible to put all attributes on one line but still add a newline at the end. + true, 'mcdoc:attribute'); + } + const shouldIndentPrelim = !putDocOnSeparateLine + && node.children.some((child) => child.type === 'mcdoc:doc_comments'); + function processFormattedAttributes(formattedAttributes, areAttributesMultiline) { + const formattedDocComments = formatChildren(node, putDocOnSeparateLine ? ctx : indentFormatter(ctx), {}, false, 'mcdoc:doc_comments'); + const hasAdditionalIndent = shouldIndentPrelim + || (!putAttributesOnSeparateLine && areAttributesMultiline); + if (formattedAttributes !== '') { + if (hasAdditionalIndent) { + formattedAttributes += `\n${ctx.indent(1)}`; + } + else if (putAttributesOnSeparateLine) { + formattedAttributes += `\n${ctx.indent()}`; + } + else { + formattedAttributes += ' '; + } + } + const prelim = (hasAdditionalIndent ? `\n${ctx.indent(1)}` : '') + + formattedDocComments + formattedAttributes; + const content = contentFormatter(hasAdditionalIndent + ? indentFormatter(ctx) + : ctx); + return prelim + content; + } + const multilineChild = node.children?.some((child) => { + child.type === 'mcdoc:attribute' && hasMultilineChild(child); + }); + if (multilineChild) { + return processFormattedAttributes(attributeFormatter(true, putAttributesOnSeparateLine ? ctx : indentFormatter(ctx)), true); + } + const inlineAttributes = attributeFormatter(false, ctx); + if (inlineAttributes.length > maxDynamicInlineLength) { + return processFormattedAttributes(attributeFormatter(true, putAttributesOnSeparateLine ? ctx : indentFormatter(ctx)), true); + } + return processFormattedAttributes((shouldIndentPrelim ? ctx.indent(1) : '') + inlineAttributes, false); +} +function liftChildComments(children) { + // Get mutable children list so comments from children that don't allow comments can be added to the list. + const mutableChildren = [...children]; + for (let i = 0; i < mutableChildren.length; i++) { + const child = mutableChildren[i]; + const { beforeNode, afterNode } = findComments(child); + // Add comments and advance i to not iterate over them again + mutableChildren.splice(i, 0, ...beforeNode); + i += beforeNode.length; + mutableChildren.splice(i + 1, 0, ...afterNode); + i += afterNode.length; + } + return mutableChildren; +} +function findComments(node) { + const result = { + beforeNode: [], + afterNode: [], + }; + if (!node.children) { + return result; + } + let currentCommentSequence = []; + node.children.forEach((child) => { + if (child.type === 'comment') { + currentCommentSequence.push(child); + return; + } + result.beforeNode.push(...currentCommentSequence); + currentCommentSequence = []; + const childComments = findComments(child); + if (nodeTypesAllowingComments.has(child.type)) { + // The child will format its own comments, so we don't need to lift them. + // Comments at the end of the child are still lifted for some nodes, because they can't be distinguished from comments + // that come after the child. + if (!nodeTypesAllowingTrailingComments.has(child.type)) { + currentCommentSequence = childComments.afterNode; + } + return; + } + result.beforeNode.push(...childComments.beforeNode); + currentCommentSequence = childComments.afterNode; + }); + result.afterNode.push(...currentCommentSequence); + return result; +} +function getTypeNodes(children) { + return children.filter((child) => child.type.startsWith('mcdoc:type/') || child.type === 'mcdoc:enum' + || child.type === 'mcdoc:struct'); +} +const formatter_module = (node, ctx) => { + const children = liftChildComments(node.children); + return children.map((child, i) => { + function addNewlineSeparator(formatted) { + if (i === children.length - 1) { + return formatted; + } + return `${formatted}\n`; + } + const formatted = ctx.meta.getFormatter(child.type)(child, ctx); + if (shouldFormatterIgnore(child)) { + // With formatterIgnore, the whitespace after a node is already included in the string, so no newlines have to be added + return formatted; + } + if (child.type === 'comment') { + return `${formatted}\n`; + } + if (child.type === 'mcdoc:use_statement' && children[i + 1]?.type === 'mcdoc:use_statement') { + return `${formatted}\n`; + } + // With an empty line between nodes + // (comments don't have them, because they probably refer to the next child) + // (use statements don't have them between each other, because use statements are supposed to be grouped together) + return addNewlineSeparator(`${formatted}\n`); + }).join(''); +}; +const formatter_useStatement = (node, ctx) => { + const hasAlias = node.children.some((child) => child.type === 'mcdoc:identifier'); + return formatChildren(node, ctx, { + 'mcdoc:literal': { suffix: ' ' }, + 'mcdoc:path': { suffix: hasAlias ? ' ' : '' }, + }); +}; +const formatter_injection = (node, ctx) => { + return formatChildren(node, ctx, { + 'mcdoc:literal': { suffix: ' ' }, + }); +}; +const formatter_struct = (node, ctx) => { + const isTopLevel = node.parent?.type === 'mcdoc:module'; + return formatWithPrelim(node, ctx, isTopLevel, isTopLevel, (contentCtx) => { + return formatChildren(node, contentCtx, { + 'mcdoc:literal': { suffix: ' ' }, + 'mcdoc:identifier': { suffix: ' ' }, + }); + }); +}; +const formatter_structInjection = (node, ctx) => { + return formatChildren(node, ctx, { + 'mcdoc:literal': { suffix: ' ' }, + 'mcdoc:path': { suffix: ' ' }, + }); +}; +const formatter_structBlock = (node, ctx) => { + if (node.children.length === 0) { + return '{}'; + } + const content = formatChildren(node, ctx, { + 'comment': { prefix: ctx.indent(1), suffix: '\n', indentSelf: true }, + 'mcdoc:struct/field/pair': { suffix: ',\n', indentSelf: true }, + 'mcdoc:struct/field/spread': { suffix: ',\n', indentSelf: true }, + }); + return `{\n${content}${ctx.indent()}}`; +}; +const formatter_structPairField = (node, ctx) => { + const keySuffix = `${node.isOptional ? '?' : ''}: `; + return ctx.indent() + formatWithPrelim(node, ctx, true, true, (contentCtx) => { + return formatChildren(node, contentCtx, { + 'mcdoc:struct/map_key': { suffix: keySuffix }, + 'mcdoc:identifier': { suffix: keySuffix }, + 'string': { suffix: keySuffix }, + }); + }); +}; +const formatter_structMapKey = (node, ctx) => { + const typeNode = getTypeNodes(node.children)[0]; + return formatChildren(node, ctx, { + [typeNode.type]: { prefix: '[', suffix: ']' }, + }); +}; +const formatter_structSpreadField = (node, ctx) => { + const typeNode = getTypeNodes(node.children)[0]; + return ctx.indent() + formatWithPrelim(node, ctx, true, true, (contentCtx) => { + return formatChildren(node, contentCtx, { + [typeNode.type]: { prefix: '...' }, + }); + }); +}; +const _enum = (node, ctx) => { + const isTopLevel = node.parent?.type === 'mcdoc:module'; + return formatWithPrelim(node, ctx, isTopLevel, isTopLevel, (contentCtx) => { + return node.children.map((child) => { + if (child.type === 'comment') { + // Don't format comments if the type doesn't allow them. + // A parent type that does allow comments should have already included them. + return ''; + } + if (child.type === 'mcdoc:attribute') { + // Formatted separately + return ''; + } + const formatted = contentCtx.meta.getFormatter(child.type)(child, contentCtx); + if (child.type === 'mcdoc:identifier') { + return formatted + ' '; + } + if (child.type !== 'mcdoc:literal' || child.value === 'enum') { + return formatted; + } + // Add parentheses to type + return `(${formatted}) `; + }).join(''); + }); +}; +const formatter_enumInjection = (node, ctx) => { + return node.children.map((child) => { + if (child.type === 'comment') { + // Don't format comments if the type doesn't allow them. + // A parent type that does allow comments should have already included them. + return ''; + } + const formatted = ctx.meta.getFormatter(child.type)(child, ctx); + if (child.type === 'mcdoc:path') { + return formatted + ' '; + } + if (child.type !== 'mcdoc:literal' || child.value === 'enum') { + return formatted; + } + // Add parentheses to type + return `(${formatted}) `; + }).join(''); +}; +const formatter_enumBlock = (node, ctx) => { + if (node.children.length === 0) { + return '{}'; + } + const content = formatChildren(node, ctx, { + 'comment': { prefix: ctx.indent(1), suffix: '\n', indentSelf: true }, + 'mcdoc:enum/field': { prefix: ctx.indent(1), suffix: ',\n', indentSelf: true }, + }); + return `{\n${content}${ctx.indent()}}`; +}; +const formatter_enumField = (node, ctx) => { + return formatWithPrelim(node, ctx, false, true, (contentCtx) => { + return formatChildren(node, contentCtx, { + 'mcdoc:identifier': { suffix: ' = ' }, + }); + }); +}; +const formatter_tupleType = (node, ctx) => { + const typeNode = getTypeNodes(node.children); + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatDynamicMultiline(node, (doMultiline) => { + const childFormatInfo = { + 'comment': { + prefix: contentCtx.indent(1), + suffix: `\n`, + }, + }; + const typeFormatInfo = { + prefix: doMultiline ? contentCtx.indent(1) : '', + suffix: ',' + (doMultiline ? `\n` : ' '), + indentSelf: true, + }; + for (const child of typeNode) { + childFormatInfo[child.type] = typeFormatInfo; + } + const content = formatChildren(node, contentCtx, childFormatInfo, !doMultiline); + return doMultiline ? `[\n${content}${contentCtx.indent()}]` : `[${content}]`; + }); + }); +}; +const formatter_unionType = (node, ctx) => { + const typeNode = getTypeNodes(node.children); + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatDynamicMultiline(node, (doMultiline) => { + const childFormatInfo = { + 'comment': { + prefix: contentCtx.indent(1), + suffix: `\n`, + }, + }; + const typeFormatInfo = { + prefix: doMultiline ? contentCtx.indent(1) : '', + suffix: ' |' + (doMultiline ? `\n` : ' '), + indentSelf: true, + }; + for (const child of typeNode) { + childFormatInfo[child.type] = typeFormatInfo; + } + const content = formatChildren(node, contentCtx, childFormatInfo, !doMultiline); + return doMultiline ? `(\n${content}${contentCtx.indent()})` : `(${content})`; + }); + }); +}; +const formatter_referenceType = (node, ctx) => { + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, {}); + }); +}; +const formatter_path = (node, ctx) => { + const formatted = formatChildren(node, ctx, { + 'mcdoc:literal': { prefix: '::' }, + 'mcdoc:identifier': { prefix: '::' }, + }); + if (!node.isAbsolute) { + return formatted.substring(2); // Remove the leading '::' for relative paths + } + return formatted; +}; +const formatter_stringType = (node, ctx) => { + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, { + 'mcdoc:int_range': { prefix: ' @ ' }, + }); + }); +}; +const formatter_primitiveArrayType = (node, ctx) => { + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, { + 'mcdoc:int_range': { prefix: ' @ ' }, + }); + }); +}; +const formatter_listType = (node, ctx) => { + const typeNode = getTypeNodes(node.children)[0]; + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, { + [typeNode.type]: { prefix: '[', suffix: ']' }, + 'mcdoc:int_range': { prefix: ' @ ' }, + }); + }); +}; +const typeAlias = (node, ctx) => { + const typeNode = getTypeNodes(node.children)[0]; + return formatWithPrelim(node, ctx, true, true, (contentCtx) => { + return formatChildren(node, contentCtx, { + [typeNode.type]: { prefix: ' = ' }, + 'mcdoc:literal': { suffix: ' ' }, + }); + }); +}; +const formatter_dispatcherType = (node, ctx) => { + return formatWithPrelim(node, ctx, true, true, (contentCtx) => { + return formatChildren(node, contentCtx, {}); + }); +}; +const formatter_dispatchStatement = (node, ctx) => { + return formatWithPrelim(node, ctx, true, true, (contentCtx) => { + return formatChildren(node, contentCtx, { + 'mcdoc:literal': { suffix: ' ' }, + 'mcdoc:index_body': { suffix: ' ' }, + }); + }); +}; +const formatter_indexBody = (node, ctx) => { + return formatDynamicMultiline(node, (doMultiline) => { + const indexFormatInfo = { + prefix: doMultiline ? ctx.indent(1) : '', + suffix: ',' + (doMultiline ? `\n` : ' '), + indentSelf: true, + }; + const content = formatChildren(node, ctx, { + 'mcdoc:dynamic_index': indexFormatInfo, + 'mcdoc:identifier': indexFormatInfo, + 'mcdoc:literal': indexFormatInfo, + 'resource_location': indexFormatInfo, + 'string': indexFormatInfo, + }, !doMultiline); + return doMultiline ? `[\n${content}${ctx.indent()}]` : `[${content}]`; + }); +}; +const dynamicIndex = (node, ctx) => { + const path = node.children.map((child) => { + if (child.type === 'comment') { + // Don't format comments if the type doesn't allow them. + // A parent type that does allow comments should have already included them. + return ''; + } + return ctx.meta.getFormatter(child.type)(child, ctx); + }).join('.'); + return `[${path}]`; +}; +const formatter_attribute = (node, ctx) => { + const hasTypeValue = getTypeNodes(node.children).length !== 0; + return formatChildren(node, ctx, { + 'mcdoc:identifier': { prefix: '#[', suffix: hasTypeValue ? '=' : '' }, + }) + ']'; +}; +const formatter_attributeTree = (node, ctx) => { + const content = formatChildren(node, ctx, {}); + return `${node.delim}${content}${AttributeTreeClosure[node.delim]}`; +}; +const formatter_attributeTreePosValues = (node, ctx) => { + const typeNode = getTypeNodes(node.children); + return formatDynamicMultiline(node, (doMultiline) => { + const childFormatInfo = { + prefix: doMultiline ? ctx.indent(1) : '', + suffix: ',' + (doMultiline ? `\n` : ' '), + indentSelf: true, + }; + const childFormatInfoMap = { + 'mcdoc:attribute/tree': childFormatInfo, + }; + for (const child of typeNode) { + childFormatInfoMap[child.type] = childFormatInfo; + } + const content = formatChildren(node, ctx, childFormatInfoMap, !doMultiline); + return doMultiline ? `\n${content}${ctx.indent()}` : content; + }); +}; +const formatter_attributeTreeNamedValues = (node, ctx) => { + const typeNode = getTypeNodes(node.children); + return formatDynamicMultiline(node, (doMultiline) => { + const childFormatInfo = { + prefix: '=', + suffix: ',' + (doMultiline ? `\n` : ' '), + indentSelf: true, + }; + const childFormatInfoMap = { + 'mcdoc:attribute/tree': childFormatInfo, + 'mcdoc:identifier': { prefix: doMultiline ? ctx.indent(1) : '' }, + 'string': { prefix: doMultiline ? ctx.indent(1) : '' }, + }; + for (const child of typeNode) { + childFormatInfoMap[child.type] = childFormatInfo; + } + const content = formatChildren(node, ctx, childFormatInfoMap, !doMultiline); + return doMultiline ? `\n${content}${ctx.indent()}` : content; + }); +}; +const formatter_typeArgBlock = (node, ctx) => { + const typeNode = getTypeNodes(node.children); + const childFormatInfo = {}; + for (const child of typeNode) { + childFormatInfo[child.type] = { suffix: ', ' }; + } + const content = formatChildren(node, ctx, childFormatInfo, true); + return `<${content}>`; +}; +const formatter_typeParamBlock = (node, ctx) => { + const content = formatChildren(node, ctx, { + 'mcdoc:type_param': { suffix: ', ' }, + }, true); + return `<${content}>`; +}; +const formatter_typeParam = (node, ctx) => { + return formatChildren(node, ctx, {}); +}; +const formatter_literalType = (node, ctx) => { + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, {}); + }); +}; +const formatter_typedNumber = (node, ctx) => { + return formatChildren(node, ctx, {}); +}; +const formatter_numericType = (node, ctx) => { + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, { + 'mcdoc:int_range': { prefix: ' @ ' }, + 'mcdoc:float_range': { prefix: ' @ ' }, + }); + }); +}; +const formatter_intRange = (node, ctx) => { + return formatChildren(node, ctx, {}); +}; +const formatter_floatRange = (node, ctx) => { + return formatChildren(node, ctx, {}); +}; +const formatter_anyType = (node, ctx) => { + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, {}); + }); +}; +const formatter_booleanType = (node, ctx) => { + return formatWithPrelim(node, ctx, false, false, (contentCtx) => { + return formatChildren(node, contentCtx, {}); + }); +}; +const formatter_literal = (node) => { + return node.value; +}; +const formatter_identifier = (node) => { + return node.value; +}; +const formatter_docComments = (node, ctx) => { + if (node.children.length === 0) { + return ''; + } + return formatChildren(node, ctx, { + comment: { suffix: ctx.indent() }, // No need to add new lines, because DocCommentNodes include them + }); +}; +function registerMcdocFormatter(meta) { + meta.registerFormatter('mcdoc:module', formatter_module); + meta.registerFormatter('mcdoc:use_statement', formatter_useStatement); + meta.registerFormatter('mcdoc:injection', formatter_injection); + meta.registerFormatter('mcdoc:struct', formatter_struct); + meta.registerFormatter('mcdoc:injection/struct', formatter_structInjection); + meta.registerFormatter('mcdoc:struct/block', formatter_structBlock); + meta.registerFormatter('mcdoc:struct/field/pair', formatter_structPairField); + meta.registerFormatter('mcdoc:struct/map_key', formatter_structMapKey); + meta.registerFormatter('mcdoc:struct/field/spread', formatter_structSpreadField); + meta.registerFormatter('mcdoc:enum', _enum); + meta.registerFormatter('mcdoc:injection/enum', formatter_enumInjection); + meta.registerFormatter('mcdoc:enum/block', formatter_enumBlock); + meta.registerFormatter('mcdoc:enum/field', formatter_enumField); + meta.registerFormatter('mcdoc:type/tuple', formatter_tupleType); + meta.registerFormatter('mcdoc:type/union', formatter_unionType); + meta.registerFormatter('mcdoc:type/reference', formatter_referenceType); + meta.registerFormatter('mcdoc:path', formatter_path); + meta.registerFormatter('mcdoc:type/string', formatter_stringType); + meta.registerFormatter('mcdoc:type/primitive_array', formatter_primitiveArrayType); + meta.registerFormatter('mcdoc:type/list', formatter_listType); + meta.registerFormatter('mcdoc:type_alias', typeAlias); + meta.registerFormatter('mcdoc:type/dispatcher', formatter_dispatcherType); + meta.registerFormatter('mcdoc:dispatch_statement', formatter_dispatchStatement); + meta.registerFormatter('mcdoc:index_body', formatter_indexBody); + meta.registerFormatter('mcdoc:dynamic_index', dynamicIndex); + meta.registerFormatter('mcdoc:attribute', formatter_attribute); + meta.registerFormatter('mcdoc:attribute/tree', formatter_attributeTree); + meta.registerFormatter('mcdoc:attribute/tree/pos', formatter_attributeTreePosValues); + meta.registerFormatter('mcdoc:attribute/tree/named', formatter_attributeTreeNamedValues); + meta.registerFormatter('mcdoc:type_arg_block', formatter_typeArgBlock); + meta.registerFormatter('mcdoc:type_param_block', formatter_typeParamBlock); + meta.registerFormatter('mcdoc:type_param', formatter_typeParam); + meta.registerFormatter('mcdoc:type/literal', formatter_literalType); + meta.registerFormatter('mcdoc:typed_number', formatter_typedNumber); + meta.registerFormatter('mcdoc:type/numeric_type', formatter_numericType); + meta.registerFormatter('mcdoc:int_range', formatter_intRange); + meta.registerFormatter('mcdoc:float_range', formatter_floatRange); + meta.registerFormatter('mcdoc:type/any', formatter_anyType); + meta.registerFormatter('mcdoc:type/boolean', formatter_booleanType); + meta.registerFormatter('mcdoc:literal', formatter_literal); + meta.registerFormatter('mcdoc:identifier', formatter_identifier); + meta.registerFormatter('mcdoc:doc_comments', formatter_docComments); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/validator.js + +const validator_string = (value) => { + if (value === undefined) { + return Parser_Failure; + } + if (value.kind === 'literal' && value.value.kind === 'string') { + return value.value.value; + } + if (value.kind === 'reference' && value.path) { + return value.path.replace(/.*::/, ''); + } + return Parser_Failure; +}; +const validator_number = (value) => { + if (value === undefined) { + return Parser_Failure; + } + if (value.kind === 'literal' && typeof value.value.value === 'number') { + return value.value.value; + } + return Parser_Failure; +}; +const validator_boolean = (value) => { + if (value === undefined) { + return Parser_Failure; + } + if (value.kind === 'literal' && value.value.kind === 'boolean') { + return value.value.value; + } + return Parser_Failure; +}; +function options(...options) { + return (value, ctx) => { + const stringValue = validator_string(value, ctx); + if (stringValue === Parser_Failure) { + return Parser_Failure; + } + if (options.includes(stringValue)) { + return stringValue; + } + return Parser_Failure; + }; +} +function tree(properties) { + return (value, ctx) => { + if (value?.kind !== 'tree') { + return Parser_Failure; + } + const result = {}; + for (const key in properties) { + const validator = properties[key]; + const propValue = value.values[key]; + const property = validator(propValue, ctx); + if (property === Parser_Failure) { + return Parser_Failure; + } + result[key] = property; + } + return result; + }; +} +function validator_list(itemValidator) { + return (value, ctx) => { + if (value?.kind !== 'tree') { + return Parser_Failure; + } + const result = []; + for (const element of Object.values(value.values)) { + const item = itemValidator(element, ctx); + if (item === Parser_Failure) { + return Parser_Failure; + } + result.push(item); + } + return result; + }; +} +function validator_optional(validator) { + return (value, ctx) => { + const config = validator(value, ctx); + return config === Parser_Failure ? undefined : config; + }; +} +function map(validator, mapper) { + return (value, ctx) => { + const config = validator(value, ctx); + return config === Parser_Failure ? Parser_Failure : mapper(config); + }; +} +function alternatives(...validators) { + return (value, ctx) => { + for (const validator of validators) { + const result = validator(value, ctx); + if (result !== Parser_Failure) { + return result; + } + } + return Parser_Failure; + }; +} +//# sourceMappingURL=validator.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/index.js + + +function registerAttribute(meta, name, validator, attribute) { + meta.registerCustom('mcdoc:attribute', name, { validator, attribute }); +} +function getAttribute(meta, name) { + return meta.getCustom('mcdoc:attribute')?.get(name); +} +function handleAttributes(attributes, ctx, fn) { + for (const { name, value } of attributes ?? []) { + const handler = getAttribute(ctx.meta, name); + if (!handler) { + continue; + } + const config = handler.validator(value, ctx); + if (config === Parser_Failure) { + continue; + } + fn(handler.attribute, config); + } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/attribute/builtin.js + + + +const idValidator = alternatives(map(validator_string, v => ({ registry: v })), tree({ + registry: validator_string, + tags: validator_optional(options('allowed', 'implicit', 'required')), + definition: validator_optional(validator_boolean), + prefix: validator_optional(options('!')), + path: validator_optional(validator_string), + empty: validator_optional(options('allowed')), + exclude: validator_optional(alternatives(map(validator_string, v => [v]), validator_list(validator_string))), +}), () => ({})); +const matchRegexValidator = alternatives(map(validator_string, v => ({ pattern: v })), tree({ + pattern: validator_string, + message: validator_optional(validator_string), +})); +function getResourceLocationOptions({ registry, tags, definition, path }, requireCanonical, ctx, typeDef) { + if (!registry) { + if (typeDef?.kind === 'enum' && typeDef.enumKind === 'string') { + return { + pool: typeDef.values.map(v => ResourceLocation.lengthen(`${v.value}`)), + allowUnknown: true, // the mcdoc checker will already report errors for this + }; + } + if (typeDef?.kind === 'literal' && typeDef.value.kind === 'string') { + return { + pool: [ResourceLocation.lengthen(typeDef.value.value)], + allowUnknown: true, + }; + } + return { pool: [], allowUnknown: true }; + } + if (tags === 'implicit') { + registry = `tag/${registry}`; + } + if (tags === 'allowed' || tags === 'required') { + return { + category: registry, + requireCanonical, + allowTag: true, + requireTag: tags === 'required', + implicitPath: path, + }; + } + return { + category: registry, + requireCanonical, + usageType: definition ? 'definition' : 'reference', + implicitPath: path, + }; +} +const integerValidator = alternatives(tree({ + min: validator_optional(validator_number), + max: validator_optional(validator_number), +}), () => ({})); +function registerBuiltinAttributes(meta) { + registerAttribute(meta, 'canonical', () => undefined, { + // Has hardcoded behavior in the runtime checker + }); + registerAttribute(meta, 'dispatcher_key', validator_string, { + stringMocker: (config, _, ctx) => { + const symbol = ctx.symbols.query(ctx.doc, 'mcdoc/dispatcher', config).symbol; + const keys = Object.keys(symbol?.members ?? {}).filter(m => !m.startsWith('%')); + return LiteralNode.mock(ctx.offset, { pool: keys }); + }, + }); + registerAttribute(meta, 'divisible_by', validator_number, { + checker(config, typeDef) { + if (typeDef.kind !== 'literal' || typeDef.value.kind === 'string' + || typeDef.value.kind === 'boolean') { + return undefined; + } + const value = typeDef.value.value; + return (node, ctx) => { + if (value % config !== 0) { + ctx.err.report(localize('not-divisible-by', value, config), node, 2 /* core.ErrorSeverity.Warning */); + } + }; + }, + }); + registerAttribute(meta, 'id', idValidator, { + checkInferred: (config, inferred, ctx) => { + if (inferred.kind === 'string') { + // Internal mcdoc isAssignable check + const idAttr = inferred.attributes?.find(a => a.name === 'id'); + if (idAttr) { + const inferredConfig = idValidator(idAttr.value, ctx); + return inferredConfig === Parser_Failure || inferredConfig.prefix === config.prefix; + // Prefix doesn't match + } + } + if (inferred.kind !== 'literal' || inferred.value.kind !== 'string') { + return true; // Ignore attribute when not a string + } + if (config.prefix && !inferred.value.value.startsWith(config.prefix)) { + return false; // Missing prefix + } + if (!config.prefix && inferred.value.value.startsWith('!')) { + return false; // Unexpected prefix + } + if (!inferred.value.value.includes(':')) { + if (config.prefix) { + inferred.value.value = config.prefix + 'minecraft:' + + inferred.value.value.slice(config.prefix.length); + } + else { + inferred.value.value = 'minecraft:' + inferred.value.value; + } + } + return true; + }, + mapType: (config, typeDef, ctx) => { + if (typeDef.kind === 'literal' && typeDef.value.kind === 'string') { + const value = ResourceLocation.lengthen(typeDef.value.value); + return { ...typeDef, value: { kind: 'string', value } }; + } + if (typeDef.kind === 'enum' && typeDef.enumKind === 'string') { + const values = typeDef.values.map(v => ({ + ...v, + value: ResourceLocation.lengthen(`${v.value}`), + })); + return { ...typeDef, values }; + } + return typeDef; + }, + stringParser: (config, typeDef, ctx) => { + const options = getResourceLocationOptions(config, ctx.requireCanonical, ctx, typeDef); + if (!options) { + return; + } + const resourceLocation = resourceLocation_resourceLocation(options); + return (src, ctx) => { + if (config.empty && !src.canRead()) { + return string_string({ + unquotable: { blockList: new Set(), allowEmpty: true }, + })(src, ctx); + } + if (config.prefix) { + return prefixed_prefixed({ prefix: config.prefix, child: resourceLocation })(src, ctx); + } + const node = resourceLocation(src, ctx); + if (config.exclude) { + const resourceLocation = ResourceLocationNode.toString(node, 'full'); + for (const e of config.exclude ?? []) { + const excluded = ResourceLocation.lengthen(e); + if (resourceLocation === excluded) { + ctx.err.report(localize('not-allowed-here', localeQuote(excluded)), node, 2 /* core.ErrorSeverity.Warning */); + } + } + } + return node; + }; + }, + stringMocker: (config, typeDef, ctx) => { + const options = getResourceLocationOptions(config, ctx.requireCanonical ?? false, ctx, typeDef); + if (!options) { + return undefined; + } + const resourceLocation = ResourceLocationNode.mock(ctx.offset, options); + if (config.prefix) { + return PrefixedNode.mock(ctx.offset, config.prefix, resourceLocation); + } + return resourceLocation; + }, + }); + registerAttribute(meta, 'integer', integerValidator, { + stringParser: (config) => { + return integer_integer({ pattern: /^-?\d+$/, min: config.min, max: config.max }); + }, + }); + registerAttribute(meta, 'color', validator_string, { + checkInferred: (config, inferred, ctx) => { + if (config === 'hex_rgb' && inferred.kind === 'literal' && inferred.value.kind === 'string') { + return inferred.value.value.startsWith('#'); + } + return true; + }, + checker: (config, inferred) => { + return (node, ctx) => { + switch (config) { + case 'named': + if (inferred.kind !== 'literal' || inferred.value.kind !== 'string') { + return; + } + node.color = Color.fromNamed(inferred.value.value); + return; + case 'hex_rgb': + if (inferred.kind !== 'literal' || inferred.value.kind !== 'string') { + return; + } + let range = node.range; + if (StringBaseNode.is(node) && node.quote) { + range = Range.translate(range, 1, -1); + } + if (!inferred.value.value.startsWith('#')) { + ctx.err.report(localize('expected', localeQuote('#')), range, 2 /* core.ErrorSeverity.Warning */); + return; + } + node.color = { + value: Color.fromHexRGB(inferred.value.value), + format: [ColorFormat.HexRGB], + range, + }; + return; + case 'composite_rgb': + if (inferred.kind !== 'literal' || typeof inferred.value.value !== 'number') { + return; + } + node.color = { + value: Color.fromCompositeRGB(inferred.value.value), + format: [ColorFormat.CompositeRGB], + range: node.range, + }; + return; + case 'composite_argb': + if (inferred.kind !== 'literal' || typeof inferred.value.value !== 'number') { + return; + } + node.color = { + value: Color.fromCompositeARGB(inferred.value.value), + format: [ColorFormat.CompositeARGB], + range: node.range, + }; + return; + default: + return; + } + }; + }, + }); + registerAttribute(meta, 'regex_pattern', () => undefined, { + checker: (_, typeDef) => { + if (typeDef.kind !== 'literal' || typeDef.value.kind !== 'string') { + return undefined; + } + const pattern = typeDef.value.value; + return (node, ctx) => { + try { + RegExp(pattern); + } + catch (e) { + const message = e instanceof Error ? e.message : `${e}`; + const error = message + .replace(/^Invalid regular expression: /, '') + .replace(/^\/.+\/: /, ''); + ctx.err.report(localize('invalid-regex-pattern', error), node, 2 /* core.ErrorSeverity.Warning */); + } + }; + }, + }); + registerAttribute(meta, 'match_regex', matchRegexValidator, { + checker: (config, typeDef, _) => { + if (typeDef.kind !== 'literal' || typeDef.value.kind !== 'string') { + return undefined; + } + const pattern = config.pattern; + const value = typeDef.value.value; + return (node, ctx) => { + try { + const regex = RegExp(pattern); + if (!regex.test(value)) { + const message = config.message ?? localize('mismatching-regex-pattern', pattern); + ctx.err.report(message, node, 2 /* core.ErrorSeverity.Warning */); + } + } + catch (e) { + ctx.logger.warn(`Invalid regular expression in "match_regex" mcdoc attribute: ${pattern}`); + } + }; + }, + }); +} +//# sourceMappingURL=builtin.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/common.js +function identifierToSeg(identifier) { + const ans = identifier.slice(2).split('::'); + if (ans.length === 1 && ans[0] === '') { + return []; + } + return ans; +} +function segToIdentifier(seg) { + return `::${seg.join('::')}`; +} +//# sourceMappingURL=common.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/uri_processors.js + + +const Extension = '.mcdoc'; +const McdocRootPrefix = 'mcdoc/'; +const uriBinder = (uris, ctx) => { + let urisAndRels = []; + for (const uri of uris) { + if (!uri.endsWith(Extension)) { + continue; + } + let rel = fileUtil.getRel(uri, ctx.roots); + if (!rel) { + continue; + } + rel = rel.slice(0, -Extension.length).replace(/(^|\/)mod$/, ''); + urisAndRels.push([uri, rel]); + } + // Now the value of `urisAndRels`: + // file:///root/mcdoc/foo/mod.mcdoc -> mcdoc/foo + // file:///root/mcdoc/foo/bar.mcdoc -> mcdoc/foo/bar + // A special check for the directory named `mcdoc`: + // If all files are put under this folder, we will treat that folder as the "root" instead. + if (urisAndRels.every(([_, rel]) => rel.startsWith(McdocRootPrefix))) { + urisAndRels = urisAndRels.map(([uri, rel]) => [uri, rel.slice(McdocRootPrefix.length)]); + } + // Now the value of `urisAndRels`: + // file:///root/mcdoc/foo/mod.mcdoc -> foo + // file:///root/mcdoc/foo/bar.mcdoc -> foo/bar + for (const [uri, rel] of urisAndRels) { + ctx.symbols.query(uri, 'mcdoc', segToIdentifier(rel.split('/'))).ifKnown(() => { }).elseEnter({ + data: { subcategory: 'module' }, + usage: { type: 'definition' }, + }); + } +}; +const uriSorter = (a, b, next) => { + if (a.endsWith(Extension) && !b.endsWith(Extension)) { + return -1; + } + else if (!a.endsWith(Extension) && b.endsWith(Extension)) { + return 1; + } + else { + return next(a, b); + } +}; +//# sourceMappingURL=uri_processors.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/checker/context.js +var McdocCheckerContext; +(function (McdocCheckerContext) { + function create(ctx, options) { + return { + ...ctx, + allowMissingKeys: options.allowMissingKeys ?? false, + requireCanonical: options.requireCanonical ?? false, + isEquivalent: options.isEquivalent ?? (() => false), + getChildren: options.getChildren ?? (() => []), + reportError: options.reportError ?? (() => { }), + attachTypeInfo: options.attachTypeInfo, + nodeAttacher: options.nodeAttacher, + stringAttacher: options.stringAttacher, + }; + } + McdocCheckerContext.create = create; +})(McdocCheckerContext || (McdocCheckerContext = {})); +//# sourceMappingURL=context.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/checker/error.js + + + + +var SimpleError; +(function (SimpleError) { + function is(error) { + return error?.kind === 'duplicate_key' + || error?.kind === 'unknown_key' + || error?.kind === 'expected_key_value_pair' + || error?.kind === 'unknown_tuple_element' + || error?.kind === 'internal'; + } + SimpleError.is = is; +})(SimpleError || (SimpleError = {})); +var UnknownKeyError; +(function (UnknownKeyError) { + function is(error) { + return error?.kind === 'unknown_key'; + } + UnknownKeyError.is = is; +})(UnknownKeyError || (UnknownKeyError = {})); +var src_RangeError; +(function (RangeError) { + function is(error) { + return error?.kind === 'invalid_collection_length' + || error?.kind === 'invalid_string_length' + || error?.kind === 'number_out_of_range'; + } + RangeError.is = is; +})(src_RangeError || (src_RangeError = {})); +var MissingKeyError; +(function (MissingKeyError) { + function is(error) { + return error?.kind === 'missing_key'; + } + MissingKeyError.is = is; +})(MissingKeyError || (MissingKeyError = {})); +var TypeMismatchError; +(function (TypeMismatchError) { + function is(error) { + return error?.kind === 'type_mismatch'; + } + TypeMismatchError.is = is; +})(TypeMismatchError || (TypeMismatchError = {})); +function condenseAndPropagate(definitionGroup, definitionErrors) { + const queue = [{ node: definitionGroup, errorsOnLayer: definitionErrors, depth: 0 }]; + while (queue.length) { + const { node, errorsOnLayer, depth } = queue.shift(); + const stillValidDefinitions = []; + const { definitions, condensedErrors } = condenseErrorsAndFilterSiblings(errorsOnLayer); + stillValidDefinitions.push(...definitions); + node.condensedErrors.push(condensedErrors); + if (node.validDefinitions.length !== stillValidDefinitions.length) { + filterChildDefinitions(node.validDefinitions.filter(d => !stillValidDefinitions.includes(d)), node.runtimeNode.children); + node.validDefinitions = stillValidDefinitions; + } + const parents = node.parents + .filter(parent => { + const lastDefWithNode = parent.groupNode.validDefinitions + .findLast(d => d.children.includes(node)); + if (lastDefWithNode !== parent) { + // Wait for last definition that leads to this parent + return false; + } + const lastChild = parent.groupNode.validDefinitions + .flatMap(d => d.children) + .findLast(v => { + if (v.condensedErrors.length > depth) { + return true; + } + let children = [v]; + for (let i = 0; i < depth; i++) { + children = children.flatMap(v => v.validDefinitions).flatMap(v => v.children); + } + return children.length > 0; + }); + if (lastChild !== node) { + // Wait for all siblings to be evaluated first + return false; + } + return true; + }) + .map(parent => ({ + node: parent.groupNode, + depth: depth + 1, + errorsOnLayer: parent.groupNode.validDefinitions + .flatMap(d => ({ + definition: d, + errors: d.children + .flatMap(c => c.condensedErrors.length > depth + ? c.condensedErrors[depth] + : []), + })), + })); + queue.push(...parents); + } +} +function filterChildDefinitions(removedDefs, children) { + for (const child of children) { + for (const childValue of child.possibleValues) { + const removedChildDefs = []; + for (let i = 0; i < childValue.definitionsByParent.length; i++) { + const definitionGroup = childValue.definitionsByParent[i]; + definitionGroup.parents = definitionGroup.parents.filter(p => !removedDefs.includes(p)); + if (definitionGroup.parents.length === 0) { + removedChildDefs.push(...definitionGroup.validDefinitions); + childValue.definitionsByParent.splice(i, 1); + i--; + } + } + if (removedChildDefs.length > 0) { + filterChildDefinitions(removedChildDefs, childValue.children); + } + } + } +} +function condenseErrorsAndFilterSiblings(definitions) { + if (definitions.length === 0) { + return { definitions: [], condensedErrors: [] }; + } + let validDefinitions = definitions; + const errors = []; + const typeMismatchResult = condense(validDefinitions, TypeMismatchError.is, (a, b) => a.expected.length === b.expected.length + && !a.expected.some(d => !b.expected.some(od => McdocType.equals(d, od))), errors => ({ + kind: 'type_mismatch', + node: errors[0].node, + expected: deduplicateGroups(errors.map(e => e.expected), McdocType.equals), + })); + validDefinitions = typeMismatchResult.filteredDefinitions; + errors.push(...typeMismatchResult.condensedErrors); + for (const kind of [ + 'unknown_key', + 'expected_key_value_pair', + 'unknown_tuple_element', + ]) { + const simpleErrorResult = condense(validDefinitions, (e) => e.kind === kind, _ => true); + validDefinitions = simpleErrorResult.filteredDefinitions; + errors.push(...simpleErrorResult.condensedErrors); + } + const missingKeyResult = condense(validDefinitions, MissingKeyError.is, (a, b) => !a.keys.some(k => !b.keys.includes(k)), errors => ({ + kind: 'missing_key', + node: errors[0].node, + keys: deduplicateGroups(errors.map(e => e.keys)), + })); + validDefinitions = missingKeyResult.filteredDefinitions; + errors.push(...missingKeyResult.condensedErrors); + for (const kind of [ + 'invalid_collection_length', + 'invalid_string_length', + 'number_out_of_range', + ]) { + const rangeErrorResult = condense(validDefinitions, (e) => e.kind === kind, (a, b) => a.ranges.length === b.ranges.length + && !a.ranges.some(r => !b.ranges.some(or => NumericRange.equals(r, or))), + // TODO merge overlapping ranges better? + errors => ({ + kind, + node: errors[0].node, + ranges: deduplicateGroups(errors.map(e => e.ranges), NumericRange.equals), + })); + validDefinitions = rangeErrorResult.filteredDefinitions; + errors.push(...rangeErrorResult.condensedErrors); + } + // No condensing needed for duplicate key. If a key is a duplicate in one definition, it really + // should have been reported by all of them + validDefinitions[0].errors.filter(e => e.kind === 'duplicate_key'); + const internalErrorResult = condense(validDefinitions, (e) => e.kind === 'internal', _ => false); + validDefinitions = internalErrorResult.filteredDefinitions; + errors.push(...internalErrorResult.condensedErrors); + return { + definitions: validDefinitions.map(d => d.definition), + condensedErrors: errors, + }; +} +function condense(validDefinitions, is, equals, combineAlternatives) { + // TODO a lot of O(n^2) in this function, may need optimization + const errorsOfType = validDefinitions + .map(def => ({ def, errors: def.errors.filter(is) })); + const definitionsWithoutError = errorsOfType + .filter(d => d.errors.length === 0) + .map(e => e.def); + if (definitionsWithoutError.length > 0) { + return { condensedErrors: [], filteredDefinitions: definitionsWithoutError }; + } + const distinctErrorsPerNode = errorsOfType + .flatMap(d => d.errors.map(e => ({ definition: d.def, error: e }))) + .reduce((entries, e) => { + const entry = entries.find(oe => oe.errors[0].error.node === e.error.node); + if (entry) { + const error = entry.errors.find(oe => equals(e.error, oe.error)); + if (error) { + error.definitions.push(e.definition); + } + else { + entry.errors.push({ error: e.error, definitions: [e.definition] }); + } + } + else { + entries.push({ errors: [{ error: e.error, definitions: [e.definition] }] }); + } + return entries; + }, []); + const distinctErrors = distinctErrorsPerNode.flatMap(e => e.errors); + const commonErrors = distinctErrors + .filter(e => e.definitions.length === validDefinitions.length) + .map(e => e.error); + const definitionsWithUncommonErrors = distinctErrors + .filter(e => e.definitions.length < validDefinitions.length) + .flatMap(e => e.definitions); + const definitionsWithOnlyCommonErrors = validDefinitions + .filter(d => !definitionsWithUncommonErrors.includes(d)); + if (definitionsWithOnlyCommonErrors.length > 0) { + return { + filteredDefinitions: definitionsWithOnlyCommonErrors, + condensedErrors: commonErrors, + }; + } + const combinedErrors = combineAlternatives + ? distinctErrorsPerNode + .map(e => { + const uniqueDefinitions = deduplicateGroups(e.errors.map(e => e.definitions), (a, b) => McdocType.equals(a.definition.typeDef, b.definition.typeDef)); + const ans = { + definitions: uniqueDefinitions, + error: combineAlternatives(e.errors + .filter(e => !commonErrors.includes(e.error)) + .map(e => e.error)), + }; + ans.error.nodesWithConflictingErrors = deduplicateGroups(e.errors.map(e => e.error.nodesWithConflictingErrors ?? [])); + if (ans.error.nodesWithConflictingErrors.length === 0) { + ans.error.nodesWithConflictingErrors = undefined; + } + return ans; + }) + : distinctErrorsPerNode.flatMap(e => e.errors + .map(ee => ({ definitions: ee.definitions, error: ee.error }))); + const conflictingErrors = combinedErrors + .filter(e => e.definitions.length < validDefinitions.length); + const nodesWithConflictingErrors = conflictingErrors + .map(e => e.error.node) + .filter((n, i, arr) => arr.indexOf(n) === i); + for (const error of conflictingErrors) { + error.error.nodesWithConflictingErrors = nodesWithConflictingErrors; + } + return { + filteredDefinitions: validDefinitions, + condensedErrors: [...commonErrors, ...combinedErrors.map(e => e.error)], + }; +} +/** + * Deduplicates groups assuming: + * - There are no duplicates within a group + * - A group with 1 element implies there is no duplicated group of length 1 with the same element + * + * When calling {@link condense}, if a group stems from an error, this should automatically be the + * case. + */ +function deduplicateGroups(definitionGroups, predicate) { + const definitions = []; + for (let i = 0; i < definitionGroups.length; i++) { + const group = definitionGroups[i]; + if (group.length === 1) { + definitions.push(group[0]); + continue; + } + definitions.push(...group + .filter(v => !definitionGroups.some((og, oi) => (oi > i || og.length === 1) + && predicate + ? og.some(ov => predicate(v, ov)) + : og.includes(v)))); + } + return definitions; +} +function getDefaultErrorRange(node, error) { + const { range } = node.originalNode; + if (error === 'missing_key' || error === 'invalid_collection_length') { + return { start: range.start, end: range.start + 1 }; + } + return range; +} +function getDefaultErrorReporter(ctx, getErrorRange) { + return (error) => { + const defaultTranslationKey = error.kind.replaceAll('_', '-'); + let localizedText; + let severity = 3 /* ErrorSeverity.Error */; + switch (error.kind) { + case 'unknown_tuple_element': + localizedText = localize('expected', localize('nothing')); + break; + case 'unknown_key': + if (error.nodesWithConflictingErrors) { + localizedText = localize('invalid-key-combination', arrayToMessage(error.nodesWithConflictingErrors.map(n => McdocType.toString(n.inferredType)), true, 'and')); + } + else { + localizedText = localize(defaultTranslationKey, error.node.inferredType.kind === 'literal' + ? localeQuote(error.node.inferredType.value.value.toString()) + : `<${localize(`mcdoc.type.${error.node.inferredType.kind}`)}>`); + severity = 2 /* ErrorSeverity.Warning */; + } + break; + case 'missing_key': + if (error.keys.length === 1) { + localizedText = localize(defaultTranslationKey, localeQuote(error.keys[0])); + } + else { + localizedText = localize('mcdoc.runtime.checker.some-missing-keys', arrayToMessage(error.keys)); + } + break; + case 'invalid_collection_length': + case 'invalid_string_length': + case 'number_out_of_range': + const baseKey = error.kind === 'invalid_collection_length' + ? 'mcdoc.runtime.checker.range.collection' + : error.kind === 'invalid_string_length' + ? 'mcdoc.runtime.checker.range.string' + : 'mcdoc.runtime.checker.range.number'; + const rangeMessages = error.ranges.map(r => { + const left = r.min !== undefined + ? localize(RangeKind.isLeftExclusive(r.kind) + ? 'mcdoc.runtime.checker.range.left-exclusive' + : 'mcdoc.runtime.checker.range.left-inclusive', r.min) + : undefined; + const right = r.max !== undefined + ? localize(RangeKind.isLeftExclusive(r.kind) + ? 'mcdoc.runtime.checker.range.right-exclusive' + : 'mcdoc.runtime.checker.range.right-inclusive', r.max) + : undefined; + if (left !== undefined && right !== undefined) { + return localize('mcdoc.runtime.checker.range.concat', left, right); + } + return left ?? right; + }).filter(r => r !== undefined); + localizedText = localize('expected', localize(baseKey, arrayToMessage(rangeMessages, false))); + break; + case 'type_mismatch': + localizedText = localize('expected', arrayToMessage(error.expected.map(e => e.kind === 'enum' + ? arrayToMessage(e.values.map(v => ResourceLocation.shorten(v.value.toString()))) + : e.kind === 'literal' + ? localeQuote(e.value.value.toString()) + : localize(`mcdoc.type.${e.kind}`)), false)); + break; + case 'expected_key_value_pair': + localizedText = localize(`mcdoc.runtime.checker.${defaultTranslationKey}`); + break; + case 'internal': + return; + default: + localizedText = localize(defaultTranslationKey); + } + ctx.err.report(localizedText, getErrorRange(error.node, error.kind), severity); + }; +} +//# sourceMappingURL=error.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/checker/index.js + + + + + + + + + +function reference(node, path, ctx) { + typeDefinition(node, { kind: 'reference', path }, ctx); +} +function dispatcher(node, registry, index, ctx) { + const parallelIndices = typeof index === 'string' + ? [{ kind: 'static', value: index }] + : Array.isArray(index) + ? index + : [index]; + typeDefinition(node, { kind: 'dispatcher', registry, parallelIndices }, ctx); +} +function isAssignable(assignValue, typeDef, ctx, isEquivalent) { + if (assignValue.kind === 'literal' && typeDef.kind === 'literal' + && assignValue.value.kind === typeDef.value.kind + && !assignValue.attributes && !typeDef.attributes) { + return assignValue.value.value === typeDef.value.value; + } + let ans = true; + const newCtx = McdocCheckerContext.create(ctx, { + isEquivalent, + getChildren: (_, d) => { + switch (d.kind) { + case 'list': + const vals = getPossibleTypes(d.item); + return [vals.map(v => ({ originalNode: v, inferredType: v }))]; + case 'byte_array': + return [[{ originalNode: { kind: 'byte' }, inferredType: { kind: 'byte' } }]]; + case 'int_array': + return [[{ originalNode: { kind: 'int' }, inferredType: { kind: 'int' } }]]; + case 'long_array': + return [[{ originalNode: { kind: 'long' }, inferredType: { kind: 'long' } }]]; + case 'struct': + return d.fields.map(f => { + const vals = getPossibleTypes(f.type); + return { + attributes: f.attributes, + key: { originalNode: f.key, inferredType: f.key }, + possibleValues: vals.map(v => ({ originalNode: v, inferredType: v })), + }; + }); + case 'tuple': + return d.items.map(f => { + const vals = getPossibleTypes(f); + return vals.map(v => ({ originalNode: v, inferredType: v })); + }); + default: + return []; + } + }, + reportError: () => { + ans = false; + }, + }); + const node = { + parent: undefined, + runtimeKey: undefined, + possibleValues: [], + }; + node.possibleValues = getPossibleTypes(typeDef).map(v => ({ + entryNode: node, + node: { originalNode: v, inferredType: v }, + children: [], + definitionsByParent: [], + })); + // TODO add bail option to allow checking logic to bail on first error + typeDefinition(getPossibleTypes(assignValue).map(v => ({ originalNode: v, inferredType: v })), typeDef, newCtx); + return ans; +} +function typeDefinition(runtimeValues, typeDef, ctx) { + const rootNode = { + parent: undefined, + runtimeKey: undefined, + possibleValues: [], + }; + rootNode.possibleValues = runtimeValues.map(n => ({ + node: n, + entryNode: rootNode, + definitionsByParent: [], + children: [], + })); + for (const value of rootNode.possibleValues) { + const simplifiedRoot = simplify(typeDef, { ctx, node: value }).typeDef; + const validRootDefinitions = simplifiedRoot.kind === 'union' + ? simplifiedRoot.members + : [simplifiedRoot]; + value.definitionsByParent = [{ + parents: [], + keyDefinition: undefined, + runtimeNode: value, + originalTypeDef: typeDef, + condensedErrors: [], + validDefinitions: [], + }]; + value.definitionsByParent[0].validDefinitions = validRootDefinitions.map(d => ({ + groupNode: value.definitionsByParent[0], + typeDef: d, + children: [], + })); + } + const nodeQueue = [rootNode]; + while (nodeQueue.length !== 0) { + const node = nodeQueue.shift(); + for (const value of node.possibleValues) { + const inferredSimplified = simplify(value.node.inferredType, { ctx, node: value }).typeDef; + const children = ctx.getChildren(value.node.originalNode, inferredSimplified); + const childNodes = children.map(c => { + const ans = { + parent: value, + runtimeKey: !Array.isArray(c) ? c.key : undefined, + possibleValues: [], + }; + ans.possibleValues = (Array.isArray(c) ? c : c.possibleValues).map(v => ({ + entryNode: ans, + node: v, + definitionsByParent: [], + condensedErrors: [], + children: [], + })); + return ans; + }); + for (const definitionGroup of value.definitionsByParent) { + const definitionErrors = []; + if (definitionGroup.validDefinitions.length === 0) { + // nothing can be assigned to an empty union + definitionGroup.condensedErrors = [[{ + kind: 'type_mismatch', + node: value.node, + expected: [], + }]]; + } + for (const def of definitionGroup.validDefinitions) { + const { errors, childDefinitions } = checkShallowly(value.node, inferredSimplified, children, def.typeDef, ctx); + definitionErrors.push({ definition: def, errors }); + for (let i = 0; i < childDefinitions.length; i++) { + const childDef = childDefinitions[i]; + if (!childDef) { + continue; + } + const child = childNodes[i]; + const existingDef = child.possibleValues.length > 0 + ? child.possibleValues[0].definitionsByParent + .find(d => (d.keyDefinition === undefined || childDef.keyType === undefined + ? d.keyDefinition === undefined + : McdocType.equals(d.keyDefinition, childDef.keyType)) + && McdocType.equals(d.originalTypeDef, childDef.type)) + : undefined; + for (const childValue of child.possibleValues) { + if (existingDef) { + existingDef.parents.push(def); + def.children.push(existingDef); + continue; + } + // TODO We need some sort of map / local cache which keeps track of the original + // non-simplified types and see if they have been compared yet. This is needed + // for structures that are cyclic, to essentially bail out once we are comparing + // the same types again and just collect the errors of the lower depth. + // This will currently lead to a stack overflow error when e.g. comparing two + // text component definitions + const simplified = simplify(childDef.type, { ctx, node: childValue }).typeDef; + const childDefinitionGroup = { + parents: [def], + runtimeNode: childValue, + keyDefinition: childDef.keyType, + originalTypeDef: childDef.type, + validDefinitions: [], + condensedErrors: [], + desc: childDef.desc, + }; + childDefinitionGroup.validDefinitions = + (simplified.kind === 'union' ? simplified.members : [simplified]) + .map(d => ({ + groupNode: childDefinitionGroup, + typeDef: d, + children: [], + })); + childValue.definitionsByParent.push(childDefinitionGroup); + def.children.push(childDefinitionGroup); + } + } + } + condenseAndPropagate(definitionGroup, definitionErrors); + } + value.children = childNodes; + nodeQueue.push(...childNodes); + } + } + if (ctx.attachTypeInfo) { + for (const node of rootNode.possibleValues) { + attachTypeInfo(node, ctx); + } + } + for (const error of rootNode.possibleValues + .flatMap(v => v.definitionsByParent) + .flatMap(d => d.condensedErrors) + .flat()) { + if (error) { + ctx.reportError(error); + } + } +} +function attachTypeInfo(node, ctx) { + const definitions = node.definitionsByParent.flatMap(d => d.validDefinitions); + if (definitions.length === 1) { + const { typeDef, groupNode } = definitions[0]; + ctx.attachTypeInfo?.(node.node.originalNode, typeDef, groupNode.desc); + handleNodeAttachers(node.node, typeDef, ctx); + if (node.entryNode.runtimeKey && groupNode.keyDefinition) { + ctx.attachTypeInfo?.(node.entryNode.runtimeKey.originalNode, groupNode.keyDefinition, groupNode.desc); + handleNodeAttachers(node.entryNode.runtimeKey, groupNode.keyDefinition, ctx); + } + } + else if (definitions.length > 1) { + ctx.attachTypeInfo?.(node.node.originalNode, { + kind: 'union', + members: definitions.map(d => d.typeDef), + }); + if (node.entryNode.runtimeKey) { + ctx.attachTypeInfo?.(node.entryNode.runtimeKey.originalNode, { + kind: 'union', + members: node.definitionsByParent + .map(d => d.keyDefinition) + .filter((d) => d !== undefined), + }); + } + // when there are multiple valid definitions, we don't run any string parsers. + } + for (const child of node.children.flatMap(c => c.possibleValues)) { + attachTypeInfo(child, ctx); + } +} +function handleNodeAttachers(runtimeValue, typeDef, ctx) { + const { nodeAttacher, stringAttacher } = ctx; + if (!nodeAttacher && !stringAttacher) { + return; + } + handleAttributes(typeDef.attributes, ctx, (handler, config) => { + const parser = handler.stringParser?.(config, typeDef, ctx); + if (parser && stringAttacher) { + stringAttacher(runtimeValue.originalNode, (node) => { + const src = new Source(node.value, node.valueMap); + const start = src.cursor; + const child = parser(src, ctx); + if (!child) { + ctx.err.report(localize('expected', localize('mcdoc.runtime.checker.value')), Range.create(start, src.skipRemaining())); + return; + } + else if (src.canRead()) { + ctx.err.report(localize('mcdoc.runtime.checker.trailing'), Range.create(src.cursor, src.skipRemaining())); + } + node.children = [child]; + }); + } + const checker = handler.checker?.(config, runtimeValue.inferredType, ctx); + if (checker && nodeAttacher) { + nodeAttacher(runtimeValue.originalNode, (node) => { + checker(node, ctx); + }); + } + }); +} +function checkShallowly(runtimeNode, simplifiedInferred, children, typeDef, ctx) { + const childDefinitions = Array(children.length) + .fill(undefined); + if (typeDef.kind === 'any' || typeDef.kind === 'unsafe' || simplifiedInferred.kind === 'unsafe') { + return { childDefinitions, errors: [] }; + } + const typeDefValueType = getValueType(typeDef); + const runtimeValueType = getValueType(simplifiedInferred); + if (runtimeValueType.kind !== typeDefValueType.kind + && !ctx.isEquivalent(runtimeValueType, typeDefValueType)) { + return { + childDefinitions, + errors: [{ kind: 'type_mismatch', node: runtimeNode, expected: [typeDef] }], + }; + } + const errors = []; + let assignable = true; + handleAttributes(typeDef.attributes, ctx, (handler, config) => { + if (handler.checkInferred?.(config, simplifiedInferred, ctx) === false) { + assignable = false; + } + }); + if (!assignable) { + errors.push({ kind: 'internal', node: runtimeNode }); + } + if ((typeDef.kind === 'literal' + && (simplifiedInferred.kind !== 'literal' + || typeDef.value.value !== simplifiedInferred.value.value)) + // TODO handle enum field attributes + || (typeDef.kind === 'enum' + && (simplifiedInferred.kind !== 'literal' + || !typeDef.values.some(v => v.value === simplifiedInferred.value.value)))) { + return { + childDefinitions, + errors: [{ kind: 'type_mismatch', node: runtimeNode, expected: [typeDef] }], + }; + } + switch (typeDef.kind) { + case 'byte': + case 'short': + case 'int': + case 'long': + case 'float': + case 'double': + if (typeDef.valueRange + && simplifiedInferred.kind === 'literal' + && typeof simplifiedInferred.value.value === 'number' + && !NumericRange.isInRange(typeDef.valueRange, simplifiedInferred.value.value)) { + errors.push({ + kind: 'number_out_of_range', + node: runtimeNode, + ranges: [typeDef.valueRange], + }); + } + break; + case 'string': + if (typeDef.lengthRange + && simplifiedInferred.kind === 'literal' + && simplifiedInferred.value.kind === 'string' + && !NumericRange.isInRange(typeDef.lengthRange, [...simplifiedInferred.value.value].length)) { + errors.push({ + kind: 'invalid_string_length', + node: runtimeNode, + ranges: [typeDef.lengthRange], + }); + } + break; + case 'struct': { + const literalKvps = new Map(); + const otherKvps = []; + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (Array.isArray(child)) { + continue; + } + if (child.key.inferredType.kind === 'literal' + && child.key.inferredType.value.kind === 'string') { + const existing = literalKvps.get(child.key.inferredType.value.value); + if (existing) { + // duplicate key + existing.values.push({ pair: child, index: i }); + } + else { + literalKvps.set(child.key.inferredType.value.value, { + values: [{ pair: child, index: i }], + definition: undefined, + }); + } + } + else { + otherKvps.push({ value: child, index: i }); + } + } + const missingKeys = new Set(); + for (const pair of typeDef.fields) { + const otherKvpMatches = []; + let foundMatch = false; + if (pair.key.kind === 'literal' && pair.key.value.kind === 'string') { + const runtimeChild = literalKvps.get(pair.key.value.value); + if (runtimeChild) { + foundMatch = true; + runtimeChild.definition = { keyType: pair.key, type: pair.type, desc: pair.desc }; + } + } + if (!foundMatch) { + for (const kvp of otherKvps) { + if (isAssignable(kvp.value.key.inferredType, pair.key, ctx, ctx.isEquivalent)) { + foundMatch = true; + otherKvpMatches.push(kvp.index); + } + } + for (const kvp of literalKvps.entries()) { + if ((!kvp[1].definition || kvp[1].definition.keyType?.kind !== 'literal') + && isAssignable({ kind: 'literal', value: { kind: 'string', value: kvp[0] } }, pair.key, ctx, ctx.isEquivalent)) { + foundMatch = true; + kvp[1].definition = { keyType: pair.key, type: pair.type, desc: pair.desc }; + } + } + } + for (const match of otherKvpMatches) { + childDefinitions[match] = { keyType: pair.key, type: pair.type, desc: pair.desc }; + } + if (!foundMatch + && !ctx.allowMissingKeys + && pair.key.kind === 'literal' + && pair.key.value.kind === 'string' + && pair.optional !== true) { + missingKeys.add(pair.key.value.value); + } + } + errors.push(...Array.from(missingKeys).map(key => ({ + kind: 'missing_key', + node: runtimeNode, + keys: [key], + }))); + for (const kvp of literalKvps.values()) { + for (const value of kvp.values) { + childDefinitions[value.index] = kvp.definition; + if (kvp.values.length > 1) { + errors.push({ kind: 'duplicate_key', node: value.pair.key }); + } + } + } + for (let i = 0; i < children.length; i++) { + const childDef = childDefinitions[i]; + const child = children[i]; + if (childDef === undefined) { + if (Array.isArray(child)) { + // This should never happen + errors.push(...child.map(v => ({ + kind: 'expected_key_value_pair', + node: v, + }))); + } + else { + errors.push({ kind: 'unknown_key', node: child.key }); + } + } + } + break; + } + case 'list': + case 'byte_array': + case 'int_array': + case 'long_array': { + let itemType; + switch (typeDef.kind) { + case 'list': + itemType = typeDef.item; + break; + case 'byte_array': + itemType = { kind: 'byte', valueRange: typeDef.valueRange }; + break; + case 'int_array': + itemType = { kind: 'int', valueRange: typeDef.valueRange }; + break; + case 'long_array': + itemType = { kind: 'long', valueRange: typeDef.valueRange }; + break; + } + for (let i = 0; i < childDefinitions.length; i++) { + childDefinitions[i] = { type: itemType }; + } + if (typeDef.lengthRange && !NumericRange.isInRange(typeDef.lengthRange, children.length)) { + errors.push({ + kind: 'invalid_collection_length', + node: runtimeNode, + ranges: [typeDef.lengthRange], + }); + } + break; + } + case 'tuple': { + for (let i = 0; i < children.length; i++) { + const child = children[i]; + if (i < typeDef.items.length) { + childDefinitions[i] = { type: typeDef.items[i] }; + } + else { + // This really should always be an array, just to handle this gracefully + const values = Array.isArray(child) ? child : [...child.possibleValues, child.key]; + errors.push(...values.map(v => ({ + kind: 'unknown_tuple_element', + node: v, + }))); + } + } + if (typeDef.items.length > children.length) { + errors.push({ + kind: 'invalid_collection_length', + node: runtimeNode, + ranges: [{ kind: 0b00, max: typeDef.items.length, min: typeDef.items.length }], + }); + } + break; + } + } + return { childDefinitions, errors }; +} +function getPossibleTypes(typeDef) { + return typeDef.kind === 'union' ? typeDef.members.flatMap(m => getPossibleTypes(m)) : [typeDef]; +} +function simplify(typeDef, context) { + function wrap(result) { + if (!result.typeDef.attributes?.length) { + return result; + } + handleAttributes(typeDef.attributes, context.ctx, (handler, config) => { + if (handler.mapType) { + result.typeDef = handler.mapType(config, result.typeDef, context.ctx); + } + }); + return result; + } + switch (typeDef.kind) { + case 'reference': + return wrap(simplifyReference(typeDef, context)); + case 'dispatcher': + return wrap(simplifyDispatcher(typeDef, context)); + case 'indexed': + return wrap(simplifyIndexed(typeDef, context)); + case 'union': + return wrap(simplifyUnion(typeDef, context)); + case 'struct': + return wrap(simplifyStruct(typeDef, context)); + case 'list': + return wrap(simplifyList(typeDef, context)); + case 'tuple': + return wrap(simplifyTuple(typeDef, context)); + case 'enum': + return wrap(simplifyEnum(typeDef, context)); + case 'concrete': + return wrap(simplifyConcrete(typeDef, context)); + case 'template': + return wrap(simplifyTemplate(typeDef, context)); + case 'mapped': + return wrap(simplifyMapped(typeDef, context)); + default: + return wrap({ typeDef }); + } +} +function simplifyReference(typeDef, context) { + if (!typeDef.path) { + // TODO when does this happen? + context.ctx.logger.warn(`Tried to access empty reference`); + return { typeDef: { kind: 'union', members: [] } }; + } + const mapped = context.typeMapping?.[typeDef.path]; + if (mapped) { + return { typeDef: mapped, dynamicData: true }; + } + // TODO Probably need to keep original symbol around in some way to support "go to definition" + const symbol = context.ctx.symbols.query(context.ctx.doc, 'mcdoc', typeDef.path); + const data = symbol.getData(TypeDefSymbolData.is); + if (!data?.typeDef) { + context.ctx.logger.warn(`Tried to access unknown reference ${typeDef.path}`); + return { typeDef: { kind: 'union', members: [] } }; + } + if (context.ctx.config.env.enableMcdocCaching && data.simplifiedTypeDef) { + return { typeDef: data.simplifiedTypeDef }; + } + const simplifiedResult = simplify(data.typeDef, context); + if (typeDef.attributes?.length) { + simplifiedResult.typeDef = { + ...simplifiedResult.typeDef, + attributes: [...typeDef.attributes, ...simplifiedResult.typeDef.attributes ?? []], + }; + } + if (context.ctx.config.env.enableMcdocCaching && !simplifiedResult.dynamicData) { + symbol.amend({ + data: { + data: { + ...data, + simplifiedTypeDef: simplifiedResult.typeDef, + }, + }, + }); + } + return simplifiedResult; +} +function simplifyDispatcher(typeDef, context) { + const dispatcherQuery = context.ctx.symbols.query(context.ctx.doc, 'mcdoc/dispatcher', typeDef.registry); + const dispatcher = dispatcherQuery.symbol?.members; + if (!dispatcher) { + context.ctx.logger.warn(`Tried to access unknown dispatcher ${typeDef.registry}`); + return { typeDef: { kind: 'union', members: [] } }; + } + const result = resolveIndices(typeDef.parallelIndices, dispatcher, dispatcherQuery, context); + return result; +} +function simplifyIndexed(typeDef, context) { + const childResult = simplify(typeDef.child, { + ...context, + typeArgs: [], + }); + const child = childResult.typeDef; + if (child.kind !== 'struct') { + context.ctx.logger.warn(`Tried to index un-indexable type ${child.kind}`); + return { typeDef: { kind: 'union', members: [] }, dynamicData: childResult.dynamicData }; + } + const symbolMap = {}; + for (const field of child.fields) { + if (field.key.kind === 'literal' && field.key.value.kind === 'string') { + symbolMap[field.key.value.value] = { + data: { + typeDef: field.type, + }, + }; + } + } + const simplified = resolveIndices(typeDef.parallelIndices, symbolMap, undefined, context); + return { ...simplified, dynamicData: childResult.dynamicData ?? simplified.dynamicData }; +} +function resolveIndices(parallelIndices, symbolMap, symbolQuery, context) { + let dynamicData = false; + let values = []; + function pushValue(key, data) { + if (context.ctx.config.env.enableMcdocCaching && data.simplifiedTypeDef) { + if (data.simplifiedTypeDef.kind === 'union') { + values.push(...data.simplifiedTypeDef.members); + } + else { + values.push(data.simplifiedTypeDef); + } + } + else { + const simplifiedResult = simplify(data.typeDef, context); + if (simplifiedResult.dynamicData) { + dynamicData = true; + } + else if (context.ctx.config.env.enableMcdocCaching && symbolQuery) { + symbolQuery.member(key, s => s.amend({ + data: { data: { ...data, simplifiedTypeDef: simplifiedResult.typeDef } }, + })); + } + if (simplifiedResult.typeDef.kind === 'union') { + values.push(...simplifiedResult.typeDef.members); + } + else { + values.push(simplifiedResult.typeDef); + } + } + } + let unkownTypeDef = false; + function getUnknownTypeDef() { + if (unkownTypeDef === false) { + const data = symbolMap['%unknown']?.data; + unkownTypeDef = TypeDefSymbolData.is(data) ? data : undefined; + } + return unkownTypeDef; + } + for (const index of parallelIndices) { + let lookup = []; + if (index.kind === 'static') { + if (index.value === '%fallback') { + values = []; + for (const [key, value] of Object.entries(symbolMap)) { + if (TypeDefSymbolData.is(value.data)) { + pushValue(key, value.data); + } + } + break; + } + if (index.value.startsWith('minecraft:')) { + lookup.push(index.value.substring(10)); + } + else { + lookup.push(index.value); + } + } + else { + dynamicData = true; + let possibilities = context.isMember + ? [{ value: context.node, key: context.node.entryNode.runtimeKey }] + : [{ + value: context.node.entryNode.parent, + key: context.node.entryNode.runtimeKey, + }]; + for (const entry of index.accessor) { + if (typeof entry !== 'string' && entry.keyword === 'parent') { + possibilities = possibilities.map(n => ({ + value: n.value?.entryNode.parent, + key: n.value?.entryNode.runtimeKey, + })); + } + else if (typeof entry !== 'string' && entry.keyword === 'key') { + possibilities = possibilities.map(p => ({ + value: p.key + ? { node: p.key, entryNode: { parent: p.value, runtimeKey: p.key } } + : undefined, + key: undefined, + })); + break; + } + else if (typeof entry === 'string') { + const newPossibilities = []; + for (const node of possibilities) { + const possibleChildren = node.value + ? context.ctx.getChildren(node.value.node.originalNode, simplify(node.value.node.inferredType, { ...context, node: node.value }) + .typeDef).filter(child => { + if (!Array.isArray(child)) { + return child.key.inferredType.kind === 'literal' + && child.key.inferredType.value.kind === 'string' + && child.key.inferredType.value.value === entry; + } + // TODO if it's a list, consider all list items. + // This should probably work recursively if we have a list of lists. + return false; + }) // We don't consider arrays yet, see above. + .flatMap(c => c.possibleValues.map(v => ({ + value: { + node: v, + entryNode: { parent: node.value, runtimeKey: c.key }, + }, + key: undefined, + }))) + : [{ value: undefined, key: undefined }]; + newPossibilities.push(...possibleChildren); + } + possibilities = newPossibilities; + } + else { + lookup.push('%none'); + break; + } + } + for (const value of possibilities.map(p => p.value?.node)) { + if (value?.inferredType.kind === 'literal' && value.inferredType.value.kind === 'string') { + const ans = value.inferredType.value.value; + if (ans.startsWith('minecraft:')) { + lookup.push(ans.substring(10)); + } + else { + lookup.push(ans); + } + } + else { + lookup.push('%none'); + } + } + } + if (lookup.length === 0) { + lookup = ['%none']; + } + const currentValues = lookup.map(v => { + const data = symbolMap[v]?.data; + return { value: v, data: TypeDefSymbolData.is(data) ? data : getUnknownTypeDef() }; + }); + const missing = currentValues.find(v => !v.data); + if (missing) { + // fallback case + return { typeDef: { kind: 'any' }, dynamicData }; + } + else { + for (const entry of currentValues) { + pushValue(entry.value, entry.data); + } + } + } + if (values.length === 1) { + return { typeDef: values[0], dynamicData }; + } + return { typeDef: { kind: 'union', members: values }, dynamicData }; +} +function simplifyUnion(typeDef, context) { + let dynamicData = false; + let validMembers = typeDef.members + .filter(member => { + let keep = true; + handleAttributes(member.attributes, context.ctx, (handler, config) => { + if (!keep || !handler.filterElement) { + return; + } + if (!handler.filterElement(config, context.ctx)) { + keep = false; + } + }); + return keep; + }); + const filterCanonical = context.ctx.requireCanonical + && validMembers.some(m => m.attributes?.some(a => a.name === 'canonical')); + if (filterCanonical) { + validMembers = typeDef.members.filter(member => member.attributes?.some(a => a.name === 'canonical')); + } + if (validMembers.length === 1) { + return simplify(validMembers[0], context); + } + const members = []; + for (const member of validMembers) { + const { typeDef: simplified, dynamicData: memberDynamic } = simplify(member, context); + if (memberDynamic) { + dynamicData = true; + } + if (simplified.kind === 'union') { + members.push(...simplified.members); + } + else { + members.push(simplified); + } + } + if (members.length === 1) { + return { typeDef: members[0], dynamicData }; + } + return { typeDef: { kind: 'union', members }, dynamicData }; +} +function simplifyStruct(typeDef, context) { + const fields = []; + let dynamicData = false; + function addField(key, field) { + handleAttributes(field.attributes, context.ctx, (handler, config) => { + if (handler.mapField) { + field = handler.mapField(config, field, context.ctx); + } + }); + if (typeof key === 'string') { + fields.push({ + ...field, + key: { kind: 'literal', value: { kind: 'string', value: key } }, + }); + } + else if (key.kind === 'union') { + key.members.forEach(m => addField(m, { ...field, optional: true })); + } + else { + fields.push({ ...field, key }); + } + } + for (const field of typeDef.fields) { + let keep = true; + handleAttributes(field.attributes, context.ctx, (handler, config) => { + if (keep && handler.filterElement?.(config, context.ctx) === false) { + keep = false; + } + }); + if (!keep) { + continue; + } + if (field.kind === 'pair') { + // Don't simplify the value here, simplify is shallow and needs a runtime value to work + // properly, so the values should only be simplified once they were assigned to a + // runtime value. + let structKey; + if (typeof field.key === 'string') { + structKey = field.key; + } + else { + const simplifiedKeyResult = simplify(field.key, { + ...context, + isMember: true, + typeArgs: [], + }); + if (simplifiedKeyResult.dynamicData) { + dynamicData = true; + } + structKey = simplifiedKeyResult.typeDef; + } + let mappedField; + if (context.typeMapping) { + mappedField = { + ...field, + type: { + kind: 'mapped', + child: field.type, + mapping: context.typeMapping, + }, + }; + // Don't cache mapped field data + // TODO find a better way to handle mapped types with caching + dynamicData = true; + } + else { + mappedField = field; + } + addField(structKey, mappedField); + } + else { + const simplifiedSpread = simplify(field.type, { + ...context, + isMember: true, + typeArgs: [], + }); + if (simplifiedSpread.dynamicData) { + dynamicData = true; + } + if (simplifiedSpread.typeDef.kind === 'any') { + fields.push({ kind: 'pair', key: { kind: 'any' }, type: { kind: 'any' } }); + } + else if (simplifiedSpread.typeDef.kind === 'struct') { + fields.push(...simplifiedSpread.typeDef.fields); + } + } + } + return { + typeDef: { kind: 'struct', fields }, + dynamicData, + }; +} +function simplifyList(typeDef, context) { + if (!context.typeMapping) { + return { typeDef }; + } + return { + typeDef: { + ...typeDef, + item: { kind: 'mapped', child: typeDef.item, mapping: context.typeMapping }, + }, + // Don't cache mapped field data + // TODO find a better way to handle mapped types with caching + dynamicData: true, + }; +} +function simplifyTuple(typeDef, context) { + if (!context.typeMapping) { + return { typeDef }; + } + return { + typeDef: { + ...typeDef, + items: typeDef.items.map(item => ({ + kind: 'mapped', + child: item, + mapping: context.typeMapping, + })), + }, + // Don't cache mapped field data + // TODO find a better way to handle mapped types with caching + dynamicData: true, + }; +} +function simplifyEnum(typeDef, context) { + const filteredValues = typeDef.values.filter(value => { + let keep = true; + handleAttributes(value.attributes, context.ctx, (handler, config) => { + if (!keep || !handler.filterElement) { + return; + } + if (!handler.filterElement(config, context.ctx)) { + keep = false; + } + }); + return keep; + }); + return { typeDef: { ...typeDef, enumKind: typeDef.enumKind ?? 'int', values: filteredValues } }; +} +function simplifyConcrete(typeDef, context) { + let dynamicData = false; + const simplifiedArgs = typeDef.typeArgs.map(arg => { + const ans = simplify(arg, context); + if (ans.dynamicData) { + dynamicData = true; + } + return ans.typeDef; + }); + const result = simplify(typeDef.child, { ...context, typeArgs: simplifiedArgs }); + return { typeDef: result.typeDef, dynamicData: dynamicData || result.dynamicData }; +} +function simplifyTemplate(typeDef, context) { + if (context.typeArgs?.length !== typeDef.typeParams.length) { + context.ctx.logger.warn(`Expected ${typeDef.typeParams.length} mcdoc type args for ${McdocType.toString(typeDef.child)}, but got ${context.typeArgs?.length ?? 0}`); + } + const mapping = Object.fromEntries(typeDef.typeParams.map((param, i) => { + const arg = context.typeArgs?.[i] ?? { kind: 'union', members: [] }; + return [param.path, arg]; + })); + return simplify(typeDef.child, { ...context, typeArgs: [], typeMapping: mapping }); +} +function simplifyMapped(typeDef, context) { + let dynamicData = false; + // Mapped types that were created in simplify are always simplified + // types already, in which case this will be a cheap operation, but + // this is necessary for type safety + const simplifiedMapping = Object.fromEntries(Object.entries(typeDef.mapping).map(([path, param]) => { + const ans = simplify(param, context); + if (ans.dynamicData) { + dynamicData = true; + } + return [path, ans.typeDef]; + })); + const ans = simplify(typeDef.child, { ...context, typeMapping: simplifiedMapping }); + return { typeDef: ans.typeDef, dynamicData: dynamicData || ans.dynamicData }; +} +function getValueType(type) { + switch (type.kind) { + case 'literal': + return { kind: type.value.kind }; + case 'enum': + return { kind: type.enumKind }; + default: + return type; + } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/completer/index.js + + +function getFields(typeDef, ctx) { + switch (typeDef.kind) { + case 'union': + const allFields = new Map(); + for (const member of typeDef.members) { + for (const field of getFields(member, ctx)) { + allFields.set(field.key, field); + } + } + return [...allFields.values()]; + case 'struct': + return typeDef.fields.flatMap(field => { + if (typeof field.key === 'string') { + return [{ key: field.key, field }]; + } + if (field.key.kind === 'string' + || (field.key.kind === 'literal' && field.key.value.kind === 'string') + || (field.key.kind === 'enum' && field.key.enumKind === 'string')) { + const ans = getStringCompletions(field.key, ctx); + if (ans.length > 0) { + return ans.map(c => ({ key: c.value, field })); + } + } + if (field.key.kind === 'literal') { + return [{ key: `${field.key.value.value}`, field }]; + } + if (field.key.kind === 'string') { + return getStringCompletions(field.key, ctx) + .map(c => ({ key: c.value, field })); + } + return getValues(field.key, ctx) + .map(c => ({ key: c.value, field })); + }); + default: + return []; + } +} +// TODO: only accept SimplifiedMcdocType here +function getValues(typeDef, ctx) { + if (typeDef.kind === 'string' + || (typeDef.kind === 'literal' && typeDef.value.kind === 'string') + || (typeDef.kind === 'enum' && typeDef.enumKind === 'string')) { + const ans = getStringCompletions(typeDef, ctx); + if (ans.length > 0) { + return ans; + } + } + switch (typeDef.kind) { + case 'union': + const allValues = new Map(); + for (const member of typeDef.members) { + for (const value of getValues(member, ctx)) { + allValues.set(value.value, value); + } + } + return [...allValues.values()]; + case 'reference': + // TODO: de-duplicate this logic from the runtime simplifier + if (!typeDef.path) { + return []; + } + const symbol = ctx.symbols.query(ctx.doc, 'mcdoc', typeDef.path); + const def = symbol.getData(TypeDefSymbolData.is)?.typeDef; + if (!def) { + return []; + } + if (typeDef.attributes?.length) { + return getValues({ + ...def, + attributes: [...typeDef.attributes, ...def.attributes ?? []], + }, ctx); + } + return getValues(def, ctx); + case 'literal': + return [{ value: `${typeDef.value.value}`, kind: typeDef.value.kind }]; + case 'boolean': + return ['false', 'true'].map(v => ({ value: v, kind: 'boolean' })); + case 'enum': + // TODO: de-duplicate this logic from the runtime simplifier + const filteredValues = typeDef.values.filter(value => { + let keep = true; + handleAttributes(value.attributes, ctx, (handler, config) => { + if (!keep || !handler.filterElement) { + return; + } + if (!handler.filterElement(config, ctx)) { + keep = false; + } + }); + return keep; + }); + return filteredValues.map(v => ({ + value: `${v.value}`, + detail: v.identifier, + kind: typeDef.enumKind ?? 'string', + documentation: v.desc, + })); + case 'byte': + case 'short': + case 'int': + case 'long': + case 'float': + case 'double': + return getNumericCompletions(typeDef, ctx); + default: + return []; + } +} +function getStringCompletions(typeDef, ctx) { + const ans = []; + handleAttributes(typeDef.attributes, ctx, (handler, config) => { + const mock = handler.stringMocker?.(config, typeDef, ctx); + if (!mock) { + return; + } + const items = ctx.meta.getCompleter(mock.type)(mock, ctx); + ans.push(...items.map(item => ({ + value: item.label, + kind: 'string', + labelSuffix: item.labelSuffix, + detail: item.detail, + completionKind: item.kind, + insertText: item.insertText, + sortText: item.sortText, + }))); + }); + if (ans.length === 0 && typeDef.kind === 'literal') { + ans.push({ value: `${typeDef.value.value}`, kind: 'string' }); + } + return ans; +} +function getNumericCompletions(typeDef, ctx) { + const ans = []; + handleAttributes(typeDef.attributes, ctx, (handler, config) => { + const items = handler.numericCompleter?.(config, ctx); + if (!items) { + return; + } + ans.push(...items.map(item => ({ + value: item.label, + kind: typeDef.kind, + labelSuffix: item.labelSuffix, + detail: item.detail, + completionKind: item.kind, + insertText: item.insertText, + sortText: item.sortText, + }))); + }); + return ans; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/runtime/index.js + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcdoc/lib/index.js + + + + + + + + + + + + + +/* istanbul ignore next */ +const initialize = ({ meta }) => { + meta.registerLanguage('mcdoc', { extensions: ['.mcdoc'], parser: parser_module_ }); + registerBuiltinAttributes(meta); + meta.registerUriBinder(uriBinder); + meta.setUriSorter(uriSorter); + registerMcdocBinders(meta); + registerMcdocColorizer(meta); + registerMcdocFormatter(meta); +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/boolean.js + + +const parser_boolean_boolean = (src, _ctx) => { + const start = src.cursor; + if (src.trySkip('false')) { + return { type: 'json:boolean', range: Range.create(start, src), value: false }; + } + if (src.trySkip('true')) { + return { type: 'json:boolean', range: Range.create(start, src), value: true }; + } + return Parser_Failure; +}; +//# sourceMappingURL=boolean.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/null.js + + +const null_ = (src, ctx) => { + const start = src.cursor; + if (src.trySkip('null')) { + return { type: 'json:null', range: Range.create(start, src) }; + } + return Parser_Failure; +}; +//# sourceMappingURL=null.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/number.js + +const number_number = (src, ctx) => { + const value = util_select([{ + regex: /^-?(?:0|[1-9]\d*)(?!\d|[.eE])/, + parser: long_long({ pattern: /^-?(?:0|[1-9]\d*)$/ }), + }, { + parser: float_float({ + // Regex form of the chart from https://www.json.org. + pattern: /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][-+]?\d+)?$/, + }), + }])(src, ctx); + return { type: 'json:number', children: [value], value, range: value.range }; +}; +//# sourceMappingURL=number.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/string.js + +const JsonStringOptions = { + escapable: { characters: ['b', 'f', 'n', 'r', 't'], unicode: true }, + quotes: ['"'], +}; +const parser_string_string = (src, ctx) => setType('json:string', string_string(JsonStringOptions))(src, ctx); +//# sourceMappingURL=string.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/object.js + + + +const object = (src, ctx) => setType('json:object', record_record({ + start: '{', + pair: { key: parser_string_string, sep: ':', value: entry, end: ',', trailingEnd: false }, + end: '}', +}))(src, ctx); +//# sourceMappingURL=object.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/entry.js + + + + + + + +const LegalNumberStart = new Set(['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-']); +const entry = (src, ctx) => util_select([ + { predicate: (src) => src.tryPeek('['), parser: array }, + { predicate: (src) => src.tryPeek('false') || src.tryPeek('true'), parser: parser_boolean_boolean }, + { predicate: (src) => src.tryPeek('null'), parser: null_ }, + { predicate: (src) => LegalNumberStart.has(src.peek()), parser: number_number }, + { + predicate: (src) => src.tryPeek('{'), + parser: object, + }, + { parser: parser_string_string }, +])(src, ctx); +//# sourceMappingURL=entry.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/array.js + + +const array = (ctx, src) => setType('json:array', list({ start: '[', value: entry, sep: ',', trailingSep: false, end: ']' }))(ctx, src); +//# sourceMappingURL=array.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/file.js + + +const parser_file_file = util_map(dumpErrors(entry), (res) => ({ type: 'json:file', range: res.range, children: [res] })); +//# sourceMappingURL=file.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/parser/index.js + + + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/node/index.js + + +var JsonFileNode; +(function (JsonFileNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'json:file'; + } + JsonFileNode.is = is; +})(JsonFileNode || (JsonFileNode = {})); +var JsonNode; +(function (JsonNode) { + function is(node) { + return (JsonObjectNode.is(node) + || JsonArrayNode.is(node) + || JsonStringNode.is(node) + || JsonNumberNode.is(node) + || JsonBooleanNode.is(node) + || JsonNullNode.is(node)); + } + JsonNode.is = is; +})(JsonNode || (JsonNode = {})); +var JsonObjectNode; +(function (JsonObjectNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'json:object'; + } + JsonObjectNode.is = is; + function mock(range) { + return { type: 'json:object', range: Range.get(range), children: [] }; + } + JsonObjectNode.mock = mock; +})(JsonObjectNode || (JsonObjectNode = {})); +var JsonPairNode; +(function (JsonPairNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'pair'; + } + JsonPairNode.is = is; +})(JsonPairNode || (JsonPairNode = {})); +var JsonArrayNode; +(function (JsonArrayNode) { + function is(obj) { + return obj?.type === 'json:array'; + } + JsonArrayNode.is = is; + function mock(range) { + return { type: 'json:array', range: Range.get(range), children: [] }; + } + JsonArrayNode.mock = mock; +})(JsonArrayNode || (JsonArrayNode = {})); +var JsonStringNode; +(function (JsonStringNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'json:string'; + } + JsonStringNode.is = is; + function mock(range) { + return { ...StringNode.mock(range, JsonStringOptions), type: 'json:string' }; + } + JsonStringNode.mock = mock; +})(JsonStringNode || (JsonStringNode = {})); +var JsonNumberNode; +(function (JsonNumberNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'json:number'; + } + JsonNumberNode.is = is; +})(JsonNumberNode || (JsonNumberNode = {})); +var JsonBooleanNode; +(function (JsonBooleanNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'json:boolean'; + } + JsonBooleanNode.is = is; +})(JsonBooleanNode || (JsonBooleanNode = {})); +var JsonNullNode; +(function (JsonNullNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'json:null'; + } + JsonNullNode.is = is; +})(JsonNullNode || (JsonNullNode = {})); +var TypedJsonNode; +(function (TypedJsonNode) { + /* istanbul ignore next */ + function is(obj) { + return obj.type === 'json:typed'; + } + TypedJsonNode.is = is; +})(TypedJsonNode || (TypedJsonNode = {})); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/checker/index.js + + + +const typed = (node, ctx) => { + index(node.targetType)(node.children[0], ctx); +}; +function register(meta) { + meta.registerChecker('json:typed', typed); +} +function index(type, options) { + return (node, ctx) => { + typeDefinition([{ originalNode: node, inferredType: inferType(node) }], type, McdocCheckerContext.create(ctx, { + isEquivalent: (inferred, def) => { + switch (inferred.kind) { + case 'list': + return ['list', 'byte_array', 'int_array', 'long_array', 'tuple'].includes(def.kind); + case 'struct': + return def.kind === 'struct'; + case 'byte': + case 'short': + case 'int': + case 'long': + return ['byte', 'short', 'int', 'long', 'float', 'double'].includes(def.kind); + case 'float': + case 'double': + return ['float', 'double'].includes(def.kind); + default: + return false; + } + }, + getChildren: node => { + if (node.type === 'json:array') { + return node.children.filter(n => n.value).map(n => [{ originalNode: n.value, inferredType: inferType(n.value) }]); + } + if (node.type === 'json:object') { + return node.children.filter(kvp => kvp.key).map(kvp => ({ + key: { originalNode: kvp.key, inferredType: inferType(kvp.key) }, + possibleValues: kvp.value + ? [{ originalNode: kvp.value, inferredType: inferType(kvp.value) }] + : [], + })); + } + return []; + }, + reportError: err => { + if (err.kind === 'duplicate_key' && options?.discardDuplicateKeyErrors) { + return; + } + getDefaultErrorReporter(ctx, (getDefaultErrorRange))(err); + }, + attachTypeInfo: (node, definition, desc = '') => { + node.typeDef = definition; + // TODO: improve hover info + // TODO some sort of shared default implementaion between JSON and SNBT (DRY) + if (node.parent && JsonPairNode?.is(node.parent)) { + if (node.parent.key?.typeDef && node.parent.value?.typeDef) { + const valueString = McdocType.toString(node.parent.value.typeDef); + let keyString = McdocType.toString(node.parent.key.typeDef); + if (node.parent.key.typeDef.kind !== 'literal') { + keyString = `[${keyString}]`; + } + const hover = `\`\`\`typescript\n${keyString}: ${valueString}\n\`\`\`\n${desc}`; + node.parent.key.hover = hover; + if (node.parent.value.type !== 'json:array' + && node.parent.value.type !== 'json:object') { + node.parent.value.hover = + `\`\`\`typescript\n${valueString}\n\`\`\`\n${desc}`; + } + } + } + else if (node.type !== 'json:array' && node.type !== 'json:object') { + node.hover = `\`\`\`typescript\n${McdocType.toString(definition)}\n\`\`\`\n${desc}`; + } + }, + nodeAttacher: (node, attacher) => attacher(node), + stringAttacher: (node, attacher) => { + if (!JsonStringNode.is(node)) { + return; + } + attacher(node); + if (node.children) { + AstNode.setParents(node); + // Because the runtime checker happens after binding, we need to manually call this + fallbackSync(node, ctx); + builtin_fallbackSync(node, ctx); + } + }, + })); + }; +} +function inferType(node) { + switch (node.type) { + case 'json:boolean': + return { kind: 'literal', value: { kind: 'boolean', value: node.value } }; + case 'json:number': + return { + kind: 'literal', + value: { kind: node.value.type, value: Number(node.value.value) }, + }; + case 'json:null': + return { kind: 'any' }; // null is always invalid? + case 'json:string': + return { kind: 'literal', value: { kind: 'string', value: node.value } }; + case 'json:array': + return { kind: 'list', item: { kind: 'any' } }; + case 'json:object': + return { kind: 'struct', fields: [] }; + } +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/colorizer/index.js + + +const colorizer_boolean = (node) => { + return [ColorToken.create(node, 'literal')]; +}; +const colorizer_null_ = (node) => { + return [ColorToken.create(node, 'literal')]; +}; +const colorizer_object = (node, ctx) => { + const ans = []; + for (const pair of node.children) { + if (pair.key) { + ans.push(ColorToken.create(pair.key, 'property')); + } + if (pair.value) { + const colorizer = ctx.meta.getColorizer(pair.value.type); + ans.push(...colorizer(pair.value, ctx)); + } + } + return ans; +}; +const colorizer_string = (node, ctx) => { + if (node.children && node.children?.length > 0) { + const child = node.children[0]; + const colorizer = ctx.meta.getColorizer(child.type); + return colorizer(child, ctx); + } + return string(node, ctx); +}; +function colorizer_register(meta) { + meta.registerColorizer('json:boolean', colorizer_boolean); + meta.registerColorizer('json:null', colorizer_null_); + meta.registerColorizer('json:number', number); + meta.registerColorizer('json:object', colorizer_object); + meta.registerColorizer('json:string', colorizer_string); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/completer/index.js + + +const completer_array = (node, ctx) => { + const index = binarySearch(node.children, ctx.offset, (n, o) => { + return Range.compareOffset(n.range, o, true); + }); + const item = index >= 0 ? node.children[index] : undefined; + if (item?.value) { + return ctx.meta.getCompleter(item.value.type)(item.value, ctx); + } + if (node.typeDef?.kind === 'list') { + const completions = completer_getValues(node.typeDef.item, ctx.offset, ctx); + if (ctx.offset < (node.children[node.children.length - 1]?.range.start ?? 0)) { + return completions.map(c => ({ ...c, insertText: c.insertText + ',' })); + } + return completions; + } + return []; +}; +const completer_object = record({ + key: (record, pair, ctx, range, iv, ipe, exitingKeys) => { + if (!record.typeDef) { + return []; + } + const keySet = new Set(exitingKeys.map(n => n.value)); + return getFields(record.typeDef, ctx) + .filter(({ key }) => !keySet.has(key)) + .map(({ key, field }) => CompletionItem.create(key, pair?.key ?? range, { + kind: 5 /* core.CompletionKind.Field */, + detail: McdocType.toString(field.type), + documentation: field.desc, + deprecated: field.deprecated, + sortText: field.optional ? '$b' : '$a', // sort above hardcoded $schema + filterText: `"${key}"`, + insertText: `"${key}"${iv ? ': ' : ''}${ipe ? '$1,' : ''}`, + })); + }, + value: (record, pair, ctx, range) => { + if (pair.value) { + return ctx.meta.getCompleter(pair.value.type)(pair.value, ctx); + } + if (pair.key && record.typeDef) { + const pairKey = pair.key.value; + const field = getFields(record.typeDef, ctx) + .find(({ key }) => key === pairKey) + ?.field.type; + if (field) { + return completer_getValues(field, range, ctx); + } + } + return []; + }, +}); +const primitive = (node, ctx) => { + const insideRange = Range.contains(node, ctx.offset, true); + if (node.type === 'json:string' && node.children?.length && insideRange) { + const childItems = builtin_string(node, ctx); + if (childItems.length > 0) { + return childItems; + } + } + if (!node.typeDef) { + return []; + } + return completer_getValues(node.typeDef, insideRange ? node : ctx.offset, ctx); +}; +function completer_getValues(typeDef, range, ctx) { + return getValues(typeDef, ctx) + .map(({ value, labelSuffix, detail, documentation, kind, completionKind, insertText, sortText }) => CompletionItem.create(value, range, { + kind: completionKind ?? 12 /* core.CompletionKind.Value */, + labelSuffix, + detail, + documentation, + filterText: kind === 'string' ? `"${value}"` : value, + insertText: kind === 'string' ? `"${insertText ?? value}"` : insertText ?? value, + sortText, + })); +} +function completer_register(meta) { + meta.registerCompleter('json:array', completer_array); + meta.registerCompleter('json:boolean', primitive); + meta.registerCompleter('json:number', primitive); + meta.registerCompleter('json:null', primitive); + meta.registerCompleter('json:object', completer_object); + meta.registerCompleter('json:string', primitive); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/formatter/index.js + + +const formatter_file = (node, ctx) => { + const child = node.children[0]; + return ctx.meta.getFormatter(child.type)(child, ctx); +}; +const formatter_array = (node, ctx) => { + if (node.children.length === 0) { + return '[]'; + } + const values = node.children.map((child) => { + const value = child.value + && ctx.meta.getFormatter(child.value.type)(child.value, indentFormatter(ctx)); + return `${ctx.indent(1)}${value ?? ''}`; + }); + return `[\n${values.join(',\n')}\n${ctx.indent()}]`; +}; +const formatter_object = (node, ctx) => { + if (node.children.length === 0) { + return '{}'; + } + const fields = node.children.map((child) => { + const key = child.key && formatter_string(child.key, ctx); + const value = child.value + && ctx.meta.getFormatter(child.value.type)(child.value, indentFormatter(ctx)); + return `${ctx.indent(1)}${key ?? ''}: ${value ?? ''}`; + }); + return `{\n${fields.join(',\n')}\n${ctx.indent()}}`; +}; +const formatter_number = (node, ctx) => { + return ctx.meta.getFormatter(node.value.type)(node.value, ctx); +}; +const formatter_string = (node, ctx) => { + // TODO: Use core.formatter.string when it correctly escapes the string + return JSON.stringify(node.value); +}; +function formatter_register(meta) { + meta.registerFormatter('json:file', formatter_file); + meta.registerFormatter('json:array', formatter_array); + meta.registerFormatter('json:boolean', formatter_builtin_boolean); + meta.registerFormatter('json:null', () => 'null'); + meta.registerFormatter('json:number', formatter_number); + meta.registerFormatter('json:object', formatter_object); + meta.registerFormatter('json:string', formatter_string); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/json/lib/index.js +/* istanbul ignore file */ + + + + + + + + + + + +/** + * @param jsonUriPredicate If provided, JSON file URIs must pass this predicate for them to be of + * proper `json` language. + */ +function getInitializer(jsonUriPredicate) { + return ({ meta }) => { + meta.registerLanguage('json', { + extensions: ['.json'], + uriPredicate: jsonUriPredicate, + triggerCharacters: ['\n', ':', '"'], + parser: parser_file_file, + }); + meta.registerLanguage('mcmeta', { + extensions: ['.mcmeta'], + triggerCharacters: ['\n', ':', '"'], + parser: parser_file_file, + }); + meta.registerParser('json:entry', entry); + register(meta); + colorizer_register(meta); + completer_register(meta); + formatter_register(meta); + }; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/node/index.js +var NbtNode; +(function (NbtNode) { + /* istanbul ignore next */ + function is(node) { + return (NbtPrimitiveNode.is(node) || NbtCompoundNode.is(node) || NbtCollectionNode.is(node)); + } + NbtNode.is = is; +})(NbtNode || (NbtNode = {})); +var NbtPrimitiveNode; +(function (NbtPrimitiveNode) { + /* istanbul ignore next */ + function is(node) { + return NbtNumberNode.is(node) || NbtStringNode.is(node); + } + NbtPrimitiveNode.is = is; +})(NbtPrimitiveNode || (NbtPrimitiveNode = {})); +var NbtStringNode; +(function (NbtStringNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'nbt:string'; + } + NbtStringNode.is = is; +})(NbtStringNode || (NbtStringNode = {})); +var NbtNumberNode; +(function (NbtNumberNode) { + /* istanbul ignore next */ + function is(node) { + return NbtIntegerAlikeNode.is(node) || NbtFloatAlikeNode.is(node); + } + NbtNumberNode.is = is; +})(NbtNumberNode || (NbtNumberNode = {})); +var NbtIntegerAlikeNode; +(function (NbtIntegerAlikeNode) { + /* istanbul ignore next */ + function is(node) { + return (NbtByteNode.is(node) + || NbtShortNode.is(node) + || NbtIntNode.is(node) + || NbtLongNode.is(node)); + } + NbtIntegerAlikeNode.is = is; +})(NbtIntegerAlikeNode || (NbtIntegerAlikeNode = {})); +var NbtByteNode; +(function (NbtByteNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:byte'; + } + NbtByteNode.is = is; +})(NbtByteNode || (NbtByteNode = {})); +var NbtShortNode; +(function (NbtShortNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:short'; + } + NbtShortNode.is = is; +})(NbtShortNode || (NbtShortNode = {})); +var NbtIntNode; +(function (NbtIntNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:int'; + } + NbtIntNode.is = is; +})(NbtIntNode || (NbtIntNode = {})); +var NbtLongNode; +(function (NbtLongNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:long'; + } + NbtLongNode.is = is; +})(NbtLongNode || (NbtLongNode = {})); +var NbtFloatAlikeNode; +(function (NbtFloatAlikeNode) { + /* istanbul ignore next */ + function is(node) { + return NbtFloatNode.is(node) || NbtDoubleNode.is(node); + } + NbtFloatAlikeNode.is = is; +})(NbtFloatAlikeNode || (NbtFloatAlikeNode = {})); +var NbtFloatNode; +(function (NbtFloatNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:float'; + } + NbtFloatNode.is = is; +})(NbtFloatNode || (NbtFloatNode = {})); +var NbtDoubleNode; +(function (NbtDoubleNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:double'; + } + NbtDoubleNode.is = is; +})(NbtDoubleNode || (NbtDoubleNode = {})); +var NbtCompoundNode; +(function (NbtCompoundNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:compound'; + } + NbtCompoundNode.is = is; +})(NbtCompoundNode || (NbtCompoundNode = {})); +var NbtCollectionNode; +(function (NbtCollectionNode) { + /* istanbul ignore next */ + function is(node) { + return NbtListNode.is(node) || NbtPrimitiveArrayNode.is(node); + } + NbtCollectionNode.is = is; +})(NbtCollectionNode || (NbtCollectionNode = {})); +var NbtListNode; +(function (NbtListNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:list'; + } + NbtListNode.is = is; +})(NbtListNode || (NbtListNode = {})); +var NbtPrimitiveArrayNode; +(function (NbtPrimitiveArrayNode) { + /* istanbul ignore next */ + function is(node) { + return (NbtByteArrayNode.is(node) || NbtIntArrayNode.is(node) || NbtLongArrayNode.is(node)); + } + NbtPrimitiveArrayNode.is = is; +})(NbtPrimitiveArrayNode || (NbtPrimitiveArrayNode = {})); +var NbtByteArrayNode; +(function (NbtByteArrayNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:byte_array'; + } + NbtByteArrayNode.is = is; +})(NbtByteArrayNode || (NbtByteArrayNode = {})); +var NbtIntArrayNode; +(function (NbtIntArrayNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:int_array'; + } + NbtIntArrayNode.is = is; +})(NbtIntArrayNode || (NbtIntArrayNode = {})); +var NbtLongArrayNode; +(function (NbtLongArrayNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:long_array'; + } + NbtLongArrayNode.is = is; +})(NbtLongArrayNode || (NbtLongArrayNode = {})); +var NbtPathNode; +(function (NbtPathNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:path'; + } + NbtPathNode.is = is; +})(NbtPathNode || (NbtPathNode = {})); +var NbtPathKeyNode; +(function (NbtPathKeyNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:path/key'; + } + NbtPathKeyNode.is = is; +})(NbtPathKeyNode || (NbtPathKeyNode = {})); +var NbtPathFilterNode; +(function (NbtPathFilterNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:path/filter'; + } + NbtPathFilterNode.is = is; +})(NbtPathFilterNode || (NbtPathFilterNode = {})); +var NbtPathIndexNode; +(function (NbtPathIndexNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:path/index'; + } + NbtPathIndexNode.is = is; +})(NbtPathIndexNode || (NbtPathIndexNode = {})); +var TypedNbtNode; +(function (TypedNbtNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'nbt:typed'; + } + TypedNbtNode.is = is; +})(TypedNbtNode || (TypedNbtNode = {})); +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/checker/mcdocUtil.js +const BlockItems = { + // Coral fans. + 'minecraft:brain_coral_fan': ['minecraft:brain_coral_fan', 'minecraft:brain_coral_wall_fan'], + 'minecraft:bubble_coral_fan': ['minecraft:bubble_coral_fan', 'minecraft:bubble_coral_wall_fan'], + 'minecraft:fire_coral_fan': ['minecraft:fire_coral_fan', 'minecraft:fire_coral_wall_fan'], + 'minecraft:horn_coral_fan': ['minecraft:horn_coral_fan', 'minecraft:horn_coral_wall_fan'], + 'minecraft:tube_coral_fan': ['minecraft:tube_coral_fan', 'minecraft:tube_coral_wall_fan'], + // Heads and skulls. + 'minecraft:creeper_head': ['minecraft:creeper_head', 'minecraft:creeper_wall_head'], + 'minecraft:dragon_head': ['minecraft:dragon_head', 'minecraft:dragon_wall_head'], + 'minecraft:player_head': ['minecraft:player_head', 'minecraft:player_wall_head'], + 'minecraft:skeleton_skull': ['minecraft:skeleton_skull', 'minecraft:skeleton_wall_skull'], + 'minecraft:wither_skeleton_skull': [ + 'minecraft:wither_skeleton_skull', + 'minecraft:wither_skeleton_wall_skull', + ], + // Dead coral fans. + 'minecraft:dead_brain_coral_fan': [ + 'minecraft:dead_brain_coral_fan', + 'minecraft:dead_brain_coral_wall_fan', + ], + 'minecraft:dead_bubble_coral_fan': [ + 'minecraft:dead_bubble_coral_fan', + 'minecraft:dead_bubble_coral_wall_fan', + ], + 'minecraft:dead_fire_coral_fan': [ + 'minecraft:dead_fire_coral_fan', + 'minecraft:dead_fire_coral_wall_fan', + ], + 'minecraft:dead_horn_coral_fan': [ + 'minecraft:dead_horn_coral_fan', + 'minecraft:dead_horn_coral_wall_fan', + ], + 'minecraft:dead_tube_coral_fan': [ + 'minecraft:dead_tube_coral_fan', + 'minecraft:dead_tube_coral_wall_fan', + ], + // Torches. + 'minecraft:torch': ['minecraft:torch', 'minecraft:wall_torch'], + 'minecraft:soul_torch': ['minecraft:soul_torch', 'minecraft:soul_wall_torch'], + 'minecraft:redstone_torch': ['minecraft:redstone_torch', 'minecraft:redstone_wall_torch'], + 'minecraft:beetroot_seeds': ['minecraft:beetroots'], + 'minecraft:carrot': ['minecraft:carrots'], + 'minecraft:cocoa_beans': ['minecraft:cocoa'], + 'minecraft:glow_berries': ['minecraft:cave_vines'], + 'minecraft:melon_seeds': ['minecraft:melon_stem'], + 'minecraft:potato': ['minecraft:potatoes'], + 'minecraft:pumpkin_seeds': ['minecraft:pumpkin_stem'], + 'minecraft:redstone': ['minecraft:redstone_wire'], + 'minecraft:string': ['minecraft:tripwire'], + 'minecraft:sweat_berries': ['minecraft:sweat_berry_bush'], + 'minecraft:wheat_seeds': ['minecraft:wheat'], +}; +function getBlocksFromItem(item) { + return BlockItems[item]; +} +function getEntityFromItem(item) { + if (item === 'minecraft:armor_stand') { + return item; + } + const result = item.match(/^minecraft:([a-z0-9_]+)_spawn_egg$/); + if (result) { + return `minecraft:${result[1]}`; + } + return undefined; +} +//# sourceMappingURL=mcdocUtil.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/checker/index.js + + + + + +const checker_typed = (node, ctx) => { + checker_typeDefinition(node.targetType)(node.children[0], ctx); +}; +function checker_register(meta) { + meta.registerChecker('nbt:typed', checker_typed); +} +/** + * @param id If the registry is under the `custom` namespace, `id` can only be a string. Otherwise it can be a string, string array, or `undefined`. + * If set to `undefined` or an empty array, all mcdoc compound definitions for this registry will be merged for checking, and unknown keys are allowed. + */ +function checker_index(registry, id, options = {}) { + switch (registry) { + case 'custom:blockitemstates': + const blockIds = getBlocksFromItem(id); + return blockIds ? blockStates(blockIds, options) : builtin_noop; + case 'custom:blockstates': + return blockStates([id], options); + case 'custom:spawnitemtag': + const entityId = getEntityFromItem(id); + return entityId ? checker_index('minecraft:entity', entityId, options) : builtin_noop; + default: + const typeDef = { + kind: 'dispatcher', + registry, + parallelIndices: getIndices(id), + }; + return (node, ctx) => { + checker_typeDefinition(typeDef, options)(node, ctx); + }; + } +} +function getIndices(id) { + if (typeof id === 'string') { + return [{ kind: 'static', value: id }]; + } + else if (id === undefined || id.length === 0) { + return [{ kind: 'static', value: '%fallback' }]; + } + else { + return id.map(i => ({ kind: 'static', value: i })); + } +} +/** + * @param identifier An identifier of mcdoc compound definition. e.g. `::minecraft::util::invitem::InventoryItem` + */ +function checker_typeDefinition(typeDef, options = {}) { + return (node, ctx) => { + typeDefinition([{ originalNode: node, inferredType: checker_inferType(node) }], typeDef, McdocCheckerContext.create(ctx, { + allowMissingKeys: options.isPredicate || options.isMerge, + requireCanonical: options.isPredicate, + isEquivalent: (inferred, def) => { + if (def.kind === 'boolean') { + // TODO: this should check whether the value is 0 or 1 + return inferred.kind === 'byte'; + } + if (inferred.kind === 'list') { + return def.kind === 'list' || def.kind === 'tuple'; + } + if (options.isPredicate) { + return inferred.kind === def.kind; + } + switch (inferred.kind) { + case 'struct': + return def.kind === 'struct'; + case 'byte': + case 'short': + case 'int': + case 'long': + return ['byte', 'short', 'int', 'long', 'float', 'double'].includes(def.kind); + case 'float': + case 'double': + return ['float', 'double'].includes(def.kind); + default: + return false; + } + }, + getChildren: node => { + const { type } = node; + if (type === 'nbt:list' || type === 'nbt:byte_array' + || type === 'nbt:int_array' || type === 'nbt:long_array') { + return node.children.filter(n => n.value).map(n => [{ originalNode: n.value, inferredType: checker_inferType(n.value) }]); + } + if (type === 'nbt:compound') { + return node.children.filter(kvp => kvp.key).map(kvp => ({ + key: { originalNode: kvp.key, inferredType: checker_inferType(kvp.key) }, + possibleValues: kvp.value + ? [{ originalNode: kvp.value, inferredType: checker_inferType(kvp.value) }] + : [], + })); + } + return []; + }, + reportError: (error) => { + if (options.isPredicate && error.kind === 'invalid_collection_length') { + return; + } + getDefaultErrorReporter(ctx, (getDefaultErrorRange))(error); + }, + attachTypeInfo: (node, definition, desc = '') => { + node.typeDef = definition; + node.requireCanonical = options.isPredicate; + // TODO: improve hover info + if (node.parent && PairNode?.is(node.parent) + && NbtNode.is(node.parent.key) + && NbtNode.is(node.parent.value)) { + if (node.parent.key?.typeDef && node.parent.value?.typeDef) { + const valueString = McdocType.toString(node.parent.value.typeDef); + let keyString = McdocType.toString(node.parent.key.typeDef); + if (node.parent.key.typeDef.kind !== 'literal') { + keyString = `[${keyString}]`; + } + node.parent.key.hover = + `\`\`\`typescript\n${keyString}: ${valueString}\n\`\`\`\n${desc}`; + if (NbtPrimitiveNode.is(node.parent.value)) { + node.parent.value.hover = + `\`\`\`typescript\n${valueString}\n\`\`\`\n${desc}`; + } + } + } + else if (NbtPrimitiveNode.is(node)) { + node.hover = `\`\`\`typescript\n${McdocType.toString(definition)}\n\`\`\`\n${desc}`; + } + }, + nodeAttacher: (node, attacher) => attacher(node), + stringAttacher: (node, attacher) => { + if (!NbtStringNode.is(node)) { + return; + } + attacher(node); + if (node.children) { + AstNode.setParents(node); + // Because the runtime checker happens after binding, we need to manually call this + fallbackSync(node, ctx); + builtin_fallbackSync(node, ctx); + } + }, + })); + }; +} +function checker_inferType(node) { + switch (node.type) { + case 'nbt:byte': + return { kind: 'literal', value: { kind: 'byte', value: node.value } }; + case 'nbt:double': + return { kind: 'literal', value: { kind: 'double', value: node.value } }; + case 'nbt:float': + return { kind: 'literal', value: { kind: 'float', value: node.value } }; + case 'nbt:long': + return { + kind: 'literal', + // TODO: this should NOT change type from `bigint` to `number` + value: { kind: 'long', value: Number(node.value) }, + }; + case 'nbt:int': + return { kind: 'literal', value: { kind: 'int', value: node.value } }; + case 'nbt:short': + return { kind: 'literal', value: { kind: 'short', value: node.value } }; + case 'nbt:string': + return { kind: 'literal', value: { kind: 'string', value: node.value } }; + case 'nbt:list': + return { kind: 'list', item: { kind: 'any' } }; + case 'nbt:compound': + return { kind: 'struct', fields: [] }; + case 'nbt:byte_array': + return { kind: 'byte_array' }; + case 'nbt:long_array': + return { kind: 'long_array' }; + case 'nbt:int_array': + return { kind: 'int_array' }; + } +} +function blockStates(blocks, _options = {}) { + return (node, ctx) => { + if (!NbtCompoundNode.is(node)) { + return; + } + const states = getStates('block', blocks, ctx); + for (const { key: keyNode, value: valueNode } of node.children) { + if (!keyNode || !valueNode) { + continue; + } + // Type check. + if (valueNode.type === 'nbt:byte' + && (ctx.src.slice(valueNode.range).toLowerCase() === 'false' + || ctx.src.slice(valueNode.range).toLowerCase() === 'true')) { + ctx.err.report(localize('nbt.checker.block-states.fake-boolean'), valueNode, 2 /* core.ErrorSeverity.Warning */); + continue; + } + else if (valueNode.type !== 'nbt:string' && valueNode.type !== 'nbt:int') { + ctx.err.report(localize('nbt.checker.block-states.unexpected-value-type'), valueNode, 2 /* core.ErrorSeverity.Warning */); + continue; + } + if (Object.keys(states).includes(keyNode.value)) { + // The current state exists. Check the value. + const stateValues = states[keyNode.value]; + if (!stateValues.includes(valueNode.value.toString())) { + ctx.err.report(localize('expected-got', stateValues, localeQuote(valueNode.value.toString())), valueNode, 2 /* core.ErrorSeverity.Warning */); + } + } + else { + // The current state doesn't exist. + ctx.err.report(localize('nbt.checker.block-states.unknown-state', localeQuote(keyNode.value), blocks), keyNode, 2 /* core.ErrorSeverity.Warning */); + } + } + }; +} +// TODO: check nbt index nodes and nbt compound nodes +function checker_path(registry, id) { + return (node, ctx) => { + // TODO: support dispatcher + const typeDef = { + kind: 'dispatcher', + registry, + parallelIndices: getIndices(id), + }; + // Create a linked list representation + const leaf = { type: 'leaf', range: Range.create(node.range.end) }; + let link = { path: node, node: leaf }; + for (let i = node.children.length - 1; i >= 0; i -= 1) { + link = { path: node, node: node.children[i], next: link }; + } + let prev = link; + while (prev.next) { + prev.next.prev = prev; + prev = prev.next; + } + typeDefinition([{ originalNode: link, inferredType: inferPath(link) }], typeDef, McdocCheckerContext.create(ctx, { + allowMissingKeys: true, + requireCanonical: true, + isEquivalent: (inferred, def) => { + switch (inferred.kind) { + case 'list': + case 'byte_array': + case 'int_array': + case 'long_array': + return ['list', 'tuple', 'byte_array', 'int_array', 'long_array'].includes(def.kind); + default: + return false; + } + }, + getChildren: (link) => { + while (link.next && link.node.type !== 'leaf' && NbtPathFilterNode.is(link.node)) { + link = link.next; + } + if (!link.next || link.node.type === 'leaf') { + return []; + } + if (NbtPathIndexNode.is(link.node)) { + return [[{ originalNode: link.next, inferredType: inferPath(link.next) }]]; + } + if (NbtPathKeyNode.is(link.node)) { + return [{ + key: { + originalNode: link, + inferredType: { + kind: 'literal', + value: { kind: 'string', value: link.node.children[0].value }, + }, + }, + possibleValues: [{ + originalNode: link.next, + inferredType: inferPath(link.next), + }], + }]; + } + // Never reachable + return []; + }, + reportError: (error) => { + if (error.kind === 'invalid_collection_length') { + return; + } + getDefaultErrorReporter(ctx, ({ originalNode: link }) => link.node.range)(error); + }, + attachTypeInfo: (link, definition, desc = '') => { + if (definition.kind === 'literal' && !definition.attributes?.length) { + return; + } + if (link.node.type === 'leaf') { + link.path.endTypeDef = definition; + } + else { + link.node.typeDef = definition; + } + // TODO: improve hover info + if (NbtPathKeyNode.is(link.prev?.node)) { + link.prev.node.hover = `\`\`\`typescript\n${link.prev.node.children[0].value}: ${McdocType.toString(definition)}\n\`\`\`\n${desc}`; + } + }, + nodeAttacher: (link, attacher) => { + if (link.node.type !== 'leaf') { + attacher(link.node); + } + }, + stringAttacher: (link, attacher) => { + if (!NbtPathKeyNode.is(link.node)) { + return; + } + attacher(link.node.children[0]); + if (link.node.children[0].children) { + AstNode.setParents(link.node.children[0]); + // Because the runtime checker happens after binding, we need to manually call this + fallbackSync(link.node.children[0], ctx); + builtin_fallbackSync(link.node.children[0], ctx); + } + }, + })); + }; +} +function inferPath(link) { + if (link.node.type === 'leaf') { + return { kind: 'unsafe' }; + } + if (NbtPathIndexNode.is(link.node)) { + return { kind: 'list', item: { kind: 'any' } }; + } + return { kind: 'struct', fields: [] }; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/colorizer/index.js + +function lib_colorizer_register(meta) { + meta.registerColorizer('nbt:string', string); + meta.registerColorizer('nbt:byte', number); + meta.registerColorizer('nbt:short', number); + meta.registerColorizer('nbt:int', number); + meta.registerColorizer('nbt:long', number); + meta.registerColorizer('nbt:float', number); + meta.registerColorizer('nbt:double', number); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/completer/index.js + + +const collection = (node, ctx) => { + const index = binarySearch(node.children, ctx.offset, (n, o) => { + return Range.compareOffset(n.range, o, true); + }); + const item = index >= 0 ? node.children[index] : undefined; + if (item?.value) { + return ctx.meta.getCompleter(item.value.type)(item.value, ctx); + } + if (node.typeDef?.kind === 'list') { + const completions = lib_completer_getValues(node.typeDef.item, ctx.offset, { + ...ctx, + requireCanonical: node.requireCanonical, + }); + if (ctx.offset < (node.children[node.children.length - 1]?.range.start ?? 0)) { + return completions.map(c => ({ ...c, insertText: c.insertText + ',' })); + } + return completions; + } + return []; +}; +const compound = record({ + key: (record, pair, ctx, range, iv, ipe, exitingKeys) => { + if (!record.typeDef) { + return []; + } + const keySet = new Set(exitingKeys.map(n => n.value)); + return getFields(record.typeDef, { ...ctx, requireCanonical: record.requireCanonical }) + .filter(({ key }) => !keySet.has(key)) + .map(({ key, field }) => CompletionItem.create(key, pair?.key ?? range, { + kind: 5 /* core.CompletionKind.Field */, + detail: McdocType.toString(field.type), + documentation: field.desc, + deprecated: field.deprecated, + sortText: field.optional ? '$b' : '$a', // sort above hardcoded $schema + filterText: formatKey(key, pair?.key?.quote), + insertText: `${formatKey(key, pair?.key?.quote)}${iv ? ':' : ''}${ipe ? '$1,' : ''}`, + })); + }, + value: (record, pair, ctx, range) => { + if (pair.value) { + return ctx.meta.getCompleter(pair.value.type)(pair.value, ctx); + } + if (pair.key && record.typeDef) { + const pairKey = pair.key.value; + const field = getFields(record.typeDef, ctx) + .find(({ key }) => key === pairKey) + ?.field.type; + if (field) { + return lib_completer_getValues(field, range, { + ...ctx, + requireCanonical: record.requireCanonical, + }); + } + } + return []; + }, +}); +const completer_primitive = (node, ctx) => { + const insideRange = Range.contains(node, ctx.offset, true); + if (node.type === 'nbt:string' && node.children?.length && insideRange) { + const childItems = builtin_string(node, ctx); + if (childItems.length > 0) { + return childItems; + } + } + if (!node.typeDef) { + return []; + } + return lib_completer_getValues(node.typeDef, insideRange ? node : ctx.offset, { + ...ctx, + requireCanonical: node.requireCanonical, + }); +}; +const completer_path = (node, ctx) => { + const index = binarySearch(node.children, ctx.offset, (n, o) => { + return Range.compareOffset(n.range, o, true); + }); + const item = index >= 0 ? node.children[index] : undefined; + if (item) { + return ctx.meta.getCompleter(item.type)(item, ctx); + } + if (!node.endTypeDef) { + return []; + } + return getPathKeys(node.endTypeDef, ctx.offset, undefined, ctx); +}; +const pathKey = (node, ctx) => { + if (!node.typeDef) { + return []; + } + const child = node.children[0]; + if (child.children?.length) { + return dispatch(child.children[0], ctx); + } + return getPathKeys(node.typeDef, node, child.quote, ctx); +}; +function getPathKeys(typeDef, range, quote, ctx) { + return getFields(typeDef, { ...ctx, requireCanonical: true }) + .map(({ key, field }) => CompletionItem.create(key, range, { + kind: 5 /* core.CompletionKind.Field */, + detail: McdocType.toString(field.type), + documentation: field.desc, + deprecated: field.deprecated, + sortText: field.optional ? '$b' : '$a', // sort above hardcoded $schema + filterText: formatKey(key, quote), + insertText: formatKey(key, quote), + })); +} +function lib_completer_getValues(typeDef, range, ctx) { + return getValues(typeDef, ctx) + .map(({ value, labelSuffix, detail, documentation, kind, completionKind, insertText, sortText }) => CompletionItem.create(value, range, { + kind: completionKind ?? 12 /* core.CompletionKind.Value */, + labelSuffix, + detail, + documentation, + filterText: formatValue(value, kind), + insertText: formatValue(insertText ?? value, kind), + sortText, + })); +} +function formatKey(key, quote) { + if (!quote && BrigadierUnquotablePattern.test(key)) { + return key; + } + const q = quote ?? '"'; + return q + escapeString(key, q) + q; +} +function formatValue(value, kind) { + switch (kind) { + case 'string': + return `"${escapeString(value, '"')}"`; + case 'byte': + return `${value}b`; + case 'short': + return `${value}s`; + case 'long': + return `${value}L`; + case 'float': + return `${value}f`; + default: + return value; + } +} +function lib_completer_register(meta) { + meta.registerCompleter('nbt:byte', completer_primitive); + meta.registerCompleter('nbt:byte_array', collection); + meta.registerCompleter('nbt:compound', compound); + meta.registerCompleter('nbt:double', completer_primitive); + meta.registerCompleter('nbt:int', completer_primitive); + meta.registerCompleter('nbt:int_array', collection); + meta.registerCompleter('nbt:list', collection); + meta.registerCompleter('nbt:long', completer_primitive); + meta.registerCompleter('nbt:long_array', collection); + meta.registerCompleter('nbt:string', completer_primitive); + meta.registerCompleter('nbt:short', completer_primitive); + meta.registerCompleter('nbt:float', completer_primitive); + meta.registerCompleter('nbt:path', completer_path); + meta.registerCompleter('nbt:path/key', pathKey); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/util.js + +function localizeTag(type) { + return localize(`nbt.node.${type.replace(/^nbt:/, '')}`); +} +function newSyntax(ctx) { + // TODO: don't have this inline java-edition version check + const release = ctx.project['loadedVersion']; + return !release || Number(release.slice(2)) >= Number('1.21.5'.slice(2)); +} +//# sourceMappingURL=util.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/primitive.js + + + +const FloatMaximum = (2 - 2 ** -23) * 2 ** 127; +const NumeralPatterns = [ + { + pattern: /^[-+]?(?:0|[1-9][0-9]*)b$/i, + type: 'nbt:byte', + hasSuffix: true, + group: 2 /* Group.IntegerAlike */, + min: -128, + max: 127, + }, + { + pattern: /^[-+]?(?:0|[1-9][0-9]*)s$/i, + type: 'nbt:short', + hasSuffix: true, + group: 2 /* Group.IntegerAlike */, + min: -32768, + max: 32767, + }, + { + pattern: /^[-+]?(?:0|[1-9][0-9]*)$/, + type: 'nbt:int', + hasSuffix: false, + group: 2 /* Group.IntegerAlike */, + min: -2147483648, + max: 2147483647, + }, + { + pattern: /^[-+]?(?:0|[1-9][0-9]*)l$/i, + type: 'nbt:long', + hasSuffix: true, + group: 3 /* Group.LongAlike */, + min: -9223372036854775808n, + max: 9223372036854775807n, + }, + { + pattern: /^[-+]?(?:[0-9]+\.?|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?f$/i, + type: 'nbt:float', + hasSuffix: true, + group: 1 /* Group.FloatAlike */, + min: -FloatMaximum, + max: FloatMaximum, + }, + { + pattern: /^[-+]?(?:[0-9]+\.|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?$/i, + type: 'nbt:double', + hasSuffix: false, + group: 1 /* Group.FloatAlike */, + min: -Number.MAX_VALUE, + max: Number.MAX_VALUE, + }, + { + pattern: /^[-+]?(?:[0-9]+\.?|[0-9]*\.[0-9]+)(?:e[-+]?[0-9]+)?d$/i, + type: 'nbt:double', + hasSuffix: true, + group: 1 /* Group.FloatAlike */, + min: -Number.MAX_VALUE, + max: Number.MAX_VALUE, + }, + { pattern: /^true$/i, type: 'nbt:byte', value: 1, group: 0 /* Group.Boolean */ }, + { pattern: /^false$/i, type: 'nbt:byte', value: 0, group: 0 /* Group.Boolean */ }, +]; +const NbtStringOptions = { + escapable: { characters: ['b', 'f', 'n', 'r', 's', 't'], unicode: true }, + quotes: ['"', "'"], + unquotable: BrigadierUnquotableOption, +}; +const primitive_string = (src, ctx) => { + const options = newSyntax(ctx) ? NbtStringOptions : BrigadierStringOptions; + return setType('nbt:string', string_string(options))(src, ctx); +}; +const primitive_primitive = (src, ctx) => { + if (Source.isBrigadierQuote(src.peek())) { + return primitive_string(src, ctx); + } + const { result: unquotedResult, updateSrcAndCtx: updateUnquoted } = util_attempt(primitive_string, src, ctx); + for (const e of NumeralPatterns) { + if (e.pattern.test(unquotedResult.value)) { + if (e.group === 0 /* Group.Boolean */) { + const ans = { + type: 'nbt:byte', + range: unquotedResult.range, + value: e.value, + }; + updateUnquoted(); + return ans; + } + let isOutOfRange = false; + const onOutOfRange = () => (isOutOfRange = true); + const numeralParser = e.group === 2 /* Group.IntegerAlike */ + // As we already checked the format of the value with `e.pattern` in the if-block, there is no need to check + // it again here in the parser, therefore we just pass in a simple /./ regex. + ? integer_integer({ pattern: /./, min: e.min, max: e.max, onOutOfRange }) + : e.group === 3 /* Group.LongAlike */ + ? long_long({ pattern: /./, min: e.min, max: e.max, onOutOfRange }) + : float_float({ pattern: /./, min: e.min, max: e.max, onOutOfRange }); + const { result: numeralResult, updateSrcAndCtx: updateNumeral } = util_attempt(numeralParser, src, ctx); + if (isOutOfRange) { + ctx.err.report(localize('nbt.parser.number.out-of-range', localizeTag(e.type), localize('nbt.node.string'), e.min, e.max), unquotedResult, 2 /* core.ErrorSeverity.Warning */); + break; + } + updateNumeral(); + if (e.hasSuffix) { + src.skip(); + numeralResult.range.end++; + } + return { ...numeralResult, type: e.type }; + } + } + updateUnquoted(); + return unquotedResult; +}; +//# sourceMappingURL=primitive.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/collection.js + + + + + +const collection_list = (src, ctx) => { + const parser = list({ + start: '[', + value: entry_entry, + sep: ',', + trailingSep: true, + end: ']', + }); + const ans = parser(src, ctx); + ans.type = 'nbt:list'; + ans.valueType = ans.children[0]?.value?.type; + // Check if every element is of the same type. + if (ans.valueType && !newSyntax(ctx)) { + for (const { value } of ans.children) { + if (value && value.type !== ans.valueType) { + ctx.err.report(localize('expected-got', localizeTag(ans.valueType), localizeTag(value.type)), value); + } + } + } + return ans; +}; +const byteArray = (src, ctx) => { + const parser = list({ + start: '[B;', + value: primitive_primitive, + sep: ',', + trailingSep: true, + end: ']', + }); + const ans = parser(src, ctx); + ans.type = 'nbt:byte_array'; + // Check if every element is of the required type. + for (const { value } of ans.children) { + if (value && value.type !== 'nbt:byte') { + ctx.err.report(localize('expected-got', localize('nbt.node.byte'), localizeTag(value.type)), value); + } + } + return ans; +}; +const intArray = (src, ctx) => { + const parser = list({ + start: '[I;', + value: primitive_primitive, + sep: ',', + trailingSep: true, + end: ']', + }); + const ans = parser(src, ctx); + ans.type = 'nbt:int_array'; + // Check if every element is of the required type. + for (const { value } of ans.children) { + if (value && value.type !== 'nbt:int') { + ctx.err.report(localize('expected-got', localize('nbt.node.int'), localizeTag(value.type)), value); + } + } + return ans; +}; +const longArray = (src, ctx) => { + const parser = list({ + start: '[L;', + value: primitive_primitive, + sep: ',', + trailingSep: true, + end: ']', + }); + const ans = parser(src, ctx); + ans.type = 'nbt:long_array'; + // Check if every element is of the required type. + for (const { value } of ans.children) { + if (value && value.type !== 'nbt:long') { + ctx.err.report(localize('expected-got', localize('nbt.node.long'), localizeTag(value.type)), value); + } + } + return ans; +}; +//# sourceMappingURL=collection.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/compound.js + + +const compound_compound = (src, ctx) => { + return setType('nbt:compound', record_record({ + start: '{', + pair: { + key: failOnEmpty(setType('nbt:string', string_string({ ...BrigadierStringOptions, colorTokenType: 'property' }))), + sep: ':', + value: entry_entry, + end: ',', + trailingEnd: true, + }, + end: '}', + }))(src, ctx); +}; +//# sourceMappingURL=compound.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/entry.js + + + + +const entry_entry = (src, ctx) => failOnEmpty(util_select([ + { predicate: (src) => src.tryPeek('[B;'), parser: byteArray }, + { + predicate: (src) => src.tryPeek('[I;'), + parser: intArray, + }, + { predicate: (src) => src.tryPeek('[L;'), parser: longArray }, + { predicate: (src) => src.tryPeek('['), parser: collection_list }, + { predicate: (src) => src.tryPeek('{'), parser: compound_compound }, + { parser: primitive_primitive }, +]))(src, ctx); +//# sourceMappingURL=entry.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/path.js + + + +const path_path = (src, ctx) => { + const ans = { type: 'nbt:path', children: [], range: Range.create(src) }; + let expectedParts = ['filter', 'key']; + let currentPart = nextPart(src); + let cursor; + while (cursor !== src.cursor) { + if (!expectedParts.includes(currentPart)) { + ctx.err.report(localize('expected-got', arrayToMessage(expectedParts.map(localizePart), false, 'or'), localizePart(currentPart)), src); + } + if (currentPart === 'end') { + break; + } + cursor = src.cursor; + expectedParts = PartParsers[currentPart](ans.children, src, ctx); + currentPart = nextPart(src); + } + ans.range.end = src.cursor; + return ans; +}; +const filter = (children, src, ctx) => { + const node = compound_compound(src, ctx); + children.push({ + type: 'nbt:path/filter', + range: node.range, + children: [node], + }); + return src.trySkip('.') ? ['key'] : ['end']; +}; +const path_index = (children, src, ctx) => { + const node = { + type: 'nbt:path/index', + children: undefined, + range: Range.create(src), + }; + if (!src.trySkip('[')) { + throw new Error(`NBT path index parser called at illegal position: “${src.peek()}” at ${src.cursor}`); + } + src.skipSpace(); + const c = src.peek(); + if (c === '{') { + node.children = [compound_compound(src, ctx)]; + } + else if (c !== ']') { + node.children = [integer_integer({ pattern: /^-?\d+$/ })(src, ctx)]; + } + src.skipSpace(); + if (!src.trySkip(']')) { + ctx.err.report(localize('expected-got', localeQuote(']'), localeQuote(src.peek())), src); + } + node.range.end = src.cursor; + children.push(node); + return src.trySkip('.') ? ['index', 'key'] : ['end', 'index']; +}; +const key = (children, src, ctx) => { + const node = setType('nbt:string', string_string({ + colorTokenType: 'property', + escapable: {}, + // Single quotes supported since 1.20 Pre-release 2 (roughly pack format 15) + // https://bugs.mojang.com/browse/MC-175504 + quotes: ['"', "'"], + unquotable: { blockList: new Set(['\n', '\r', '\t', ' ', '"', '[', ']', '.', '{', '}']) }, + }))(src, ctx); + children.push({ + type: 'nbt:path/key', + range: node.range, + children: [node], + }); + return src.trySkip('.') ? ['index', 'key'] : ['end', 'filter', 'index']; +}; +function nextPart(src) { + switch (src.peek()) { + case '': + case ' ': + case '\n': + case '\r': + return 'end'; + case '{': + return 'filter'; + case '[': + return 'index'; + default: + return 'key'; + } +} +function localizePart(part) { + return localize(`nbt.node.path.${part}`); +} +const PartParsers = { filter, index: path_index, key }; +//# sourceMappingURL=path.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/mcdocAttributes.js + + + + + +const nbtValidator = (value) => { + if (!value || value?.kind === 'tree') { + return Parser_Failure; + } + return value; +}; +function registerMcdocAttributes(meta) { + registerAttribute(meta, 'nbt', nbtValidator, { + stringParser: (config) => makeInfallible(util_map(entry_entry, res => ({ + type: 'nbt:typed', + range: res.range, + children: [res], + targetType: config, + })), localize('nbt.node')), + }); + registerAttribute(meta, 'nbt_path', nbtValidator, { + stringParser: () => makeInfallible(path_path, localize('nbt.path')), + }); +} +function makeInfallible(parser, message) { + return (src, ctx) => { + const start = src.cursor; + const res = parser(src, ctx); + if (res === Parser_Failure) { + ctx.err.report(localize('expected', message), Range.create(start, src.skipRemaining())); + return undefined; + } + return res; + }; +} +//# sourceMappingURL=mcdocAttributes.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/parser/index.js + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/nbt/lib/index.js + + + + + + + + + + +/* istanbul ignore next */ +const lib_initialize = ({ meta }) => { + meta.registerLanguage('snbt', { + extensions: ['.snbt'], + parser: entry_entry, + }); + meta.registerLanguage('nbt', { + extensions: ['.nbt'], + }); + meta.registerParser('nbt:entry', entry_entry); + meta.registerParser('nbt:compound', compound_compound); + meta.registerParser('nbt:path', path_path); + checker_register(meta); + lib_colorizer_register(meta); + lib_completer_register(meta); + registerMcdocAttributes(meta); +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/dependency/common.js +var ReleaseVersion; +(function (ReleaseVersion) { + /** + * @returns + * * `-1` if `a` is older than `b`. + * * `0` if `a` is the same as `b`. + * * `1` if `a` is newer than `b`. + */ + function cmp(a, b) { + return Math.sign(Number(a.slice(2)) - Number(b.slice(2))); + } + ReleaseVersion.cmp = cmp; + /** + * @returns `true` if `version` is newer than `since` (inclusive) and older + * than `until` (exclusive) + */ + function isBetween(version, since, until) { + return cmp(version, since) >= 0 && cmp(version, until) < 0; + } + ReleaseVersion.isBetween = isBetween; +})(ReleaseVersion || (ReleaseVersion = {})); +var PackMcmeta; +(function (PackMcmeta) { + function readPackFormat(data) { + const supported = data?.pack?.supported_formats; + if (Array.isArray(supported) && supported.length === 2 && typeof supported[1] === 'number') { + return supported[1]; + } + if (typeof supported === 'object' && typeof supported?.max_inclusive === 'number') { + return supported.max_inclusive; + } + const format = data?.pack?.pack_format; + if (typeof format === 'number') { + return format; + } + throw new Error('“pack.pack_format” is not a number'); + } + PackMcmeta.readPackFormat = readPackFormat; + async function getType(packRoot, externals) { + const dir = await externals.fs.readdir(packRoot); + const isResourcePack = dir.some(e => e.isDirectory() && e.name === 'assets') + && !dir.some(e => e.isDirectory() && e.name === 'data'); + return isResourcePack ? 'assets' : 'data'; + } + PackMcmeta.getType = getType; +})(PackMcmeta || (PackMcmeta = {})); +//# sourceMappingURL=common.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/dependency/mcmeta.js + + +// DOCS: Update this when a new snapshot cycle begins +const NEXT_RELEASE_VERSION = '1.21.9'; +/** + * @param inputVersion {@link core.Config.env.gameVersion} + */ +function resolveConfiguredVersion(inputVersion, versions, packs, logger) { + function findReleaseTarget(version) { + if (version.release_target) { + return version.release_target; + } + if (version.type === 'release') { + return version.id; + } + const index = versions.findIndex((v) => v.id === version.id); + for (let i = index; i >= 0; i -= 1) { + if (versions[i].type === 'release') { + return versions[i].id; + } + } + return NEXT_RELEASE_VERSION; + } + function toVersionInfo(version) { + version = version ?? versions[0]; + return { + id: version.id, + name: version.name, + release: findReleaseTarget(version), + isLatest: version === versions[0], + }; + } + if (versions.length === 0) { + throw new Error('mcmeta version list is empty'); + } + // This should never happen, but for some reason happens sometimes + // https://github.com/SpyglassMC/Spyglass/issues/1621 + if (inputVersion === undefined) { + logger.warn('[resolveConfiguredVersion] Input version was undefined! Falling back to "auto"'); + inputVersion = 'auto'; + } + inputVersion = inputVersion.toLowerCase(); + versions = versions.sort((a, b) => b.data_version - a.data_version); + const latestRelease = versions.find((v) => v.type === 'release'); + if (inputVersion === 'auto') { + if (packs.length === 0) { + // Fall back to the latest release if pack mcmeta is not available + logger.info(`[resolveConfiguredVersion] No pack format detected, selecting latest release ${latestRelease?.id}`); + return toVersionInfo(latestRelease); + } + packs.sort((a, b) => b.format - a.format); + const maxData = packs.filter(p => p.type === 'data')[0]; + const maxAssets = packs.filter(p => p.type === 'assets')[0]; + // Look for versions from recent to oldest, picking the most recent release that matches + let oldestRelease = versions[0]; + const releases = versions.filter(v => v.type === 'release'); + for (const version of releases) { + // If we already passed the pack format, use the oldest release so far + if (maxData && maxData.format > version.data_pack_version) { + logger.info(`[resolveConfiguredVersion] Detected data pack format ${maxData.format} in ${maxData.packRoot}, selecting version ${oldestRelease.id}`); + return toVersionInfo(oldestRelease); + } + if (maxAssets && maxAssets.format > version.resource_pack_version) { + logger.info(`[resolveConfiguredVersion] Detected resource pack format ${maxAssets.format} in ${maxAssets.packRoot}, selecting version ${oldestRelease.id}`); + return toVersionInfo(oldestRelease); + } + if (maxData && maxData.format === version.data_pack_version) { + logger.info(`[resolveConfiguredVersion] Detected data pack format ${maxData.format} in ${maxData.packRoot}, selecting version ${version.id}`); + return toVersionInfo(version); + } + if (maxAssets && maxAssets.format === version.resource_pack_version) { + logger.info(`[resolveConfiguredVersion] Detected resource pack format ${maxAssets.format} in ${maxAssets.packRoot}, selecting version ${version.id}`); + return toVersionInfo(version); + } + oldestRelease = version; + } + // If the pack format is still lower, use the oldest known release version + logger.info(`[resolveConfiguredVersion] Detected pack format too low, selecting oldest supported release ${oldestRelease?.id}`); + return toVersionInfo(oldestRelease); + } + else if (inputVersion === 'latest release') { + logger.info(`[resolveConfiguredVersion] Using config "${inputVersion}", selecting version ${latestRelease?.id}`); + return toVersionInfo(latestRelease); + } + else if (inputVersion === 'latest snapshot') { + logger.info(`[resolveConfiguredVersion] Using config "${inputVersion}", selecting version ${versions[0]?.id}`); + return toVersionInfo(versions[0]); + } + const configVersion = versions.find((v) => inputVersion === v.id.toLowerCase() || inputVersion === v.name.toLowerCase()); + logger.info(`[resolveConfiguredVersion] Using config "${inputVersion}", selecting version ${configVersion?.id}`); + return toVersionInfo(configVersion); +} +const DataSources = { + fastly: 'https://fastly.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}', + github: 'https://raw.githubusercontent.com/${user}/${repo}/${tag}/${path}', + jsdelivr: 'https://cdn.jsdelivr.net/gh/${user}/${repo}@${tag}/${path}', +}; +function getMcmetaSummaryUris(version, isLatest, source) { + const tag = isLatest ? 'summary' : `${version}-summary`; + function getUri(path) { + const template = DataSources[source.toLowerCase()] ?? source; + const ans = template.replace(/\${user}/g, 'misode').replace(/\${repo}/g, 'mcmeta').replace(/\${tag}/g, tag).replace(/\${path}/g, path); + if (!RemoteUriString.is(ans)) { + throw new Error(`Expected a remote URI from data source template but got ${ans}`); + } + return ans; + } + return { + blocks: getUri('blocks/data.json.gz'), + commands: getUri('commands/data.json.gz'), + registries: getUri('registries/data.json.gz'), + }; +} +function symbolRegistrar(summary, release) { + const McmetaSummaryUri = 'mcmeta://summary/registries.json'; + /** + * Add states of blocks or fluids to the symbol table. + */ + function addStatesSymbols(category, states, symbols) { + const capitalizedCategory = `${category[0].toUpperCase()}${category.slice(1)}`; + for (const [id, [properties, defaults]] of Object.entries(states)) { + const uri = McmetaSummaryUri; + symbols.query(uri, category, ResourceLocation.lengthen(id)).onEach(Object.entries(properties), ([state, values], blockQuery) => { + const defaultValue = defaults[state]; + blockQuery.member(`${uri}#${capitalizedCategory}_states`, state, (stateQuery) => { + stateQuery.enter({ + data: { subcategory: 'state' }, + usage: { type: 'declaration' }, + }).onEach(values, (value) => { + stateQuery.member(value, (valueQuery) => { + valueQuery.enter({ + data: { subcategory: 'state_value' }, + usage: { type: 'declaration' }, + }); + if (value === defaultValue) { + stateQuery.amend({ + data: { relations: { default: { category, path: valueQuery.path } } }, + }); + } + }); + }); + }); + }); + } + const stateTypes = { block: summary.blocks, fluid: summary.fluids }; + for (const [type, states] of Object.entries(stateTypes)) { + symbols.query(McmetaSummaryUri, 'mcdoc/dispatcher', `mcdoc:${type}_states`) + .enter({ usage: { type: 'declaration' } }) + .onEach(Object.entries(states), ([id, [properties]], query) => { + const data = { + typeDef: { + kind: 'struct', + fields: Object.entries(properties).map(([propKey, propValues]) => ({ + kind: 'pair', + key: propKey, + optional: true, + type: { + kind: 'union', + members: propValues.map(value => ({ + kind: 'literal', + value: { kind: 'string', value }, + })), + }, + })), + }, + }; + query.member(id, (stateQuery) => { + stateQuery.enter({ + data: { data }, + usage: { type: 'declaration' }, + }); + }); + }); + symbols.query(McmetaSummaryUri, 'mcdoc/dispatcher', `mcdoc:${type}_state_keys`) + .enter({ usage: { type: 'declaration' } }) + .onEach(Object.entries(states), ([id, [properties]], query) => { + const data = { + typeDef: { + kind: 'union', + members: Object.keys(properties).map(propKey => ({ + kind: 'literal', + value: { kind: 'string', value: propKey }, + })), + }, + }; + query.member(id, (stateQuery) => { + stateQuery.enter({ + data: { data }, + usage: { type: 'declaration' }, + }); + }); + }); + } + } + function addRegistriesSymbols(registries, symbols) { + function isCategory(str) { + return (FileCategories.includes(str) + || RegistryCategories.includes(str)); + } + for (const [registryId, registry] of Object.entries(registries)) { + if (isCategory(registryId)) { + for (const entryId of registry) { + symbols.query(McmetaSummaryUri, registryId, ResourceLocation.lengthen(entryId)) + .enter({ usage: { type: 'declaration' } }); + } + } + } + } + function addBuiltinSymbols(symbols) { + if (ReleaseVersion.cmp(release, '1.21.2') < 0) { + symbols.query(McmetaSummaryUri, 'loot_table', 'minecraft:empty') + .enter({ usage: { type: 'declaration' } }); + } + symbols.query(McmetaSummaryUri, 'model', 'minecraft:builtin/generated') + .enter({ usage: { type: 'declaration' } }); + if (ReleaseVersion.cmp(release, '1.21.4') < 0) { + symbols.query(McmetaSummaryUri, 'model', 'minecraft:builtin/entity') + .enter({ usage: { type: 'declaration' } }); + } + } + return (symbols) => { + addRegistriesSymbols(summary.registries, symbols); + addStatesSymbols('block', summary.blocks, symbols); + addStatesSymbols('fluid', summary.fluids, symbols); + addBuiltinSymbols(symbols); + }; +} +const Fluids = { + flowing_lava: [{ falling: ['false', 'true'], level: ['1', '2', '3', '4', '5', '6', '7', '8'] }, { + falling: 'false', + level: '1', + }], + flowing_water: [ + { falling: ['false', 'true'], level: ['1', '2', '3', '4', '5', '6', '7', '8'] }, + { falling: 'false', level: '1' }, + ], + lava: [{ falling: ['false', 'true'] }, { falling: 'false' }], + water: [{ falling: ['false', 'true'] }, { falling: 'false' }], +}; +// #endregion +//# sourceMappingURL=mcmeta.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/dependency/index.js + + + + +// Memory cache TTL in milliseconds +const DownloaderTtl = 15_000; +/* istanbul ignore next */ +/** + * Return the deserialized [`versions.json`][versions.json]. + * + * [versions.json]: https://github.com/misode/mcmeta/blob/summary/versions/data.json + */ +async function getVersions(externals, downloader) { + return downloader.download({ + id: 'mc-je/versions.json.gz', + uri: 'https://raw.githubusercontent.com/misode/mcmeta/summary/versions/data.json.gz', + transformer: (buffer) => parseGzippedJson(externals, buffer), + cache: getCacheOptionsBasedOnGitHubCommitSha('misode', 'mcmeta', 'refs/heads/summary'), + ttl: DownloaderTtl, + }); +} +/* istanbul ignore next */ +/** + * Get vanilla resources, including block definitions, fluid definitions, command tree, and registries. + * + * @throws Network/file system errors. + */ +async function getMcmetaSummary(externals, downloader, logger, version, isLatest, source, overridePaths = {}) { + const ref = getGitRef({ + defaultBranch: 'summary', + getTag: (v) => `${v}-summary`, + isLatest, + version, + }); + const uris = getMcmetaSummaryUris(version, isLatest, source); + let checksum; + async function handleOverride(currentValue, overrideConfig) { + if (overrideConfig) { + try { + const override = (await fileUtil.readJson(externals, overrideConfig.path)); + if (overrideConfig.replace) { + return override; + } + else { + return merge(currentValue, override); + } + } + catch (e) { + logger.error(`[je] [mcmeta-overrides] Failed loading customized mcmeta summary file “${overrideConfig.path}”`, e); + } + } + return currentValue; + } + const getResource = async (type, overrideConfig) => { + const out = {}; + const data = await downloader.download({ + id: `mc-je/${version}/${type}.json.gz`, + uri: uris[type], + transformer: (buffer) => parseGzippedJson(externals, buffer), + cache: getCacheOptionsBasedOnGitHubCommitSha('misode', 'mcmeta', ref), + ttl: DownloaderTtl, + }, out); + checksum ||= out.checksum; + return handleOverride(data, overrideConfig); + }; + const [blocks, commands, fluids, registries] = [ + await getResource('blocks', overridePaths.blocks), + await getResource('commands', overridePaths.commands), + await handleOverride(Fluids, overridePaths.fluids), + await getResource('registries', overridePaths.registries), + ]; + return { blocks, commands, fluids, registries, checksum }; +} +function getGitRef({ defaultBranch, getTag, isLatest, version }) { + return isLatest ? `refs/heads/${defaultBranch}` : `refs/tags/${getTag(version)}`; +} +const GitHubApiDownloadOptions = { + headers: { Accept: 'application/vnd.github.v3+json', 'User-Agent': 'SpyglassMC' }, +}; +function getCacheOptionsBasedOnGitHubCommitSha(owner, repo, ref) { + return { + checksumExtension: '.commit-sha', + checksumJob: { + uri: `https://api.github.com/repos/${owner}/${repo}/git/${ref}`, + transformer: (buffer) => { + const response = JSON.parse(bufferToString(buffer)); + if (Array.isArray(response)) { + return response[0].object.sha; + } + else if (response.message === undefined) { + return response.object.sha; + } + else { + throw new Error(response.message); + } + }, + options: GitHubApiDownloadOptions, + ttl: DownloaderTtl, + }, + }; +} +/** + * Download data from a GitHub repository with tags corresponding to Minecraft versions. + * The downloaded data will be cached based on the commit SHA of the respective tag. + * + * If `isLatest` if `true`, instead of finding the tag corresponding to the given version, the default branch will be used. + * + * @returns The URI to the `.tar.gz` file. + */ +async function downloadGitHubRepo({ defaultBranch, downloader, getTag, repo, isLatest, owner, version, suffix }) { + const ref = getGitRef({ defaultBranch, getTag, isLatest, version }); + const out = {}; + await downloader.download({ + id: `mc-je/${version}/${repo}${suffix ?? ''}.tar.gz`, + uri: `https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`, + transformer: (b) => b, + cache: getCacheOptionsBasedOnGitHubCommitSha(owner, repo, ref), + options: GitHubApiDownloadOptions, + ttl: DownloaderTtl, + }, out); + return out.cacheUri; +} +/* istanbul ignore next */ +/** + * @throws Network/file system errors. + * + * @returns + * - `startDepth`: The amount of level to skip when unzipping the tarball. + * - `uri`: URI to the `.tar.gz` file. + */ +async function getVanillaDatapack(downloader, version, isLatest) { + const uri = await downloadGitHubRepo({ + defaultBranch: 'data', + downloader, + getTag: (v) => `${v}-data`, + owner: 'misode', + repo: 'mcmeta', + isLatest, + version, + }); + return { info: { startDepth: 1 }, uri }; +} +/* istanbul ignore next */ +/** + * @throws Network/file system errors. + * + * @returns + * - `startDepth`: The amount of level to skip when unzipping the tarball. + * - `uri`: URI to the `.tar.gz` file. + */ +async function getVanillaResourcepack(downloader, version, isLatest) { + const uri = await downloadGitHubRepo({ + defaultBranch: 'assets-tiny', + downloader, + getTag: (v) => `${v}-assets-tiny`, + owner: 'misode', + repo: 'mcmeta', + isLatest, + version, + suffix: '-assets', + }); + return { info: { startDepth: 1 }, uri }; +} +/** + * @throws Network/file system errors. + * + * @returns + * - `startDepth`: The amount of level to skip when unzipping the tarball. + * - `uri`: URI to the `.tar.gz` file. + */ +async function getVanillaMcdoc(downloader) { + const owner = 'SpyglassMC'; + const repo = 'vanilla-mcdoc'; + const ref = 'refs/heads/main'; + const out = {}; + await downloader.download({ + id: 'mc-je/vanilla-mcdoc.tar.gz', + uri: `https://api.github.com/repos/${owner}/${repo}/tarball/${ref}`, + transformer: (b) => b, + cache: getCacheOptionsBasedOnGitHubCommitSha(owner, repo, ref), + options: GitHubApiDownloadOptions, + ttl: DownloaderTtl, + }, out); + return { info: { startDepth: 1 }, uri: out.cacheUri }; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/binder/index.js + + + +const Resources = new Map(); +function resource(path, resource = {}) { + const previous = Resources.get(path) ?? []; + Resources.set(path, [ + ...previous, + { + path, + category: resource.category ?? path, + ext: resource.ext ?? '.json', + pack: resource.pack ?? 'data', + ...resource, + }, + ]); +} +// Pre-1.21 data pack plurals +resource('advancements', { category: 'advancement', until: '1.21' }); +resource('functions', { category: 'function', until: '1.21', ext: '.mcfunction' }); +resource('item_modifiers', { category: 'item_modifier', since: '1.17', until: '1.21' }); +resource('loot_tables', { category: 'loot_table', until: '1.21' }); +resource('predicates', { category: 'predicate', until: '1.21' }); +resource('recipes', { category: 'recipe', until: '1.21' }); +resource('structures', { category: 'structure', until: '1.21', ext: '.nbt' }); +resource('tags/blocks', { category: 'tag/block', until: '1.21' }); +resource('tags/entity_types', { category: 'tag/entity_type', until: '1.21' }); +resource('tags/fluids', { category: 'tag/fluid', until: '1.21' }); +resource('tags/functions', { category: 'tag/function', until: '1.21' }); +resource('tags/game_events', { category: 'tag/game_event', since: '1.17', until: '1.21' }); +resource('tags/items', { category: 'tag/item', until: '1.21' }); +// Post-1.21 data pack non-plurals +resource('advancement', { since: '1.21' }); +resource('function', { since: '1.21', ext: '.mcfunction' }); +resource('item_modifier', { since: '1.21' }); +resource('loot_table', { since: '1.21' }); +resource('predicate', { since: '1.21' }); +resource('recipe', { since: '1.21' }); +resource('structure', { since: '1.21', ext: '.nbt' }); +resource('tags/block', { category: 'tag/block', since: '1.21' }); +resource('tags/entity_type', { category: 'tag/entity_type', since: '1.21' }); +resource('tags/fluid', { category: 'tag/fluid', since: '1.21' }); +resource('tags/function', { category: 'tag/function', since: '1.21' }); +resource('tags/game_event', { category: 'tag/game_event', since: '1.21' }); +resource('tags/item', { category: 'tag/item', since: '1.21' }); +// Data pack +resource('banner_pattern', { since: '1.20.5' }); +resource('cat_variant', { since: '1.21.5' }); +resource('chat_type', { since: '1.19' }); +resource('chicken_variant', { since: '1.21.5' }); +resource('cow_variant', { since: '1.21.5' }); +resource('damage_type', { since: '1.19.4' }); +resource('dialog', { since: '1.21.6' }); +resource('enchantment', { since: '1.21' }); +resource('enchantment_provider', { since: '1.21' }); +resource('frog_variant', { since: '1.21.5' }); +resource('instrument', { since: '1.21.2' }); +resource('jukebox_song', { since: '1.21' }); +resource('painting_variant', { since: '1.21' }); +resource('pig_variant', { since: '1.21.5' }); +resource('test_instance', { since: '1.21.5' }); +resource('test_environment', { since: '1.21.5' }); +resource('trial_spawner', { since: '1.21.2' }); +resource('trim_pattern', { since: '1.19.4' }); +resource('trim_material', { since: '1.19.4' }); +resource('wolf_sound_variant', { since: '1.21.5' }); +resource('wolf_variant', { since: '1.20.5' }); +// Worldgen +resource('dimension', { since: '1.16' }); +resource('dimension_type', { since: '1.16' }); +resource('worldgen/biome', { since: '1.16.2' }); +resource('worldgen/configured_carver', { since: '1.16.2' }); +resource('worldgen/configured_feature', { since: '1.16.2' }); +resource('worldgen/configured_structure_feature', { since: '1.16.2', until: '1.19' }); +resource('worldgen/density_function', { since: '1.18.2' }); +resource('worldgen/flat_level_generator_preset', { since: '1.19' }); +resource('worldgen/multi_noise_biome_source_parameter_list', { since: '1.19.4' }); +resource('worldgen/noise', { since: '1.18' }); +resource('worldgen/noise_settings', { since: '1.16.2' }); +resource('worldgen/placed_feature', { since: '1.18' }); +resource('worldgen/processor_list', { since: '1.16.2' }); +resource('worldgen/configured_surface_builder', { since: '1.16.2', until: '1.18' }); +resource('worldgen/structure', { since: '1.19' }); +resource('worldgen/structure_set', { since: '1.18.2' }); +resource('worldgen/template_pool', { since: '1.16.2' }); +resource('worldgen/world_preset', { since: '1.19' }); +// Tags +const NonTaggableRegistries = new Set([ + // Legacy plural paths + 'block', + 'fluid', + 'function', + 'game_event', + 'item', + // Removed before 1.18 + 'worldgen/block_placer_type', + 'worldgen/surface_builder', +]); +for (const registry of TaggableResourceLocationCategories) { + if (NonTaggableRegistries.has(registry)) { + continue; + } + resource(`tags/${registry}`, { category: `tag/${registry}`, since: '1.18' }); +} +// Resource pack +resource('atlases', { pack: 'assets', category: 'atlas', since: '1.19.3' }); +resource('blockstates', { pack: 'assets', category: 'block_definition' }); +resource('equipment', { pack: 'assets', since: '1.21.4' }); +resource('font', { pack: 'assets', since: '1.16' }); +resource('font', { pack: 'assets', category: 'font/ttf', since: '1.16', ext: '.ttf' }); +resource('font', { pack: 'assets', category: 'font/otf', since: '1.16', ext: '.otf' }); +resource('font', { pack: 'assets', category: 'font/unihex', since: '1.20', ext: '.zip' }); +resource('items', { pack: 'assets', category: 'item_definition', since: '1.21.4' }); +resource('lang', { pack: 'assets' }); +resource('models', { pack: 'assets', category: 'model' }); +resource('models/equipment', { + pack: 'assets', + category: 'equipment', + since: '1.21.2', + until: '1.21.4', +}); +resource('particles', { pack: 'assets', category: 'particle' }); +resource('post_effect', { pack: 'assets', since: '1.21.2' }); +resource('shaders/post', { pack: 'assets', category: 'post_effect', until: '1.21.2' }); +resource('shaders', { pack: 'assets', category: 'shader' }); +resource('shaders', { pack: 'assets', category: 'shader/fragment', ext: '.fsh' }); +resource('shaders', { pack: 'assets', category: 'shader/vertex', ext: '.vsh' }); +resource('sounds', { pack: 'assets', category: 'sound', ext: '.ogg' }); +resource('textures', { pack: 'assets', category: 'texture', ext: '.png' }); +resource('textures', { pack: 'assets', category: 'texture_meta', ext: '.png.mcmeta' }); +resource('waypoint_style', { pack: 'assets', since: '1.21.6' }); +resource('lang', { pack: 'assets', category: 'lang/deprecated', identifier: 'deprecated' }); +resource('', { pack: 'assets', category: 'sounds', identifier: 'sounds' }); +resource('', { + pack: 'assets', + category: 'regional_compliancies', + identifier: 'regional_compliancies', +}); +resource('', { pack: 'assets', category: 'gpu_warnlist', identifier: 'gpu_warnlist' }); +function* getResources() { + for (const resources of Resources.values()) { + yield* resources; + } + return undefined; +} +function* getRels(uri, rootUris) { + yield* fileUtil.getRels(uri, rootUris); + const parts = uri.split('/'); + for (let i = parts.length - 2; i >= 0; i--) { + if (parts[i] === 'data' || parts[i] === 'assets') { + yield parts.slice(i).join('/'); + } + } + return undefined; +} +function* getRoots(uri, rootUris) { + yield* fileUtil.getRoots(uri, rootUris); + const parts = uri.split('/'); + for (let i = parts.length - 2; i >= 0; i--) { + if (parts[i] === 'data' || parts[i] === 'assets') { + yield `${parts.slice(0, i).join('/')}/`; + } + } + return undefined; +} +function getCandidateResourcesForRel(rel) { + const parts = rel.split('/'); + if (parts.length < 3) { + return []; + } + const [pack, namespace, ...rest] = parts; + if (pack !== 'data' && pack !== 'assets') { + return []; + } + const candidateResources = []; + if (rest.length === 1) { + const resources = Resources.get(''); + for (const res of resources ?? []) { + if (res.pack !== pack) { + continue; + } + let identifier = rest[0]; + if (!identifier.endsWith(res.ext)) { + continue; + } + identifier = identifier.slice(0, -res.ext.length); + if (res.identifier && identifier !== res.identifier) { + continue; + } + candidateResources.push({ ...res, namespace, identifier }); + } + } + for (let i = 1; i < rest.length; i += 1) { + const resources = Resources.get(rest.slice(0, i).join('/')); + for (const res of resources ?? []) { + if (res.pack !== pack) { + continue; + } + let identifier = rest.slice(i).join('/'); + if (!identifier.endsWith(res.ext)) { + continue; + } + identifier = identifier.slice(0, -res.ext.length); + if (res.identifier && identifier !== res.identifier) { + continue; + } + candidateResources.push({ ...res, namespace, identifier }); + } + } + return candidateResources; +} +function dissectUri(uri, ctx) { + const rels = getRels(uri, ctx.roots); + const release = ctx.project['loadedVersion']; + if (!release) { + return undefined; + } + for (const rel of rels) { + const candidateResources = getCandidateResourcesForRel(rel); + if (candidateResources.length === 0) { + continue; + } + // Finding the last, because that will be the deepest match + let res = candidateResources.findLast((res) => matchVersion(release, res.since, res.until)); + if (res !== undefined) { + return { ok: true, ...res, expected: undefined }; + } + // Try to find the expected path that matches the current version + res = candidateResources[candidateResources.length - 1]; + let expected = undefined; + for (const [path, others] of Resources) { + for (const other of others) { + if (other.category !== res.category) { + continue; + } + if (matchVersion(release, other.since, other.until)) { + expected = path; + break; + } + } + } + return { ok: false, ...res, expected }; + } + return undefined; +} +const binder_uriBinder = (uris, ctx) => { + for (const uri of uris) { + const parts = dissectUri(uri, ctx); + if (parts) { + ctx.symbols.query(uri, parts.category, `${parts.namespace}:${parts.identifier}`).enter({ + usage: { type: 'definition' }, + }); + } + } +}; +function registerCustomResources(config) { + for (const [path, res] of Object.entries(config.env.customResources)) { + resource(path, { ...res, category: res.category }); + } +} +function matchVersion(target, since, until) { + if (since && ReleaseVersion.cmp(target, since) < 0) { + return false; + } + if (until && ReleaseVersion.cmp(until, target) <= 0) { + return false; + } + return true; +} +function reportDissectError(realPath, expectedPath, ctx) { + const release = ctx.project['loadedVersion']; + if (!release) { + return; + } + if (expectedPath) { + ctx.err.report(localize('java-edition.binder.wrong-folder', localeQuote(realPath), release, localeQuote(expectedPath)), Range.Beginning, 0 /* ErrorSeverity.Hint */); + } + else { + ctx.err.report(localize('java-edition.binder.wrong-version', localeQuote(realPath), release), Range.Beginning, 0 /* ErrorSeverity.Hint */); + } +} +function uriBuilder(resources) { + return (identifier, ctx) => { + const root = getRoots(ctx.doc.uri, ctx.roots).next().value; + if (!root) { + return undefined; + } + const release = ctx.project['loadedVersion']; + if (!release) { + return undefined; + } + const resource = resources.find(r => matchVersion(release, r.since, r.until)); + if (!resource) { + return undefined; + } + const sepIndex = identifier.indexOf(':'); + const namespace = sepIndex > 0 ? identifier.slice(0, sepIndex) : 'minecraft'; + const path = identifier.slice(sepIndex + 1); + return `${root}${resource.pack}/${namespace}/${resource.path}/${path}${resource.ext}`; + }; +} +function registerUriBuilders(meta) { + const resourcesByCategory = new Map(); + for (const resource of getResources()) { + resourcesByCategory.set(resource.category, [ + ...resourcesByCategory.get(resource.category) ?? [], + resource, + ]); + } + for (const [category, resources] of resourcesByCategory.entries()) { + meta.registerUriBuilder(category, uriBuilder(resources)); + } +} +/** + * Returns true for JSON file URIs that belong to any known resource category. No version check is + * performed as we would like to provide errors even for files in the wrong folder or files for the + * wrong version. + */ +const jsonUriPredicate = (uri, ctx) => { + const rels = [...getRels(uri, ctx.roots)]; + return rels.some((rel) => getCandidateResourcesForRel(rel).length > 0); +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/binder/index.js + + +function bindDeprecated(node, ctx) { + const renamed = node.children.find(p => p.key?.value === 'renamed')?.value; + if (JsonObjectNode.is(renamed)) { + for (const pair of renamed.children) { + if (JsonStringNode.is(pair.value)) { + const range = Range.translate(pair.value.range, 1, -1); + ctx.symbols.query(ctx.doc, 'translation_key', pair.value.value) + .enter({ + usage: { type: 'definition', range, fullRange: pair }, + }); + } + } + } +} +function bindLanguage(node, ctx) { + const isEnglish = ctx.doc.uri.endsWith('/en_us.json'); + for (const pair of node.children) { + if (pair.key) { + const desc = JsonStringNode.is(pair.value) ? pair.value.value : undefined; + const range = Range.translate(pair.key.range, 1, -1); + ctx.symbols.query(ctx.doc, 'translation_key', pair.key.value) + .enter({ + data: { desc: isEnglish ? desc : undefined }, + usage: { type: 'definition', range, fullRange: pair }, + }); + } + } +} +const binder_file = (node, ctx) => { + if (ctx.doc.uri.match(/\/lang\/[a-z_]+.json$/)) { + const child = node.children[0]; + if (JsonObjectNode.is(child)) { + if (ctx.doc.uri.endsWith('/deprecated.json')) { + bindDeprecated(child, ctx); + } + else { + bindLanguage(child, ctx); + } + } + } +}; +function binder_register(meta) { + meta.registerBinder('json:file', binder_file); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/checker/index.js + + +function createTagDefinition(registry) { + const id = { + kind: 'tree', + values: { + registry: { kind: 'literal', value: { kind: 'string', value: registry } }, + tags: { kind: 'literal', value: { kind: 'string', value: 'allowed' } }, + }, + }; + return { + kind: 'concrete', + child: { kind: 'reference', path: '::java::data::tag::Tag' }, + typeArgs: [{ kind: 'string', attributes: [{ name: 'id', value: id }] }], + }; +} +const checker_file = (node, ctx) => { + const child = node.children[0]; + if (ctx.doc.uri.endsWith('/pack.mcmeta')) { + const type = { kind: 'reference', path: '::java::pack::Pack' }; + return index(type)(child, ctx); + } + const parts = dissectUri(ctx.doc.uri, ctx); + if (parts?.ok) { + if (parts.category.startsWith('tag/')) { + const type = createTagDefinition(parts.category.slice(4)); + return index(type)(child, ctx); + } + const type = { + kind: 'dispatcher', + registry: 'minecraft:resource', + parallelIndices: [{ kind: 'static', value: parts.category }], + }; + return index(type, { discardDuplicateKeyErrors: true })(child, ctx); + } + else if (parts?.ok === false) { + reportDissectError(parts.path, parts.expected, ctx); + } +}; +function json_checker_register(meta) { + meta.registerChecker('json:file', checker_file); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/completer/index.js + +const textureSlot = (node, ctx) => { + const slot = node.slot ?? SymbolNode.mock(node, { + category: 'texture_slot', + usageType: node.kind === 'definition' ? 'definition' : 'reference', + }); + const slotItems = completer_builtin_symbol(slot, ctx); + if (node.kind === 'definition') { + return slotItems; + } + if (node.kind === 'reference') { + return slotItems.map(item => ({ + ...item, + range: node.range, + label: '#' + item.label, + insertText: '#' + (item.insertText ?? item.label), + })); + } + const id = node.id ?? ResourceLocationNode.mock(node, { category: 'texture' }); + return completer_builtin_resourceLocation(id, ctx); +}; +function json_completer_register(meta) { + meta.registerCompleter('java_edition:texture_slot', textureSlot); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/parser/index.js + + +function textureSlotParser(kind) { + return (src, ctx) => { + const start = src.cursor; + const ans = { + type: 'java_edition:texture_slot', + range: Range.create(start), + kind, + children: [], + }; + if (kind === 'definition') { + const slot = symbol_symbol({ category: 'texture_slot', usageType: 'definition' })(src, ctx); + ans.children.push(slot); + ans.slot = slot; + } + else if (src.tryPeek('#')) { + ans.children.push(literal('#')(src, ctx)); + const slot = symbol_symbol({ category: 'texture_slot', usageType: 'reference' })(src, ctx); + ans.children.push(slot); + ans.slot = slot; + } + else if (kind === 'reference') { + ctx.err.report(localize('expected', localeQuote('#')), src); + } + else { + const id = resourceLocation_resourceLocation({ category: 'texture', usageType: 'reference' })(src, ctx); + ans.children.push(id); + ans.id = id; + } + ans.range = Range.create(start, src); + return ans; + }; +} +const translationValueParser = (src, ctx) => { + const start = src.cursor; + const ans = { + type: 'java_edition:translation_value', + range: Range.create(start), + children: [], + value: '', + }; + while (src.canRead()) { + src.skipUntilOrEnd('%'); + const argStart = src.cursor; + if (src.trySkip('%')) { + if (src.trySkip('%')) { + const token = src.sliceToCursor(argStart); + ans.children.push({ + type: 'literal', + range: Range.create(argStart, src), + options: { pool: [token], colorTokenType: 'escape' }, + value: token, + }); + continue; + } + let hasInteger = false; + while (src.canRead() && Source.isDigit(src.peek())) { + src.skip(); + hasInteger = true; + } + if (hasInteger && !src.trySkip('$')) { + ctx.err.report(localize('java-edition.translation-value.percent-escape-hint', localize('expected', localeQuote('$'))), src); + } + if (!src.trySkip('s')) { + ctx.err.report(localize('java-edition.translation-value.percent-escape-hint', localize('expected', localeQuote('s'))), src); + } + const token = src.sliceToCursor(argStart); + ans.children.push({ + type: 'literal', + range: Range.create(argStart, src), + options: { pool: [token] }, + value: token, + }); + } + } + ans.value = src.sliceToCursor(start); + ans.range = Range.create(start, src); + return ans; +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/mcdocAttributes.js + + + + +const validator = validator_namespaceObject; +const criterionValidator = validator.alternatives(validator.tree({ + definition: validator.boolean, +}), () => ({ definition: false })); +const textureSlotValidator = validator.alternatives(validator.tree({ + kind: validator.options('definition', 'value', 'reference'), +}), () => ({ kind: 'value' })); +const translationKeyValidator = validator.alternatives(validator.tree({ + definition: validator.boolean, +}), () => ({ definition: false })); +function mcdocAttributes_registerMcdocAttributes(meta) { + registerAttribute(meta, 'criterion', criterionValidator, { + stringParser: (config, _, ctx) => { + const parts = dissectUri(ctx.doc.uri, ctx); + if (!parts || !parts.ok || parts.category !== 'advancement') { + return undefined; + } + return symbol_symbol({ + category: 'advancement', + subcategory: 'criterion', + parentPath: [`${parts.namespace}:${parts.identifier}`], + usageType: config.definition ? 'definition' : 'reference', + }); + }, + stringMocker: (config, _, ctx) => { + const parts = dissectUri(ctx.doc.uri, ctx); + if (!parts || !parts.ok || parts.category !== 'advancement') { + return undefined; + } + return SymbolNode.mock(ctx.offset, { + category: 'advancement', + subcategory: 'criterion', + parentPath: [`${parts.namespace}:${parts.identifier}`], + }); + }, + }); + registerAttribute(meta, 'texture_slot', textureSlotValidator, { + stringParser: (config, _, ctx) => { + return textureSlotParser(config.kind); + }, + stringMocker: (config, _, ctx) => { + return { + type: 'java_edition:texture_slot', + range: Range.create(ctx.offset), + kind: config.kind, + children: [], + }; + }, + }); + registerAttribute(meta, 'translation_key', translationKeyValidator, { + stringParser: (config, _, ctx) => { + return symbol_symbol({ + category: 'translation_key', + usageType: config.definition ? 'definition' : 'reference', + }); + }, + stringMocker: (config, _, ctx) => { + return SymbolNode.mock(ctx.offset, { + category: 'translation_key', + usageType: config.definition ? 'definition' : 'reference', + }); + }, + }); + registerAttribute(meta, 'translation_value', () => undefined, { + stringParser: () => translationValueParser, + }); +} +//# sourceMappingURL=mcdocAttributes.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/json/index.js +/* istanbul ignore file */ + + + + +const json_initialize = (ctx) => { + mcdocAttributes_registerMcdocAttributes(ctx.meta); + binder_register(ctx.meta); + json_checker_register(ctx.meta); + json_completer_register(ctx.meta); +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcdocAttributes.js + + + +const mcdocAttributes_validator = validator_namespaceObject; +const gameRuleValidator = mcdocAttributes_validator.tree({ + type: mcdocAttributes_validator.options('boolean', 'int'), +}); +function lib_mcdocAttributes_registerMcdocAttributes(meta, commands, release) { + registerAttribute(meta, 'since', mcdocAttributes_validator.string, { + filterElement: (config, ctx) => { + if (!config.startsWith('1.')) { + ctx.logger.warn(`Invalid mcdoc attribute for "since": ${config}`); + return true; + } + return ReleaseVersion.cmp(release, config) >= 0; + }, + }); + registerAttribute(meta, 'until', mcdocAttributes_validator.string, { + filterElement: (config, ctx) => { + if (!config.startsWith('1.')) { + ctx.logger.warn(`Invalid mcdoc attribute for "until": ${config}`); + return true; + } + return ReleaseVersion.cmp(release, config) < 0; + }, + }); + registerAttribute(meta, 'deprecated', mcdocAttributes_validator.optional(mcdocAttributes_validator.string), { + mapField: (config, field, ctx) => { + if (config === undefined) { + return { ...field, deprecated: true }; + } + if (!config.startsWith('1.')) { + ctx.logger.warn(`Invalid mcdoc attribute for "deprecated": ${config}`); + return field; + } + if (ReleaseVersion.cmp(release, config) >= 0) { + return { ...field, deprecated: true }; + } + return field; + }, + }); + const gameRuleNode = commands.children.gamerule?.children; + if (gameRuleNode) { + const [boolGameRules, intGameRules] = ['brigadier:bool', 'brigadier:integer'].map((type) => Object.entries(gameRuleNode).flatMap(([key, node]) => node.children?.value?.type === 'argument' && node.children.value.parser === type + ? [key] + : [])); + registerAttribute(meta, 'game_rule', gameRuleValidator, { + stringParser: (config, _, ctx) => { + return literal({ + pool: config.type === 'boolean' ? boolGameRules : intGameRules, + colorTokenType: 'string', + }); + }, + stringMocker: (config, _, ctx) => { + return LiteralNode.mock(ctx.offset, { + pool: config.type === 'boolean' ? boolGameRules : intGameRules, + }); + }, + }); + } +} +function registerPackFormatAttribute(meta, versions, packs) { + const dataFormats = new Map(); + const assetsFormats = new Map(); + if (versions[0]?.type !== 'release') { + dataFormats.set(versions[0].data_pack_version, [NEXT_RELEASE_VERSION]); + assetsFormats.set(versions[0].resource_pack_version, [NEXT_RELEASE_VERSION]); + } + for (const version of versions) { + if (version.type === 'release') { + dataFormats.set(version.data_pack_version, [ + ...dataFormats.get(version.data_pack_version) ?? [], + version.id, + ]); + assetsFormats.set(version.resource_pack_version, [ + ...assetsFormats.get(version.resource_pack_version) ?? [], + version.id, + ]); + } + } + function getFormats(packMcmetaUri) { + const thisPack = packs.find(p => fileUtil.isSubUriOf(packMcmetaUri, p.packRoot)); + return thisPack?.type === 'assets' ? assetsFormats : dataFormats; + } + registerAttribute(meta, 'pack_format', () => undefined, { + numericCompleter: (_, ctx) => { + return [...getFormats(ctx.doc.uri).entries()].map(([k, v], i) => ({ + range: Range.create(ctx.offset), + label: `${k}`, + labelSuffix: ` (${v[0]})`, + sortText: `${i}`.padStart(4, '0'), + })); + }, + }); +} +//# sourceMappingURL=mcdocAttributes.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/colorizer/macro.js + +const macro = (node, ctx) => { + const tokens = []; + for (const child of node.children) { + if (child.type === 'mcfunction:macro/prefix') { + tokens.push(ColorToken.create(child.range, 'literal')); + } + else if (child.type === 'mcfunction:macro/other') { + tokens.push(ColorToken.create(child.range, 'string')); + } + else { + const { start, end } = child.range; + // $( + tokens.push(ColorToken.create(Range.create(start, start + 2), 'literal')); + // Key + tokens.push(ColorToken.create(Range.create(start + 2, end - 1), 'property')); + // ) + tokens.push(ColorToken.create(Range.create(end - 1, end), 'literal')); + } + } + return tokens; +}; +//# sourceMappingURL=macro.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/colorizer/index.js + + +function mcfunction_lib_colorizer_register(meta) { + meta.registerColorizer('mcfunction:command_child/literal', builtin_literal); + meta.registerColorizer('mcfunction:command_child/trailing', error); + meta.registerColorizer('mcfunction:macro', macro); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/command.js + +var CommandNode; +(function (CommandNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'mcfunction:command'; + } + CommandNode.is = is; + function mock(range, options = {}) { + return { type: 'mcfunction:command', range: Range.get(range), children: [], options }; + } + CommandNode.mock = mock; +})(CommandNode || (CommandNode = {})); +var CommandChildNode; +(function (CommandChildNode) { + function is(node) { + return node.type === 'mcfunction:command_child'; + } + CommandChildNode.is = is; +})(CommandChildNode || (CommandChildNode = {})); +var LiteralCommandChildNode; +(function (LiteralCommandChildNode) { + function is(node) { + return (node?.type + === 'mcfunction:command_child/literal'); + } + LiteralCommandChildNode.is = is; +})(LiteralCommandChildNode || (LiteralCommandChildNode = {})); +//# sourceMappingURL=command.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/entry.js +var McfunctionNode; +(function (McfunctionNode) { + /* istanbul ignore next */ + function is(node) { + return node?.type === 'mcfunction:entry'; + } + McfunctionNode.is = is; +})(McfunctionNode || (McfunctionNode = {})); +//# sourceMappingURL=entry.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/macro.js + +var MacroNode; +(function (MacroNode) { + /* istanbul ignore next */ + function is(obj) { + return obj?.type === 'mcfunction:macro'; + } + MacroNode.is = is; + function mock(range) { + return { type: 'mcfunction:macro', range: Range.get(range), children: [] }; + } + MacroNode.mock = mock; +})(MacroNode || (MacroNode = {})); +//# sourceMappingURL=macro.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/node/index.js + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/tree/util.js +function redirect(rootTreeNode, path) { + return path.reduce((p, c) => p?.children?.[c], rootTreeNode); +} +function resolveParentTreeNode(parentTreeNode, rootTreeNode, parentPath) { + if (parentTreeNode?.redirect) { + return { + treeNode: redirect(rootTreeNode, parentTreeNode.redirect), + path: [...parentTreeNode.redirect], + }; + } + else if (parentTreeNode && !parentTreeNode.children && !parentTreeNode.executable) { + // The `execute.run` literal tree node doesn't have any property. + // We should use children from the root tree node in this case. + return { treeNode: rootTreeNode, path: [] }; + } + else { + return { treeNode: parentTreeNode, path: parentPath }; + } +} +/** + * Categorize command tree children to literal entries and argument entries. + */ +function categorizeTreeChildren(children) { + const ans = { + literalTreeNodes: [], + argumentTreeNodes: [], + }; + for (const e of Object.entries(children)) { + /* istanbul ignore else */ + if (e[1].type === 'literal') { + ans.literalTreeNodes.push(e); + } + else if (e[1].type === 'argument') { + ans.argumentTreeNodes.push(e); + } + } + return ans; +} +//# sourceMappingURL=util.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/completer/index.js + + + +/** + * @param getMockNodes A function that returns a mock AST Node from given {@link ArgumentTreeNode}. These mock nodes + * will be used for completing the argument. + */ +function completer_entry(tree, getMockNodes) { + return (node, ctx) => { + const childNode = AstNode.findChild(node, ctx.offset, true); + if (CommandNode.is(childNode)) { + return command(tree, getMockNodes)(childNode ?? CommandNode.mock(ctx.offset), ctx); + } + else { + return []; + } + }; +} +function command(tree, getMockNodes) { + return (node, ctx) => { + const index = AstNode.findChildIndex(node, ctx.offset, true); + const selectedChildNode = node.children[index] + ?.children[0]; + if (selectedChildNode) { + return dispatch(selectedChildNode, ctx); + } + const lastChildNode = AstNode.findLastChild(node, ctx.offset); + if (!lastChildNode) { + return Object.keys(tree.children ?? {}).map((v) => CompletionItem.create(v, ctx.offset, { kind: 14 /* core.CompletionKind.Keyword */ })); + } + const treePath = lastChildNode.path; + const { treeNode: parentTreeNode } = resolveParentTreeNode(redirect(tree, treePath), tree); + if (!parentTreeNode?.children) { + return []; + } + const { literalTreeNodes, argumentTreeNodes } = categorizeTreeChildren(parentTreeNode.children); + const lastIndex = node.children.indexOf(lastChildNode); + const prevNodes = node.children.slice(0, lastIndex + 1); + return [ + ...literalTreeNodes.map(([name]) => CompletionItem.create(name, ctx.offset, { kind: 14 /* core.CompletionKind.Keyword */ })), + ...argumentTreeNodes.flatMap(([_name, treeNode]) => Arrayable.toArray(getMockNodes(treeNode, prevNodes, ctx)).flatMap((n) => dispatch(n, ctx))), + ]; + }; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/argument.js +function argumentTreeNodeToString(name, treeNode) { + const parserName = treeNode.parser.slice(treeNode.parser.indexOf(':') + 1); + return `<${name}: ${parserName}>`; +} +//# sourceMappingURL=argument.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/common.js + + +/** + * A parser that takes a continuous sequence of spaces and tabs, and marks an error if it is not a single space. + * + * @returns The accepted spaces and tabs. + */ +const common_sep = (src, ctx) => { + const start = src.cursor; + const ans = src.readSpace(); + if (ans !== ' ') { + ctx.err.report(localize('expected', localize('mcfunction.parser.sep', localeQuote(' '))), Range.create(start, src)); + } + return ans; +}; +//# sourceMappingURL=common.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/literal.js + + +function literal_literal(names, isRoot = false) { + const options = { + pool: names, + colorTokenType: isRoot ? 'keyword' : 'literal', + }; + return (src, ctx) => { + const start = src.cursor; + const value = src.readUntil(' ', '\r', '\n'); + if (!value.length) { + return Parser_Failure; + } + const ans = { + type: 'mcfunction:command_child/literal', + range: Range.create(start, src), + options, + value, + }; + if (!names.includes(value)) { + ctx.err.report(localize('expected', names), ans); + } + return ans; + }; +} +//# sourceMappingURL=literal.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/command.js + + + + + + +/** + * @returns A parser that always takes a whole line (excluding line turn characters) and tries to parse it as a command. + */ +function command_command(tree, argument, options = {}) { + return (src, ctx) => { + const ans = { + type: 'mcfunction:command', + range: Range.create(src), + children: [], + options, + }; + const start = src.cursor; + const innerStart = src.innerCursor; + if (src.trySkip('/')) { + ans.slash = Range.create(start, src.cursor); + if (!options.slash) { + ctx.err.report(localize('mcfunction.parser.leading-slash.unexpected'), ans.slash, 3 /* core.ErrorSeverity.Error */, { + codeAction: { + title: localize('code-action.remove-leading-slash'), + isPreferred: true, + changes: [ + { + type: 'edit', + range: ans.slash, + text: '', + }, + ], + }, + }); + } + } + else if (options.slash === 'required') { + ctx.err.report(localize('expected', localize('mcfunction.parser.leading-slash')), Range.create(start, start + 1), 3 /* core.ErrorSeverity.Error */, { + codeAction: { + title: localize('code-action.add-leading-slash'), + isPreferred: true, + changes: [ + { + type: 'edit', + range: Range.create(start), + text: '/', + }, + ], + }, + }); + } + command_dispatch(ans.children, src, ctx, [], tree, tree, argument); + if (src.canReadInLine()) { + // There is trailing string after the command. + const node = trailing(src, ctx); + ans.children.push({ + type: 'mcfunction:command_child', + range: node.range, + children: [node], + path: [], + }); + } + ans.range.end = src.cursor; + if (options.maxLength) { + const commandLength = src.innerCursor - innerStart; + if (commandLength > options.maxLength) { + ctx.err.report(localize('mcfunction.parser.command-too-long', commandLength, options.maxLength), ans); + } + } + return ans; + }; +} +/** + * Dispatch and parse based on the specified command tree node's children. + * + * @param ans An array where child nodes will be pushed into. + */ +function command_dispatch(ans, src, ctx, path, rootTreeNode, parentTreeNode, argument) { + // Convention: suffix `Node` is for AST nodes; `TreeNode` is for command tree nodes. + function _dispatch(path, parentTreeNode) { + const { treeNode: parent, path: resolvedPath } = resolveParentTreeNode(parentTreeNode, rootTreeNode, path); + path = resolvedPath; + const children = parent?.children; + if (!children) { + return false; + } + const { literalTreeNodes, argumentTreeNodes } = categorizeTreeChildren(children); + const argumentParsers = argumentTreeNodes.map(([name, treeNode]) => ({ name, parser: argument(treeNode, ans) ?? unknown(treeNode) })); + const literalParser = literalTreeNodes.length + ? literal_literal(literalTreeNodes.map(([name, _treeNode]) => name), parent.type === 'root') + : undefined; + const parsers = [ + ...(literalParser ? [literalParser] : []), + ...argumentParsers.map((v) => v.parser), + ]; + const out = { index: 0 }; + if (parsers.length === 0) { + return false; + } + const parser = parsers.length > 1 ? util_any(parsers, out) : parsers[0]; + const result = parser(src, ctx); + if (result !== Parser_Failure) { + const takenName = argumentParsers[out.index - (literalParser ? 1 : 0)]?.name + ?? result.value; + const childPath = [...path, takenName]; + ans.push({ + type: 'mcfunction:command_child', + range: result.range, + children: [result], + path: childPath, + }); + const childTreeNode = children[takenName]; + if (!childTreeNode) { + return false; + } + const requiredPermissionLevel = childTreeNode.permission ?? 2; + if (ctx.config.env.permissionLevel < requiredPermissionLevel) { + ctx.err.report(localize('mcfunction.parser.no-permission', requiredPermissionLevel, ctx.config.env.permissionLevel), result); + } + if (result.type === 'mcfunction:command_child/unknown') { + // Encountered an unsupported parser. Stop parsing this command. + return false; + } + if (src.canReadInLine()) { + // Skip command argument separation (a space). + common_sep(src, ctx); + return { childPath, childTreeNode }; + } + else { + // End-of-command. + if (!childTreeNode.executable) { + ctx.err.report(localize('mcfunction.parser.eoc-unexpected'), src); + } + } + } + else { + // Failed to parse as any arguments. + ctx.err.report(localize('expected', treeNodeChildrenToString(children)), Range.create(src)); + } + return false; + } + let result = _dispatch(path, parentTreeNode); + while (result) { + result = _dispatch(result.childPath, result.childTreeNode); + } +} +function unknown(treeNode) { + return (src, ctx) => { + const start = src.cursor; + const value = src.readUntilLineEnd(); + const range = Range.create(start, src); + ctx.err.report(localize('mcfunction.parser.unknown-parser', localeQuote(treeNode.parser)), range, 0 /* core.ErrorSeverity.Hint */); + return { type: 'mcfunction:command_child/unknown', range, value }; + }; +} +const trailing = (src, ctx) => { + const start = src.cursor; + const value = src.readUntilLineEnd(); + const range = Range.create(start, src); + ctx.err.report(localize('mcfunction.parser.trailing', localeQuote(value)), range); + return { type: 'mcfunction:command_child/trailing', range, value }; +}; +function wrapWithBrackets(syntax, executable) { + return executable ? `[${syntax}]` : syntax; +} +function treeNodeChildrenToStringArray(children, executable = false) { + const entries = Object.entries(children).map(([name, treeNode]) => wrapWithBrackets(treeNodeToString(name, treeNode), executable)); + return entries; +} +function treeNodeChildrenToString(children) { + const entries = treeNodeChildrenToStringArray(children); + return entries.length > 5 + ? `${entries.slice(0, 3).join('|')}|...|${entries.slice(-2).join('|')}` + : entries.join('|'); +} +function treeNodeToString(name, treeNode) { + if (treeNode.type === 'argument') { + return argumentTreeNodeToString(name, treeNode); + } + else { + return name; + } +} +//# sourceMappingURL=command.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/macro.js + + +/** + * Parse a macro line. + * @param hasPrefix When false, don't look for a starting '$'. + */ +function macro_macro(hasPrefix = true) { + return (src, ctx) => { + const ans = { + type: 'mcfunction:macro', + range: Range.create(src.cursor), + children: [], + }; + let start = src.cursor; + let hasMacroArgs = false; + if (hasPrefix) { + // Skip the starting '$' + if (src.trySkip('$')) { + ans.children.push({ + type: 'mcfunction:macro/prefix', + range: Range.create(start, src), + }); + start = src.cursor; + } + else { + ctx.err.report(localize('expected', localeQuote('$')), ans); + } + } + while (src.canReadInLine()) { + src.skipUntilOrEnd(LF, CR, '$'); + if (src.peek(2) === '$(') { + hasMacroArgs = true; + // Add the other stuff before this macro key + const other = src.sliceToCursor(start); + if (other.length > 0) { + ans.children.push({ + type: 'mcfunction:macro/other', + range: Range.create(start, src), + value: other, + }); + start = src.cursor; + } + // Parse the macro key + const key = validateMacroArgument(src, ctx, start); + ans.children.push({ + type: 'mcfunction:macro/argument', + range: Range.create(start, src.cursor), + value: key, + }); + start = src.cursor; + } + else { + if (src.peek() === '$') { + src.skip(); + } + if (!src.canReadInLine()) { + // No more macro arguments, add the remaining other stuff + ans.children.push({ + type: 'mcfunction:macro/other', + range: Range.create(start, src), + value: src.sliceToCursor(start), + }); + } + } + } + // A line with no macro arguments is invalid + if (!hasMacroArgs) { + ctx.err.report(localize('expected', localize('mcfunction.parser.macro.at-least-one')), Range.create(start, src)); + } + ans.range.end = src.cursor; + return ans; + }; +} +/** + * Error checking for a macro argument/key. + */ +function validateMacroArgument(src, ctx, start) { + src.skip(2); + const keyStart = src.cursor; + src.skipUntilOrEnd(LF, CR, ')'); + if (src.peek() !== ')') { + // Macro key was not closed + ctx.err.report(localize('expected', localeQuote(')')), Range.create(keyStart, src.cursor)); + } + else if (src.cursor <= keyStart) { + // Encountered $() + ctx.err.report(localize('expected', localize('mcfunction.parser.macro.key')), Range.create(start, src.cursor + 1)); + } + const key = src.sliceToCursor(keyStart); + const matchedInvalid = key.replace(/[a-zA-Z0-9_]*/, ''); + if (matchedInvalid.length > 0) { + ctx.err.report(localize('mcfunction.parser.macro.illegal-key', matchedInvalid.charAt(0)), Range.create(keyStart, src.cursor)); + } + src.skip(); + return key; +} +//# sourceMappingURL=macro.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/entry.js + + + + +function mcfunction(commandTree, argument, options) { + return (src, ctx) => { + const ans = { + type: 'mcfunction:entry', + range: Range.create(src), + children: [], + }; + while (src.skipWhitespace().canReadInLine()) { + let result; + if (src.peek() === '#') { + result = entry_comment(src, ctx); + } + else if (src.peek() === '$') { + const start = src.cursor; + if (options.macros) { + result = macro_macro()(src, ctx); + } + else { + src.skipLine(); + ans.range.end = src.cursor; + result = { + type: 'error', + range: Range.create(start, src), + }; + ctx.err.report(localize('mcfunction.parser.macro.disallowed'), result); + } + } + else { + result = command_command(commandTree, argument, options.commandOptions)(src, ctx); + } + ans.children.push(result); + src.nextLine(); + } + ans.range.end = src.cursor; + return ans; + }; +} +const entry_comment = comment_comment({ singleLinePrefixes: new Set(['#']) }); +const parser_entry_entry = (commandTree, argument, options = {}) => { + const parser = mcfunction(commandTree, argument, options); + return options.lineContinuation ? concatOnTrailingBackslash(parser) : parser; +}; +//# sourceMappingURL=entry.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/parser/index.js + + + + + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/tree/index.js + + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/mcfunction/lib/index.js + + + + + + + +/* istanbul ignore next */ +const mcfunction_lib_initialize = ({ meta }) => { + mcfunction_lib_colorizer_register(meta); + meta.registerCompleter('mcfunction:command_child/literal', completer_builtin_literal); +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/common/index.js + + +/** + * @returns An array of URIs corresponding to the specified resource. + */ +function getUris(category, id, ctx) { + return (ctx.symbols.query(ctx.doc, category, ResourceLocation.lengthen(id)).symbol + ?.definition?.map((v) => v.uri) ?? []); +} +function getTagValues(category, id, ctx) { + const resolveValueNode = (node) => JsonStringNode.is(node) + ? node.value + : node.children.find((n) => n.key?.value === 'id').value.value; + const set = getUris(category, id, ctx).reduce((ans, uri) => { + // const result = ctx.getDocAndNode(uri) + const result = undefined; // FIXME: Use global symbol table to get the result + if (!result || result.node.parserErrors.length || result.node.checkerErrors?.length) { + return ans; + } + // No errors in the node. We can assume it is a semantically correct tag file. + const rootNode = result.node.children[0]; + const replaceNode = rootNode.children.find((n) => n.key?.value === 'replace')?.value; + const valuesNode = rootNode.children.find((n) => n.key?.value === 'values') + ?.value; + const replace = replaceNode?.value; + const values = valuesNode.children.map((n) => ResourceLocation.lengthen(resolveValueNode(n.value))); + if (replace) { + ans = new Set(); + } + for (const value of values) { + ans.add(value); + } + return ans; + }, new Set()); + return [...set]; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/node/argument.js + + +var BlockStatesNode; +(function (BlockStatesNode) { + /* istanbul ignore next */ + function is(node) { + return node.type === 'mcfunction:block/states'; + } + BlockStatesNode.is = is; +})(BlockStatesNode || (BlockStatesNode = {})); +var BlockNode; +(function (BlockNode) { + function is(node) { + return node?.type === 'mcfunction:block'; + } + BlockNode.is = is; + function mock(range, isPredicate) { + const id = ResourceLocationNode.mock(range, { category: 'block', allowTag: isPredicate }); + return { + type: 'mcfunction:block', + range: Range.get(range), + children: [id], + id, + isPredicate: false, + }; + } + BlockNode.mock = mock; +})(BlockNode || (BlockNode = {})); +const CoordinateNotations = (/* unused pure expression or super */ null && (['', '~', '^'])); +var CoordinateNode; +(function (CoordinateNode) { + function mock(range) { + return { type: 'mcfunction:coordinate', range: Range.get(range), notation: '', value: 0 }; + } + CoordinateNode.mock = mock; + /** + * @returns A number in the range `[-180.0, 180.0)`. + */ + function toDegree(node) { + // TODO: For relative coordinates, const value = (node.value + baseCoordinate) % 360 + const value = node.value % 360; + return value >= 180 ? value - 360 : value < -180 ? value + 360 : value; + } + CoordinateNode.toDegree = toDegree; +})(CoordinateNode || (CoordinateNode = {})); +var EntitySelectorArgumentsNode; +(function (EntitySelectorArgumentsNode) { + /* istanbul ignore next */ + function is(node) { + return (node.type === 'mcfunction:entity_selector/arguments'); + } + EntitySelectorArgumentsNode.is = is; +})(EntitySelectorArgumentsNode || (EntitySelectorArgumentsNode = {})); +const EntitySelectorVariables = ['a', 'e', 'p', 'r', 's', 'n']; +var EntitySelectorVariable; +(function (EntitySelectorVariable) { + /* istanbul ignore next */ + function is(value) { + return EntitySelectorVariables.includes(value); + } + EntitySelectorVariable.is = is; +})(EntitySelectorVariable || (EntitySelectorVariable = {})); +const EntitySelectorAtVariables = EntitySelectorVariables.map((v) => `@${v}`); +var EntitySelectorAtVariable; +(function (EntitySelectorAtVariable) { + /* istanbul ignore next */ + function is(value) { + return EntitySelectorAtVariables.includes(value); + } + EntitySelectorAtVariable.is = is; + /** + * Should be used to get a list of available selectors for the current version. + */ + function filterAvailable(ctx) { + const release = ctx.project['loadedVersion']; + return EntitySelectorAtVariables.filter(variable => !(variable === '@n' && release && ReleaseVersion.cmp(release, '1.21') < 0)); + } + EntitySelectorAtVariable.filterAvailable = filterAvailable; +})(EntitySelectorAtVariable || (EntitySelectorAtVariable = {})); +var EntitySelectorNode; +(function (EntitySelectorNode) { + /* istanbul ignore next */ + function is(node) { + return (node?.type === 'mcfunction:entity_selector'); + } + EntitySelectorNode.is = is; + function mock(range, options) { + const literal = LiteralNode.mock(range, options); + return { + type: 'mcfunction:entity_selector', + range: Range.get(range), + children: [literal], + variable: 'e', + }; + } + EntitySelectorNode.mock = mock; + EntitySelectorNode.ArgumentKeys = new Set([ + 'advancements', + 'distance', + 'gamemode', + 'level', + 'limit', + 'name', + 'nbt', + 'predicate', + 'scores', + 'sort', + 'tag', + 'team', + 'type', + 'x', + 'y', + 'z', + 'dx', + 'dy', + 'dz', + 'x_rotation', + 'y_rotation', + ]); + function canKeyExist(selector, argument, key) { + const hasKey = (key) => !!argument.children.find((p) => p.key?.value === key); + const hasNonInvertedKey = (key) => !!argument.children.find((p) => p.key?.value === key + && !p.value?.inverted); + switch (key) { + case 'advancements': + case 'distance': + case 'level': + case 'scores': + case 'x': + case 'y': + case 'z': + case 'dx': + case 'dy': + case 'dz': + case 'x_rotation': + case 'y_rotation': + return hasKey(key) ? 1 /* Result.Duplicated */ : 0 /* Result.Ok */; + case 'gamemode': + case 'name': + case 'team': + return hasNonInvertedKey(key) ? 1 /* Result.Duplicated */ : 0 /* Result.Ok */; + case 'limit': + case 'sort': + return selector.currentEntity + ? 2 /* Result.NotApplicable */ + : hasKey(key) + ? 1 /* Result.Duplicated */ + : 0 /* Result.Ok */; + case 'type': + return selector.typeLimited + ? hasKey(key) ? 1 /* Result.Duplicated */ : 2 /* Result.NotApplicable */ + : 0 /* Result.Ok */; + } + return 0 /* Result.Ok */; + } + EntitySelectorNode.canKeyExist = canKeyExist; +})(EntitySelectorNode || (EntitySelectorNode = {})); +var EntityNode; +(function (EntityNode) { + function is(node) { + return node?.type === 'mcfunction:entity'; + } + EntityNode.is = is; +})(EntityNode || (EntityNode = {})); +var ItemStackNode; +(function (ItemStackNode) { + function is(node) { + return node?.type === 'mcfunction:item_stack'; + } + ItemStackNode.is = is; + function mock(range) { + const id = ResourceLocationNode.mock(range, { category: 'item' }); + return { type: 'mcfunction:item_stack', range: Range.get(range), children: [id], id }; + } + ItemStackNode.mock = mock; +})(ItemStackNode || (ItemStackNode = {})); +var ComponentListNode; +(function (ComponentListNode) { + function is(node) { + return node.type === 'mcfunction:component_list'; + } + ComponentListNode.is = is; +})(ComponentListNode || (ComponentListNode = {})); +var ComponentNode; +(function (ComponentNode) { + function is(node) { + return node.type === 'mcfunction:component'; + } + ComponentNode.is = is; +})(ComponentNode || (ComponentNode = {})); +var ComponentRemovalNode; +(function (ComponentRemovalNode) { + function is(node) { + return node.type === 'mcfunction:component_removal'; + } + ComponentRemovalNode.is = is; +})(ComponentRemovalNode || (ComponentRemovalNode = {})); +var ItemPredicateNode; +(function (ItemPredicateNode) { + function is(node) { + return node?.type === 'mcfunction:item_predicate'; + } + ItemPredicateNode.is = is; + function mock(range) { + const id = ResourceLocationNode.mock(range, { category: 'item', allowTag: true }); + return { type: 'mcfunction:item_predicate', range: Range.get(range), children: [id], id }; + } + ItemPredicateNode.mock = mock; +})(ItemPredicateNode || (ItemPredicateNode = {})); +var ComponentTestsNode; +(function (ComponentTestsNode) { + function is(node) { + return node.type === 'mcfunction:component_tests'; + } + ComponentTestsNode.is = is; +})(ComponentTestsNode || (ComponentTestsNode = {})); +var ComponentTestsAnyOfNode; +(function (ComponentTestsAnyOfNode) { + function is(node) { + return node.type === 'mcfunction:component_tests_any_of'; + } + ComponentTestsAnyOfNode.is = is; +})(ComponentTestsAnyOfNode || (ComponentTestsAnyOfNode = {})); +var ComponentTestsAllOfNode; +(function (ComponentTestsAllOfNode) { + function is(node) { + return node.type === 'mcfunction:component_tests_all_of'; + } + ComponentTestsAllOfNode.is = is; +})(ComponentTestsAllOfNode || (ComponentTestsAllOfNode = {})); +var ComponentTestExactNode; +(function (ComponentTestExactNode) { + function is(node) { + return node.type === 'mcfunction:component_test_exact'; + } + ComponentTestExactNode.is = is; +})(ComponentTestExactNode || (ComponentTestExactNode = {})); +var ComponentTestExistsNode; +(function (ComponentTestExistsNode) { + function is(node) { + return node.type === 'mcfunction:component_test_exists'; + } + ComponentTestExistsNode.is = is; +})(ComponentTestExistsNode || (ComponentTestExistsNode = {})); +var ComponentTestSubpredicateNode; +(function (ComponentTestSubpredicateNode) { + function is(node) { + return node.type + === 'mcfunction:component_test_sub_predicate'; + } + ComponentTestSubpredicateNode.is = is; +})(ComponentTestSubpredicateNode || (ComponentTestSubpredicateNode = {})); +var argument_IntRangeNode; +(function (IntRangeNode) { + function mock(range) { + return { + type: 'mcfunction:int_range', + range: Range.get(range), + children: [], + value: [undefined, undefined], + }; + } + IntRangeNode.mock = mock; +})(argument_IntRangeNode || (argument_IntRangeNode = {})); +var argument_NbtNode; +(function (NbtNode) { + /* istanbul ignore next */ + function is(node) { + return node.type === 'mcfunction:nbt'; + } + NbtNode.is = is; +})(argument_NbtNode || (argument_NbtNode = {})); +var argument_NbtPathNode; +(function (NbtPathNode) { + /* istanbul ignore next */ + function is(node) { + return node.type === 'mcfunction:nbt_path'; + } + NbtPathNode.is = is; +})(argument_NbtPathNode || (argument_NbtPathNode = {})); +var NbtResourceNode; +(function (NbtResourceNode) { + /* istanbul ignore next */ + function is(node) { + return node.type === 'mcfunction:nbt_resource'; + } + NbtResourceNode.is = is; +})(NbtResourceNode || (NbtResourceNode = {})); +var ObjectiveCriteriaNode; +(function (ObjectiveCriteriaNode) { + ObjectiveCriteriaNode.SimpleValues = [ + 'air', + 'armor', + 'deathCount', + 'dummy', + 'food', + 'health', + 'level', + 'playerKillCount', + 'totalKillCount', + 'trigger', + 'xp', + ...Color.ColorNames.map((n) => `killedByTeam.${n}`), + ...Color.ColorNames.map((n) => `teamkill.${n}`), + ]; + ObjectiveCriteriaNode.ComplexCategories = new Map([ + ['broken', 'item'], + ['crafted', 'item'], + ['custom', 'custom_stat'], + ['dropped', 'item'], + ['killed', 'entity_type'], + ['killed_by', 'entity_type'], + ['mined', 'block'], + ['picked_up', 'item'], + ['used', 'item'], + ]); + ObjectiveCriteriaNode.ComplexSep = ':'; + function mock(range) { + return { type: 'mcfunction:objective_criteria', range: Range.get(range) }; + } + ObjectiveCriteriaNode.mock = mock; +})(ObjectiveCriteriaNode || (ObjectiveCriteriaNode = {})); +var ParticleNode; +(function (ParticleNode) { + // until 1.20.5 + const SpecialTypes = new Set([ + 'block', + 'block_marker', + 'dust', + 'dust_color_transition', + 'falling_dust', + 'item', + 'sculk_charge', + 'shriek', + 'vibration', + ]); + function isSpecialType(type) { + return SpecialTypes.has(type); + } + ParticleNode.isSpecialType = isSpecialType; + // since 1.20.5 + const OptionTypes = new Set([ + ...SpecialTypes, + 'block_crumble', + 'dust_pillar', + 'entity_effect', + 'trail', + ]); + function requiresOptions(type) { + return OptionTypes.has(type); + } + ParticleNode.requiresOptions = requiresOptions; + function is(node) { + return node?.type === 'mcfunction:particle'; + } + ParticleNode.is = is; + function mock(range) { + const id = ResourceLocationNode.mock(range, { category: 'particle_type' }); + return { type: 'mcfunction:particle', range: Range.get(range), children: [id], id }; + } + ParticleNode.mock = mock; +})(ParticleNode || (ParticleNode = {})); +var ScoreHolderNode; +(function (ScoreHolderNode) { + function mock(range) { + const fakeName = SymbolNode.mock(range, { category: 'score_holder' }); + return { + type: 'mcfunction:score_holder', + range: Range.get(range), + children: [fakeName], + fakeName, + }; + } + ScoreHolderNode.mock = mock; +})(ScoreHolderNode || (ScoreHolderNode = {})); +var TimeNode; +(function (TimeNode) { + TimeNode.UnitToTicks = new Map([['', 1], ['t', 1], ['s', 20], ['d', 24000]]); + TimeNode.Units = [...TimeNode.UnitToTicks.keys()]; +})(TimeNode || (TimeNode = {})); +var VectorNode; +(function (VectorNode) { + function mock(range, options) { + return { + type: 'mcfunction:vector', + range: Range.get(range), + children: [], + options, + system: 0 /* CoordinateSystem.World */, + }; + } + VectorNode.mock = mock; +})(VectorNode || (VectorNode = {})); +//# sourceMappingURL=argument.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/node/index.js + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/checker/index.js + + + + + + + + +const checker_entry = (node, ctx) => { + const parts = dissectUri(ctx.doc.uri, ctx); + if (parts?.ok === false) { + reportDissectError(parts.path, parts.expected, ctx); + } + builtin_dispatchSync(node, ctx); +}; +const checker_command = (node, ctx) => { + rootCommand(node.children, 0, ctx); +}; +function getEarlierNode(nodes, before, name) { + if (name === undefined) { + return undefined; + } + for (let i = before - 1; i > 0; i -= 1) { + if (nodes[i].path[nodes[i].path.length - 1] === name) { + return nodes[i].children[0]; + } + } + return undefined; +} +const rootCommand = (nodes, index, ctx) => { + for (let i = 0; i < nodes.length; i += 1) { + const node = nodes[i].children[0]; + if (BlockNode.is(node)) { + block(node, ctx); + } + else if (EntityNode.is(node)) { + entity(node, ctx); + } + else if (ItemPredicateNode.is(node)) { + itemPredicate(node, ctx); + } + else if (ItemStackNode.is(node)) { + itemStack(node, ctx); + } + else if (ParticleNode.is(node)) { + particle(node, ctx); + } + else if (NbtResourceNode.is(node)) { + nbtResource(node, ctx); + } + else if (TypedJsonNode.is(node)) { + typed(node, ctx); + } + else if (TypedNbtNode.is(node)) { + checker_typed(node, ctx); + } + else if (argument_NbtNode.is(node) && node.properties) { + const dispatchedBy = getEarlierNode(nodes, i, node.properties.dispatchedBy); + const indexedBy = getEarlierNode(nodes, i, node.properties.indexedBy); + nbtChecker(dispatchedBy, indexedBy)(node, ctx); + } + else if (argument_NbtPathNode.is(node) && node.properties) { + const dispatchedBy = getEarlierNode(nodes, i, node.properties.dispatchedBy); + nbtPathChecker(dispatchedBy)(node, ctx); + } + } +}; +// #region Checkers for argument nodes +const block = (node, ctx) => { + if (!node.nbt) { + return; + } + const type = ResourceLocationNode.toString(node.id, 'full'); + checker_index('minecraft:block', type, { isPredicate: node.isPredicate })(node.nbt, ctx); +}; +const entity = (node, ctx) => { + for (const pair of node.selector?.arguments?.children ?? []) { + if (pair.key?.value !== 'nbt' || !pair.value) { + continue; + } + const types = getTypesFromEntity(node, ctx); + if (!NbtCompoundNode.is(pair.value.value)) { + continue; + } + checker_index('minecraft:entity', types, { isPredicate: true })(pair.value.value, ctx); + } +}; +const itemPredicate = (node, ctx) => { + if (node.nbt) { + const type = ResourceLocationNode.toString(node.id, 'full'); + checker_index('minecraft:item', type, { isPredicate: true })(node.nbt, ctx); + } + if (!node.tests?.children) { + return; + } + const anyOfTest = node.tests.children[0]; + for (const allOfTest of anyOfTest.children) { + for (const test of allOfTest.children) { + const key = ResourceLocationNode.toString(test.key, 'full'); + // count is a special case that's only valid in item predicate arguments, not json + // note: basically all errors checked here are otherwise accepted by vanilla, but it's good to report them + if (key === 'minecraft:count' && !ComponentTestExistsNode.is(test) && test.value) { + const validInt = { kind: 'int', valueRange: { kind: 0b00, min: 0 } }; + const type = { + kind: 'union', + members: [ + validInt, + { + kind: 'struct', + fields: [ + { kind: 'pair', key: 'min', optional: true, type: validInt }, + { kind: 'pair', key: 'max', optional: true, type: validInt }, + ], + }, + ], + }; + checker_typeDefinition(type)(test.value, ctx); + } + else if (ComponentTestExactNode.is(test) && test.value) { + checker_index('minecraft:data_component', key)(test.value, ctx); + } + else if (ComponentTestSubpredicateNode.is(test) && test.value) { + checker_index('minecraft:data_component_predicate', key)(test.value, ctx); + } + } + } +}; +const itemStack = (node, ctx) => { + const itemId = ResourceLocationNode.toString(node.id, 'full'); + if (node.nbt) { + checker_index('minecraft:item', itemId)(node.nbt, ctx); + } + if (!node.components) { + return; + } + const groupedComponents = new Map(); + for (const child of node.components.children) { + if (!child.key) { + continue; + } + const componentId = ResourceLocationNode.toString(child.key, 'full'); + if (!groupedComponents.has(componentId)) { + groupedComponents.set(componentId, []); + } + groupedComponents.get(componentId).push(child.key); + if (child.type === 'mcfunction:component' && child.value) { + checker_index('minecraft:data_component', componentId)(child.value, ctx); + } + } + for (const [_, group] of groupedComponents) { + if (group.length > 1) { + for (const node of group) { + ctx.err.report(localize('mcfunction.parser.duplicate-components'), node.range, 2 /* core.ErrorSeverity.Warning */); + } + } + } +}; +const nbtResource = (node, ctx) => { + const type = { + kind: 'dispatcher', + registry: 'minecraft:resource', + parallelIndices: [{ kind: 'static', value: ResourceLocation.lengthen(node.category) }], + }; + checker_typeDefinition(type)(node.children[0], ctx); +}; +function nbtChecker(dispatchedBy, indexedBy) { + return (node, ctx) => { + if (!node.properties) { + return; + } + const tag = node.children[0]; + if (indexedBy) { + if (argument_NbtPathNode.is(indexedBy)) { + const indexedByTypedef = indexedBy.children[0].endTypeDef; + const typeDef = indexedByTypedef && node.properties.isListIndex + ? getListLikeChild(indexedByTypedef) + : indexedByTypedef; + if (typeDef) { + checker_typeDefinition(typeDef, node.properties)(tag, ctx); + } + } + return; + } + switch (node.properties.dispatcher) { + case 'minecraft:entity': + if (NbtCompoundNode.is(tag)) { + const types = (EntityNode.is(dispatchedBy) || ResourceLocationNode.is(dispatchedBy)) + ? getTypesFromEntity(dispatchedBy, ctx) + : undefined; + checker_index('minecraft:entity', types, { + isPredicate: node.properties.isPredicate, + isMerge: node.properties.isMerge, + })(tag, ctx); + } + break; + case 'minecraft:block': + if (NbtCompoundNode.is(tag)) { + checker_index('minecraft:block', undefined, { + isPredicate: node.properties.isPredicate, + isMerge: node.properties.isMerge, + })(tag, ctx); + } + break; + case 'minecraft:storage': + if (NbtCompoundNode.is(tag)) { + const storage = ResourceLocationNode.is(dispatchedBy) + ? ResourceLocationNode.toString(dispatchedBy) + : undefined; + checker_index('minecraft:storage', storage, { + isPredicate: node.properties.isPredicate, + isMerge: node.properties.isMerge, + })(tag, ctx); + } + break; + } + }; +} +function getListLikeChild(typeDef) { + switch (typeDef.kind) { + case 'list': + return typeDef.item; + case 'byte_array': + return { kind: 'byte' }; + case 'int_array': + return { kind: 'int' }; + case 'long_array': + return { kind: 'long' }; + case 'union': + const members = typeDef.members + .map(m => getListLikeChild(m)) + .filter((m) => m !== undefined); + if (members.length === 0) { + return undefined; + } + if (members.length === 1) { + return members[0]; + } + return { kind: 'union', members }; + default: + return undefined; + } +} +function nbtPathChecker(dispatchedBy) { + return (node, ctx) => { + if (!node.properties) { + return; + } + const path = node.children[0]; + switch (node.properties.dispatcher) { + case 'minecraft:entity': + const types = (EntityNode.is(dispatchedBy) || ResourceLocationNode.is(dispatchedBy)) + ? getTypesFromEntity(dispatchedBy, ctx) + : undefined; + checker_path('minecraft:entity', types)(path, ctx); + break; + case 'minecraft:block': + checker_path('minecraft:block', undefined)(path, ctx); + break; + case 'minecraft:storage': + const storage = ResourceLocationNode.is(dispatchedBy) + ? ResourceLocationNode.toString(dispatchedBy) + : undefined; + checker_path('minecraft:storage', storage)(path, ctx); + break; + } + }; +} +const particle = (node, ctx) => { + const id = ResourceLocationNode.toString(node.id, 'short'); + const release = ctx.project['loadedVersion']; + if (release && ReleaseVersion.cmp(release, '1.20.5') < 0) { + return; + } + const options = node.children?.find(NbtCompoundNode.is); + if (options) { + // Even if particle isn't explicitly marked as requiring options, + // run the type checker anyways to allow an empty compound + checker_index('minecraft:particle', ResourceLocation.lengthen(id))(options, ctx); + } + else if (ParticleNode.requiresOptions(id)) { + ctx.err.report(localize('expected', localize('nbt.node.compound')), Range.create(node.id.range.end, node.id.range.end + 1)); + } +}; +// #endregion +function getTypesFromEntity(entity, ctx) { + if (ResourceLocationNode.is(entity)) { + const value = ResourceLocationNode.toString(entity, 'full', true); + if (value.startsWith(ResourceLocation.TagPrefix)) { + return getTagValues('tag/entity_type', value.slice(1), ctx); + } + else { + return [value]; + } + } + else if (entity.playerName !== undefined || entity.selector?.playersOnly) { + return ['minecraft:player']; + } + else if (entity.selector) { + const argumentsNode = entity.selector.arguments; + if (!argumentsNode) { + return undefined; + } + let types = undefined; + for (const pairNode of argumentsNode.children) { + if (pairNode.key?.value !== 'type') { + continue; + } + const valueNode = pairNode.value; + if (!valueNode || valueNode.inverted) { + continue; + } + const value = ResourceLocationNode.toString(valueNode.value, 'full', true); + if (value.startsWith(ResourceLocation.TagPrefix)) { + const tagValues = getTagValues('tag/entity_type', value.slice(1), ctx); + if (types === undefined) { + types = tagValues.map(ResourceLocation.lengthen); + } + else { + types = types.filter((t) => tagValues.includes(t)); + } + } + else { + types = [value]; + } + } + return types; + } + return undefined; +} +function mcfunction_checker_register(meta) { + meta.registerChecker('mcfunction:entry', checker_entry); + meta.registerChecker('mcfunction:command', checker_command); + meta.registerChecker('mcfunction:block', block); + meta.registerChecker('mcfunction:entity', entity); + meta.registerChecker('mcfunction:item_stack', itemStack); + meta.registerChecker('mcfunction:item_predicate', itemPredicate); + meta.registerChecker('mcfunction:particle', particle); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/colorizer/index.js + +const objectiveCriterion = (node) => [ColorToken.create(node, 'type')]; +const vector = (node) => { + return [ColorToken.create(node, 'vector')]; +}; +function mcfunction_colorizer_register(meta) { + meta.registerColorizer('mcfunction:coordinate', number); + meta.registerColorizer('mcfunction:vector', vector); + meta.registerColorizer('mcfunction:objective_criteria', objectiveCriterion); +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/common/index.js + + +const ColorArgumentValues = [...Color.ColorNames, 'reset']; +const EntityAnchorArgumentValues = ['feet', 'eyes']; +const GamemodeArgumentValues = ['adventure', 'survival', 'creative', 'spectator']; +function getItemSlotArgumentValues(ctx) { + const release = ctx.project['loadedVersion']; + const output = [ + ...[...Array(54).keys()].map((n) => `container.${n}`), + ...[...Array(27).keys()].map((n) => `enderchest.${n}`), + ...[...Array(15).keys()].map((n) => `horse.${n}`), + ...[...Array(9).keys()].map((n) => `hotbar.${n}`), + ...[...Array(27).keys()].map((n) => `inventory.${n}`), + ...[...Array(8).keys()].map((n) => `villager.${n}`), + 'armor.chest', + 'armor.feet', + 'armor.head', + 'armor.legs', + 'horse.chest', + 'weapon', + 'weapon.mainhand', + 'weapon.offhand', + ]; + if (ReleaseVersion.cmp(release, '1.20.5') >= 0) { + output.push(...[...Array(4).keys()].map((n) => `player.crafting.${n}`), 'armor.body', 'contents', 'player.cursor'); + } + else { + output.push('horse.armor'); + } + if (ReleaseVersion.cmp(release, '1.21.5') >= 0) { + output.push('saddle'); + } + else { + output.push('horse.saddle'); + } + return output; +} +// Only exists since 1.20.5 +function getItemSlotsArgumentValues(ctx) { + return [ + ...getItemSlotArgumentValues(ctx), + 'armor.*', + 'container.*', + 'enderchest.*', + 'horse.*', + 'hotbar.*', + 'inventory.*', + 'player.crafting.*', + 'villager.*', + 'weapon.*', + ]; +} +const OperationArgumentValues = ['=', '+=', '-=', '*=', '/=', '%=', '<', '>', '><']; +function getScoreboardSlotArgumentValues(ctx) { + const release = ctx.project['loadedVersion']; + return [ + ReleaseVersion.cmp(release, '1.20.2') < 0 ? 'belowName' : 'below_name', + 'list', + 'sidebar', + ...Color.ColorNames.map((n) => `sidebar.team.${n}`), + ]; +} +const SwizzleArgumentValues = [ + 'x', + 'xy', + 'xz', + 'xyz', + 'xzy', + 'y', + 'yx', + 'yz', + 'yxz', + 'yzx', + 'z', + 'zx', + 'zy', + 'zxy', + 'zyx', +]; +const HeightmapValues = [ + 'motion_blocking', + 'motion_blocking_no_leaves', + 'ocean_floor', + 'world_surface', +]; +const RotationValues = ['none', 'clockwise_90', '180', 'counterclockwise_90']; +const MirrorValues = ['none', 'left_right', 'front_back']; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/completer/argument.js + + + + + + + +const getMockNodes = (rawTreeNode, prevNodes, ctx) => { + const range = ctx.offset; + const treeNode = rawTreeNode; + switch (treeNode.parser) { + case 'brigadier:bool': + return BooleanNode.mock(range); + case 'brigadier:double': + case 'brigadier:float': + case 'brigadier:integer': + case 'brigadier:long': + case 'minecraft:float_range': + case 'minecraft:message': + case 'minecraft:time': + case 'minecraft:uuid': + return []; + case 'brigadier:string': + return treeNode.properties.type === 'phrase' + ? StringNode.mock(range, BrigadierStringOptions) + : []; + case 'minecraft:angle': + return CoordinateNode.mock(range); + case 'minecraft:block_pos': + return VectorNode.mock(range, { dimension: 3, integersOnly: true }); + case 'minecraft:block_predicate': + return BlockNode.mock(range, true); + case 'minecraft:block_state': + return BlockNode.mock(range, false); + case 'minecraft:color': + return LiteralNode.mock(range, { pool: ColorArgumentValues }); + case 'minecraft:column_pos': + return VectorNode.mock(range, { dimension: 2, integersOnly: true }); + case 'minecraft:component': + return [ + JsonArrayNode.mock(range), + JsonObjectNode.mock(range), + JsonStringNode.mock(range), + ]; + case 'minecraft:dialog': + return ResourceLocationNode.mock(range, { category: 'dialog' }); + case 'minecraft:dimension': + return ResourceLocationNode.mock(range, { category: 'dimension' }); + case 'minecraft:entity': + case 'minecraft:game_profile': + return EntitySelectorNode.mock(range, { + pool: EntitySelectorAtVariable.filterAvailable(ctx), + }); + case 'minecraft:heightmap': + return LiteralNode.mock(range, { pool: HeightmapValues }); + case 'minecraft:entity_anchor': + return LiteralNode.mock(range, { pool: EntityAnchorArgumentValues }); + case 'minecraft:entity_summon': + return ResourceLocationNode.mock(range, { category: 'entity_type' }); + case 'minecraft:function': + return ResourceLocationNode.mock(range, { category: 'function' }); + case 'minecraft:gamemode': + return LiteralNode.mock(range, { pool: GamemodeArgumentValues }); + case 'minecraft:int_range': + return argument_IntRangeNode.mock(range); + case 'minecraft:item_enchantment': + return ResourceLocationNode.mock(range, { category: 'enchantment' }); + case 'minecraft:item_predicate': + return ItemPredicateNode.mock(range); + case 'minecraft:item_slot': + return LiteralNode.mock(range, { pool: getItemSlotArgumentValues(ctx) }); + case 'minecraft:item_slots': + return LiteralNode.mock(range, { pool: getItemSlotsArgumentValues(ctx) }); + case 'minecraft:item_stack': + return ItemStackNode.mock(range); + case 'minecraft:loot_modifier': + return ResourceLocationNode.mock(range, { category: 'item_modifier' }); + case 'minecraft:loot_predicate': + return ResourceLocationNode.mock(range, { category: 'predicate' }); + case 'minecraft:loot_table': + return ResourceLocationNode.mock(range, { category: 'loot_table' }); + case 'minecraft:mob_effect': + return ResourceLocationNode.mock(range, { category: 'mob_effect' }); + case 'minecraft:objective': + return SymbolNode.mock(range, { category: 'objective' }); + case 'minecraft:objective_criteria': + return ObjectiveCriteriaNode.mock(range); + case 'minecraft:operation': + return LiteralNode.mock(range, { + pool: OperationArgumentValues, + colorTokenType: 'operator', + }); + case 'minecraft:particle': + return ParticleNode.mock(range); + case 'minecraft:resource': + case 'minecraft:resource_key': + case 'minecraft:resource_or_tag': + case 'minecraft:resource_or_tag_key': + const allowTag = treeNode.parser === 'minecraft:resource_or_tag' + || treeNode.parser === 'minecraft:resource_or_tag_key'; + return ResourceLocationNode.mock(range, { + category: ResourceLocation.shorten(treeNode.properties.registry), + allowTag, + }); + case 'minecraft:resource_location': + return ResourceLocationNode.mock(range, treeNode.properties ?? { pool: [], allowUnknown: true }); + case 'minecraft:rotation': + return VectorNode.mock(range, { dimension: 2, noLocal: true }); + case 'minecraft:scoreboard_slot': + return LiteralNode.mock(range, { pool: getScoreboardSlotArgumentValues(ctx) }); + case 'minecraft:score_holder': + return ScoreHolderNode.mock(range); + case 'minecraft:style': + return JsonObjectNode.mock(range); + case 'minecraft:swizzle': + return LiteralNode.mock(range, { pool: SwizzleArgumentValues }); + case 'minecraft:team': + return SymbolNode.mock(range, { category: 'team' }); + case 'minecraft:template_mirror': + return LiteralNode.mock(range, { pool: MirrorValues }); + case 'minecraft:template_rotation': + return LiteralNode.mock(range, { pool: RotationValues }); + case 'minecraft:vec2': + return VectorNode.mock(range, { dimension: 2, integersOnly: true }); + case 'minecraft:vec3': + return VectorNode.mock(range, { dimension: 3 }); + case 'spyglassmc:criterion': + const advancementNode = prevNodes.length > 0 + ? prevNodes[prevNodes.length - 1].children[0] + : undefined; + if (ResourceLocationNode.is(advancementNode)) { + return SymbolNode.mock(range, { + category: 'advancement', + subcategory: 'criterion', + parentPath: [ResourceLocationNode.toString(advancementNode, 'full')], + }); + } + return []; + case 'spyglassmc:tag': + return SymbolNode.mock(range, { category: 'tag' }); + // ==== Unimplemented ==== + case 'minecraft:nbt_compound_tag': + case 'minecraft:nbt_path': + case 'minecraft:nbt_tag': + default: + // Unknown parser. + return []; + } +}; +const argument_block = (node, ctx) => { + const ans = []; + if (Range.contains(node.id, ctx.offset, true)) { + ans.push(...completer_builtin_resourceLocation(node.id, ctx)); + } + if (node.states?.innerRange && Range.contains(node.states.innerRange, ctx.offset, true)) { + ans.push(...argument_blockStates(node.states, ctx)); + } + if (node.nbt?.innerRange && Range.contains(node.nbt.innerRange, ctx.offset, true)) { + ans.push(...dispatch(node.nbt, ctx)); + } + return ans; +}; +const argument_blockStates = (node, ctx) => { + if (!BlockNode.is(node.parent)) { + return []; + } + const idNode = node.parent.id; + const id = ResourceLocationNode.toString(idNode, 'full'); + const blocks = idNode.isTag ? getTagValues('tag/block', id, ctx) : [id]; + const states = getStates('block', blocks, ctx); + return record({ + key: (_record, pair, _ctx, range, insertValue, insertComma, existingKeys) => { + return Object.keys(states).filter((k) => pair?.key?.value === k || !existingKeys.some((ek) => ek.value === k)).map((k) => CompletionItem.create(k, range, { + kind: 10 /* CompletionKind.Property */, + detail: localize('mcfunction.completer.block.states.default-value', localeQuote(states[k][0])), + insertText: new InsertTextBuilder().literal(k).if(insertValue, (b) => b.literal('=').placeholder(...states[k])).if(insertComma, (b) => b.literal(',')).build(), + })); + }, + value: (_record, pair, ctx) => { + if (pair.key && states[pair.key.value]) { + return states[pair.key.value].map((v) => CompletionItem.create(v, pair.value ?? ctx.offset, { kind: 12 /* CompletionKind.Value */ })); + } + return []; + }, + })(node, ctx); +}; +const componentList = (node, ctx) => { + if (!node.innerRange || !Range.contains(node.innerRange, ctx.offset, true)) { + return []; + } + const completeKey = (key) => { + const id = key + ?? ResourceLocationNode.mock(key ?? ctx.offset, { category: 'data_component_type' }); + return completer_builtin_resourceLocation(id, ctx); + }; + const index = binarySearch(node.children, ctx.offset, (n, o) => Range.compareOffset(n.range, o, true)); + const child = index >= 0 ? node.children[index] : undefined; + if (!child) { + return [ + ...completer_builtin_literal(LiteralNode.mock(ctx.offset, { pool: ['!'] }), ctx), + ...completeKey(undefined), + ]; + } + if (child.type === 'mcfunction:component_removal') { + return completeKey(child.key); + } + if ((child.key && Range.contains(child.key, ctx.offset, true))) { + return completeKey(child.key); + } + if (child.value && Range.contains(child.value, ctx.offset, true)) { + return dispatch(child.value, ctx); + } + return []; +}; +const componentTests = (node, ctx) => { + // TODO: improve this completer + const test = AstNode.findShallowestChild({ + node: node, + needle: ctx.offset, + endInclusive: true, + predicate: (n) => ComponentTestExactNode.is(n) || ComponentTestSubpredicateNode.is(n), + }); + if (test && ComponentTestExactNode.is(test) && test.value) { + return dispatch(test.value, ctx); + } + else if (test && ComponentTestSubpredicateNode.is(test) && test.value) { + return dispatch(test.value, ctx); + } + return []; +}; +const coordinate = (node, _ctx) => { + return [CompletionItem.create('~', node)]; +}; +const argument_itemStack = (node, ctx) => { + const ans = []; + if (Range.contains(node.id, ctx.offset, true)) { + ans.push(...completer_builtin_resourceLocation(node.id, ctx)); + } + if (node.components && Range.contains(node.components, ctx.offset, true)) { + ans.push(...componentList(node.components, ctx)); + } + if (node.nbt && Range.contains(node.nbt, ctx.offset, true)) { + ans.push(...dispatch(node.nbt, ctx)); + } + return ans; +}; +const argument_itemPredicate = (node, ctx) => { + const ans = []; + if (Range.contains(node.id, ctx.offset, true)) { + ans.push(CompletionItem.create('*', node, { sortText: '##' })); + if (node.id.type === 'resource_location') { + ans.push(...completer_builtin_resourceLocation(node.id, ctx)); + } + } + if (node.tests && Range.contains(node.tests, ctx.offset, true)) { + ans.push(...componentTests(node.tests, ctx)); + } + if (node.nbt && Range.contains(node.nbt, ctx.offset, true)) { + ans.push(...dispatch(node.nbt, ctx)); + } + return ans; +}; +const objectiveCriteria = (node, ctx) => { + const ans = ObjectiveCriteriaNode.SimpleValues.map((v) => CompletionItem.create(v, node)); + if (!node.children?.[0] || Range.contains(node.children[0], ctx.offset, true)) { + ans.push(...completer_builtin_resourceLocation(node.children?.[0] + ?? ResourceLocationNode.mock(node, { category: 'stat_type', namespacePathSep: '.' }), ctx)); + } + if (node.children?.[1] && Range.contains(node.children[1], ctx.offset, true)) { + ans.push(...completer_builtin_resourceLocation(node.children[1], ctx)); + } + return ans; +}; +const argument_particle = (node, ctx) => { + const child = AstNode.findChild(node, ctx.offset, true); + if (child) { + return dispatch(child, ctx); + } + const release = ctx.project['loadedVersion']; + if (!release || ReleaseVersion.cmp(release, '1.20.5') >= 0) { + return []; + } + const id = ResourceLocationNode.toString(node.id, 'short'); + const map = { + block: [BlockNode.mock(ctx.offset, false)], + block_marker: [BlockNode.mock(ctx.offset, false)], + dust: [VectorNode.mock(ctx.offset, { dimension: 3 }), FloatNode.mock(ctx.offset)], + dust_color_transition: [ + VectorNode.mock(ctx.offset, { dimension: 3 }), + FloatNode.mock(ctx.offset), + VectorNode.mock(ctx.offset, { dimension: 3 }), + ], + falling_dust: [BlockNode.mock(ctx.offset, false)], + item: [ItemStackNode.mock(ctx.offset)], + sculk_charge: [FloatNode.mock(ctx.offset)], + shriek: [IntegerNode.mock(ctx.offset)], + vibration: [ + VectorNode.mock(ctx.offset, { dimension: 3 }), + VectorNode.mock(ctx.offset, { dimension: 3 }), + IntegerNode.mock(ctx.offset), + ], + }; + if (ParticleNode.isSpecialType(id)) { + const numParamsBefore = node.children?.slice(1).filter((n) => n.range.end < ctx.offset).length + ?? 0; + const mock = map[id][numParamsBefore]; + if (mock) { + return dispatch(mock, ctx); + } + } + return []; +}; +const scoreHolder = (node, ctx) => { + let ans; + if (node.selector && Range.contains(node.selector, ctx.offset, true)) { + ans = selector(node.selector, ctx); + if (Range.contains(node.children[0], ctx.offset, true)) { + ans.push(...completer_builtin_symbol(SymbolNode.mock(node, { category: 'score_holder' }), ctx)); + } + } + else { + ans = completer_builtin_symbol(node.fakeName ?? SymbolNode.mock(node, { category: 'score_holder' }), ctx); + ans.push(...completer_builtin_literal(LiteralNode.mock(node, { pool: ['*'] }), ctx), ...selector(EntitySelectorNode.mock(node, { pool: EntitySelectorAtVariable.filterAvailable(ctx) }), ctx)); + } + return ans; +}; +const selector = (node, ctx) => { + if (Range.contains(node.children[0], ctx.offset, true)) { + return completer_builtin_literal(node.children[0], ctx); + } + if (node.arguments?.innerRange && Range.contains(node.arguments.innerRange, ctx.offset, true)) { + return selectorArguments(node.arguments, ctx); + } + return []; +}; +const selectorArguments = (node, ctx) => { + const selector = node.parent; + if (!EntitySelectorNode.is(selector)) { + return []; + } + return record({ + key: (record, pair, _ctx, range, insertValue, insertComma) => { + return [...EntitySelectorNode.ArgumentKeys].filter((k) => EntitySelectorNode.canKeyExist(selector, record, k) === 0 /* EntitySelectorNode.Result.Ok */).map((k) => CompletionItem.create(k, range, { + kind: 10 /* CompletionKind.Property */, + insertText: new InsertTextBuilder().literal(k).if(insertValue, (b) => b.literal('=').placeholder()) // TODO + .if(insertComma, (b) => b.literal(',')).build(), + })); + }, + value: (_record, pair, ctx) => { + if (pair.value) { + return dispatch(pair.value, ctx); + } + return []; + }, + })(node, ctx); +}; +const argument_intRange = (node, _ctx) => { + return [ + CompletionItem.create('-2147483648..2147483647', node, { kind: 21 /* CompletionKind.Constant */ }), + ]; +}; +const argument_vector = (node, _ctx) => { + const createCompletion = (coordinate, sortText) => CompletionItem.create(new Array(node.options.dimension).fill(coordinate).join(' '), node, { + sortText, + }); + const ans = []; + ans.push(createCompletion('~', 'a')); + if (!node.options.noLocal) { + ans.push(createCompletion('^', 'b')); + } + ans.push(createCompletion('0.0', 'c')); + return ans; +}; +function argument_register(meta) { + meta.registerCompleter('mcfunction:block', argument_block); + meta.registerCompleter('mcfunction:component_list', componentList); + meta.registerCompleter('mcfunction:component_tests', componentTests); + meta.registerCompleter('mcfunction:coordinate', coordinate); + meta.registerCompleter('mcfunction:entity_selector', selector); + meta.registerCompleter('mcfunction:entity_selector/arguments', selectorArguments); + meta.registerCompleter('mcfunction:int_range', argument_intRange); + meta.registerCompleter('mcfunction:item_stack', argument_itemStack); + meta.registerCompleter('mcfunction:item_predicate', argument_itemPredicate); + meta.registerCompleter('mcfunction:objective_criteria', objectiveCriteria); + meta.registerCompleter('mcfunction:particle', argument_particle); + meta.registerCompleter('mcfunction:score_holder', scoreHolder); + meta.registerCompleter('mcfunction:vector', argument_vector); +} +//# sourceMappingURL=argument.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/completer/index.js + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/inlayHintProvider.js + + +const inlayHintProvider = (node, ctx) => { + if (node.children[0]?.type !== 'mcfunction:entry') { + return []; + } + const ans = []; + traversePreOrder(node, (_) => true, CommandChildNode.is, (n) => { + const node = n; + const config = ctx.config.env.feature.inlayHint; + if (config === true + || (typeof config === 'object' && config.enabledNodes.includes(node.children[0].type))) { + ans.push({ + offset: node.range.start, + label: `${node.path[node.path.length - 1]}:`, + paddingRight: true, + }); + } + }); + return ans; +}; +//# sourceMappingURL=inlayHintProvider.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/parser/argument.js + + + + + + + + + +const IntegerPattern = /^-?\d+$/; +/** + * A combination of: + * - https://github.com/Mojang/brigadier/blob/cf754c4ef654160dca946889c11941634c5db3d5/src/main/java/com/mojang/brigadier/StringReader.java#L137 + * - https://docs.oracle.com/javase/7/docs/api/java/lang/Double.html#valueOf(java.lang.String) + * + * i.e. Only `[0-9\.\-]` is allowed in the number, and its format must follow The Java™ Language Specification. + * + * i.e. + * ``` + * [NegativeSign] Digits [`.`] [Digits] | + * [NegativeSign] `.` Digits + * ``` + */ +const FloatPattern = /^-?(?:\d+\.?\d*|\.\d+)$/; +const DoubleMax = Number.MAX_VALUE; +const DoubleMin = -DoubleMax; +const FloatMax = (2 - 2 ** -23) * 2 ** 127; +const FloatMin = -FloatMax; +const IntegerMax = 2 ** 31 - 1; +const IntegerMin = -(2 ** 31); +const LongMax = 9223372036854775807n; +const LongMin = -9223372036854775808n; +const FakeNameMaxLength = 40; +const ObjectiveMaxLength = 16; +const PlayerNameMaxLength = 16; +function shouldValidateLength(ctx) { + const release = ctx.project['loadedVersion']; + return !release || ReleaseVersion.cmp(release, '1.18') < 0; +} +function shouldUseOldItemStackFormat(ctx) { + const release = ctx.project['loadedVersion']; + return !release || ReleaseVersion.cmp(release, '1.20.5') < 0; +} +/** + * @returns The parser for the specified argument tree node. All argument parsers used in the `mcfunction` package + * fail on empty input. + */ +const argument = (rawTreeNode, prevNodes) => { + const treeNode = rawTreeNode; + const wrap = (parser) => failOnEmpty(stopBefore(parser, '\r', '\n')); + switch (treeNode.parser) { + case 'brigadier:bool': + return wrap(boolean_boolean); + case 'brigadier:double': + return wrap(argument_double(treeNode.properties?.min, treeNode.properties?.max)); + case 'brigadier:float': + return wrap(argument_float(treeNode.properties?.min, treeNode.properties?.max)); + case 'brigadier:integer': + return wrap(argument_integer(treeNode.properties?.min, treeNode.properties?.max)); + case 'brigadier:long': + return wrap(argument_long(treeNode.properties?.min, treeNode.properties?.max)); + case 'brigadier:string': + switch (treeNode.properties.type) { + case 'word': + return wrap(unquotedString); + case 'phrase': + return wrap(brigadierString); + case 'greedy': + default: + return wrap(greedyString); + } + case 'minecraft:angle': + return wrap(validate(argument_coordinate(), (res) => res.notation !== '^', localize('mcfunction.parser.vector.local-disallowed'))); + case 'minecraft:block_pos': + return wrap(parser_argument_vector({ dimension: 3, integersOnly: true })); + case 'minecraft:block_predicate': + return wrap(blockPredicate); + case 'minecraft:block_state': + return wrap(blockState); + case 'minecraft:color': + return wrap(util_map(commandLiteral({ pool: ColorArgumentValues }), (res) => ({ + ...res, + color: Color.NamedColors.has(res.value) + ? Color.fromCompositeRGB(Color.NamedColors.get(res.value)) + : undefined, + }))); + case 'minecraft:column_pos': + return wrap(parser_argument_vector({ dimension: 2, integersOnly: true })); + case 'minecraft:component': + return wrap(typeRefParser('::java::server::util::text::Text')); + case 'minecraft:dialog': + return wrap(resourceOrInline('dialog')); + case 'minecraft:dimension': + return wrap(resourceLocation_resourceLocation({ category: 'dimension' })); + case 'minecraft:entity': + return wrap(argument_entity(treeNode.properties.amount, treeNode.properties.type)); + case 'minecraft:entity_anchor': + return wrap(commandLiteral({ pool: EntityAnchorArgumentValues })); + case 'minecraft:entity_summon': + return wrap(resourceLocation_resourceLocation({ category: 'entity_type' })); + case 'minecraft:float_range': + return wrap(argument_range('float', treeNode.properties?.min, treeNode.properties?.max, treeNode.properties?.minSpan, treeNode.properties?.maxSpan)); + case 'minecraft:function': + return wrap(resourceLocation_resourceLocation({ category: 'function', allowTag: true })); + case 'minecraft:gamemode': + return wrap(commandLiteral({ pool: GamemodeArgumentValues })); + case 'minecraft:game_profile': + return wrap(argument_entity('multiple', 'players')); + case 'minecraft:heightmap': + return wrap(commandLiteral({ pool: HeightmapValues })); + case 'minecraft:int_range': + return wrap(argument_range('integer', treeNode.properties?.min, treeNode.properties?.max, treeNode.properties?.minSpan, treeNode.properties?.maxSpan)); + case 'minecraft:item_enchantment': + return wrap(resourceLocation_resourceLocation({ category: 'enchantment' })); + case 'minecraft:item_predicate': + return wrap(parser_argument_itemPredicate); + case 'minecraft:item_slot': + return wrap((src, ctx) => { + return commandLiteral({ pool: getItemSlotArgumentValues(ctx) })(src, ctx); + }); + case 'minecraft:item_slots': + return wrap((src, ctx) => { + return commandLiteral({ pool: getItemSlotsArgumentValues(ctx) })(src, ctx); + }); + case 'minecraft:item_stack': + return wrap(parser_argument_itemStack); + case 'minecraft:loot_modifier': + return wrap(resourceOrInline('item_modifier')); + case 'minecraft:loot_predicate': + return wrap(resourceOrInline('predicate')); + case 'minecraft:loot_table': + return wrap(resourceOrInline('loot_table')); + case 'minecraft:message': + return wrap(message); + case 'minecraft:mob_effect': + return wrap(resourceLocation_resourceLocation({ category: 'mob_effect' })); + case 'minecraft:nbt_compound_tag': + return wrap(nbtDispatchedParser(compound_compound, treeNode.properties)); + case 'minecraft:nbt_path': + return wrap(nbtPathParser(path_path, treeNode.properties)); + case 'minecraft:nbt_tag': + return wrap(nbtDispatchedParser(entry_entry, treeNode.properties)); + case 'minecraft:objective': + return wrap(objective(SymbolUsageType.is(treeNode.properties?.usageType) + ? treeNode.properties?.usageType + : undefined)); + case 'minecraft:objective_criteria': + return wrap(argument_objectiveCriteria); + case 'minecraft:operation': + return wrap(commandLiteral({ pool: OperationArgumentValues, colorTokenType: 'operator' })); + case 'minecraft:particle': + return wrap(parser_argument_particle); + case 'minecraft:resource': + case 'minecraft:resource_key': + case 'minecraft:resource_or_tag': + case 'minecraft:resource_or_tag_key': + const allowTag = treeNode.parser === 'minecraft:resource_or_tag' + || treeNode.parser === 'minecraft:resource_or_tag_key'; + return wrap(resourceLocation_resourceLocation({ + category: ResourceLocation.shorten(treeNode.properties.registry), + allowTag, + })); + case 'minecraft:resource_location': + return wrap(resourceLocation_resourceLocation(treeNode.properties ?? { pool: [], allowUnknown: true })); + case 'minecraft:resource_selector': + return wrap(resourceSelector(treeNode.properties.registry)); + case 'minecraft:rotation': + return wrap(parser_argument_vector({ dimension: 2, noLocal: true })); + case 'minecraft:score_holder': + return wrap(argument_scoreHolder(treeNode.properties.usageType, treeNode.properties.amount)); + case 'minecraft:scoreboard_slot': + // `BELOWNAME` and `sidebar.team.r--.+++e----__d` are also legal slots. + // But I do not want to spend time supporting them. + return wrap((src, ctx) => { + return commandLiteral({ pool: getScoreboardSlotArgumentValues(ctx) })(src, ctx); + }); + case 'minecraft:style': + return wrap(typeRefParser('::java::server::util::text::TextStyle')); + case 'minecraft:swizzle': + return wrap(commandLiteral({ pool: SwizzleArgumentValues })); + case 'minecraft:team': + return wrap(team(SymbolUsageType.is(treeNode.properties?.usageType) + ? treeNode.properties?.usageType + : undefined)); + case 'minecraft:template_mirror': + return wrap(commandLiteral({ pool: MirrorValues })); + case 'minecraft:template_rotation': + return wrap(commandLiteral({ pool: RotationValues })); + case 'minecraft:time': + return wrap(time); + case 'minecraft:uuid': + return wrap(uuid); + case 'minecraft:vec2': + return wrap(parser_argument_vector({ dimension: 2, noLocal: true })); + case 'minecraft:vec3': + return wrap(parser_argument_vector({ dimension: 3 })); + case 'spyglassmc:criterion': + const advancementNode = prevNodes.length > 0 + ? prevNodes[prevNodes.length - 1].children[0] + : undefined; + if (ResourceLocationNode.is(advancementNode)) { + return wrap(criterion(ResourceLocationNode.toString(advancementNode, 'full'), SymbolUsageType.is(treeNode.properties?.usageType) + ? treeNode.properties?.usageType + : undefined)); + } + return wrap(greedyString); + case 'spyglassmc:tag': + return wrap(tag(SymbolUsageType.is(treeNode.properties?.usageType) + ? treeNode.properties?.usageType + : undefined)); + default: + // Unknown parser. + return undefined; + } +}; +function parser_argument_block(isPredicate) { + return util_map(sequence([ + resourceLocation_resourceLocation({ category: 'block', allowTag: isPredicate }), + optional(util_map(failOnEmpty(record_record({ + start: '[', + pair: { + key: string_string({ + ...BrigadierStringOptions, + colorTokenType: 'property', + }), + sep: '=', + value: brigadierString, + end: ',', + trailingEnd: true, + }, + end: ']', + })), (res) => ({ ...res, type: 'mcfunction:block/states' }))), + optional(failOnEmpty(compound_compound)), + ]), (res) => { + const ans = { + type: 'mcfunction:block', + range: res.range, + children: res.children, + id: res.children.find(ResourceLocationNode.is), + states: res.children.find(BlockStatesNode.is), + nbt: res.children.find(NbtCompoundNode.is), + isPredicate, + }; + return ans; + }); +} +const blockState = parser_argument_block(false); +const blockPredicate = parser_argument_block(true); +function argument_double(min = DoubleMin, max = DoubleMax) { + return float_float({ pattern: FloatPattern, min, max }); +} +function argument_float(min = FloatMin, max = FloatMax) { + return float_float({ pattern: FloatPattern, min, max }); +} +function argument_integer(min = IntegerMin, max = IntegerMax) { + return integer_integer({ pattern: IntegerPattern, min, max }); +} +function argument_long(min, max) { + return long_long({ + pattern: IntegerPattern, + min: BigInt(min ?? LongMin), + max: BigInt(max ?? LongMax), + }); +} +function argument_coordinate(integerOnly = false) { + return (src, ctx) => { + const ans = { + type: 'mcfunction:coordinate', + notation: '', + range: Range.create(src), + value: 0, + }; + if (src.trySkip('^')) { + ans.notation = '^'; + } + else if (src.trySkip('~')) { + ans.notation = '~'; + } + if ((src.canReadInLine() && src.peek() !== ' ') || ans.notation === '') { + const result = (integerOnly && ans.notation === '' ? argument_integer : argument_double)()(src, ctx); + ans.value = Number(result.value); + } + ans.range.end = src.cursor; + return ans; + }; +} +function criterion(advancement, usageType, terminators = []) { + return unquotableSymbol({ category: 'advancement', subcategory: 'criterion', parentPath: [advancement], usageType }, terminators); +} +function argument_entity(amount, type) { + return util_map(util_select([{ predicate: (src) => src.peek() === '@', parser: argument_selector() }, { + parser: util_any([ + failOnError(uuid), + validateLength(brigadierString, PlayerNameMaxLength, 'mcfunction.parser.entity-selector.player-name.too-long'), + ]), + }]), (res, _src, ctx) => { + const ans = { type: 'mcfunction:entity', range: res.range, children: [res] }; + if (StringNode.is(res)) { + ans.playerName = res; + } + else if (EntitySelectorNode.is(res)) { + ans.selector = res; + } + else { + ans.uuid = res; + } + if (amount === 'single' && ans.selector && !ans.selector.single) { + ctx.err.report(localize('mcfunction.parser.entity-selector.multiple-disallowed'), ans); + } + if (type === 'players' + && (ans.uuid + || (ans.selector && !ans.selector.playersOnly && !ans.selector.currentEntity))) { + ctx.err.report(localize('mcfunction.parser.entity-selector.entities-disallowed'), ans); + } + return ans; + }); +} +const greedyString = string_string({ + unquotable: { blockList: new Set(['\n', '\r']) }, +}); +const parser_argument_itemStack = (src, ctx) => { + const oldFormat = shouldUseOldItemStackFormat(ctx); + return util_map(sequence([ + resourceLocation_resourceLocation({ category: 'item' }), + oldFormat + ? optional(failOnEmpty(compound_compound)) + : optional(failOnEmpty(components)), + ]), (res) => { + const ans = { + type: 'mcfunction:item_stack', + range: res.range, + children: res.children, + id: res.children.find(ResourceLocationNode.is), + components: res.children.find(ComponentListNode.is), + nbt: res.children.find(NbtCompoundNode.is), + }; + return ans; + })(src, ctx); +}; +const parser_argument_itemPredicate = (src, ctx) => { + const oldFormat = shouldUseOldItemStackFormat(ctx); + return util_map(sequence([ + oldFormat + ? resourceLocation_resourceLocation({ category: 'item', allowTag: true }) + : util_any([ + resourceLocation_resourceLocation({ category: 'item', allowTag: true }), + literal('*'), + ]), + oldFormat + ? optional(failOnEmpty(compound_compound)) + : optional(argument_componentTests), + ]), (res) => { + const ans = { + type: 'mcfunction:item_predicate', + range: res.range, + children: res.children, + id: (res.children.find(ResourceLocationNode.is) + || res.children.find(LiteralNode.is)), + tests: res.children.find(ComponentTestsNode.is), + nbt: res.children.find(NbtCompoundNode.is), + }; + return ans; + })(src, ctx); +}; +function typeRefParser(typeRef) { + return (src, ctx) => { + const release = ctx.project['loadedVersion']; + if (!release || ReleaseVersion.cmp(release, '1.21.5') < 0) { + return jsonParser(typeRef)(src, ctx); + } + return nbtParser(typeRef)(src, ctx); + }; +} +function jsonParser(typeRef) { + return util_map(entry, (res) => ({ + type: 'json:typed', + range: res.range, + children: [res], + targetType: { kind: 'reference', path: typeRef }, + })); +} +function nbtParser(typeRef) { + return util_map(entry_entry, (res) => ({ + type: 'nbt:typed', + range: res.range, + children: [res], + targetType: { kind: 'reference', path: typeRef }, + })); +} +function commandLiteral(options) { + return (src, ctx) => { + const ans = literal(options)(src, ctx); + if (ans.value.length === 0) { + ans.value = src.readUntil(...Whitespaces); + ans.range = Range.create(ans.range.start, src); + } + return ans; + }; +} +const message = (src, ctx) => { + const ans = { + type: 'mcfunction:message', + range: Range.create(src), + children: [], + }; + while (src.canReadInLine()) { + if (EntitySelectorAtVariable.is(src.peek(2))) { + ans.children.push(argument_selector(true)(src, ctx)); + } + else { + ans.children.push(stopBefore(greedyString, ...EntitySelectorAtVariable.filterAvailable(ctx))(src, ctx)); + } + } + return ans; +}; +function nbtDispatchedParser(parser, properties) { + return util_map(parser, (res) => { + const ans = { type: 'mcfunction:nbt', range: res.range, children: [res], properties }; + return ans; + }); +} +function nbtPathParser(parser, properties) { + return util_map(parser, (res) => { + const ans = { + type: 'mcfunction:nbt_path', + range: res.range, + children: [res], + properties, + }; + return ans; + }); +} +const parser_argument_particle = (src, ctx) => { + const release = ctx.project['loadedVersion']; + if (!release || ReleaseVersion.cmp(release, '1.20.5') >= 0) { + return util_map(sequence([ + resourceLocation_resourceLocation({ category: 'particle_type' }), + optional(failOnEmpty(compound_compound)), + ]), (res) => { + const ans = { + type: 'mcfunction:particle', + range: res.range, + children: res.children, + id: res.children.find(ResourceLocationNode.is), + }; + return ans; + })(src, ctx); + } + const sep = util_map(common_sep, () => []); + const vec = parser_argument_vector({ dimension: 3 }); + const color = util_map(vec, (res) => ({ + ...res, + color: res.children.length === 3 + ? { + value: Color.fromDecRGB(res.children[0].value, res.children[1].value, res.children[2].value), + format: [ColorFormat.DecRGB], + } + : undefined, + })); + const map = { + block: blockState, + block_marker: blockState, + dust: sequence([color, argument_float()], sep), + dust_color_transition: sequence([color, argument_float(), color], sep), + falling_dust: blockState, + item: parser_argument_itemStack, + sculk_charge: argument_float(), + shriek: argument_integer(), + vibration: sequence([vec, argument_integer()], sep), + }; + return util_map(sequence([resourceLocation_resourceLocation({ category: 'particle_type' }), { + get: (res) => { + return map[ResourceLocationNode.toString(res.children[0], 'short')]; + }, + }], sep), (res) => { + const ans = { + type: 'mcfunction:particle', + range: res.range, + children: res.children, + id: res.children.find(ResourceLocationNode.is), + }; + return ans; + })(src, ctx); +}; +function argument_range(type, min, max, minSpan, maxSpan, cycleable) { + const number = type === 'float' + ? argument_float(min, max) + : argument_integer(min, max); + const low = failOnEmpty(stopBefore(number, '..')); + const sep = failOnEmpty(literal({ pool: ['..'], colorTokenType: 'keyword' })); + const high = failOnEmpty(number); + return util_map(util_any([ + /* exactly */ sequence([low]), + /* atLeast */ sequence([low, sep]), + /* atMost */ sequence([sep, high]), + /* between */ sequence([low, sep, high]), + ]), (res, _src, ctx) => { + const valueNodes = type === 'float' + ? res.children.filter(FloatNode.is) + : res.children.filter(IntegerNode.is); + const sepNode = res.children.find(LiteralNode.is); + const ans = { + type: type === 'float' ? 'mcfunction:float_range' : 'mcfunction:int_range', + range: res.range, + children: res.children, + value: sepNode + ? valueNodes.length === 2 + ? [valueNodes[0].value, valueNodes[1].value] + : Range.endsBefore(valueNodes[0].range, sepNode.range.start) + ? [valueNodes[0].value, undefined] + : [undefined, valueNodes[0].value] + : [valueNodes[0].value, valueNodes[0].value], + }; + if (!cycleable + && ans.value[0] !== undefined + && ans.value[1] !== undefined + && ans.value[0] > ans.value[1]) { + ctx.err.report(localize('mcfunction.parser.range.min>max', ans.value[0], ans.value[1]), res); + } + else if (minSpan !== undefined || maxSpan !== undefined) { + const span = ans.value[0] !== undefined && ans.value[1] !== undefined + ? Math.abs(ans.value[0] - ans.value[1]) + : (ans.value[0] ?? ans.value[1] ?? Infinity); + if (minSpan !== undefined && span < minSpan) { + ctx.err.report(localize('mcfunction.parser.range.span-too-small', span, minSpan), res); + } + else if (maxSpan !== undefined && span > maxSpan) { + ctx.err.report(localize('mcfunction.parser.range.span-too-large', span, maxSpan), res); + } + } + return ans; + }); +} +function resourceOrInline(category) { + return util_select([{ + predicate: (src) => LegalResourceLocationCharacters.has(src.peek()), + parser: resourceLocation_resourceLocation({ category }), + }, { + parser: util_map(entry_entry, (res) => { + const ans = { + type: 'mcfunction:nbt_resource', + range: res.range, + children: [res], + category, + }; + return ans; + }), + }]); +} +const LegalResourceSelectorCharacters = new Set([ + ...LegalResourceLocationCharacters, + ':', + '/', + '*', + '?', +]); +function resourceSelector(registry) { + return string_string({ + colorTokenType: 'resourceLocation', + unquotable: { allowList: LegalResourceSelectorCharacters }, + }); +} +function selectorPrefix(ignoreInvalidPrefix) { + return (src, ctx) => { + const start = src.cursor; + let value; + if (ignoreInvalidPrefix) { + value = src.peek(2); + src.skip(2); + } + else { + value = src.readUntil(' ', '\r', '\n', '['); + } + const allowedVariables = EntitySelectorAtVariable.filterAvailable(ctx); + const ans = { + type: 'literal', + range: Range.create(start, src), + options: { pool: allowedVariables }, + value, + }; + if (!allowedVariables.includes(value) && !ignoreInvalidPrefix) { + ctx.err.report(localize('mcfunction.parser.entity-selector.invalid', ans.value), ans); + } + return ans; + }; +} +/** + * Failure when not beginning with `@[parse]` + */ +function argument_selector(ignoreInvalidPrefix = false) { + let chunkLimited; + let currentEntity; + let dimensionLimited; + let playersOnly; + let predicates; + let single; + let typeLimited; + return util_map(sequence([failOnEmpty(selectorPrefix(ignoreInvalidPrefix)), { + get: (res) => { + const variable = LiteralNode.is(res.children?.[0]) + ? res.children[0].value + : undefined; + currentEntity = variable ? variable === '@s' : undefined; + playersOnly = variable + ? variable === '@p' || variable === '@a' || variable === '@r' + : undefined; + predicates = variable === '@e' ? ['Entity::isAlive'] : undefined; + single = variable ? ['@p', '@r', '@s', '@n'].includes(variable) : undefined; + typeLimited = playersOnly; + function invertable(parser) { + return util_map(sequence([ + optional(failOnEmpty(literal({ pool: ['!'], colorTokenType: 'keyword' }))), + (src) => { + src.skipSpace(); + return undefined; + }, + parser, + ]), (res) => { + const ans = { + type: 'mcfunction:entity_selector/arguments/value/invertable', + range: res.range, + children: res.children, + inverted: !!res.children.find((n) => LiteralNode.is(n) && n.value === '!'), + value: res.children.find((n) => !LiteralNode.is(n) || n.value !== '!'), + }; + return ans; + }); + } + return optional(util_map(failOnEmpty(record_record({ + start: '[', + pair: { + key: string_string({ + ...BrigadierStringOptions, + value: { + parser: literal({ + pool: [...EntitySelectorNode.ArgumentKeys], + colorTokenType: 'property', + }), + type: 'literal', + }, + }), + sep: '=', + value: { + get: (record, key) => { + const hasKey = (key) => !!record.children.find((p) => p.key?.value === key); + const hasNonInvertedKey = (key) => !!record.children.find((p) => p.key?.value === key + && !p.value?.inverted); + switch (key?.value) { + case 'advancements': + return util_map(record_record({ + start: '{', + pair: { + key: resourceLocation_resourceLocation({ + category: 'advancement', + }), + sep: '=', + value: { + get: (_, key) => util_select([{ + predicate: (src) => src.peek() === '{', + parser: util_map(record_record({ + start: '{', + pair: { + key: key + ? criterion(ResourceLocationNode + .toString(key, 'full'), 'reference', ['}', ',', '=']) + : unquotedString, + sep: '=', + value: boolean_boolean, + end: ',', + trailingEnd: true, + }, + end: '}', + }), (res) => { + const ans = { + ...res, + type: 'mcfunction:entity_selector/arguments/advancements/criteria', + }; + return ans; + }), + }, { parser: boolean_boolean }]), + }, + end: ',', + trailingEnd: true, + }, + end: '}', + }), (res, _, ctx) => { + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + const ans = { + ...res, + type: 'mcfunction:entity_selector/arguments/advancements', + }; + return ans; + }); + case 'distance': + return util_map(argument_range('float', 0), (res, _, ctx) => { + dimensionLimited = true; + // x, y, z, dx, dy, dz take precedence over distance, so we use ??= instead of = to ensure it won't override the result. + chunkLimited ??= !playersOnly + && res.value[1] !== undefined; + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case 'gamemode': + return util_map(invertable(string_string({ + unquotable: BrigadierUnquotableOption, + value: { + type: 'literal', + parser: literal(...GamemodeArgumentValues), + }, + })), (res, _, ctx) => { + playersOnly = true; + if (res.inverted + ? hasNonInvertedKey(key.value) + : hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case 'limit': + return util_map(argument_integer(0), (res, _, ctx) => { + single = res.value <= 1; + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + if (currentEntity) { + ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.not-applicable', localeQuote(key.value)), key); + } + return res; + }); + case 'level': + return util_map(argument_range('integer', 0), (res, _, ctx) => { + playersOnly = true; + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case 'name': + return util_map(invertable(brigadierString), (res, _, ctx) => { + if (res.inverted + ? hasNonInvertedKey(key.value) + : hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case 'nbt': + return invertable(compound_compound); + case 'predicate': + return invertable(resourceLocation_resourceLocation({ category: 'predicate' })); + case 'scores': + return util_map(record_record({ + start: '{', + pair: { + key: objective('reference', [ + '[', + '=', + ',', + ']', + '{', + '}', + ]), + sep: '=', + value: argument_range('integer'), + end: ',', + trailingEnd: true, + }, + end: '}', + }), (res, _, ctx) => { + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + const ans = { + ...res, + type: 'mcfunction:entity_selector/arguments/scores', + }; + return ans; + }); + case 'sort': + return util_map(string_string({ + unquotable: BrigadierUnquotableOption, + value: { + type: 'literal', + parser: literal('arbitrary', 'furthest', 'nearest', 'random'), + }, + }), (res, _, ctx) => { + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + if (currentEntity) { + ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.not-applicable', localeQuote(key.value)), key); + } + return res; + }); + case 'tag': + return invertable(tag('reference', ['[', '=', ',', ']', '{', '}'])); + case 'team': + return util_map(invertable(team('reference', ['[', '=', ',', ']', '{', '}'])), (res, _, ctx) => { + if (res.inverted + ? hasNonInvertedKey(key.value) + : hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case 'type': + return util_map(invertable(resourceLocation_resourceLocation({ + category: 'entity_type', + allowTag: true, + })), (res, _, ctx) => { + if (typeLimited) { + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + else { + ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.not-applicable', localeQuote(key.value)), key); + } + } + else if (!res.inverted && !res.value.isTag) { + typeLimited = true; + if (ResourceLocationNode.toString(res.value, 'short') === 'player') { + playersOnly = true; + } + } + return res; + }); + case 'x': + case 'y': + case 'z': + return util_map(argument_double(), (res, _, ctx) => { + dimensionLimited = true; + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case 'dx': + case 'dy': + case 'dz': + return util_map(argument_double(), (res, _, ctx) => { + dimensionLimited = true; + chunkLimited = !playersOnly; + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case 'x_rotation': + case 'y_rotation': + return util_map(argument_range('float', undefined, undefined, undefined, undefined, true), (res, _, ctx) => { + if (hasKey(key.value)) { + ctx.err.report(localize('duplicate-key', localeQuote(key.value)), key); + } + return res; + }); + case undefined: + // The key is empty. Let's just fail the value as well. + return () => Parser_Failure; + default: + // The key is unknown. + return (_src, ctx) => { + ctx.err.report(localize('mcfunction.parser.entity-selector.arguments.unknown', localeQuote(key.value)), key); + return Parser_Failure; + }; + } + }, + }, + end: ',', + trailingEnd: true, + }, + end: ']', + })), (res) => { + const ans = { + ...res, + type: 'mcfunction:entity_selector/arguments', + }; + return ans; + })); + }, + }]), (res) => { + const ans = { + type: 'mcfunction:entity_selector', + range: res.range, + children: res.children, + variable: res.children.find(LiteralNode.is).value.slice(1), + arguments: res.children.find(EntitySelectorArgumentsNode.is), + chunkLimited, + currentEntity, + dimensionLimited, + playersOnly, + predicates, + single, + typeLimited, + }; + ans.hover = getEntitySelectorHover(ans); + return ans; + }); +} +// This is more like a proof-of-concept. +// Might not make into the actual release. +function getEntitySelectorHover(node) { + const grades = new Map([ + [0, '🤢'], // Bad + [1, '😅'], // Normal + [2, 'Good'], // Good + [3, 'Great'], // Great + [4, '😌👌'], // Excellent + ]); + let ans; + if (node.currentEntity) { + ans = `**Performance**: ${grades.get(4)} +- \`currentEntity\`: \`${node.currentEntity}\``; + } + else { + const amountOfTrue = [node.chunkLimited, node.dimensionLimited, node.playersOnly, node.typeLimited].filter((v) => v).length; + ans = `**Performance**: ${grades.get(amountOfTrue)} +- \`chunkLimited\`: \`${!!node.chunkLimited}\` +- \`dimensionLimited\`: \`${!!node.dimensionLimited}\` +- \`playersOnly\`: \`${!!node.playersOnly}\` +- \`typeLimited\`: \`${!!node.typeLimited}\``; + } + if (node.predicates?.length) { + ans += ` + +------ +**Predicates**: +${node.predicates.map((p) => `- \`${p}\``).join('\n')}`; + } + return ans; +} +function scoreHolderFakeName(usageType) { + return validateLength(argument_symbol({ category: 'score_holder', usageType }), FakeNameMaxLength, 'mcfunction.parser.score_holder.fake-name.too-long'); +} +function argument_scoreHolder(usageType, amount) { + return util_map(util_select([ + { + predicate: (src) => src.peek() === '*' + && (!src.canRead(2) || src.matchPattern(/^\s/, 1)), + parser: literal('*'), + }, + { prefix: '@', parser: argument_selector() }, + { parser: scoreHolderFakeName(usageType) }, + ]), (res, _src, ctx) => { + const ans = { + type: 'mcfunction:score_holder', + range: res.range, + children: [res], + }; + if (SymbolNode.is(res)) { + ans.fakeName = res; + } + else if (EntitySelectorNode.is(res)) { + ans.selector = res; + } + else { + ans.wildcard = res; + } + if (amount === 'single' && ans.selector && !ans.selector.single) { + ctx.err.report(localize('mcfunction.parser.entity-selector.multiple-disallowed'), ans); + } + return ans; + }); +} +function argument_symbol(options, terminators = []) { + return stopBefore(symbol_symbol(options), Whitespaces, terminators); +} +function objective(usageType, terminators = []) { + return validateLength(unquotableSymbol({ category: 'objective', usageType }, terminators), ObjectiveMaxLength, 'mcfunction.parser.objective.too-long'); +} +const argument_objectiveCriteria = util_map(util_any([ + sequence([ + stopBefore(resourceLocation_resourceLocation({ category: 'stat_type', namespacePathSep: '.' }), ':'), + failOnEmpty(literal(':')), + { + get: (res) => { + if (ResourceLocationNode.is(res.children[0])) { + const category = ObjectiveCriteriaNode.ComplexCategories.get(ResourceLocationNode.toString(res.children[0], 'short')); + if (category) { + return resourceLocation_resourceLocation({ category, namespacePathSep: '.' }); + } + } + return resourceLocation_resourceLocation({ pool: [], allowUnknown: true, namespacePathSep: '.' }); + }, + }, + ]), + literal(...ObjectiveCriteriaNode.SimpleValues), +]), (res) => { + const ans = { type: 'mcfunction:objective_criteria', range: res.range }; + if (LiteralNode.is(res)) { + ans.simpleValue = res.value; + } + else { + ans.children = res.children.filter(ResourceLocationNode.is); + } + return ans; +}); +function tag(usageType, terminators = []) { + return unquotableSymbol({ category: 'tag', usageType }, terminators); +} +function team(usageType, terminators = []) { + return unquotableSymbol({ category: 'team', usageType }, terminators); +} +function unquotableSymbol(options, terminators) { + return validateUnquotable(argument_symbol(options, terminators)); +} +const time = util_map(sequence([ + argument_float(0, undefined), + optional(failOnEmpty(literal(...TimeNode.Units))), +]), (res) => { + const valueNode = res.children.find(FloatNode.is); + const unitNode = res.children.find(LiteralNode.is); + const ans = { + type: 'mcfunction:time', + range: res.range, + children: res.children, + value: valueNode.value, + unit: unitNode?.value, + }; + return ans; +}); +const unquotedString = string_string({ + unquotable: BrigadierUnquotableOption, +}); +const UuidPattern = /^[0-9a-f]+-[0-9a-f]+-[0-9a-f]+-[0-9a-f]+-[0-9a-f]+$/i; +const uuid = (src, ctx) => { + const ans = { type: 'mcfunction:uuid', range: Range.create(src), bits: [0n, 0n] }; + const raw = src.readUntil(' ', '\r', '\n', '\r'); + /** + * According to the implementation of Minecraft's UUID parser and Java's `UUID#fromString` method, + * only strings that don't have five parts and strings where any part exceed the maximum Long value are + * considered invalid. + * + * http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/default/src/share/classes/java/util/UUID.java + */ + let isLegal = false; + if (raw.match(UuidPattern)) { + try { + const parts = raw.split('-').map((p) => BigInt(`0x${p}`)); + if (parts.every((p) => p <= LongMax)) { + isLegal = true; + ans.bits[0] = BigInt.asIntN(64, (parts[0] << 32n) | (parts[1] << 16n) | parts[2]); + ans.bits[1] = BigInt.asIntN(64, (parts[3] << 48n) | parts[4]); + } + } + catch { + // Ignored. + } + } + ans.range.end = src.cursor; + if (!isLegal) { + ctx.err.report(localize('mcfunction.parser.uuid.invalid'), ans); + } + return ans; +}; +function validateLength(parser, maxLength, localeKey) { + return (src, ctx) => { + if (!shouldValidateLength(ctx)) { + return parser(src, ctx); + } + return util_map(parser, (res, _src, ctx) => { + if (res.value.length > maxLength) { + ctx.err.report(localize(localeKey, maxLength), res); + } + return res; + })(src, ctx); + }; +} +function validateUnquotable(parser) { + return util_map(parser, (res, _src, ctx) => { + if (!res.value.match(BrigadierUnquotablePattern)) { + ctx.err.report(localize('parser.string.illegal-brigadier', localeQuote(res.value)), res); + } + return res; + }); +} +function parser_argument_vector(options) { + return (src, ctx) => { + const ans = { + type: 'mcfunction:vector', + range: Range.create(src), + children: [], + options, + system: 0 /* CoordinateSystem.World */, + }; + if (src.peek() === '^') { + ans.system = 1 /* CoordinateSystem.Local */; + } + for (let i = 0; i < options.dimension; i++) { + if (i > 0) { + common_sep(src, ctx); + } + const coord = options.integersOnly + ? argument_coordinate(options.integersOnly)(src, ctx) + : argument_coordinate(options.integersOnly)(src, ctx); + ans.children.push(coord); + if ((ans.system === 1 /* CoordinateSystem.Local */) !== (coord.notation === '^')) { + ctx.err.report(localize('mcfunction.parser.vector.mixed'), coord); + } + } + if (options.noLocal && ans.system === 1 /* CoordinateSystem.Local */) { + ctx.err.report(localize('mcfunction.parser.vector.local-disallowed'), ans); + } + ans.range.end = src.cursor; + return ans; + }; +} +const components = (src, ctx) => { + const release = ctx.project['loadedVersion']; + const allowComponentRemoval = !release || ReleaseVersion.cmp(release, '1.21') >= 0; + const ans = { + type: 'mcfunction:component_list', + range: Range.create(src), + children: [], + }; + if (!src.trySkip('[')) { + return Parser_Failure; + } + ans.innerRange = Range.create(src); + src.skipWhitespace(); + while (src.canRead() && src.peek() !== ']') { + const start = src.cursor; + if (allowComponentRemoval && src.tryPeek('!')) { + const prefix = literal('!')(src, ctx); + src.skipWhitespace(); + const key = resourceLocation_resourceLocation({ category: 'data_component_type' })(src, ctx); + ans.children.push({ + type: 'mcfunction:component_removal', + range: Range.create(start, src), + children: [prefix, key], + prefix, + key, + }); + src.skipWhitespace(); + } + else { + const key = resourceLocation_resourceLocation({ category: 'data_component_type' })(src, ctx); + src.skipWhitespace(); + literal('=')(src, ctx); + src.skipWhitespace(); + const value = entry_entry(src, ctx); + if (value === Parser_Failure) { + ctx.err.report(localize('expected', localize('parser.record.value')), Range.create(src, () => src.skipUntilOrEnd(',', ']', '\r', '\n'))); + ans.children.push({ + type: 'mcfunction:component', + range: Range.create(start, src), + children: [key], + key, + value: undefined, + }); + } + else { + ans.children.push({ + type: 'mcfunction:component', + range: Range.create(start, src), + children: [key, value], + key, + value, + }); + } + src.skipWhitespace(); + } + if (src.trySkip(',')) { + src.skipWhitespace(); + if (src.peek() === ']') { + break; + } + } + else { + break; + } + } + src.skipWhitespace(); + ans.innerRange.end = src.cursor; + literal(']')(src, ctx); + ans.range.end = src.cursor; + return ans; +}; +const componentTest = (src, ctx) => { + const start = src.cursor; + src.skipWhitespace(); + const negated = src.trySkip('!'); + src.skipWhitespace(); + const key = resourceLocation_resourceLocation({ category: 'data_component_type' })(src, ctx); + src.skipWhitespace(); + if (ResourceLocationNode.toString(key, 'full') === 'minecraft:count') { + key.options.category = undefined; + key.options.pool = ['minecraft:count']; + } + if (src.trySkip('=')) { + src.skipWhitespace(); + const ans = { + type: 'mcfunction:component_test_exact', + range: Range.create(start, src), + children: [key], + key, + negated, + }; + const value = entry_entry(src, ctx); + if (value === Parser_Failure) { + ctx.err.report(localize('expected', localize('nbt.node')), src); + src.skipUntilOrEnd(',', '|', ']'); + } + else { + ans.children.push(value); + ans.value = value; + } + src.skipWhitespace(); + ans.range.end = src.cursor; + return ans; + } + if (src.trySkip('~')) { + src.skipWhitespace(); + if (key.options.category !== undefined) { + const release = ctx.project['loadedVersion']; + if (release && ReleaseVersion.cmp(release, '1.21.5') < 0) { + key.options.category = 'item_sub_predicate_type'; + } + else { + key.options.category = 'data_component_predicate_type'; + } + } + const ans = { + type: 'mcfunction:component_test_sub_predicate', + range: Range.create(start, src), + children: [key], + key, + negated, + }; + const predicate = entry_entry(src, ctx); + if (predicate === Parser_Failure) { + ctx.err.report(localize('expected', localize('nbt.node')), src); + src.skipUntilOrEnd(',', '|', ']'); + } + else { + ans.children.push(predicate); + ans.value = predicate; + } + src.skipWhitespace(); + ans.range.end = src.cursor; + return ans; + } + const ans = { + type: 'mcfunction:component_test_exists', + range: Range.create(start, src), + children: [key], + key, + negated, + }; + return ans; +}; +const componentTestsAllOf = (src, ctx) => { + const ans = { + type: 'mcfunction:component_tests_all_of', + range: Range.create(src), + children: [], + }; + while (src.canRead()) { + src.skipWhitespace(); + const testNode = componentTest(src, ctx); + ans.children.push(testNode); + src.skipWhitespace(); + if (src.peek() === ',') { + src.skip(); + } + else if (src.peek() === '|' || src.peek() === ']') { + break; + } + else { + ctx.err.report(localize('expected', localeQuote(']')), src); + src.skipUntilOrEnd(',', '|', ']'); + } + } + ans.range.end = src.cursor; + return ans; +}; +const componentTestsAnyOf = (src, ctx) => { + const ans = { + type: 'mcfunction:component_tests_any_of', + range: Range.create(src), + children: [], + }; + while (src.canRead()) { + src.skipWhitespace(); + const allOfNode = componentTestsAllOf(src, ctx); + ans.children.push(allOfNode); + src.skipWhitespace(); + if (src.peek() === '|') { + src.skip(); + } + else if (src.peek() === ']') { + break; + } + else { + ctx.err.report(localize('expected', localeQuote(']')), src); + src.skipUntilOrEnd('|', ']'); + } + } + ans.range.end = src.cursor; + return ans; +}; +const argument_componentTests = (src, ctx) => { + const ans = { + type: 'mcfunction:component_tests', + range: Range.create(src), + }; + if (!src.trySkip('[')) { + return Parser_Failure; + } + src.skipWhitespace(); + const tests = optional(failOnEmpty(componentTestsAnyOf))(src, ctx); + if (tests) { + ans.children = [tests]; + } + src.skipWhitespace(); + literal(']')(src, ctx); + ans.range.end = src.cursor; + return ans; +}; +//# sourceMappingURL=argument.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/parser/index.js + +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/mcdocAttributes.js + + + + + + + + +const mcfunction_mcdocAttributes_validator = validator_namespaceObject; +const commandValidator = mcfunction_mcdocAttributes_validator.alternatives(mcfunction_mcdocAttributes_validator.tree({ + slash: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('allowed', 'required', 'chat')), + macro: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('implicit')), + max_length: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.number), + empty: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('allowed')), + incomplete: mcfunction_mcdocAttributes_validator.optional(mcfunction_mcdocAttributes_validator.options('allowed')), +}), () => ({})); +const entityValidator = mcfunction_mcdocAttributes_validator.alternatives(mcfunction_mcdocAttributes_validator.tree({ + amount: mcfunction_mcdocAttributes_validator.options('multiple', 'single'), + type: mcfunction_mcdocAttributes_validator.options('entities', 'players'), +}), () => ({ amount: 'multiple', type: 'entities' })); +const scoreHolderValidator = mcfunction_mcdocAttributes_validator.alternatives(mcfunction_mcdocAttributes_validator.tree({ + amount: mcfunction_mcdocAttributes_validator.options('multiple', 'single'), +}), () => ({ amount: 'multiple' })); +function mcfunction_mcdocAttributes_registerMcdocAttributes(meta, rootTreeNode) { + registerAttribute(meta, 'command', commandValidator, { + // TODO: fix completer inside commands + stringParser: ({ slash, macro, max_length, empty, incomplete }) => { + return (src, ctx) => { + if (macro) { + return macro_macro(false)(src, ctx); + } + if ((empty && !src.canRead()) || (slash === 'chat' && src.peek() !== '/')) { + return string_string({ + unquotable: { blockList: new Set(), allowEmpty: true }, + })(src, ctx); + } + const tmpCtx = { ...ctx, err: new ErrorReporter(ctx.err.source) }; + const result = command_command(rootTreeNode, argument, { + slash: slash === 'chat' ? 'allowed' : slash, + maxLength: max_length, + })(src, tmpCtx); + if (incomplete) { + tmpCtx.err.errors = tmpCtx.err.errors.filter(e => e.range.end < result.range.end); + } + ctx.err.absorb(tmpCtx.err); + return result; + }; + }, + }); + registerAttribute(meta, 'text_component', () => undefined, { + stringParser: () => mcdocAttributes_makeInfallible(util_map(entry, (res) => ({ + type: 'json:typed', + range: res.range, + children: [res], + targetType: { kind: 'reference', path: '::java::server::util::text::Text' }, + })), localize('text-component')), + }); + registerAttribute(meta, 'objective', () => undefined, { + stringParser: () => objective('reference'), + stringMocker: (_, __, ctx) => SymbolNode.mock(ctx.offset, { category: 'objective' }), + }); + registerAttribute(meta, 'team', () => undefined, { + stringParser: () => team('reference'), + stringMocker: (_, __, ctx) => SymbolNode.mock(ctx.offset, { category: 'team' }), + }); + registerAttribute(meta, 'score_holder', scoreHolderValidator, { + stringParser: (config) => mcdocAttributes_makeInfallible(argument_scoreHolder('reference', config.amount), localize('score-holder')), + stringMocker: (_, __, ctx) => ScoreHolderNode.mock(ctx.offset), + }); + registerAttribute(meta, 'tag', () => undefined, { + stringParser: () => tag('reference'), + stringMocker: (_, __, ctx) => SymbolNode.mock(ctx.offset, { category: 'tag' }), + }); + registerAttribute(meta, 'block_predicate', () => undefined, { + stringParser: () => blockPredicate, + stringMocker: (_, __, ctx) => BlockNode.mock(ctx.offset, true), + }); + registerAttribute(meta, 'entity', entityValidator, { + stringParser: (config) => mcdocAttributes_makeInfallible(argument_entity(config.amount, config.type), localize('selector')), + stringMocker: (_, __, ctx) => EntitySelectorNode.mock(ctx.offset, { + pool: EntitySelectorAtVariable.filterAvailable(ctx), + }), + }); + registerAttribute(meta, 'item_slots', () => undefined, { + stringParser: (_, __, ctx) => literal({ pool: getItemSlotsArgumentValues(ctx) }), + stringMocker: (_, __, ctx) => LiteralNode.mock(ctx.offset, { pool: getItemSlotsArgumentValues(ctx) }), + }); + registerAttribute(meta, 'uuid', () => undefined, { + stringParser: () => uuid, + }); +} +function mcdocAttributes_makeInfallible(parser, message) { + return (src, ctx) => { + const start = src.cursor; + const res = parser(src, ctx); + if (res === Parser_Failure) { + ctx.err.report(localize('expected', message), Range.create(start, src.skipRemaining())); + return undefined; + } + return res; + }; +} +//# sourceMappingURL=mcdocAttributes.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/signatureHelpProvider.js + + +/** + * Only command options that can be satisfied by the current command node will be listed in `signatures`. + * Only parameters at and immediately after the `offset` will be listed in `parameters`. + */ +function signatureHelpProvider(rootTreeNode) { + return (fileNode, ctx) => { + if (fileNode.children[0]?.type !== 'mcfunction:entry') { + // Not mcfunction. + return undefined; + } + const node = getSelectedCommandNode(fileNode, ctx.offset); + if (!CommandNode.is(node)) { + // Not a command node. + return undefined; + } + const argumentNodes = node ? node.children : []; + const options = signatureHelpProvider_getOptions(rootTreeNode, argumentNodes); + if (options.length === 0) { + // Not matching any syntax at all. + return undefined; + } + let selectedIndex = 0; + for (const child of argumentNodes) { + if (ctx.offset > child.range.end) { + selectedIndex += 1; + } + else { + break; + } + } + if (selectedIndex >= options[0].length) { + // No matching syntax for the selected argument node. + return undefined; + } + const ans = { activeSignature: 0, signatures: [] }; + ans.signatures = options.map((v) => { + const part1 = v[selectedIndex]; + const part2 = selectedIndex + 1 < v.length ? ` ${v[selectedIndex + 1]}` : ''; + const label = `${part1}${part2}`; + return { + label, + activeParameter: 0, + // documentation: localize('mcfunction.signature-help.command-documentation', v[0]), + parameters: [{ label: [0, part1.length] }, { label: [part1.length, label.length] }], + }; + }); + return ans; + }; +} +function getSelectedCommandNode(fileNode, offset) { + return AstNode.findChild(fileNode.children[0], offset, true); +} +function signatureHelpProvider_getOptions(rootTreeNode, argumentNodes) { + const current = []; + let treeNode = rootTreeNode; + for (const argumentNode of argumentNodes) { + const name = argumentNode.path[argumentNode.path.length - 1]; + if (!name) { + break; + } + treeNode = resolveParentTreeNode(treeNode, rootTreeNode).treeNode?.children?.[name]; + if (!treeNode) { + break; + } + current.push(treeNodeToString(name, treeNode)); + } + if (treeNode) { + treeNode = resolveParentTreeNode(treeNode, rootTreeNode).treeNode; + if (treeNode?.children) { + return treeNodeChildrenToStringArray(treeNode.children, treeNode.executable).map((v) => [...current, v]); + } + } + return current.length ? [current] : []; +} +//# sourceMappingURL=signatureHelpProvider.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/tree/patch.js + +function getPatch(release) { + return { + children: { + advancement: { + children: { + grant: AdvancementTargets, + revoke: AdvancementTargets, + }, + }, + ...(ReleaseVersion.cmp(release, '1.16') >= 0 + ? { + attribute: { + children: { + target: { + children: { + attribute: { + properties: { + category: 'attribute', + }, + children: { + modifier: { + children: { + add: { + children: { + id: { + properties: { + category: 'attribute_modifier', + }, + }, + uuid: { + properties: { + category: 'attribute_modifier_uuid', + }, + }, + }, + }, + remove: { + children: { + id: { + properties: { + category: 'attribute_modifier', + }, + }, + uuid: { + properties: { + category: 'attribute_modifier_uuid', + }, + }, + }, + }, + value: { + children: { + get: { + children: { + id: { + properties: { + category: 'attribute_modifier', + }, + }, + uuid: { + properties: { + category: 'attribute_modifier_uuid', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + : {}), + ban: { + permission: 3, + }, + 'ban-ip': { + permission: 3, + }, + banlist: { + permission: 3, + }, + bossbar: { + children: { + add: { + children: { + id: { + properties: { + category: 'bossbar', + usageType: 'definition', + }, + }, + }, + }, + get: { + children: { + id: { + properties: { + category: 'bossbar', + }, + }, + }, + }, + remove: { + children: { + id: { + properties: { + category: 'bossbar', + }, + }, + }, + }, + set: { + children: { + id: { + properties: { + category: 'bossbar', + accessType: 1 /* SymbolAccessType.Write */, + }, + }, + }, + }, + }, + }, + data: { + children: { + get: getDataPatch('target', 'path'), + merge: getDataPatch('target', 'nbt', { + isMerge: true, + vaultAccessType: 1 /* SymbolAccessType.Write */, + }), + modify: getDataPatch('target', 'targetPath', { + nbtAccessType: 1 /* SymbolAccessType.Write */, + vaultAccessType: 1 /* SymbolAccessType.Write */, + children: (type) => ({ + append: getDataModifySource(type, { + isListIndex: true, + }), + insert: { + children: { + index: getDataModifySource(type, { + isListIndex: true, + }), + }, + }, + merge: getDataModifySource(type, { + isMerge: true, + }), + prepend: getDataModifySource(type, { + isListIndex: true, + }), + set: getDataModifySource(type), + }), + }), + remove: getDataPatch('target', 'path', { + nbtAccessType: 1 /* SymbolAccessType.Write */, + vaultAccessType: 1 /* SymbolAccessType.Write */, + }), + }, + }, + datapack: { + children: { + ...(ReleaseVersion.cmp(release, '1.21.6') >= 0 + ? { + // Added in 21w15a (1.21.6, pack format 72) + create: { + permission: 4, + }, + } + : {}), + }, + }, + debug: { + permission: 3, + }, + deop: { + permission: 3, + }, + execute: { + children: { + if: ExecuteCondition, + store: { + children: { + result: ExecuteStoreTarget, + success: ExecuteStoreTarget, + }, + }, + unless: ExecuteCondition, + }, + }, + function: { + children: { + name: { + ...(ReleaseVersion.cmp(release, '1.20.2') >= 0 + ? { + children: { + // Added in 23w31a (1.20.2, pack format 16) + arguments: { + properties: { + dispatcher: 'minecraft:macro_function', + dispatchedBy: 'name', + }, + }, + with: getDataPatch('source', 'path'), + }, + } + : {}), + }, + }, + }, + ...(ReleaseVersion.cmp(release, '1.17') >= 0 + ? { + // Added in 20w46a (1.17, pack format 7) + item: { + children: { + replace: { + children: { + block: { + children: { + pos: { + children: { + slot: { + children: { + from: { + children: { + block: { + children: { + source: { + children: { + sourceSlot: { + children: { + modifier: { + properties: { + category: 'item_modifier', + }, + }, + }, + }, + }, + }, + }, + }, + entity: { + children: { + source: { + children: { + sourceSlot: { + children: { + modifier: { + properties: { + category: 'item_modifier', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + entity: { + children: { + targets: { + children: { + slot: { + children: { + from: { + children: { + block: { + children: { + source: { + children: { + sourceSlot: { + children: { + modifier: { + properties: { + category: 'item_modifier', + }, + }, + }, + }, + }, + }, + }, + }, + entity: { + children: { + source: { + children: { + sourceSlot: { + children: { + modifier: { + properties: { + category: 'item_modifier', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + modify: { + children: { + block: { + children: { + pos: { + children: { + slot: { + children: { + modifier: { + properties: { + category: 'item_modifier', + }, + }, + }, + }, + }, + }, + }, + }, + entity: { + children: { + targets: { + children: { + slot: { + children: { + modifier: { + properties: { + category: 'item_modifier', + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + : {}), + help: { + permission: 0, + }, + ...(ReleaseVersion.cmp(release, '1.18') >= 0 + ? { + // Added in 21w37a (1.18, pack format 8) + jfr: { + permission: 4, + }, + } + : {}), + kick: { + permission: 3, + }, + list: { + permission: 0, + }, + ...(ReleaseVersion.isBetween(release, '1.16', '1.19') + ? { + // Added in 20w06a (1.16, pack format 5) + // Removed in 22w19a (1.19, pack format 10) + locatebiome: { + children: { + biome: { + properties: { + category: 'worldgen/biome', + // Allowed in 1.18.2-pre1 (1.18.2, pack format 9) + allowTag: ReleaseVersion.cmp(release, '1.18.2') >= 0, + }, + }, + }, + }, + } + : {}), + loot: { + children: { + give: { + children: { + players: LootSource, + }, + }, + insert: { + children: { + targetPos: LootSource, + }, + }, + replace: { + children: { + block: { + children: { + targetPos: { + children: { + slot: { + children: { + ...LootSource.children, + count: LootSource, + }, + }, + }, + }, + }, + }, + entity: { + children: { + entities: { + children: { + slot: { + children: { + ...LootSource.children, + count: LootSource, + }, + }, + }, + }, + }, + }, + }, + }, + spawn: { + children: { + targetPos: LootSource, + }, + }, + }, + }, + me: { + permission: 0, + }, + msg: { + permission: 0, + }, + op: { + permission: 3, + }, + pardon: { + permission: 3, + }, + 'pardon-ip': { + permission: 3, + }, + ...(ReleaseVersion.cmp(release, '1.17') >= 0 + ? { + // Added in 1.17 Pre-release 1 (1.17, pack format 7) + perf: { + permission: 4, + }, + } + : {}), + ...(ReleaseVersion.cmp(release, '1.19') >= 0 + ? { + // Added in 22w18a (1.19, pack format 10) + place: { + children: { + jigsaw: { + children: { + pool: { + children: { + target: { + properties: { + category: 'jigsaw_block_name', + allowUnknown: true, + }, + }, + }, + }, + }, + }, + template: { + children: { + template: { + properties: { + category: 'structure', + }, + }, + }, + }, + }, + }, + } + : {}), + playsound: Sound, + publish: { + permission: 4, + }, + ...(ReleaseVersion.cmp(release, '1.20.2') >= 0 + ? { + // Added in 23w31a (1.20.2, pack format 16) + random: { + children: { + reset: { + children: { + sequence: { + properties: { + category: 'random_sequence', + allowUnknown: true, + }, + }, + }, + }, + roll: { + children: { + range: { + properties: { + minSpan: 1, + maxSpan: 2147483646, + }, + children: { + sequence: { + properties: { + category: 'random_sequence', + allowUnknown: true, + }, + }, + }, + }, + }, + }, + value: { + children: { + range: { + properties: { + minSpan: 1, + maxSpan: 2147483646, + }, + children: { + sequence: { + properties: { + category: 'random_sequence', + allowUnknown: true, + }, + }, + }, + }, + }, + }, + }, + }, + } + : {}), + recipe: { + children: { + give: RecipeTargets, + take: RecipeTargets, + }, + }, + 'save-all': { + permission: 4, + }, + 'save-off': { + permission: 4, + }, + 'save-on': { + permission: 4, + }, + schedule: { + children: { + clear: { + children: { + function: { + parser: 'minecraft:function', + properties: undefined, + }, + }, + }, + }, + }, + scoreboard: { + children: { + objectives: { + children: { + add: { + children: { + objective: { + parser: 'minecraft:objective', + properties: { + usageType: 'definition', + }, + }, + }, + }, + }, + }, + players: { + children: { + add: ObjectiveWriteTargets, + operation: ObjectiveWriteTargets, + remove: ObjectiveWriteTargets, + reset: ObjectiveWriteTargets, + set: ObjectiveWriteTargets, + }, + }, + }, + }, + setidletimeout: { + permission: 3, + }, + stop: { + permission: 4, + }, + stopsound: { + children: { + targets: { + children: { + '*': Sound, + ambient: Sound, + block: Sound, + hostile: Sound, + master: Sound, + music: Sound, + neutral: Sound, + player: Sound, + record: Sound, + voice: Sound, + weather: Sound, + }, + }, + }, + }, + summon: { + children: { + entity: { + children: { + pos: { + children: { + nbt: { + properties: { + dispatcher: 'minecraft:entity', + dispatchedBy: 'entity', + }, + }, + }, + }, + }, + }, + }, + }, + tag: { + children: { + targets: { + children: { + add: { + children: { + name: { + parser: 'spyglassmc:tag', + }, + }, + }, + remove: { + children: { + name: { + parser: 'spyglassmc:tag', + }, + }, + }, + }, + }, + }, + }, + team: { + children: { + add: { + children: { + team: { + parser: 'minecraft:team', + properties: { + usageType: 'definition', + }, + }, + }, + }, + }, + }, + teammsg: { + permission: 0, + }, + /** + * Original command syntax: + * 1. `teleport ` + * 2. `teleport ` + * 3. `teleport <...arguments>` + * + * It is impossible for Spyglass to differentiate between (1) and (3) when it encounters a single entity + * at the position of the first argument, due to its lack of ability to backtrack. + * + * Therefore, we have compromised to patch the trees to something like this: + * - `teleport ` + * - `teleport [<...arguments>]` + * + * Diff: + * - Removed (1) `teleport `. + * - Marked `<...arguments>` in (3) as optional. + * + * The downside of this patch is that entity selectors tracking multiple entities can now be used as the + * `` argument. We will see how this work. + */ + teleport: { + children: { + destination: undefined, + targets: { + executable: true, + }, + }, + }, + tell: { + permission: 0, + }, + ...(ReleaseVersion.cmp(release, '1.20.3') >= 0 + ? { + // Added in 23w43a (1.20.3, pack format 22) + tick: { + permission: 3, + }, + } + : {}), + tm: { + permission: 0, + }, + ...(ReleaseVersion.cmp(release, '1.20.5') >= 0 + ? { + // Added in 24w04a (1.20.5, pack format 29) + transfer: { + permission: 3, + }, + } + : {}), + trigger: { + permission: 0, + children: { + objective: { + properties: { + category: 'objective', + accessType: 1 /* SymbolAccessType.Write */, + }, + }, + }, + }, + w: { + permission: 0, + }, + whitelist: { + permission: 3, + }, + }, + }; +} +const AdvancementTargets = Object.freeze({ + children: { + targets: { + children: { + from: { + children: { + advancement: { + properties: { + category: 'advancement', + }, + }, + }, + }, + only: { + children: { + advancement: { + properties: { + category: 'advancement', + }, + children: { + criterion: { + parser: 'spyglassmc:criterion', + properties: { + usageType: 'reference', + }, + }, + }, + }, + }, + }, + through: { + children: { + advancement: { + properties: { + category: 'advancement', + }, + }, + }, + }, + until: { + children: { + advancement: { + properties: { + category: 'advancement', + }, + }, + }, + }, + }, + }, + }, +}); +/** + * Return the command tree patch for anything related to data sources as used in + * `data`, `execute if` and `execute store` commands. + * + * A **vault** refers to a block, an entity, or a storage that contains NBT data. + * + * e.g., in a syntax like + * `block |entity |storage ) `, the + * `` and `` arguments identify a vault, and the + * `` argument is an NBT path that points to data in the vault. + * + * @param vaultKey Key of the argument identifying a vault. This argument should + * be a vec3, an entity, or a storage resource location. + * @param nbtKey Key of the argument containing an NBT tag or an NBT path. + * @param nbtAccessType Access type for the NBT argument. This is only + * meaningful for NBT paths and should be enforced by the + * NBT path checker. + * Note this usually match `vaultAccessType`. The only case + * where they don't match is in `data merge`, where the + * vault is being written to while the NBT argument is + * being read from. + * @default {@link SymbolAccessType.Read} + * @param vaultAccessType Access type for the vault. This is only meaningful for + * storage vaults and should be enforced by the resource + * location checker. + * @see {@link nbtAccessType} + * @default {@link SymbolAccessType.Read} + * @param children Optional patch for children after the NBT argument. + */ +function getDataPatch(vaultKey, nbtKey, { children, isPredicate = false, isMerge = false, nbtAccessType = 0 /* SymbolAccessType.Read */, vaultAccessType = 0 /* SymbolAccessType.Read */, } = {}) { + return Object.freeze({ + children: { + block: { + children: { + [`${vaultKey}Pos`]: { + children: { + [nbtKey]: { + properties: { + dispatcher: 'minecraft:block', + dispatchedBy: `${vaultKey}Pos`, + accessType: nbtAccessType, + isPredicate, + isMerge, + }, + ...children ? { children: children('block') } : {}, + }, + }, + }, + }, + }, + entity: { + children: { + [vaultKey]: { + children: { + [nbtKey]: { + properties: { + dispatcher: 'minecraft:entity', + dispatchedBy: vaultKey, + accessType: nbtAccessType, + isPredicate, + isMerge, + }, + ...children ? { children: children('entity') } : {}, + }, + }, + }, + }, + }, + storage: { + children: { + [vaultKey]: { + properties: { + category: 'storage', + accessType: vaultAccessType, + usageType: 'definition', + }, + children: { + [nbtKey]: { + properties: { + dispatcher: 'minecraft:storage', + dispatchedBy: vaultKey, + accessType: nbtAccessType, + isPredicate, + isMerge, + }, + ...children ? { children: children('storage') } : {}, + }, + }, + }, + }, + }, + }, + }); +} +const getDataModifySource = (type, { isMerge = false, isListIndex = false, } = {}) => Object.freeze({ + children: { + from: getDataPatch('source', 'sourcePath'), + string: getDataPatch('source', 'sourcePath'), + value: { + children: { + value: { + properties: { + dispatcher: `minecraft:${type}`, + dispatchedBy: type === 'block' ? 'targetPos' : 'target', + indexedBy: 'targetPath', + isMerge, + isListIndex, + }, + }, + }, + }, + }, +}); +const ExecuteCondition = Object.freeze({ + children: { + data: getDataPatch('source', 'path', { + isPredicate: true, + }), + predicate: { + children: { + predicate: { + properties: { + category: 'predicate', + }, + }, + }, + }, + }, +}); +const ExecuteStoreTarget = Object.freeze({ + children: { + ...getDataPatch('target', 'path', { + nbtAccessType: 1 /* SymbolAccessType.Write */, + vaultAccessType: 1 /* SymbolAccessType.Write */, + }) + .children, + bossbar: { + children: { + id: { + properties: { + category: 'bossbar', + accessType: 1 /* SymbolAccessType.Write */, + }, + }, + }, + }, + score: { + children: { + targets: { + properties: { + usageType: 'definition', + }, + children: { + objective: { + properties: { + accessType: 1 /* SymbolAccessType.Write */, + }, + }, + }, + }, + }, + }, + }, +}); +const LootSource = Object.freeze({ + children: { + fish: { + children: { + loot_table: { + properties: { + category: 'loot_table', + }, + }, + }, + }, + loot: { + children: { + loot_table: { + properties: { + category: 'loot_table', + }, + }, + }, + }, + }, +}); +const ObjectiveWriteTargets = Object.freeze({ + children: { + targets: { + properties: { + usageType: 'definition', + }, + children: { + objective: { + properties: { + accessType: 1 /* SymbolAccessType.Write */, + }, + }, + }, + }, + }, +}); +const RecipeTargets = Object.freeze({ + children: { + targets: { + children: { + recipe: { + properties: { + category: 'recipe', + }, + }, + }, + }, + }, +}); +const Sound = Object.freeze({ + children: { + sound: { + properties: { + category: 'sound_event', + }, + }, + }, +}); +//# sourceMappingURL=patch.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/tree/patchValidator.js +/** + * A set of parsers that must be patched with a `properties` field. + */ +const PatchRequiredParsers = new Set([ + 'minecraft:nbt_compound_tag', + 'minecraft:nbt_path', + 'minecraft:nbt_tag', + 'minecraft:resource_location', + 'minecraft:uuid', +]); +/** + * Validate that parsers requiring patches have been patched in the tree. + */ +function validatePatchedTree(tree, logger) { + walk(tree, []); + function walk(node, path) { + if (node.type === 'argument' && PatchRequiredParsers.has(node.parser) && !node.properties) { + logger.warn(`[validatePatchedTree] Patch required: ${node.parser} at ${path.join('.')}`); + } + for (const [key, value] of Object.entries(node.children ?? {})) { + walk(value, [...path, key]); + } + } +} +//# sourceMappingURL=patchValidator.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/mcfunction/index.js + + + + + + + + + + + + + + + + + +/* istanbul ignore next */ +const mcfunction_initialize = (ctx, commands, releaseVersion) => { + const { meta } = ctx; + registerCustomResources(ctx.config); + const tree = merge(commands, getPatch(releaseVersion)); + if (ctx.isDebugging) { + validatePatchedTree(tree, ctx.logger); + } + mcfunction_lib_initialize(ctx); + const mcfunctionOptions = { + lineContinuation: ReleaseVersion.cmp(releaseVersion, '1.20.2') >= 0, + macros: ReleaseVersion.cmp(releaseVersion, '1.20.2') >= 0, + commandOptions: ReleaseVersion.cmp(releaseVersion, '1.20.5') >= 0 + ? { maxLength: 2_000_000 } + : {}, + }; + meta.registerLanguage('mcfunction', { + extensions: ['.mcfunction'], + parser: parser_entry_entry(tree, argument, mcfunctionOptions), + completer: completer_entry(tree, getMockNodes), + triggerCharacters: [' ', '[', '=', '!', ',', '{', ':', '/', '.', '"', "'"], + }); + meta.registerParser('mcfunction:block_predicate', blockPredicate); + meta.registerParser('mcfunction:particle', parser_argument_particle); + meta.registerParser('mcfunction:tag', tag()); + meta.registerParser('mcfunction:team', team()); + meta.registerParser('mcfunction:command', command_command(tree, argument)); + mcfunction_mcdocAttributes_registerMcdocAttributes(meta, tree); + mcfunction_checker_register(meta); + mcfunction_colorizer_register(meta); + argument_register(meta); + meta.registerInlayHintProvider(inlayHintProvider); + meta.registerSignatureHelpProvider(signatureHelpProvider(tree)); +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/java-edition/lib/index.js + + + + + + + + + + + + + + +const java_edition_lib_initialize = async (ctx) => { + const { config, downloader, externals, logger, meta, projectRoots } = ctx; + async function readPackFormat(uri) { + try { + const data = await fileUtil.readJson(externals, uri); + return PackMcmeta.readPackFormat(data); + } + catch (e) { + if (!externals.error.isKind(e, 'ENOENT')) { + // `pack.mcmeta` exists but broken. Log an error. + logger.error(`[je.initialize] Failed loading pack.mcmeta ${uri}`, e); + } + } + return undefined; + } + async function findPackMcmetas() { + const searchedUris = new Set(); + const packs = []; + for (let depth = 0; depth <= 2; depth += 1) { + for (const projectRoot of projectRoots) { + const files = await fileUtil.getAllFiles(externals, projectRoot, depth + 1); + for (const uri of files.filter(uri => uri.endsWith('/pack.mcmeta'))) { + if (searchedUris.has(uri)) { + continue; + } + searchedUris.add(uri); + const packRoot = fileUtil.dirname(uri); + const [format, type] = await Promise.all([ + readPackFormat(uri), + PackMcmeta.getType(packRoot, externals), + ]); + if (format !== undefined) { + packs.push({ type, packRoot, format }); + } + } + } + } + return packs; + } + meta.registerUriBinder(binder_uriBinder); + registerUriBuilders(meta); + const [versions, packs] = await Promise.all([ + getVersions(ctx.externals, ctx.downloader), + findPackMcmetas(), + ]); + if (!versions) { + ctx.logger.error('[je-initialize] Failed loading game version list. Expect everything to be broken.'); + return; + } + const version = resolveConfiguredVersion(config.env.gameVersion, versions, packs, logger); + const release = version.release; + meta.registerDependencyProvider('@vanilla-datapack', () => getVanillaDatapack(downloader, version.id, version.isLatest)); + meta.registerDependencyProvider('@vanilla-resourcepack', () => getVanillaResourcepack(downloader, version.id, version.isLatest)); + meta.registerDependencyProvider('@vanilla-mcdoc', () => getVanillaMcdoc(downloader)); + const summary = await getMcmetaSummary(ctx.externals, downloader, logger, version.id, version.isLatest, config.env.dataSource, config.env.mcmetaSummaryOverrides); + if (!summary.blocks || !summary.commands || !summary.fluids || !summary.registries) { + ctx.logger.error('[je-initialize] Failed loading mcmeta summaries. Expect everything to be broken.'); + return; + } + meta.registerSymbolRegistrar('mcmeta-summary', { + checksum: `${summary.checksum}_v3`, + registrar: symbolRegistrar(summary, release), + }); + meta.registerLinter('nameOfNbtKey', { + configValidator: configValidator.nameConvention, + linter: nameConvention('value'), + nodePredicate: (n) => + // nbt compound keys without mcdoc definition. + (!n.symbol + && n.parent?.parent?.type === 'nbt:compound' + && PairNode.is(n.parent) + && n.type === 'string' + && n.parent.key === n) // nbt path keys without mcdoc definition. + || (!n.symbol && n.parent?.type === 'nbt:path' && n.type === 'string') // mcdoc compound key definition outside of `::minecraft` modules. + || (StructFieldNode.is(n.parent) + && StructKeyNode.is(n) + && !n.symbol?.path[0]?.startsWith('::minecraft')), + }); + lib_mcdocAttributes_registerMcdocAttributes(meta, summary.commands, release); + registerPackFormatAttribute(meta, versions, packs); + meta.registerLanguage('zip', { extensions: ['.zip'] }); + meta.registerLanguage('png', { extensions: ['.png'] }); + meta.registerLanguage('ogg', { extensions: ['.ogg'] }); + meta.registerLanguage('ttf', { extensions: ['.ttf'] }); + meta.registerLanguage('otf', { extensions: ['.otf'] }); + meta.registerLanguage('fsh', { extensions: ['.fsh'] }); + meta.registerLanguage('vsh', { extensions: ['.vsh'] }); + getInitializer(jsonUriPredicate)(ctx); + json_initialize(ctx); + mcfunction_initialize(ctx, summary.commands, release); + lib_initialize(ctx); + return { loadedVersion: release, errorSource: release }; +}; +//# sourceMappingURL=index.js.map +// EXTERNAL MODULE: ./node_modules/chokidar/index.js +var chokidar = __nccwpck_require__(5315); +// EXTERNAL MODULE: ./node_modules/decompress/index.js +var decompress = __nccwpck_require__(6591); +// EXTERNAL MODULE: ./node_modules/follow-redirects/index.js +var follow_redirects = __nccwpck_require__(1573); +;// CONCATENATED MODULE: external "node:buffer" +const external_node_buffer_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:buffer"); +;// CONCATENATED MODULE: external "node:child_process" +const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); +// EXTERNAL MODULE: external "node:crypto" +var external_node_crypto_ = __nccwpck_require__(7598); +// EXTERNAL MODULE: external "node:events" +var external_node_events_ = __nccwpck_require__(8474); +;// CONCATENATED MODULE: external "node:fs" +const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs"); +var external_node_fs_namespaceObject_0 = /*#__PURE__*/__nccwpck_require__.t(external_node_fs_namespaceObject, 2); +;// CONCATENATED MODULE: external "node:process" +const external_node_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:process"); +;// CONCATENATED MODULE: external "node:url" +const external_node_url_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:url"); +// EXTERNAL MODULE: external "node:util" +var external_node_util_ = __nccwpck_require__(7975); +;// CONCATENATED MODULE: external "node:zlib" +const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/common/externals/NodeJsExternals.js +// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/60592 + + + + + + + + + + + + + +const { http, https } = follow_redirects; +const gunzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gunzip); +const gzip = (0,external_node_util_.promisify)(external_node_zlib_namespaceObject.gzip); +class NodeJsExternalDownloader { + get(uri, options = {}) { + const protocol = new Uri(uri).protocol; + return new Promise((resolve, reject) => { + const backend = protocol === 'http:' ? http : https; + backend.get(uri, options, (res) => { + if (res.statusCode !== 200) { + reject(new Error(`Status code ${res.statusCode}: ${res.statusMessage}`)); + } + else { + resolve(promisifyAsyncIterable(res, (chunks) => external_node_buffer_namespaceObject.Buffer.concat(chunks))); + } + }).on('error', (e) => { + reject(e); + }); + }); + } +} +const NodeJsExternals = { + archive: { + decompressBall(buffer, options) { + if (buffer instanceof external_node_buffer_namespaceObject.Buffer) { + return decompress(buffer, { strip: options?.stripLevel }); + } + throw new TypeError(`The 'buffer' argument for 'decompressBall' on Node.js must be an instance of 'Buffer'. Got '${buffer}' instead.`); + }, + gunzip(buffer) { + return gunzip(buffer); + }, + gzip(buffer) { + return gzip(buffer); + }, + }, + crypto: { + async getSha1(data) { + const hash = external_node_crypto_.createHash('sha1'); + hash.update(data); + return hash.digest('hex'); + }, + }, + downloader: new NodeJsExternalDownloader(), + error: { + createKind(kind, message) { + const error = new Error(message); + error.code = kind; + return error; + }, + isKind(e, kind) { + return e instanceof Error && e.code === kind; + }, + }, + event: { EventEmitter: external_node_events_.EventEmitter }, + fs: { + chmod(location, mode) { + return external_node_fs_namespaceObject.promises.chmod(toFsPathLike(location), mode); + }, + async mkdir(location, options) { + return void (await external_node_fs_namespaceObject.promises.mkdir(toFsPathLike(location), options)); + }, + readdir(location) { + return external_node_fs_namespaceObject.promises.readdir(toFsPathLike(location), { encoding: 'utf-8', withFileTypes: true }); + }, + readFile(location) { + return external_node_fs_namespaceObject.promises.readFile(toFsPathLike(location)); + }, + async showFile(location) { + const execFile = (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.execFile); + let command; + switch (external_node_process_namespaceObject.platform) { + case 'darwin': + command = 'open'; + break; + case 'win32': + command = 'explorer'; + break; + default: + command = 'xdg-open'; + break; + } + return void (await execFile(command, [toPath(location)])); + }, + stat(location) { + return external_node_fs_namespaceObject.promises.stat(toFsPathLike(location)); + }, + unlink(location) { + return external_node_fs_namespaceObject.promises.unlink(toFsPathLike(location)); + }, + watch(locations, { usePolling = false } = {}) { + return new ChokidarWatcherWrapper(chokidar.watch(locations.map(toPath), { + usePolling, + disableGlobbing: true, + })); + }, + writeFile(location, data, options) { + return external_node_fs_namespaceObject.promises.writeFile(toFsPathLike(location), data, options); + }, + }, +}; +Object.freeze(NodeJsExternals); +/** + * @returns A {@link fs.PathLike}. + */ +function toFsPathLike(path) { + if (path instanceof Uri) { + // Convert WHATWG URL to string so that it will be converted + // to Node.js URL by the next if-block. + path = path.toString(); + } + if (typeof path === 'string' && path.startsWith('file:')) { + return new external_node_url_namespaceObject.URL(path); + } + return path; +} +function toPath(path) { + if (typeof path === 'string' && !path.startsWith('file:')) { + return path; + } + return uriToPath(path); +} +const uriToPath = (uri) => external_node_url_namespaceObject.fileURLToPath(uri instanceof Uri ? new external_node_url_namespaceObject.URL(uri.toString()) : uri); +const uriFromPath = (path) => external_node_url_namespaceObject.pathToFileURL(path).toString(); +class ChokidarWatcherWrapper extends external_node_events_.EventEmitter { + #watcher; + constructor(watcher) { + super(); + this.#watcher = watcher + .on('ready', () => this.emit('ready')) + .on('add', (path) => this.emit('add', uriFromPath(path))) + .on('change', (path) => this.emit('change', uriFromPath(path))) + .on('unlink', (path) => this.emit('unlink', uriFromPath(path))) + .on('error', (e) => this.emit('error', e)); + } + close() { + return this.#watcher.close(); + } +} +//# sourceMappingURL=NodeJsExternals.js.map +;// CONCATENATED MODULE: ./node_modules/@spyglassmc/core/lib/nodejs.js + +//# sourceMappingURL=nodejs.js.map +// EXTERNAL MODULE: external "path" +var external_path_ = __nccwpck_require__(6928); +var external_path_default = /*#__PURE__*/__nccwpck_require__.n(external_path_); +;// CONCATENATED MODULE: ./node_modules/@isaacs/balanced-match/dist/esm/index.js +const balanced = (a, b, str) => { + const ma = a instanceof RegExp ? maybeMatch(a, str) : a; + const mb = b instanceof RegExp ? maybeMatch(b, str) : b; + const r = ma !== null && mb != null && esm_range(ma, mb, str); + return (r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + ma.length, r[1]), + post: str.slice(r[1] + mb.length), + }); +}; +const maybeMatch = (reg, str) => { + const m = str.match(reg); + return m ? m[0] : null; +}; +const esm_range = (a, b, str) => { + let begs, beg, left, right = undefined, result; + let ai = str.indexOf(a); + let bi = str.indexOf(b, ai + 1); + let i = ai; + if (ai >= 0 && bi > 0) { + if (a === b) { + return [ai, bi]; + } + begs = []; + left = str.length; + while (i >= 0 && !result) { + if (i === ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } + else if (begs.length === 1) { + const r = begs.pop(); + if (r !== undefined) + result = [r, bi]; + } + else { + beg = begs.pop(); + if (beg !== undefined && beg < left) { + left = beg; + right = bi; + } + bi = str.indexOf(b, i + 1); + } + i = ai < bi && ai >= 0 ? ai : bi; + } + if (begs.length && right !== undefined) { + result = [left, right]; + } + } + return result; +}; +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/@isaacs/brace-expansion/dist/esm/index.js + +const escSlash = '\0SLASH' + Math.random() + '\0'; +const escOpen = '\0OPEN' + Math.random() + '\0'; +const escClose = '\0CLOSE' + Math.random() + '\0'; +const escComma = '\0COMMA' + Math.random() + '\0'; +const escPeriod = '\0PERIOD' + Math.random() + '\0'; +const escSlashPattern = new RegExp(escSlash, 'g'); +const escOpenPattern = new RegExp(escOpen, 'g'); +const escClosePattern = new RegExp(escClose, 'g'); +const escCommaPattern = new RegExp(escComma, 'g'); +const escPeriodPattern = new RegExp(escPeriod, 'g'); +const slashPattern = /\\\\/g; +const openPattern = /\\{/g; +const closePattern = /\\}/g; +const commaPattern = /\\,/g; +const periodPattern = /\\./g; +function numeric(str) { + return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0); +} +function escapeBraces(str) { + return str + .replace(slashPattern, escSlash) + .replace(openPattern, escOpen) + .replace(closePattern, escClose) + .replace(commaPattern, escComma) + .replace(periodPattern, escPeriod); +} +function unescapeBraces(str) { + return str + .replace(escSlashPattern, '\\') + .replace(escOpenPattern, '{') + .replace(escClosePattern, '}') + .replace(escCommaPattern, ',') + .replace(escPeriodPattern, '.'); +} +/** + * Basically just str.split(","), but handling cases + * where we have nested braced sections, which should be + * treated as individual members, like {a,{b,c},d} + */ +function parseCommaParts(str) { + if (!str) { + return ['']; + } + const parts = []; + const m = balanced('{', '}', str); + if (!m) { + return str.split(','); + } + const { pre, body, post } = m; + const p = pre.split(','); + p[p.length - 1] += '{' + body + '}'; + const postParts = parseCommaParts(post); + if (post.length) { + ; + p[p.length - 1] += postParts.shift(); + p.push.apply(p, postParts); + } + parts.push.apply(parts, p); + return parts; +} +function expand(str) { + if (!str) { + return []; + } + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.slice(0, 2) === '{}') { + str = '\\{\\}' + str.slice(2); + } + return expand_(escapeBraces(str), true).map(unescapeBraces); +} +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} +function expand_(str, isTop) { + /** @type {string[]} */ + const expansions = []; + const m = balanced('{', '}', str); + if (!m) + return [str]; + // no need to expand pre, since it is guaranteed to be free of brace-sets + const pre = m.pre; + const post = m.post.length ? expand_(m.post, false) : ['']; + if (/\$$/.test(m.pre)) { + for (let k = 0; k < post.length; k++) { + const expansion = pre + '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } + else { + const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + const isSequence = isNumericSequence || isAlphaSequence; + const isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,(?!,).*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand_(str); + } + return [str]; + } + let n; + if (isSequence) { + n = m.body.split(/\.\./); + } + else { + n = parseCommaParts(m.body); + if (n.length === 1 && n[0] !== undefined) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand_(n[0], false).map(embrace); + //XXX is this necessary? Can't seem to hit it in tests. + /* c8 ignore start */ + if (n.length === 1) { + return post.map(p => m.pre + n[0] + p); + } + /* c8 ignore stop */ + } + } + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + let N; + if (isSequence && n[0] !== undefined && n[1] !== undefined) { + const x = numeric(n[0]); + const y = numeric(n[1]); + const width = Math.max(n[0].length, n[1].length); + let incr = n.length === 3 && n[2] !== undefined ? Math.abs(numeric(n[2])) : 1; + let test = lte; + const reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + const pad = n.some(isPadded); + N = []; + for (let i = x; test(i, y); i += incr) { + let c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') { + c = ''; + } + } + else { + c = String(i); + if (pad) { + const need = width - c.length; + if (need > 0) { + const z = new Array(need + 1).join('0'); + if (i < 0) { + c = '-' + z + c.slice(1); + } + else { + c = z + c; + } + } + } + } + N.push(c); + } + } + else { + N = []; + for (let j = 0; j < n.length; j++) { + N.push.apply(N, expand_(n[j], false)); + } + } + for (let j = 0; j < N.length; j++) { + for (let k = 0; k < post.length; k++) { + const expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) { + expansions.push(expansion); + } + } + } + } + return expansions; +} +//# sourceMappingURL=index.js.map +;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/assert-valid-pattern.js +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; +//# sourceMappingURL=assert-valid-pattern.js.map +;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/brace-expressions.js +// translate the various posix character classes into unicode properties +// this works across all unicode locales +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length + ? '(' + sranges + '|' + snegs + ')' + : ranges.length + ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; +//# sourceMappingURL=brace-expressions.js.map +;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/unescape.js +/** + * Un-escape a string that has been escaped with {@link escape}. + * + * If the {@link windowsPathsNoEscape} option is used, then square-brace + * escapes are removed, but not backslash escapes. For example, it will turn + * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`, + * becuase `\` is a path separator in `windowsPathsNoEscape` mode. + * + * When `windowsPathsNoEscape` is not set, then both brace escapes and + * backslash escapes are removed. + * + * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped + * or unescaped. + */ +const unescape_unescape = (s, { windowsPathsNoEscape = false, } = {}) => { + return windowsPathsNoEscape + ? s.replace(/\[([^\/\\])\]/g, '$1') + : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1'); +}; +//# sourceMappingURL=unescape.js.map +;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/ast.js +// parse a single path portion + + +const types = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types.has(c); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + if (this.#toString !== undefined) + return this.#toString; + if (!this.type) { + return (this.#toString = this.#parts.map(p => String(p)).join('')); + } + else { + return (this.#toString = + this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')'); + } + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null + ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof AST && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new AST(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt) { + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { + ast.push(acc); + acc = ''; + const ext = new AST(c, ast); + i = AST.#parseAST(str, ext, i, opt); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new AST(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (isExtglobType(c) && str.charAt(i) === '(') { + part.push(acc); + acc = ''; + const ext = new AST(c, part); + part.push(ext); + i = AST.#parseAST(str, ext, i, opt); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new AST(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + static fromGlob(pattern, options = {}) { + const ast = new AST(null, undefined, options); + AST.#parseAST(pattern, ast, 0, options); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) + this.#fillNegs(); + if (!this.type) { + const noEmpty = this.isStart() && this.isEnd(); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' + ? AST.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + unescape_unescape(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + this.#parts = [s]; + this.type = null; + this.#hasMagic = undefined; + return [s, unescape_unescape(this.toString()), false, false]; + } + // XXX abstract out this map method + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot + ? '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' + ? // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star + + ')' + : this.type === '@' + ? ')' + : this.type === '?' + ? ')?' + : this.type === '+' && bodyDotAllowed + ? ')' + : this.type === '*' && bodyDotAllowed + ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + unescape_unescape(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = parseClass(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '*') { + if (noEmpty && glob === '*') + re += starNoEmpty; + else + re += star; + hasMagic = true; + continue; + } + if (c === '?') { + re += qmark; + hasMagic = true; + continue; + } + re += regExpEscape(c); + } + return [re, unescape_unescape(glob), !!hasMagic, uflag]; + } +} +//# sourceMappingURL=ast.js.map +;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/escape.js +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + */ +const escape_escape = (s, { windowsPathsNoEscape = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + return windowsPathsNoEscape + ? s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; +//# sourceMappingURL=escape.js.map +;// CONCATENATED MODULE: ./node_modules/minimatch/dist/esm/index.js + + + + + +const minimatch = (p, pattern, options = {}) => { + assertValidPattern(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform = (typeof process === 'object' && process + ? (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const esm_path = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +const sep = defaultPlatform === 'win32' ? esm_path.win32.sep : esm_path.posix.sep; +minimatch.sep = sep; +const GLOBSTAR = Symbol('globstar **'); +minimatch.GLOBSTAR = GLOBSTAR; +// any single thing other than / +// don't need to escape / when using new RegExp() +const esm_qmark = '[^/]'; +// * => any number of characters +const esm_star = esm_qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const esm_filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options); +minimatch.filter = esm_filter; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch; + } + const orig = minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: GLOBSTAR, + }); +}; +minimatch.defaults = defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + assertValidPattern(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return expand(pattern); +}; +minimatch.braceExpand = braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +minimatch.makeRe = makeRe; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +minimatch.match = match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const esm_regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + regexp; + constructor(pattern, options = {}) { + assertValidPattern(pattern); + options = options || {}; + this.options = options; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform; + this.isWindows = this.platform === 'win32'; + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined + ? options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn all ** into * + if (this.options.noglobstar) { + for (let i = 0; i < globParts.length; i++) { + for (let j = 0; j < globParts[i].length; j++) { + if (globParts[i][j] === '**') { + globParts[i][j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p && p !== '.' && p !== '..' && p !== '**') {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        const options = this.options;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
+            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [file[fdi], pattern[pdi]];
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    if (pdi > fdi) {
+                        pattern = pattern.slice(pdi);
+                    }
+                    else if (fdi > pdi) {
+                        file = file.slice(fdi);
+                    }
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // dont' need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        this.debug('matchOne', this, { file, pattern });
+        this.debug('matchOne', file.length, pattern.length);
+        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            var p = pattern[pi];
+            var f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false) {
+                return false;
+            }
+            /* c8 ignore stop */
+            if (p === GLOBSTAR) {
+                this.debug('GLOBSTAR', [pattern, p, f]);
+                // "**"
+                // a/**/b/**/c would match the following:
+                // a/b/x/y/z/c
+                // a/x/y/z/b/c
+                // a/b/x/b/x/c
+                // a/b/c
+                // To do this, take the rest of the pattern after
+                // the **, and see if it would match the file remainder.
+                // If so, return success.
+                // If not, the ** "swallows" a segment, and try again.
+                // This is recursively awful.
+                //
+                // a/**/b/**/c matching a/b/x/y/z/c
+                // - a matches a
+                // - doublestar
+                //   - matchOne(b/x/y/z/c, b/**/c)
+                //     - b matches b
+                //     - doublestar
+                //       - matchOne(x/y/z/c, c) -> no
+                //       - matchOne(y/z/c, c) -> no
+                //       - matchOne(z/c, c) -> no
+                //       - matchOne(c, c) yes, hit
+                var fr = fi;
+                var pr = pi + 1;
+                if (pr === pl) {
+                    this.debug('** at the end');
+                    // a ** at the end will just swallow the rest.
+                    // We have found a match.
+                    // however, it will not swallow /.x, unless
+                    // options.dot is set.
+                    // . and .. are *never* matched by **, for explosively
+                    // exponential reasons.
+                    for (; fi < fl; fi++) {
+                        if (file[fi] === '.' ||
+                            file[fi] === '..' ||
+                            (!options.dot && file[fi].charAt(0) === '.'))
+                            return false;
+                    }
+                    return true;
+                }
+                // ok, let's see if we can swallow whatever we can.
+                while (fr < fl) {
+                    var swallowee = file[fr];
+                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
+                    // XXX remove this slice.  Just pass the start index.
+                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+                        this.debug('globstar found match!', fr, fl, swallowee);
+                        // found a match.
+                        return true;
+                    }
+                    else {
+                        // can't swallow "." or ".." ever.
+                        // can only swallow ".foo" when explicitly asked.
+                        if (swallowee === '.' ||
+                            swallowee === '..' ||
+                            (!options.dot && swallowee.charAt(0) === '.')) {
+                            this.debug('dot detected!', file, fr, pattern, pr);
+                            break;
+                        }
+                        // ** swallows a segment, and continue.
+                        this.debug('globstar swallow a segment, and continue');
+                        fr++;
+                    }
+                }
+                // no match was found.
+                // However, in partial mode, we can't say this is necessarily over.
+                /* c8 ignore start */
+                if (partial) {
+                    // ran out of file
+                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
+                    if (fr === fl) {
+                        return true;
+                    }
+                }
+                /* c8 ignore stop */
+                return false;
+            }
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot
+                    ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot
+                    ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar
+            ? esm_star
+            : options.dot
+                ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return typeof p === 'string'
+                    ? esm_regExpEscape(p)
+                    : p === GLOBSTAR
+                        ? GLOBSTAR
+                        : p._src;
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR || prev === GLOBSTAR) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR;
+                }
+            });
+            return pp.filter(p => p !== GLOBSTAR).join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch (ex) {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (let i = 0; i < set.length; i++) {
+            const pattern = set[i];
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore start */
+
+
+
+/* c8 ignore stop */
+minimatch.AST = AST;
+minimatch.Minimatch = Minimatch;
+minimatch.escape = escape_escape;
+minimatch.unescape = unescape_unescape;
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/lru-cache/dist/esm/index.js
+/**
+ * @module LRUCache
+ */
+const defaultPerf = (typeof performance === 'object' &&
+    performance &&
+    typeof performance.now === 'function') ?
+    performance
+    : Date;
+const warned = new Set();
+/* c8 ignore start */
+const PROCESS = (typeof process === 'object' && !!process ?
+    process
+    : {});
+/* c8 ignore start */
+const emitWarning = (msg, type, code, fn) => {
+    typeof PROCESS.emitWarning === 'function' ?
+        PROCESS.emitWarning(msg, type, code, fn)
+        : console.error(`[${code}] ${type}: ${msg}`);
+};
+let AC = globalThis.AbortController;
+let AS = globalThis.AbortSignal;
+/* c8 ignore start */
+if (typeof AC === 'undefined') {
+    //@ts-ignore
+    AS = class AbortSignal {
+        onabort;
+        _onabort = [];
+        reason;
+        aborted = false;
+        addEventListener(_, fn) {
+            this._onabort.push(fn);
+        }
+    };
+    //@ts-ignore
+    AC = class AbortController {
+        constructor() {
+            warnACPolyfill();
+        }
+        signal = new AS();
+        abort(reason) {
+            if (this.signal.aborted)
+                return;
+            //@ts-ignore
+            this.signal.reason = reason;
+            //@ts-ignore
+            this.signal.aborted = true;
+            //@ts-ignore
+            for (const fn of this.signal._onabort) {
+                fn(reason);
+            }
+            this.signal.onabort?.(reason);
+        }
+    };
+    let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
+    const warnACPolyfill = () => {
+        if (!printACPolyfillWarning)
+            return;
+        printACPolyfillWarning = false;
+        emitWarning('AbortController is not defined. If using lru-cache in ' +
+            'node 14, load an AbortController polyfill from the ' +
+            '`node-abort-controller` package. A minimal polyfill is ' +
+            'provided for use by LRUCache.fetch(), but it should not be ' +
+            'relied upon in other contexts (eg, passing it to other APIs that ' +
+            'use AbortController/AbortSignal might have undesirable effects). ' +
+            'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
+    };
+}
+/* c8 ignore stop */
+const shouldWarn = (code) => !warned.has(code);
+const TYPE = Symbol('type');
+const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
+/* c8 ignore start */
+// This is a little bit ridiculous, tbh.
+// The maximum array length is 2^32-1 or thereabouts on most JS impls.
+// And well before that point, you're caching the entire world, I mean,
+// that's ~32GB of just integers for the next/prev links, plus whatever
+// else to hold that many keys and values.  Just filling the memory with
+// zeroes at init time is brutal when you get that big.
+// But why not be complete?
+// Maybe in the future, these limits will have expanded.
+const getUintArray = (max) => !isPosInt(max) ? null
+    : max <= Math.pow(2, 8) ? Uint8Array
+        : max <= Math.pow(2, 16) ? Uint16Array
+            : max <= Math.pow(2, 32) ? Uint32Array
+                : max <= Number.MAX_SAFE_INTEGER ? ZeroArray
+                    : null;
+/* c8 ignore stop */
+class ZeroArray extends Array {
+    constructor(size) {
+        super(size);
+        this.fill(0);
+    }
+}
+class Stack {
+    heap;
+    length;
+    // private constructor
+    static #constructing = false;
+    static create(max) {
+        const HeapCls = getUintArray(max);
+        if (!HeapCls)
+            return [];
+        Stack.#constructing = true;
+        const s = new Stack(max, HeapCls);
+        Stack.#constructing = false;
+        return s;
+    }
+    constructor(max, HeapCls) {
+        /* c8 ignore start */
+        if (!Stack.#constructing) {
+            throw new TypeError('instantiate Stack using Stack.create(n)');
+        }
+        /* c8 ignore stop */
+        this.heap = new HeapCls(max);
+        this.length = 0;
+    }
+    push(n) {
+        this.heap[this.length++] = n;
+    }
+    pop() {
+        return this.heap[--this.length];
+    }
+}
+/**
+ * Default export, the thing you're using this module to get.
+ *
+ * The `K` and `V` types define the key and value types, respectively. The
+ * optional `FC` type defines the type of the `context` object passed to
+ * `cache.fetch()` and `cache.memo()`.
+ *
+ * Keys and values **must not** be `null` or `undefined`.
+ *
+ * All properties from the options object (with the exception of `max`,
+ * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
+ * added as normal public members. (The listed options are read-only getters.)
+ *
+ * Changing any of these will alter the defaults for subsequent method calls.
+ */
+class LRUCache {
+    // options that cannot be changed without disaster
+    #max;
+    #maxSize;
+    #dispose;
+    #onInsert;
+    #disposeAfter;
+    #fetchMethod;
+    #memoMethod;
+    #perf;
+    /**
+     * {@link LRUCache.OptionsBase.perf}
+     */
+    get perf() {
+        return this.#perf;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.ttl}
+     */
+    ttl;
+    /**
+     * {@link LRUCache.OptionsBase.ttlResolution}
+     */
+    ttlResolution;
+    /**
+     * {@link LRUCache.OptionsBase.ttlAutopurge}
+     */
+    ttlAutopurge;
+    /**
+     * {@link LRUCache.OptionsBase.updateAgeOnGet}
+     */
+    updateAgeOnGet;
+    /**
+     * {@link LRUCache.OptionsBase.updateAgeOnHas}
+     */
+    updateAgeOnHas;
+    /**
+     * {@link LRUCache.OptionsBase.allowStale}
+     */
+    allowStale;
+    /**
+     * {@link LRUCache.OptionsBase.noDisposeOnSet}
+     */
+    noDisposeOnSet;
+    /**
+     * {@link LRUCache.OptionsBase.noUpdateTTL}
+     */
+    noUpdateTTL;
+    /**
+     * {@link LRUCache.OptionsBase.maxEntrySize}
+     */
+    maxEntrySize;
+    /**
+     * {@link LRUCache.OptionsBase.sizeCalculation}
+     */
+    sizeCalculation;
+    /**
+     * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
+     */
+    noDeleteOnFetchRejection;
+    /**
+     * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
+     */
+    noDeleteOnStaleGet;
+    /**
+     * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
+     */
+    allowStaleOnFetchAbort;
+    /**
+     * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
+     */
+    allowStaleOnFetchRejection;
+    /**
+     * {@link LRUCache.OptionsBase.ignoreFetchAbort}
+     */
+    ignoreFetchAbort;
+    // computed properties
+    #size;
+    #calculatedSize;
+    #keyMap;
+    #keyList;
+    #valList;
+    #next;
+    #prev;
+    #head;
+    #tail;
+    #free;
+    #disposed;
+    #sizes;
+    #starts;
+    #ttls;
+    #hasDispose;
+    #hasFetchMethod;
+    #hasDisposeAfter;
+    #hasOnInsert;
+    /**
+     * Do not call this method unless you need to inspect the
+     * inner workings of the cache.  If anything returned by this
+     * object is modified in any way, strange breakage may occur.
+     *
+     * These fields are private for a reason!
+     *
+     * @internal
+     */
+    static unsafeExposeInternals(c) {
+        return {
+            // properties
+            starts: c.#starts,
+            ttls: c.#ttls,
+            sizes: c.#sizes,
+            keyMap: c.#keyMap,
+            keyList: c.#keyList,
+            valList: c.#valList,
+            next: c.#next,
+            prev: c.#prev,
+            get head() {
+                return c.#head;
+            },
+            get tail() {
+                return c.#tail;
+            },
+            free: c.#free,
+            // methods
+            isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
+            backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
+            moveToTail: (index) => c.#moveToTail(index),
+            indexes: (options) => c.#indexes(options),
+            rindexes: (options) => c.#rindexes(options),
+            isStale: (index) => c.#isStale(index),
+        };
+    }
+    // Protected read-only members
+    /**
+     * {@link LRUCache.OptionsBase.max} (read-only)
+     */
+    get max() {
+        return this.#max;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.maxSize} (read-only)
+     */
+    get maxSize() {
+        return this.#maxSize;
+    }
+    /**
+     * The total computed size of items in the cache (read-only)
+     */
+    get calculatedSize() {
+        return this.#calculatedSize;
+    }
+    /**
+     * The number of items stored in the cache (read-only)
+     */
+    get size() {
+        return this.#size;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.fetchMethod} (read-only)
+     */
+    get fetchMethod() {
+        return this.#fetchMethod;
+    }
+    get memoMethod() {
+        return this.#memoMethod;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.dispose} (read-only)
+     */
+    get dispose() {
+        return this.#dispose;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.onInsert} (read-only)
+     */
+    get onInsert() {
+        return this.#onInsert;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
+     */
+    get disposeAfter() {
+        return this.#disposeAfter;
+    }
+    constructor(options) {
+        const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, onInsert, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, perf, } = options;
+        if (perf !== undefined) {
+            if (typeof perf?.now !== 'function') {
+                throw new TypeError('perf option must have a now() method if specified');
+            }
+        }
+        this.#perf = perf ?? defaultPerf;
+        if (max !== 0 && !isPosInt(max)) {
+            throw new TypeError('max option must be a nonnegative integer');
+        }
+        const UintArray = max ? getUintArray(max) : Array;
+        if (!UintArray) {
+            throw new Error('invalid max value: ' + max);
+        }
+        this.#max = max;
+        this.#maxSize = maxSize;
+        this.maxEntrySize = maxEntrySize || this.#maxSize;
+        this.sizeCalculation = sizeCalculation;
+        if (this.sizeCalculation) {
+            if (!this.#maxSize && !this.maxEntrySize) {
+                throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');
+            }
+            if (typeof this.sizeCalculation !== 'function') {
+                throw new TypeError('sizeCalculation set to non-function');
+            }
+        }
+        if (memoMethod !== undefined &&
+            typeof memoMethod !== 'function') {
+            throw new TypeError('memoMethod must be a function if defined');
+        }
+        this.#memoMethod = memoMethod;
+        if (fetchMethod !== undefined &&
+            typeof fetchMethod !== 'function') {
+            throw new TypeError('fetchMethod must be a function if specified');
+        }
+        this.#fetchMethod = fetchMethod;
+        this.#hasFetchMethod = !!fetchMethod;
+        this.#keyMap = new Map();
+        this.#keyList = new Array(max).fill(undefined);
+        this.#valList = new Array(max).fill(undefined);
+        this.#next = new UintArray(max);
+        this.#prev = new UintArray(max);
+        this.#head = 0;
+        this.#tail = 0;
+        this.#free = Stack.create(max);
+        this.#size = 0;
+        this.#calculatedSize = 0;
+        if (typeof dispose === 'function') {
+            this.#dispose = dispose;
+        }
+        if (typeof onInsert === 'function') {
+            this.#onInsert = onInsert;
+        }
+        if (typeof disposeAfter === 'function') {
+            this.#disposeAfter = disposeAfter;
+            this.#disposed = [];
+        }
+        else {
+            this.#disposeAfter = undefined;
+            this.#disposed = undefined;
+        }
+        this.#hasDispose = !!this.#dispose;
+        this.#hasOnInsert = !!this.#onInsert;
+        this.#hasDisposeAfter = !!this.#disposeAfter;
+        this.noDisposeOnSet = !!noDisposeOnSet;
+        this.noUpdateTTL = !!noUpdateTTL;
+        this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
+        this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
+        this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
+        this.ignoreFetchAbort = !!ignoreFetchAbort;
+        // NB: maxEntrySize is set to maxSize if it's set
+        if (this.maxEntrySize !== 0) {
+            if (this.#maxSize !== 0) {
+                if (!isPosInt(this.#maxSize)) {
+                    throw new TypeError('maxSize must be a positive integer if specified');
+                }
+            }
+            if (!isPosInt(this.maxEntrySize)) {
+                throw new TypeError('maxEntrySize must be a positive integer if specified');
+            }
+            this.#initializeSizeTracking();
+        }
+        this.allowStale = !!allowStale;
+        this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
+        this.updateAgeOnGet = !!updateAgeOnGet;
+        this.updateAgeOnHas = !!updateAgeOnHas;
+        this.ttlResolution =
+            isPosInt(ttlResolution) || ttlResolution === 0 ?
+                ttlResolution
+                : 1;
+        this.ttlAutopurge = !!ttlAutopurge;
+        this.ttl = ttl || 0;
+        if (this.ttl) {
+            if (!isPosInt(this.ttl)) {
+                throw new TypeError('ttl must be a positive integer if specified');
+            }
+            this.#initializeTTLTracking();
+        }
+        // do not allow completely unbounded caches
+        if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
+            throw new TypeError('At least one of max, maxSize, or ttl is required');
+        }
+        if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
+            const code = 'LRU_CACHE_UNBOUNDED';
+            if (shouldWarn(code)) {
+                warned.add(code);
+                const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +
+                    'result in unbounded memory consumption.';
+                emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);
+            }
+        }
+    }
+    /**
+     * Return the number of ms left in the item's TTL. If item is not in cache,
+     * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
+     */
+    getRemainingTTL(key) {
+        return this.#keyMap.has(key) ? Infinity : 0;
+    }
+    #initializeTTLTracking() {
+        const ttls = new ZeroArray(this.#max);
+        const starts = new ZeroArray(this.#max);
+        this.#ttls = ttls;
+        this.#starts = starts;
+        this.#setItemTTL = (index, ttl, start = this.#perf.now()) => {
+            starts[index] = ttl !== 0 ? start : 0;
+            ttls[index] = ttl;
+            if (ttl !== 0 && this.ttlAutopurge) {
+                const t = setTimeout(() => {
+                    if (this.#isStale(index)) {
+                        this.#delete(this.#keyList[index], 'expire');
+                    }
+                }, ttl + 1);
+                // unref() not supported on all platforms
+                /* c8 ignore start */
+                if (t.unref) {
+                    t.unref();
+                }
+                /* c8 ignore stop */
+            }
+        };
+        this.#updateItemAge = index => {
+            starts[index] = ttls[index] !== 0 ? this.#perf.now() : 0;
+        };
+        this.#statusTTL = (status, index) => {
+            if (ttls[index]) {
+                const ttl = ttls[index];
+                const start = starts[index];
+                /* c8 ignore next */
+                if (!ttl || !start)
+                    return;
+                status.ttl = ttl;
+                status.start = start;
+                status.now = cachedNow || getNow();
+                const age = status.now - start;
+                status.remainingTTL = ttl - age;
+            }
+        };
+        // debounce calls to perf.now() to 1s so we're not hitting
+        // that costly call repeatedly.
+        let cachedNow = 0;
+        const getNow = () => {
+            const n = this.#perf.now();
+            if (this.ttlResolution > 0) {
+                cachedNow = n;
+                const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);
+                // not available on all platforms
+                /* c8 ignore start */
+                if (t.unref) {
+                    t.unref();
+                }
+                /* c8 ignore stop */
+            }
+            return n;
+        };
+        this.getRemainingTTL = key => {
+            const index = this.#keyMap.get(key);
+            if (index === undefined) {
+                return 0;
+            }
+            const ttl = ttls[index];
+            const start = starts[index];
+            if (!ttl || !start) {
+                return Infinity;
+            }
+            const age = (cachedNow || getNow()) - start;
+            return ttl - age;
+        };
+        this.#isStale = index => {
+            const s = starts[index];
+            const t = ttls[index];
+            return !!t && !!s && (cachedNow || getNow()) - s > t;
+        };
+    }
+    // conditionally set private methods related to TTL
+    #updateItemAge = () => { };
+    #statusTTL = () => { };
+    #setItemTTL = () => { };
+    /* c8 ignore stop */
+    #isStale = () => false;
+    #initializeSizeTracking() {
+        const sizes = new ZeroArray(this.#max);
+        this.#calculatedSize = 0;
+        this.#sizes = sizes;
+        this.#removeItemSize = index => {
+            this.#calculatedSize -= sizes[index];
+            sizes[index] = 0;
+        };
+        this.#requireSize = (k, v, size, sizeCalculation) => {
+            // provisionally accept background fetches.
+            // actual value size will be checked when they return.
+            if (this.#isBackgroundFetch(v)) {
+                return 0;
+            }
+            if (!isPosInt(size)) {
+                if (sizeCalculation) {
+                    if (typeof sizeCalculation !== 'function') {
+                        throw new TypeError('sizeCalculation must be a function');
+                    }
+                    size = sizeCalculation(v, k);
+                    if (!isPosInt(size)) {
+                        throw new TypeError('sizeCalculation return invalid (expect positive integer)');
+                    }
+                }
+                else {
+                    throw new TypeError('invalid size value (must be positive integer). ' +
+                        'When maxSize or maxEntrySize is used, sizeCalculation ' +
+                        'or size must be set.');
+                }
+            }
+            return size;
+        };
+        this.#addItemSize = (index, size, status) => {
+            sizes[index] = size;
+            if (this.#maxSize) {
+                const maxSize = this.#maxSize - sizes[index];
+                while (this.#calculatedSize > maxSize) {
+                    this.#evict(true);
+                }
+            }
+            this.#calculatedSize += sizes[index];
+            if (status) {
+                status.entrySize = size;
+                status.totalCalculatedSize = this.#calculatedSize;
+            }
+        };
+    }
+    #removeItemSize = _i => { };
+    #addItemSize = (_i, _s, _st) => { };
+    #requireSize = (_k, _v, size, sizeCalculation) => {
+        if (size || sizeCalculation) {
+            throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');
+        }
+        return 0;
+    };
+    *#indexes({ allowStale = this.allowStale } = {}) {
+        if (this.#size) {
+            for (let i = this.#tail; true;) {
+                if (!this.#isValidIndex(i)) {
+                    break;
+                }
+                if (allowStale || !this.#isStale(i)) {
+                    yield i;
+                }
+                if (i === this.#head) {
+                    break;
+                }
+                else {
+                    i = this.#prev[i];
+                }
+            }
+        }
+    }
+    *#rindexes({ allowStale = this.allowStale } = {}) {
+        if (this.#size) {
+            for (let i = this.#head; true;) {
+                if (!this.#isValidIndex(i)) {
+                    break;
+                }
+                if (allowStale || !this.#isStale(i)) {
+                    yield i;
+                }
+                if (i === this.#tail) {
+                    break;
+                }
+                else {
+                    i = this.#next[i];
+                }
+            }
+        }
+    }
+    #isValidIndex(index) {
+        return (index !== undefined &&
+            this.#keyMap.get(this.#keyList[index]) === index);
+    }
+    /**
+     * Return a generator yielding `[key, value]` pairs,
+     * in order from most recently used to least recently used.
+     */
+    *entries() {
+        for (const i of this.#indexes()) {
+            if (this.#valList[i] !== undefined &&
+                this.#keyList[i] !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield [this.#keyList[i], this.#valList[i]];
+            }
+        }
+    }
+    /**
+     * Inverse order version of {@link LRUCache.entries}
+     *
+     * Return a generator yielding `[key, value]` pairs,
+     * in order from least recently used to most recently used.
+     */
+    *rentries() {
+        for (const i of this.#rindexes()) {
+            if (this.#valList[i] !== undefined &&
+                this.#keyList[i] !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield [this.#keyList[i], this.#valList[i]];
+            }
+        }
+    }
+    /**
+     * Return a generator yielding the keys in the cache,
+     * in order from most recently used to least recently used.
+     */
+    *keys() {
+        for (const i of this.#indexes()) {
+            const k = this.#keyList[i];
+            if (k !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield k;
+            }
+        }
+    }
+    /**
+     * Inverse order version of {@link LRUCache.keys}
+     *
+     * Return a generator yielding the keys in the cache,
+     * in order from least recently used to most recently used.
+     */
+    *rkeys() {
+        for (const i of this.#rindexes()) {
+            const k = this.#keyList[i];
+            if (k !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield k;
+            }
+        }
+    }
+    /**
+     * Return a generator yielding the values in the cache,
+     * in order from most recently used to least recently used.
+     */
+    *values() {
+        for (const i of this.#indexes()) {
+            const v = this.#valList[i];
+            if (v !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield this.#valList[i];
+            }
+        }
+    }
+    /**
+     * Inverse order version of {@link LRUCache.values}
+     *
+     * Return a generator yielding the values in the cache,
+     * in order from least recently used to most recently used.
+     */
+    *rvalues() {
+        for (const i of this.#rindexes()) {
+            const v = this.#valList[i];
+            if (v !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield this.#valList[i];
+            }
+        }
+    }
+    /**
+     * Iterating over the cache itself yields the same results as
+     * {@link LRUCache.entries}
+     */
+    [Symbol.iterator]() {
+        return this.entries();
+    }
+    /**
+     * A String value that is used in the creation of the default string
+     * description of an object. Called by the built-in method
+     * `Object.prototype.toString`.
+     */
+    [Symbol.toStringTag] = 'LRUCache';
+    /**
+     * Find a value for which the supplied fn method returns a truthy value,
+     * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
+     */
+    find(fn, getOptions = {}) {
+        for (const i of this.#indexes()) {
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
+            if (value === undefined)
+                continue;
+            if (fn(value, this.#keyList[i], this)) {
+                return this.get(this.#keyList[i], getOptions);
+            }
+        }
+    }
+    /**
+     * Call the supplied function on each item in the cache, in order from most
+     * recently used to least recently used.
+     *
+     * `fn` is called as `fn(value, key, cache)`.
+     *
+     * If `thisp` is provided, function will be called in the `this`-context of
+     * the provided object, or the cache if no `thisp` object is provided.
+     *
+     * Does not update age or recenty of use, or iterate over stale values.
+     */
+    forEach(fn, thisp = this) {
+        for (const i of this.#indexes()) {
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
+            if (value === undefined)
+                continue;
+            fn.call(thisp, value, this.#keyList[i], this);
+        }
+    }
+    /**
+     * The same as {@link LRUCache.forEach} but items are iterated over in
+     * reverse order.  (ie, less recently used items are iterated over first.)
+     */
+    rforEach(fn, thisp = this) {
+        for (const i of this.#rindexes()) {
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
+            if (value === undefined)
+                continue;
+            fn.call(thisp, value, this.#keyList[i], this);
+        }
+    }
+    /**
+     * Delete any stale entries. Returns true if anything was removed,
+     * false otherwise.
+     */
+    purgeStale() {
+        let deleted = false;
+        for (const i of this.#rindexes({ allowStale: true })) {
+            if (this.#isStale(i)) {
+                this.#delete(this.#keyList[i], 'expire');
+                deleted = true;
+            }
+        }
+        return deleted;
+    }
+    /**
+     * Get the extended info about a given entry, to get its value, size, and
+     * TTL info simultaneously. Returns `undefined` if the key is not present.
+     *
+     * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
+     * serialization, the `start` value is always the current timestamp, and the
+     * `ttl` is a calculated remaining time to live (negative if expired).
+     *
+     * Always returns stale values, if their info is found in the cache, so be
+     * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
+     * if relevant.
+     */
+    info(key) {
+        const i = this.#keyMap.get(key);
+        if (i === undefined)
+            return undefined;
+        const v = this.#valList[i];
+        /* c8 ignore start - this isn't tested for the info function,
+         * but it's the same logic as found in other places. */
+        const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
+        if (value === undefined)
+            return undefined;
+        /* c8 ignore end */
+        const entry = { value };
+        if (this.#ttls && this.#starts) {
+            const ttl = this.#ttls[i];
+            const start = this.#starts[i];
+            if (ttl && start) {
+                const remain = ttl - (this.#perf.now() - start);
+                entry.ttl = remain;
+                entry.start = Date.now();
+            }
+        }
+        if (this.#sizes) {
+            entry.size = this.#sizes[i];
+        }
+        return entry;
+    }
+    /**
+     * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
+     * passed to {@link LRUCache#load}.
+     *
+     * The `start` fields are calculated relative to a portable `Date.now()`
+     * timestamp, even if `performance.now()` is available.
+     *
+     * Stale entries are always included in the `dump`, even if
+     * {@link LRUCache.OptionsBase.allowStale} is false.
+     *
+     * Note: this returns an actual array, not a generator, so it can be more
+     * easily passed around.
+     */
+    dump() {
+        const arr = [];
+        for (const i of this.#indexes({ allowStale: true })) {
+            const key = this.#keyList[i];
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
+            if (value === undefined || key === undefined)
+                continue;
+            const entry = { value };
+            if (this.#ttls && this.#starts) {
+                entry.ttl = this.#ttls[i];
+                // always dump the start relative to a portable timestamp
+                // it's ok for this to be a bit slow, it's a rare operation.
+                const age = this.#perf.now() - this.#starts[i];
+                entry.start = Math.floor(Date.now() - age);
+            }
+            if (this.#sizes) {
+                entry.size = this.#sizes[i];
+            }
+            arr.unshift([key, entry]);
+        }
+        return arr;
+    }
+    /**
+     * Reset the cache and load in the items in entries in the order listed.
+     *
+     * The shape of the resulting cache may be different if the same options are
+     * not used in both caches.
+     *
+     * The `start` fields are assumed to be calculated relative to a portable
+     * `Date.now()` timestamp, even if `performance.now()` is available.
+     */
+    load(arr) {
+        this.clear();
+        for (const [key, entry] of arr) {
+            if (entry.start) {
+                // entry.start is a portable timestamp, but we may be using
+                // node's performance.now(), so calculate the offset, so that
+                // we get the intended remaining TTL, no matter how long it's
+                // been on ice.
+                //
+                // it's ok for this to be a bit slow, it's a rare operation.
+                const age = Date.now() - entry.start;
+                entry.start = this.#perf.now() - age;
+            }
+            this.set(key, entry.value, entry);
+        }
+    }
+    /**
+     * Add a value to the cache.
+     *
+     * Note: if `undefined` is specified as a value, this is an alias for
+     * {@link LRUCache#delete}
+     *
+     * Fields on the {@link LRUCache.SetOptions} options param will override
+     * their corresponding values in the constructor options for the scope
+     * of this single `set()` operation.
+     *
+     * If `start` is provided, then that will set the effective start
+     * time for the TTL calculation. Note that this must be a previous
+     * value of `performance.now()` if supported, or a previous value of
+     * `Date.now()` if not.
+     *
+     * Options object may also include `size`, which will prevent
+     * calling the `sizeCalculation` function and just use the specified
+     * number if it is a positive integer, and `noDisposeOnSet` which
+     * will prevent calling a `dispose` function in the case of
+     * overwrites.
+     *
+     * If the `size` (or return value of `sizeCalculation`) for a given
+     * entry is greater than `maxEntrySize`, then the item will not be
+     * added to the cache.
+     *
+     * Will update the recency of the entry.
+     *
+     * If the value is `undefined`, then this is an alias for
+     * `cache.delete(key)`. `undefined` is never stored in the cache.
+     */
+    set(k, v, setOptions = {}) {
+        if (v === undefined) {
+            this.delete(k);
+            return this;
+        }
+        const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
+        let { noUpdateTTL = this.noUpdateTTL } = setOptions;
+        const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
+        // if the item doesn't fit, don't do anything
+        // NB: maxEntrySize set to maxSize by default
+        if (this.maxEntrySize && size > this.maxEntrySize) {
+            if (status) {
+                status.set = 'miss';
+                status.maxEntrySizeExceeded = true;
+            }
+            // have to delete, in case something is there already.
+            this.#delete(k, 'set');
+            return this;
+        }
+        let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
+        if (index === undefined) {
+            // addition
+            index = (this.#size === 0 ? this.#tail
+                : this.#free.length !== 0 ? this.#free.pop()
+                    : this.#size === this.#max ? this.#evict(false)
+                        : this.#size);
+            this.#keyList[index] = k;
+            this.#valList[index] = v;
+            this.#keyMap.set(k, index);
+            this.#next[this.#tail] = index;
+            this.#prev[index] = this.#tail;
+            this.#tail = index;
+            this.#size++;
+            this.#addItemSize(index, size, status);
+            if (status)
+                status.set = 'add';
+            noUpdateTTL = false;
+            if (this.#hasOnInsert) {
+                this.#onInsert?.(v, k, 'add');
+            }
+        }
+        else {
+            // update
+            this.#moveToTail(index);
+            const oldVal = this.#valList[index];
+            if (v !== oldVal) {
+                if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
+                    oldVal.__abortController.abort(new Error('replaced'));
+                    const { __staleWhileFetching: s } = oldVal;
+                    if (s !== undefined && !noDisposeOnSet) {
+                        if (this.#hasDispose) {
+                            this.#dispose?.(s, k, 'set');
+                        }
+                        if (this.#hasDisposeAfter) {
+                            this.#disposed?.push([s, k, 'set']);
+                        }
+                    }
+                }
+                else if (!noDisposeOnSet) {
+                    if (this.#hasDispose) {
+                        this.#dispose?.(oldVal, k, 'set');
+                    }
+                    if (this.#hasDisposeAfter) {
+                        this.#disposed?.push([oldVal, k, 'set']);
+                    }
+                }
+                this.#removeItemSize(index);
+                this.#addItemSize(index, size, status);
+                this.#valList[index] = v;
+                if (status) {
+                    status.set = 'replace';
+                    const oldValue = oldVal && this.#isBackgroundFetch(oldVal) ?
+                        oldVal.__staleWhileFetching
+                        : oldVal;
+                    if (oldValue !== undefined)
+                        status.oldValue = oldValue;
+                }
+            }
+            else if (status) {
+                status.set = 'update';
+            }
+            if (this.#hasOnInsert) {
+                this.onInsert?.(v, k, v === oldVal ? 'update' : 'replace');
+            }
+        }
+        if (ttl !== 0 && !this.#ttls) {
+            this.#initializeTTLTracking();
+        }
+        if (this.#ttls) {
+            if (!noUpdateTTL) {
+                this.#setItemTTL(index, ttl, start);
+            }
+            if (status)
+                this.#statusTTL(status, index);
+        }
+        if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
+            const dt = this.#disposed;
+            let task;
+            while ((task = dt?.shift())) {
+                this.#disposeAfter?.(...task);
+            }
+        }
+        return this;
+    }
+    /**
+     * Evict the least recently used item, returning its value or
+     * `undefined` if cache is empty.
+     */
+    pop() {
+        try {
+            while (this.#size) {
+                const val = this.#valList[this.#head];
+                this.#evict(true);
+                if (this.#isBackgroundFetch(val)) {
+                    if (val.__staleWhileFetching) {
+                        return val.__staleWhileFetching;
+                    }
+                }
+                else if (val !== undefined) {
+                    return val;
+                }
+            }
+        }
+        finally {
+            if (this.#hasDisposeAfter && this.#disposed) {
+                const dt = this.#disposed;
+                let task;
+                while ((task = dt?.shift())) {
+                    this.#disposeAfter?.(...task);
+                }
+            }
+        }
+    }
+    #evict(free) {
+        const head = this.#head;
+        const k = this.#keyList[head];
+        const v = this.#valList[head];
+        if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
+            v.__abortController.abort(new Error('evicted'));
+        }
+        else if (this.#hasDispose || this.#hasDisposeAfter) {
+            if (this.#hasDispose) {
+                this.#dispose?.(v, k, 'evict');
+            }
+            if (this.#hasDisposeAfter) {
+                this.#disposed?.push([v, k, 'evict']);
+            }
+        }
+        this.#removeItemSize(head);
+        // if we aren't about to use the index, then null these out
+        if (free) {
+            this.#keyList[head] = undefined;
+            this.#valList[head] = undefined;
+            this.#free.push(head);
+        }
+        if (this.#size === 1) {
+            this.#head = this.#tail = 0;
+            this.#free.length = 0;
+        }
+        else {
+            this.#head = this.#next[head];
+        }
+        this.#keyMap.delete(k);
+        this.#size--;
+        return head;
+    }
+    /**
+     * Check if a key is in the cache, without updating the recency of use.
+     * Will return false if the item is stale, even though it is technically
+     * in the cache.
+     *
+     * Check if a key is in the cache, without updating the recency of
+     * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
+     * to `true` in either the options or the constructor.
+     *
+     * Will return `false` if the item is stale, even though it is technically in
+     * the cache. The difference can be determined (if it matters) by using a
+     * `status` argument, and inspecting the `has` field.
+     *
+     * Will not update item age unless
+     * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
+     */
+    has(k, hasOptions = {}) {
+        const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
+        const index = this.#keyMap.get(k);
+        if (index !== undefined) {
+            const v = this.#valList[index];
+            if (this.#isBackgroundFetch(v) &&
+                v.__staleWhileFetching === undefined) {
+                return false;
+            }
+            if (!this.#isStale(index)) {
+                if (updateAgeOnHas) {
+                    this.#updateItemAge(index);
+                }
+                if (status) {
+                    status.has = 'hit';
+                    this.#statusTTL(status, index);
+                }
+                return true;
+            }
+            else if (status) {
+                status.has = 'stale';
+                this.#statusTTL(status, index);
+            }
+        }
+        else if (status) {
+            status.has = 'miss';
+        }
+        return false;
+    }
+    /**
+     * Like {@link LRUCache#get} but doesn't update recency or delete stale
+     * items.
+     *
+     * Returns `undefined` if the item is stale, unless
+     * {@link LRUCache.OptionsBase.allowStale} is set.
+     */
+    peek(k, peekOptions = {}) {
+        const { allowStale = this.allowStale } = peekOptions;
+        const index = this.#keyMap.get(k);
+        if (index === undefined ||
+            (!allowStale && this.#isStale(index))) {
+            return;
+        }
+        const v = this.#valList[index];
+        // either stale and allowed, or forcing a refresh of non-stale value
+        return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
+    }
+    #backgroundFetch(k, index, options, context) {
+        const v = index === undefined ? undefined : this.#valList[index];
+        if (this.#isBackgroundFetch(v)) {
+            return v;
+        }
+        const ac = new AC();
+        const { signal } = options;
+        // when/if our AC signals, then stop listening to theirs.
+        signal?.addEventListener('abort', () => ac.abort(signal.reason), {
+            signal: ac.signal,
+        });
+        const fetchOpts = {
+            signal: ac.signal,
+            options,
+            context,
+        };
+        const cb = (v, updateCache = false) => {
+            const { aborted } = ac.signal;
+            const ignoreAbort = options.ignoreFetchAbort && v !== undefined;
+            if (options.status) {
+                if (aborted && !updateCache) {
+                    options.status.fetchAborted = true;
+                    options.status.fetchError = ac.signal.reason;
+                    if (ignoreAbort)
+                        options.status.fetchAbortIgnored = true;
+                }
+                else {
+                    options.status.fetchResolved = true;
+                }
+            }
+            if (aborted && !ignoreAbort && !updateCache) {
+                return fetchFail(ac.signal.reason);
+            }
+            // either we didn't abort, and are still here, or we did, and ignored
+            const bf = p;
+            if (this.#valList[index] === p) {
+                if (v === undefined) {
+                    if (bf.__staleWhileFetching !== undefined) {
+                        this.#valList[index] = bf.__staleWhileFetching;
+                    }
+                    else {
+                        this.#delete(k, 'fetch');
+                    }
+                }
+                else {
+                    if (options.status)
+                        options.status.fetchUpdated = true;
+                    this.set(k, v, fetchOpts.options);
+                }
+            }
+            return v;
+        };
+        const eb = (er) => {
+            if (options.status) {
+                options.status.fetchRejected = true;
+                options.status.fetchError = er;
+            }
+            return fetchFail(er);
+        };
+        const fetchFail = (er) => {
+            const { aborted } = ac.signal;
+            const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
+            const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
+            const noDelete = allowStale || options.noDeleteOnFetchRejection;
+            const bf = p;
+            if (this.#valList[index] === p) {
+                // if we allow stale on fetch rejections, then we need to ensure that
+                // the stale value is not removed from the cache when the fetch fails.
+                const del = !noDelete || bf.__staleWhileFetching === undefined;
+                if (del) {
+                    this.#delete(k, 'fetch');
+                }
+                else if (!allowStaleAborted) {
+                    // still replace the *promise* with the stale value,
+                    // since we are done with the promise at this point.
+                    // leave it untouched if we're still waiting for an
+                    // aborted background fetch that hasn't yet returned.
+                    this.#valList[index] = bf.__staleWhileFetching;
+                }
+            }
+            if (allowStale) {
+                if (options.status && bf.__staleWhileFetching !== undefined) {
+                    options.status.returnedStale = true;
+                }
+                return bf.__staleWhileFetching;
+            }
+            else if (bf.__returned === bf) {
+                throw er;
+            }
+        };
+        const pcall = (res, rej) => {
+            const fmp = this.#fetchMethod?.(k, v, fetchOpts);
+            if (fmp && fmp instanceof Promise) {
+                fmp.then(v => res(v === undefined ? undefined : v), rej);
+            }
+            // ignored, we go until we finish, regardless.
+            // defer check until we are actually aborting,
+            // so fetchMethod can override.
+            ac.signal.addEventListener('abort', () => {
+                if (!options.ignoreFetchAbort ||
+                    options.allowStaleOnFetchAbort) {
+                    res(undefined);
+                    // when it eventually resolves, update the cache.
+                    if (options.allowStaleOnFetchAbort) {
+                        res = v => cb(v, true);
+                    }
+                }
+            });
+        };
+        if (options.status)
+            options.status.fetchDispatched = true;
+        const p = new Promise(pcall).then(cb, eb);
+        const bf = Object.assign(p, {
+            __abortController: ac,
+            __staleWhileFetching: v,
+            __returned: undefined,
+        });
+        if (index === undefined) {
+            // internal, don't expose status.
+            this.set(k, bf, { ...fetchOpts.options, status: undefined });
+            index = this.#keyMap.get(k);
+        }
+        else {
+            this.#valList[index] = bf;
+        }
+        return bf;
+    }
+    #isBackgroundFetch(p) {
+        if (!this.#hasFetchMethod)
+            return false;
+        const b = p;
+        return (!!b &&
+            b instanceof Promise &&
+            b.hasOwnProperty('__staleWhileFetching') &&
+            b.__abortController instanceof AC);
+    }
+    async fetch(k, fetchOptions = {}) {
+        const { 
+        // get options
+        allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, 
+        // set options
+        ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, 
+        // fetch exclusive options
+        noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;
+        if (!this.#hasFetchMethod) {
+            if (status)
+                status.fetch = 'get';
+            return this.get(k, {
+                allowStale,
+                updateAgeOnGet,
+                noDeleteOnStaleGet,
+                status,
+            });
+        }
+        const options = {
+            allowStale,
+            updateAgeOnGet,
+            noDeleteOnStaleGet,
+            ttl,
+            noDisposeOnSet,
+            size,
+            sizeCalculation,
+            noUpdateTTL,
+            noDeleteOnFetchRejection,
+            allowStaleOnFetchRejection,
+            allowStaleOnFetchAbort,
+            ignoreFetchAbort,
+            status,
+            signal,
+        };
+        let index = this.#keyMap.get(k);
+        if (index === undefined) {
+            if (status)
+                status.fetch = 'miss';
+            const p = this.#backgroundFetch(k, index, options, context);
+            return (p.__returned = p);
+        }
+        else {
+            // in cache, maybe already fetching
+            const v = this.#valList[index];
+            if (this.#isBackgroundFetch(v)) {
+                const stale = allowStale && v.__staleWhileFetching !== undefined;
+                if (status) {
+                    status.fetch = 'inflight';
+                    if (stale)
+                        status.returnedStale = true;
+                }
+                return stale ? v.__staleWhileFetching : (v.__returned = v);
+            }
+            // if we force a refresh, that means do NOT serve the cached value,
+            // unless we are already in the process of refreshing the cache.
+            const isStale = this.#isStale(index);
+            if (!forceRefresh && !isStale) {
+                if (status)
+                    status.fetch = 'hit';
+                this.#moveToTail(index);
+                if (updateAgeOnGet) {
+                    this.#updateItemAge(index);
+                }
+                if (status)
+                    this.#statusTTL(status, index);
+                return v;
+            }
+            // ok, it is stale or a forced refresh, and not already fetching.
+            // refresh the cache.
+            const p = this.#backgroundFetch(k, index, options, context);
+            const hasStale = p.__staleWhileFetching !== undefined;
+            const staleVal = hasStale && allowStale;
+            if (status) {
+                status.fetch = isStale ? 'stale' : 'refresh';
+                if (staleVal && isStale)
+                    status.returnedStale = true;
+            }
+            return staleVal ? p.__staleWhileFetching : (p.__returned = p);
+        }
+    }
+    async forceFetch(k, fetchOptions = {}) {
+        const v = await this.fetch(k, fetchOptions);
+        if (v === undefined)
+            throw new Error('fetch() returned undefined');
+        return v;
+    }
+    memo(k, memoOptions = {}) {
+        const memoMethod = this.#memoMethod;
+        if (!memoMethod) {
+            throw new Error('no memoMethod provided to constructor');
+        }
+        const { context, forceRefresh, ...options } = memoOptions;
+        const v = this.get(k, options);
+        if (!forceRefresh && v !== undefined)
+            return v;
+        const vv = memoMethod(k, v, {
+            options,
+            context,
+        });
+        this.set(k, vv, options);
+        return vv;
+    }
+    /**
+     * Return a value from the cache. Will update the recency of the cache
+     * entry found.
+     *
+     * If the key is not found, get() will return `undefined`.
+     */
+    get(k, getOptions = {}) {
+        const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;
+        const index = this.#keyMap.get(k);
+        if (index !== undefined) {
+            const value = this.#valList[index];
+            const fetching = this.#isBackgroundFetch(value);
+            if (status)
+                this.#statusTTL(status, index);
+            if (this.#isStale(index)) {
+                if (status)
+                    status.get = 'stale';
+                // delete only if not an in-flight background fetch
+                if (!fetching) {
+                    if (!noDeleteOnStaleGet) {
+                        this.#delete(k, 'expire');
+                    }
+                    if (status && allowStale)
+                        status.returnedStale = true;
+                    return allowStale ? value : undefined;
+                }
+                else {
+                    if (status &&
+                        allowStale &&
+                        value.__staleWhileFetching !== undefined) {
+                        status.returnedStale = true;
+                    }
+                    return allowStale ? value.__staleWhileFetching : undefined;
+                }
+            }
+            else {
+                if (status)
+                    status.get = 'hit';
+                // if we're currently fetching it, we don't actually have it yet
+                // it's not stale, which means this isn't a staleWhileRefetching.
+                // If it's not stale, and fetching, AND has a __staleWhileFetching
+                // value, then that means the user fetched with {forceRefresh:true},
+                // so it's safe to return that value.
+                if (fetching) {
+                    return value.__staleWhileFetching;
+                }
+                this.#moveToTail(index);
+                if (updateAgeOnGet) {
+                    this.#updateItemAge(index);
+                }
+                return value;
+            }
+        }
+        else if (status) {
+            status.get = 'miss';
+        }
+    }
+    #connect(p, n) {
+        this.#prev[n] = p;
+        this.#next[p] = n;
+    }
+    #moveToTail(index) {
+        // if tail already, nothing to do
+        // if head, move head to next[index]
+        // else
+        //   move next[prev[index]] to next[index] (head has no prev)
+        //   move prev[next[index]] to prev[index]
+        // prev[index] = tail
+        // next[tail] = index
+        // tail = index
+        if (index !== this.#tail) {
+            if (index === this.#head) {
+                this.#head = this.#next[index];
+            }
+            else {
+                this.#connect(this.#prev[index], this.#next[index]);
+            }
+            this.#connect(this.#tail, index);
+            this.#tail = index;
+        }
+    }
+    /**
+     * Deletes a key out of the cache.
+     *
+     * Returns true if the key was deleted, false otherwise.
+     */
+    delete(k) {
+        return this.#delete(k, 'delete');
+    }
+    #delete(k, reason) {
+        let deleted = false;
+        if (this.#size !== 0) {
+            const index = this.#keyMap.get(k);
+            if (index !== undefined) {
+                deleted = true;
+                if (this.#size === 1) {
+                    this.#clear(reason);
+                }
+                else {
+                    this.#removeItemSize(index);
+                    const v = this.#valList[index];
+                    if (this.#isBackgroundFetch(v)) {
+                        v.__abortController.abort(new Error('deleted'));
+                    }
+                    else if (this.#hasDispose || this.#hasDisposeAfter) {
+                        if (this.#hasDispose) {
+                            this.#dispose?.(v, k, reason);
+                        }
+                        if (this.#hasDisposeAfter) {
+                            this.#disposed?.push([v, k, reason]);
+                        }
+                    }
+                    this.#keyMap.delete(k);
+                    this.#keyList[index] = undefined;
+                    this.#valList[index] = undefined;
+                    if (index === this.#tail) {
+                        this.#tail = this.#prev[index];
+                    }
+                    else if (index === this.#head) {
+                        this.#head = this.#next[index];
+                    }
+                    else {
+                        const pi = this.#prev[index];
+                        this.#next[pi] = this.#next[index];
+                        const ni = this.#next[index];
+                        this.#prev[ni] = this.#prev[index];
+                    }
+                    this.#size--;
+                    this.#free.push(index);
+                }
+            }
+        }
+        if (this.#hasDisposeAfter && this.#disposed?.length) {
+            const dt = this.#disposed;
+            let task;
+            while ((task = dt?.shift())) {
+                this.#disposeAfter?.(...task);
+            }
+        }
+        return deleted;
+    }
+    /**
+     * Clear the cache entirely, throwing away all values.
+     */
+    clear() {
+        return this.#clear('delete');
+    }
+    #clear(reason) {
+        for (const index of this.#rindexes({ allowStale: true })) {
+            const v = this.#valList[index];
+            if (this.#isBackgroundFetch(v)) {
+                v.__abortController.abort(new Error('deleted'));
+            }
+            else {
+                const k = this.#keyList[index];
+                if (this.#hasDispose) {
+                    this.#dispose?.(v, k, reason);
+                }
+                if (this.#hasDisposeAfter) {
+                    this.#disposed?.push([v, k, reason]);
+                }
+            }
+        }
+        this.#keyMap.clear();
+        this.#valList.fill(undefined);
+        this.#keyList.fill(undefined);
+        if (this.#ttls && this.#starts) {
+            this.#ttls.fill(0);
+            this.#starts.fill(0);
+        }
+        if (this.#sizes) {
+            this.#sizes.fill(0);
+        }
+        this.#head = 0;
+        this.#tail = 0;
+        this.#free.length = 0;
+        this.#calculatedSize = 0;
+        this.#size = 0;
+        if (this.#hasDisposeAfter && this.#disposed) {
+            const dt = this.#disposed;
+            let task;
+            while ((task = dt?.shift())) {
+                this.#disposeAfter?.(...task);
+            }
+        }
+    }
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: external "node:path"
+const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path");
+// EXTERNAL MODULE: external "fs"
+var external_fs_ = __nccwpck_require__(9896);
+var external_fs_default = /*#__PURE__*/__nccwpck_require__.n(external_fs_);
+;// CONCATENATED MODULE: external "node:fs/promises"
+const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
+// EXTERNAL MODULE: external "node:stream"
+var external_node_stream_ = __nccwpck_require__(7075);
+;// CONCATENATED MODULE: external "node:string_decoder"
+const external_node_string_decoder_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:string_decoder");
+;// CONCATENATED MODULE: ./node_modules/minipass/dist/esm/index.js
+const proc = typeof process === 'object' && process
+    ? process
+    : {
+        stdout: null,
+        stderr: null,
+    };
+
+
+
+/**
+ * Return true if the argument is a Minipass stream, Node stream, or something
+ * else that Minipass can interact with.
+ */
+const isStream = (s) => !!s &&
+    typeof s === 'object' &&
+    (s instanceof Minipass ||
+        s instanceof external_node_stream_ ||
+        isReadable(s) ||
+        isWritable(s));
+/**
+ * Return true if the argument is a valid {@link Minipass.Readable}
+ */
+const isReadable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof external_node_events_.EventEmitter &&
+    typeof s.pipe === 'function' &&
+    // node core Writable streams have a pipe() method, but it throws
+    s.pipe !== external_node_stream_.Writable.prototype.pipe;
+/**
+ * Return true if the argument is a valid {@link Minipass.Writable}
+ */
+const isWritable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof external_node_events_.EventEmitter &&
+    typeof s.write === 'function' &&
+    typeof s.end === 'function';
+const EOF = Symbol('EOF');
+const MAYBE_EMIT_END = Symbol('maybeEmitEnd');
+const EMITTED_END = Symbol('emittedEnd');
+const EMITTING_END = Symbol('emittingEnd');
+const EMITTED_ERROR = Symbol('emittedError');
+const CLOSED = Symbol('closed');
+const READ = Symbol('read');
+const FLUSH = Symbol('flush');
+const FLUSHCHUNK = Symbol('flushChunk');
+const ENCODING = Symbol('encoding');
+const DECODER = Symbol('decoder');
+const FLOWING = Symbol('flowing');
+const PAUSED = Symbol('paused');
+const RESUME = Symbol('resume');
+const BUFFER = Symbol('buffer');
+const PIPES = Symbol('pipes');
+const BUFFERLENGTH = Symbol('bufferLength');
+const BUFFERPUSH = Symbol('bufferPush');
+const BUFFERSHIFT = Symbol('bufferShift');
+const OBJECTMODE = Symbol('objectMode');
+// internal event when stream is destroyed
+const DESTROYED = Symbol('destroyed');
+// internal event when stream has an error
+const ERROR = Symbol('error');
+const EMITDATA = Symbol('emitData');
+const EMITEND = Symbol('emitEnd');
+const EMITEND2 = Symbol('emitEnd2');
+const ASYNC = Symbol('async');
+const ABORT = Symbol('abort');
+const ABORTED = Symbol('aborted');
+const SIGNAL = Symbol('signal');
+const DATALISTENERS = Symbol('dataListeners');
+const DISCARDED = Symbol('discarded');
+const defer = (fn) => Promise.resolve().then(fn);
+const nodefer = (fn) => fn();
+const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';
+const isArrayBufferLike = (b) => b instanceof ArrayBuffer ||
+    (!!b &&
+        typeof b === 'object' &&
+        b.constructor &&
+        b.constructor.name === 'ArrayBuffer' &&
+        b.byteLength >= 0);
+const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
+/**
+ * Internal class representing a pipe to a destination stream.
+ *
+ * @internal
+ */
+class Pipe {
+    src;
+    dest;
+    opts;
+    ondrain;
+    constructor(src, dest, opts) {
+        this.src = src;
+        this.dest = dest;
+        this.opts = opts;
+        this.ondrain = () => src[RESUME]();
+        this.dest.on('drain', this.ondrain);
+    }
+    unpipe() {
+        this.dest.removeListener('drain', this.ondrain);
+    }
+    // only here for the prototype
+    /* c8 ignore start */
+    proxyErrors(_er) { }
+    /* c8 ignore stop */
+    end() {
+        this.unpipe();
+        if (this.opts.end)
+            this.dest.end();
+    }
+}
+/**
+ * Internal class representing a pipe to a destination stream where
+ * errors are proxied.
+ *
+ * @internal
+ */
+class PipeProxyErrors extends Pipe {
+    unpipe() {
+        this.src.removeListener('error', this.proxyErrors);
+        super.unpipe();
+    }
+    constructor(src, dest, opts) {
+        super(src, dest, opts);
+        this.proxyErrors = er => dest.emit('error', er);
+        src.on('error', this.proxyErrors);
+    }
+}
+const isObjectModeOptions = (o) => !!o.objectMode;
+const isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer';
+/**
+ * Main export, the Minipass class
+ *
+ * `RType` is the type of data emitted, defaults to Buffer
+ *
+ * `WType` is the type of data to be written, if RType is buffer or string,
+ * then any {@link Minipass.ContiguousData} is allowed.
+ *
+ * `Events` is the set of event handler signatures that this object
+ * will emit, see {@link Minipass.Events}
+ */
+class Minipass extends external_node_events_.EventEmitter {
+    [FLOWING] = false;
+    [PAUSED] = false;
+    [PIPES] = [];
+    [BUFFER] = [];
+    [OBJECTMODE];
+    [ENCODING];
+    [ASYNC];
+    [DECODER];
+    [EOF] = false;
+    [EMITTED_END] = false;
+    [EMITTING_END] = false;
+    [CLOSED] = false;
+    [EMITTED_ERROR] = null;
+    [BUFFERLENGTH] = 0;
+    [DESTROYED] = false;
+    [SIGNAL];
+    [ABORTED] = false;
+    [DATALISTENERS] = 0;
+    [DISCARDED] = false;
+    /**
+     * true if the stream can be written
+     */
+    writable = true;
+    /**
+     * true if the stream can be read
+     */
+    readable = true;
+    /**
+     * If `RType` is Buffer, then options do not need to be provided.
+     * Otherwise, an options object must be provided to specify either
+     * {@link Minipass.SharedOptions.objectMode} or
+     * {@link Minipass.SharedOptions.encoding}, as appropriate.
+     */
+    constructor(...args) {
+        const options = (args[0] ||
+            {});
+        super();
+        if (options.objectMode && typeof options.encoding === 'string') {
+            throw new TypeError('Encoding and objectMode may not be used together');
+        }
+        if (isObjectModeOptions(options)) {
+            this[OBJECTMODE] = true;
+            this[ENCODING] = null;
+        }
+        else if (isEncodingOptions(options)) {
+            this[ENCODING] = options.encoding;
+            this[OBJECTMODE] = false;
+        }
+        else {
+            this[OBJECTMODE] = false;
+            this[ENCODING] = null;
+        }
+        this[ASYNC] = !!options.async;
+        this[DECODER] = this[ENCODING]
+            ? new external_node_string_decoder_namespaceObject.StringDecoder(this[ENCODING])
+            : null;
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposeBuffer === true) {
+            Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] });
+        }
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposePipes === true) {
+            Object.defineProperty(this, 'pipes', { get: () => this[PIPES] });
+        }
+        const { signal } = options;
+        if (signal) {
+            this[SIGNAL] = signal;
+            if (signal.aborted) {
+                this[ABORT]();
+            }
+            else {
+                signal.addEventListener('abort', () => this[ABORT]());
+            }
+        }
+    }
+    /**
+     * The amount of data stored in the buffer waiting to be read.
+     *
+     * For Buffer strings, this will be the total byte length.
+     * For string encoding streams, this will be the string character length,
+     * according to JavaScript's `string.length` logic.
+     * For objectMode streams, this is a count of the items waiting to be
+     * emitted.
+     */
+    get bufferLength() {
+        return this[BUFFERLENGTH];
+    }
+    /**
+     * The `BufferEncoding` currently in use, or `null`
+     */
+    get encoding() {
+        return this[ENCODING];
+    }
+    /**
+     * @deprecated - This is a read only property
+     */
+    set encoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * @deprecated - Encoding may only be set at instantiation time
+     */
+    setEncoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * True if this is an objectMode stream
+     */
+    get objectMode() {
+        return this[OBJECTMODE];
+    }
+    /**
+     * @deprecated - This is a read-only property
+     */
+    set objectMode(_om) {
+        throw new Error('objectMode must be set at instantiation time');
+    }
+    /**
+     * true if this is an async stream
+     */
+    get ['async']() {
+        return this[ASYNC];
+    }
+    /**
+     * Set to true to make this stream async.
+     *
+     * Once set, it cannot be unset, as this would potentially cause incorrect
+     * behavior.  Ie, a sync stream can be made async, but an async stream
+     * cannot be safely made sync.
+     */
+    set ['async'](a) {
+        this[ASYNC] = this[ASYNC] || !!a;
+    }
+    // drop everything and get out of the flow completely
+    [ABORT]() {
+        this[ABORTED] = true;
+        this.emit('abort', this[SIGNAL]?.reason);
+        this.destroy(this[SIGNAL]?.reason);
+    }
+    /**
+     * True if the stream has been aborted.
+     */
+    get aborted() {
+        return this[ABORTED];
+    }
+    /**
+     * No-op setter. Stream aborted status is set via the AbortSignal provided
+     * in the constructor options.
+     */
+    set aborted(_) { }
+    write(chunk, encoding, cb) {
+        if (this[ABORTED])
+            return false;
+        if (this[EOF])
+            throw new Error('write after end');
+        if (this[DESTROYED]) {
+            this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' }));
+            return true;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (!encoding)
+            encoding = 'utf8';
+        const fn = this[ASYNC] ? defer : nodefer;
+        // convert array buffers and typed array views into buffers
+        // at some point in the future, we may want to do the opposite!
+        // leave strings and buffers as-is
+        // anything is only allowed if in object mode, so throw
+        if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
+            if (isArrayBufferView(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
+            }
+            else if (isArrayBufferLike(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk);
+            }
+            else if (typeof chunk !== 'string') {
+                throw new Error('Non-contiguous data written to non-objectMode stream');
+            }
+        }
+        // handle object mode up front, since it's simpler
+        // this yields better performance, fewer checks later.
+        if (this[OBJECTMODE]) {
+            // maybe impossible?
+            /* c8 ignore start */
+            if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+                this[FLUSH](true);
+            /* c8 ignore stop */
+            if (this[FLOWING])
+                this.emit('data', chunk);
+            else
+                this[BUFFERPUSH](chunk);
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // at this point the chunk is a buffer or string
+        // don't buffer it up or send it to the decoder
+        if (!chunk.length) {
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // fast-path writing strings of same encoding to a stream with
+        // an empty buffer, skipping the buffer/decoder dance
+        if (typeof chunk === 'string' &&
+            // unless it is a string already ready for us to use
+            !(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = Buffer.from(chunk, encoding);
+        }
+        if (Buffer.isBuffer(chunk) && this[ENCODING]) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = this[DECODER].write(chunk);
+        }
+        // Note: flushing CAN potentially switch us into not-flowing mode
+        if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+            this[FLUSH](true);
+        if (this[FLOWING])
+            this.emit('data', chunk);
+        else
+            this[BUFFERPUSH](chunk);
+        if (this[BUFFERLENGTH] !== 0)
+            this.emit('readable');
+        if (cb)
+            fn(cb);
+        return this[FLOWING];
+    }
+    /**
+     * Low-level explicit read method.
+     *
+     * In objectMode, the argument is ignored, and one item is returned if
+     * available.
+     *
+     * `n` is the number of bytes (or in the case of encoding streams,
+     * characters) to consume. If `n` is not provided, then the entire buffer
+     * is returned, or `null` is returned if no data is available.
+     *
+     * If `n` is greater that the amount of data in the internal buffer,
+     * then `null` is returned.
+     */
+    read(n) {
+        if (this[DESTROYED])
+            return null;
+        this[DISCARDED] = false;
+        if (this[BUFFERLENGTH] === 0 ||
+            n === 0 ||
+            (n && n > this[BUFFERLENGTH])) {
+            this[MAYBE_EMIT_END]();
+            return null;
+        }
+        if (this[OBJECTMODE])
+            n = null;
+        if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
+            // not object mode, so if we have an encoding, then RType is string
+            // otherwise, must be Buffer
+            this[BUFFER] = [
+                (this[ENCODING]
+                    ? this[BUFFER].join('')
+                    : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])),
+            ];
+        }
+        const ret = this[READ](n || null, this[BUFFER][0]);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [READ](n, chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERSHIFT]();
+        else {
+            const c = chunk;
+            if (n === c.length || n === null)
+                this[BUFFERSHIFT]();
+            else if (typeof c === 'string') {
+                this[BUFFER][0] = c.slice(n);
+                chunk = c.slice(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+            else {
+                this[BUFFER][0] = c.subarray(n);
+                chunk = c.subarray(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+        }
+        this.emit('data', chunk);
+        if (!this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+        return chunk;
+    }
+    end(chunk, encoding, cb) {
+        if (typeof chunk === 'function') {
+            cb = chunk;
+            chunk = undefined;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (chunk !== undefined)
+            this.write(chunk, encoding);
+        if (cb)
+            this.once('end', cb);
+        this[EOF] = true;
+        this.writable = false;
+        // if we haven't written anything, then go ahead and emit,
+        // even if we're not reading.
+        // we'll re-emit if a new 'end' listener is added anyway.
+        // This makes MP more suitable to write-only use cases.
+        if (this[FLOWING] || !this[PAUSED])
+            this[MAYBE_EMIT_END]();
+        return this;
+    }
+    // don't let the internal resume be overwritten
+    [RESUME]() {
+        if (this[DESTROYED])
+            return;
+        if (!this[DATALISTENERS] && !this[PIPES].length) {
+            this[DISCARDED] = true;
+        }
+        this[PAUSED] = false;
+        this[FLOWING] = true;
+        this.emit('resume');
+        if (this[BUFFER].length)
+            this[FLUSH]();
+        else if (this[EOF])
+            this[MAYBE_EMIT_END]();
+        else
+            this.emit('drain');
+    }
+    /**
+     * Resume the stream if it is currently in a paused state
+     *
+     * If called when there are no pipe destinations or `data` event listeners,
+     * this will place the stream in a "discarded" state, where all data will
+     * be thrown away. The discarded state is removed if a pipe destination or
+     * data handler is added, if pause() is called, or if any synchronous or
+     * asynchronous iteration is started.
+     */
+    resume() {
+        return this[RESUME]();
+    }
+    /**
+     * Pause the stream
+     */
+    pause() {
+        this[FLOWING] = false;
+        this[PAUSED] = true;
+        this[DISCARDED] = false;
+    }
+    /**
+     * true if the stream has been forcibly destroyed
+     */
+    get destroyed() {
+        return this[DESTROYED];
+    }
+    /**
+     * true if the stream is currently in a flowing state, meaning that
+     * any writes will be immediately emitted.
+     */
+    get flowing() {
+        return this[FLOWING];
+    }
+    /**
+     * true if the stream is currently in a paused state
+     */
+    get paused() {
+        return this[PAUSED];
+    }
+    [BUFFERPUSH](chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] += 1;
+        else
+            this[BUFFERLENGTH] += chunk.length;
+        this[BUFFER].push(chunk);
+    }
+    [BUFFERSHIFT]() {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] -= 1;
+        else
+            this[BUFFERLENGTH] -= this[BUFFER][0].length;
+        return this[BUFFER].shift();
+    }
+    [FLUSH](noDrain = false) {
+        do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&
+            this[BUFFER].length);
+        if (!noDrain && !this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+    }
+    [FLUSHCHUNK](chunk) {
+        this.emit('data', chunk);
+        return this[FLOWING];
+    }
+    /**
+     * Pipe all data emitted by this stream into the destination provided.
+     *
+     * Triggers the flow of data.
+     */
+    pipe(dest, opts) {
+        if (this[DESTROYED])
+            return dest;
+        this[DISCARDED] = false;
+        const ended = this[EMITTED_END];
+        opts = opts || {};
+        if (dest === proc.stdout || dest === proc.stderr)
+            opts.end = false;
+        else
+            opts.end = opts.end !== false;
+        opts.proxyErrors = !!opts.proxyErrors;
+        // piping an ended stream ends immediately
+        if (ended) {
+            if (opts.end)
+                dest.end();
+        }
+        else {
+            // "as" here just ignores the WType, which pipes don't care about,
+            // since they're only consuming from us, and writing to the dest
+            this[PIPES].push(!opts.proxyErrors
+                ? new Pipe(this, dest, opts)
+                : new PipeProxyErrors(this, dest, opts));
+            if (this[ASYNC])
+                defer(() => this[RESUME]());
+            else
+                this[RESUME]();
+        }
+        return dest;
+    }
+    /**
+     * Fully unhook a piped destination stream.
+     *
+     * If the destination stream was the only consumer of this stream (ie,
+     * there are no other piped destinations or `'data'` event listeners)
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    unpipe(dest) {
+        const p = this[PIPES].find(p => p.dest === dest);
+        if (p) {
+            if (this[PIPES].length === 1) {
+                if (this[FLOWING] && this[DATALISTENERS] === 0) {
+                    this[FLOWING] = false;
+                }
+                this[PIPES] = [];
+            }
+            else
+                this[PIPES].splice(this[PIPES].indexOf(p), 1);
+            p.unpipe();
+        }
+    }
+    /**
+     * Alias for {@link Minipass#on}
+     */
+    addListener(ev, handler) {
+        return this.on(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.on`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * - Adding a 'data' event handler will trigger the flow of data
+     *
+     * - Adding a 'readable' event handler when there is data waiting to be read
+     *   will cause 'readable' to be emitted immediately.
+     *
+     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
+     *   already passed will cause the event to be emitted immediately and all
+     *   handlers removed.
+     *
+     * - Adding an 'error' event handler after an error has been emitted will
+     *   cause the event to be re-emitted immediately with the error previously
+     *   raised.
+     */
+    on(ev, handler) {
+        const ret = super.on(ev, handler);
+        if (ev === 'data') {
+            this[DISCARDED] = false;
+            this[DATALISTENERS]++;
+            if (!this[PIPES].length && !this[FLOWING]) {
+                this[RESUME]();
+            }
+        }
+        else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {
+            super.emit('readable');
+        }
+        else if (isEndish(ev) && this[EMITTED_END]) {
+            super.emit(ev);
+            this.removeAllListeners(ev);
+        }
+        else if (ev === 'error' && this[EMITTED_ERROR]) {
+            const h = handler;
+            if (this[ASYNC])
+                defer(() => h.call(this, this[EMITTED_ERROR]));
+            else
+                h.call(this, this[EMITTED_ERROR]);
+        }
+        return ret;
+    }
+    /**
+     * Alias for {@link Minipass#off}
+     */
+    removeListener(ev, handler) {
+        return this.off(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.off`
+     *
+     * If a 'data' event handler is removed, and it was the last consumer
+     * (ie, there are no pipe destinations or other 'data' event listeners),
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    off(ev, handler) {
+        const ret = super.off(ev, handler);
+        // if we previously had listeners, and now we don't, and we don't
+        // have any pipes, then stop the flow, unless it's been explicitly
+        // put in a discarded flowing state via stream.resume().
+        if (ev === 'data') {
+            this[DATALISTENERS] = this.listeners('data').length;
+            if (this[DATALISTENERS] === 0 &&
+                !this[DISCARDED] &&
+                !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * Mostly identical to `EventEmitter.removeAllListeners`
+     *
+     * If all 'data' event handlers are removed, and they were the last consumer
+     * (ie, there are no pipe destinations), then the flow of data will stop
+     * until there is another consumer or {@link Minipass#resume} is explicitly
+     * called.
+     */
+    removeAllListeners(ev) {
+        const ret = super.removeAllListeners(ev);
+        if (ev === 'data' || ev === undefined) {
+            this[DATALISTENERS] = 0;
+            if (!this[DISCARDED] && !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * true if the 'end' event has been emitted
+     */
+    get emittedEnd() {
+        return this[EMITTED_END];
+    }
+    [MAYBE_EMIT_END]() {
+        if (!this[EMITTING_END] &&
+            !this[EMITTED_END] &&
+            !this[DESTROYED] &&
+            this[BUFFER].length === 0 &&
+            this[EOF]) {
+            this[EMITTING_END] = true;
+            this.emit('end');
+            this.emit('prefinish');
+            this.emit('finish');
+            if (this[CLOSED])
+                this.emit('close');
+            this[EMITTING_END] = false;
+        }
+    }
+    /**
+     * Mostly identical to `EventEmitter.emit`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * If the stream has been destroyed, and the event is something other
+     * than 'close' or 'error', then `false` is returned and no handlers
+     * are called.
+     *
+     * If the event is 'end', and has already been emitted, then the event
+     * is ignored. If the stream is in a paused or non-flowing state, then
+     * the event will be deferred until data flow resumes. If the stream is
+     * async, then handlers will be called on the next tick rather than
+     * immediately.
+     *
+     * If the event is 'close', and 'end' has not yet been emitted, then
+     * the event will be deferred until after 'end' is emitted.
+     *
+     * If the event is 'error', and an AbortSignal was provided for the stream,
+     * and there are no listeners, then the event is ignored, matching the
+     * behavior of node core streams in the presense of an AbortSignal.
+     *
+     * If the event is 'finish' or 'prefinish', then all listeners will be
+     * removed after emitting the event, to prevent double-firing.
+     */
+    emit(ev, ...args) {
+        const data = args[0];
+        // error and close are only events allowed after calling destroy()
+        if (ev !== 'error' &&
+            ev !== 'close' &&
+            ev !== DESTROYED &&
+            this[DESTROYED]) {
+            return false;
+        }
+        else if (ev === 'data') {
+            return !this[OBJECTMODE] && !data
+                ? false
+                : this[ASYNC]
+                    ? (defer(() => this[EMITDATA](data)), true)
+                    : this[EMITDATA](data);
+        }
+        else if (ev === 'end') {
+            return this[EMITEND]();
+        }
+        else if (ev === 'close') {
+            this[CLOSED] = true;
+            // don't emit close before 'end' and 'finish'
+            if (!this[EMITTED_END] && !this[DESTROYED])
+                return false;
+            const ret = super.emit('close');
+            this.removeAllListeners('close');
+            return ret;
+        }
+        else if (ev === 'error') {
+            this[EMITTED_ERROR] = data;
+            super.emit(ERROR, data);
+            const ret = !this[SIGNAL] || this.listeners('error').length
+                ? super.emit('error', data)
+                : false;
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'resume') {
+            const ret = super.emit('resume');
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'finish' || ev === 'prefinish') {
+            const ret = super.emit(ev);
+            this.removeAllListeners(ev);
+            return ret;
+        }
+        // Some other unknown event
+        const ret = super.emit(ev, ...args);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITDATA](data) {
+        for (const p of this[PIPES]) {
+            if (p.dest.write(data) === false)
+                this.pause();
+        }
+        const ret = this[DISCARDED] ? false : super.emit('data', data);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITEND]() {
+        if (this[EMITTED_END])
+            return false;
+        this[EMITTED_END] = true;
+        this.readable = false;
+        return this[ASYNC]
+            ? (defer(() => this[EMITEND2]()), true)
+            : this[EMITEND2]();
+    }
+    [EMITEND2]() {
+        if (this[DECODER]) {
+            const data = this[DECODER].end();
+            if (data) {
+                for (const p of this[PIPES]) {
+                    p.dest.write(data);
+                }
+                if (!this[DISCARDED])
+                    super.emit('data', data);
+            }
+        }
+        for (const p of this[PIPES]) {
+            p.end();
+        }
+        const ret = super.emit('end');
+        this.removeAllListeners('end');
+        return ret;
+    }
+    /**
+     * Return a Promise that resolves to an array of all emitted data once
+     * the stream ends.
+     */
+    async collect() {
+        const buf = Object.assign([], {
+            dataLength: 0,
+        });
+        if (!this[OBJECTMODE])
+            buf.dataLength = 0;
+        // set the promise first, in case an error is raised
+        // by triggering the flow here.
+        const p = this.promise();
+        this.on('data', c => {
+            buf.push(c);
+            if (!this[OBJECTMODE])
+                buf.dataLength += c.length;
+        });
+        await p;
+        return buf;
+    }
+    /**
+     * Return a Promise that resolves to the concatenation of all emitted data
+     * once the stream ends.
+     *
+     * Not allowed on objectMode streams.
+     */
+    async concat() {
+        if (this[OBJECTMODE]) {
+            throw new Error('cannot concat in objectMode');
+        }
+        const buf = await this.collect();
+        return (this[ENCODING]
+            ? buf.join('')
+            : Buffer.concat(buf, buf.dataLength));
+    }
+    /**
+     * Return a void Promise that resolves once the stream ends.
+     */
+    async promise() {
+        return new Promise((resolve, reject) => {
+            this.on(DESTROYED, () => reject(new Error('stream destroyed')));
+            this.on('error', er => reject(er));
+            this.on('end', () => resolve());
+        });
+    }
+    /**
+     * Asynchronous `for await of` iteration.
+     *
+     * This will continue emitting all chunks until the stream terminates.
+     */
+    [Symbol.asyncIterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = async () => {
+            this.pause();
+            stopped = true;
+            return { value: undefined, done: true };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const res = this.read();
+            if (res !== null)
+                return Promise.resolve({ done: false, value: res });
+            if (this[EOF])
+                return stop();
+            let resolve;
+            let reject;
+            const onerr = (er) => {
+                this.off('data', ondata);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                reject(er);
+            };
+            const ondata = (value) => {
+                this.off('error', onerr);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                this.pause();
+                resolve({ value, done: !!this[EOF] });
+            };
+            const onend = () => {
+                this.off('error', onerr);
+                this.off('data', ondata);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                resolve({ done: true, value: undefined });
+            };
+            const ondestroy = () => onerr(new Error('stream destroyed'));
+            return new Promise((res, rej) => {
+                reject = rej;
+                resolve = res;
+                this.once(DESTROYED, ondestroy);
+                this.once('error', onerr);
+                this.once('end', onend);
+                this.once('data', ondata);
+            });
+        };
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+        };
+    }
+    /**
+     * Synchronous `for of` iteration.
+     *
+     * The iteration will terminate when the internal buffer runs out, even
+     * if the stream has not yet terminated.
+     */
+    [Symbol.iterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = () => {
+            this.pause();
+            this.off(ERROR, stop);
+            this.off(DESTROYED, stop);
+            this.off('end', stop);
+            stopped = true;
+            return { done: true, value: undefined };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const value = this.read();
+            return value === null ? stop() : { done: false, value };
+        };
+        this.once('end', stop);
+        this.once(ERROR, stop);
+        this.once(DESTROYED, stop);
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.iterator]() {
+                return this;
+            },
+        };
+    }
+    /**
+     * Destroy a stream, preventing it from being used for any further purpose.
+     *
+     * If the stream has a `close()` method, then it will be called on
+     * destruction.
+     *
+     * After destruction, any attempt to write data, read data, or emit most
+     * events will be ignored.
+     *
+     * If an error argument is provided, then it will be emitted in an
+     * 'error' event.
+     */
+    destroy(er) {
+        if (this[DESTROYED]) {
+            if (er)
+                this.emit('error', er);
+            else
+                this.emit(DESTROYED);
+            return this;
+        }
+        this[DESTROYED] = true;
+        this[DISCARDED] = true;
+        // throw away all buffered data, it's never coming out
+        this[BUFFER].length = 0;
+        this[BUFFERLENGTH] = 0;
+        const wc = this;
+        if (typeof wc.close === 'function' && !this[CLOSED])
+            wc.close();
+        if (er)
+            this.emit('error', er);
+        // if no error to emit, still reject pending promises
+        else
+            this.emit(DESTROYED);
+        return this;
+    }
+    /**
+     * Alias for {@link isStream}
+     *
+     * Former export location, maintained for backwards compatibility.
+     *
+     * @deprecated
+     */
+    static get isStream() {
+        return isStream;
+    }
+}
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/path-scurry/dist/esm/index.js
+
+
+
+
+
+const realpathSync = external_fs_.realpathSync.native;
+// TODO: test perf of fs/promises realpath vs realpathCB,
+// since the promises one uses realpath.native
+
+
+const defaultFS = {
+    lstatSync: external_fs_.lstatSync,
+    readdir: external_fs_.readdir,
+    readdirSync: external_fs_.readdirSync,
+    readlinkSync: external_fs_.readlinkSync,
+    realpathSync,
+    promises: {
+        lstat: promises_namespaceObject.lstat,
+        readdir: promises_namespaceObject.readdir,
+        readlink: promises_namespaceObject.readlink,
+        realpath: promises_namespaceObject.realpath,
+    },
+};
+// if they just gave us require('fs') then use our default
+const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === external_node_fs_namespaceObject_0 ?
+    defaultFS
+    : {
+        ...defaultFS,
+        ...fsOption,
+        promises: {
+            ...defaultFS.promises,
+            ...(fsOption.promises || {}),
+        },
+    };
+// turn something like //?/c:/ into c:\
+const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
+const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
+// windows paths are separated by either / or \
+const eitherSep = /[\\\/]/;
+const UNKNOWN = 0; // may not even exist, for all we know
+const IFIFO = 0b0001;
+const IFCHR = 0b0010;
+const IFDIR = 0b0100;
+const IFBLK = 0b0110;
+const IFREG = 0b1000;
+const IFLNK = 0b1010;
+const IFSOCK = 0b1100;
+const IFMT = 0b1111;
+// mask to unset low 4 bits
+const IFMT_UNKNOWN = ~IFMT;
+// set after successfully calling readdir() and getting entries.
+const READDIR_CALLED = 0b0000_0001_0000;
+// set after a successful lstat()
+const LSTAT_CALLED = 0b0000_0010_0000;
+// set if an entry (or one of its parents) is definitely not a dir
+const ENOTDIR = 0b0000_0100_0000;
+// set if an entry (or one of its parents) does not exist
+// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
+const ENOENT = 0b0000_1000_0000;
+// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
+// set if we fail to readlink
+const ENOREADLINK = 0b0001_0000_0000;
+// set if we know realpath() will fail
+const ENOREALPATH = 0b0010_0000_0000;
+const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
+const TYPEMASK = 0b0011_1111_1111;
+const entToType = (s) => s.isFile() ? IFREG
+    : s.isDirectory() ? IFDIR
+        : s.isSymbolicLink() ? IFLNK
+            : s.isCharacterDevice() ? IFCHR
+                : s.isBlockDevice() ? IFBLK
+                    : s.isSocket() ? IFSOCK
+                        : s.isFIFO() ? IFIFO
+                            : UNKNOWN;
+// normalize unicode path names
+const normalizeCache = new Map();
+const normalize = (s) => {
+    const c = normalizeCache.get(s);
+    if (c)
+        return c;
+    const n = s.normalize('NFKD');
+    normalizeCache.set(s, n);
+    return n;
+};
+const normalizeNocaseCache = new Map();
+const normalizeNocase = (s) => {
+    const c = normalizeNocaseCache.get(s);
+    if (c)
+        return c;
+    const n = normalize(s.toLowerCase());
+    normalizeNocaseCache.set(s, n);
+    return n;
+};
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+class ResolveCache extends LRUCache {
+    constructor() {
+        super({ max: 256 });
+    }
+}
+// In order to prevent blowing out the js heap by allocating hundreds of
+// thousands of Path entries when walking extremely large trees, the "children"
+// in this tree are represented by storing an array of Path entries in an
+// LRUCache, indexed by the parent.  At any time, Path.children() may return an
+// empty array, indicating that it doesn't know about any of its children, and
+// thus has to rebuild that cache.  This is fine, it just means that we don't
+// benefit as much from having the cached entries, but huge directory walks
+// don't blow out the stack, and smaller ones are still as fast as possible.
+//
+//It does impose some complexity when building up the readdir data, because we
+//need to pass a reference to the children array that we started with.
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+class ChildrenCache extends LRUCache {
+    constructor(maxSize = 16 * 1024) {
+        super({
+            maxSize,
+            // parent + children
+            sizeCalculation: a => a.length + 1,
+        });
+    }
+}
+const setAsCwd = Symbol('PathScurry setAsCwd');
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+class PathBase {
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots;
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD = false;
+    // potential default fs override
+    #fs;
+    // Stats fields
+    #dev;
+    get dev() {
+        return this.#dev;
+    }
+    #mode;
+    get mode() {
+        return this.#mode;
+    }
+    #nlink;
+    get nlink() {
+        return this.#nlink;
+    }
+    #uid;
+    get uid() {
+        return this.#uid;
+    }
+    #gid;
+    get gid() {
+        return this.#gid;
+    }
+    #rdev;
+    get rdev() {
+        return this.#rdev;
+    }
+    #blksize;
+    get blksize() {
+        return this.#blksize;
+    }
+    #ino;
+    get ino() {
+        return this.#ino;
+    }
+    #size;
+    get size() {
+        return this.#size;
+    }
+    #blocks;
+    get blocks() {
+        return this.#blocks;
+    }
+    #atimeMs;
+    get atimeMs() {
+        return this.#atimeMs;
+    }
+    #mtimeMs;
+    get mtimeMs() {
+        return this.#mtimeMs;
+    }
+    #ctimeMs;
+    get ctimeMs() {
+        return this.#ctimeMs;
+    }
+    #birthtimeMs;
+    get birthtimeMs() {
+        return this.#birthtimeMs;
+    }
+    #atime;
+    get atime() {
+        return this.#atime;
+    }
+    #mtime;
+    get mtime() {
+        return this.#mtime;
+    }
+    #ctime;
+    get ctime() {
+        return this.#ctime;
+    }
+    #birthtime;
+    get birthtime() {
+        return this.#birthtime;
+    }
+    #matchName;
+    #depth;
+    #fullpath;
+    #fullpathPosix;
+    #relative;
+    #relativePosix;
+    #type;
+    #children;
+    #linkTarget;
+    #realpath;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath() {
+        return (this.parent || this).fullpath();
+    }
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     *
+     * @deprecated
+     */
+    get path() {
+        return this.parentPath;
+    }
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        this.name = name;
+        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
+        this.#type = type & TYPEMASK;
+        this.nocase = nocase;
+        this.roots = roots;
+        this.root = root || this;
+        this.#children = children;
+        this.#fullpath = opts.fullpath;
+        this.#relative = opts.relative;
+        this.#relativePosix = opts.relativePosix;
+        this.parent = opts.parent;
+        if (this.parent) {
+            this.#fs = this.parent.#fs;
+        }
+        else {
+            this.#fs = fsFromOption(opts.fs);
+        }
+    }
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth() {
+        if (this.#depth !== undefined)
+            return this.#depth;
+        if (!this.parent)
+            return (this.#depth = 0);
+        return (this.#depth = this.parent.depth() + 1);
+    }
+    /**
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path) {
+        if (!path) {
+            return this;
+        }
+        const rootPath = this.getRootString(path);
+        const dir = path.substring(rootPath.length);
+        const dirParts = dir.split(this.splitSep);
+        const result = rootPath ?
+            this.getRoot(rootPath).#resolveParts(dirParts)
+            : this.#resolveParts(dirParts);
+        return result;
+    }
+    #resolveParts(dirParts) {
+        let p = this;
+        for (const part of dirParts) {
+            p = p.child(part);
+        }
+        return p;
+    }
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children() {
+        const cached = this.#children.get(this);
+        if (cached) {
+            return cached;
+        }
+        const children = Object.assign([], { provisional: 0 });
+        this.#children.set(this, children);
+        this.#type &= ~READDIR_CALLED;
+        return children;
+    }
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart, opts) {
+        if (pathPart === '' || pathPart === '.') {
+            return this;
+        }
+        if (pathPart === '..') {
+            return this.parent || this;
+        }
+        // find the child
+        const children = this.children();
+        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
+        for (const p of children) {
+            if (p.#matchName === name) {
+                return p;
+            }
+        }
+        // didn't find it, create provisional child, since it might not
+        // actually exist.  If we know the parent isn't a dir, then
+        // in fact it CAN'T exist.
+        const s = this.parent ? this.sep : '';
+        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
+        const pchild = this.newChild(pathPart, UNKNOWN, {
+            ...opts,
+            parent: this,
+            fullpath,
+        });
+        if (!this.canReaddir()) {
+            pchild.#type |= ENOENT;
+        }
+        // don't have to update provisional, because if we have real children,
+        // then provisional is set to children.length, otherwise a lower number
+        children.push(pchild);
+        return pchild;
+    }
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative() {
+        if (this.isCWD)
+            return '';
+        if (this.#relative !== undefined) {
+            return this.#relative;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relative = this.name);
+        }
+        const pv = p.relative();
+        return pv + (!pv || !p.parent ? '' : this.sep) + name;
+    }
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix() {
+        if (this.sep === '/')
+            return this.relative();
+        if (this.isCWD)
+            return '';
+        if (this.#relativePosix !== undefined)
+            return this.#relativePosix;
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relativePosix = this.fullpathPosix());
+        }
+        const pv = p.relativePosix();
+        return pv + (!pv || !p.parent ? '' : '/') + name;
+    }
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath() {
+        if (this.#fullpath !== undefined) {
+            return this.#fullpath;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#fullpath = this.name);
+        }
+        const pv = p.fullpath();
+        const fp = pv + (!p.parent ? '' : this.sep) + name;
+        return (this.#fullpath = fp);
+    }
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix() {
+        if (this.#fullpathPosix !== undefined)
+            return this.#fullpathPosix;
+        if (this.sep === '/')
+            return (this.#fullpathPosix = this.fullpath());
+        if (!this.parent) {
+            const p = this.fullpath().replace(/\\/g, '/');
+            if (/^[a-z]:\//i.test(p)) {
+                return (this.#fullpathPosix = `//?/${p}`);
+            }
+            else {
+                return (this.#fullpathPosix = p);
+            }
+        }
+        const p = this.parent;
+        const pfpp = p.fullpathPosix();
+        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
+        return (this.#fullpathPosix = fpp);
+    }
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown() {
+        return (this.#type & IFMT) === UNKNOWN;
+    }
+    isType(type) {
+        return this[`is${type}`]();
+    }
+    getType() {
+        return (this.isUnknown() ? 'Unknown'
+            : this.isDirectory() ? 'Directory'
+                : this.isFile() ? 'File'
+                    : this.isSymbolicLink() ? 'SymbolicLink'
+                        : this.isFIFO() ? 'FIFO'
+                            : this.isCharacterDevice() ? 'CharacterDevice'
+                                : this.isBlockDevice() ? 'BlockDevice'
+                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
+                                        : 'Unknown');
+        /* c8 ignore stop */
+    }
+    /**
+     * Is the Path a regular file?
+     */
+    isFile() {
+        return (this.#type & IFMT) === IFREG;
+    }
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory() {
+        return (this.#type & IFMT) === IFDIR;
+    }
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice() {
+        return (this.#type & IFMT) === IFCHR;
+    }
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice() {
+        return (this.#type & IFMT) === IFBLK;
+    }
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO() {
+        return (this.#type & IFMT) === IFIFO;
+    }
+    /**
+     * Is the path a socket?
+     */
+    isSocket() {
+        return (this.#type & IFMT) === IFSOCK;
+    }
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink() {
+        return (this.#type & IFLNK) === IFLNK;
+    }
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached() {
+        return this.#type & LSTAT_CALLED ? this : undefined;
+    }
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached() {
+        return this.#linkTarget;
+    }
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached() {
+        return this.#realpath;
+    }
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached() {
+        const children = this.children();
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink() {
+        if (this.#linkTarget)
+            return true;
+        if (!this.parent)
+            return false;
+        // cases where it cannot possibly succeed
+        const ifmt = this.#type & IFMT;
+        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
+            this.#type & ENOREADLINK ||
+            this.#type & ENOENT);
+    }
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir() {
+        return !!(this.#type & READDIR_CALLED);
+    }
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT() {
+        return !!(this.#type & ENOENT);
+    }
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n) {
+        return !this.nocase ?
+            this.#matchName === normalize(n)
+            : this.#matchName === normalizeNocase(n);
+    }
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    async readlink() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = await this.#fs.promises.readlink(this.fullpath());
+            const linkTarget = (await this.parent.realpath())?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = this.#fs.readlinkSync(this.fullpath());
+            const linkTarget = this.parent.realpathSync()?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    #readdirSuccess(children) {
+        // succeeded, mark readdir called bit
+        this.#type |= READDIR_CALLED;
+        // mark all remaining provisional children as ENOENT
+        for (let p = children.provisional; p < children.length; p++) {
+            const c = children[p];
+            if (c)
+                c.#markENOENT();
+        }
+    }
+    #markENOENT() {
+        // mark as UNKNOWN and ENOENT
+        if (this.#type & ENOENT)
+            return;
+        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
+        this.#markChildrenENOENT();
+    }
+    #markChildrenENOENT() {
+        // all children are provisional and do not exist
+        const children = this.children();
+        children.provisional = 0;
+        for (const p of children) {
+            p.#markENOENT();
+        }
+    }
+    #markENOREALPATH() {
+        this.#type |= ENOREALPATH;
+        this.#markENOTDIR();
+    }
+    // save the information when we know the entry is not a dir
+    #markENOTDIR() {
+        // entry is not a directory, so any children can't exist.
+        // this *should* be impossible, since any children created
+        // after it's been marked ENOTDIR should be marked ENOENT,
+        // so it won't even get to this point.
+        /* c8 ignore start */
+        if (this.#type & ENOTDIR)
+            return;
+        /* c8 ignore stop */
+        let t = this.#type;
+        // this could happen if we stat a dir, then delete it,
+        // then try to read it or one of its children.
+        if ((t & IFMT) === IFDIR)
+            t &= IFMT_UNKNOWN;
+        this.#type = t | ENOTDIR;
+        this.#markChildrenENOENT();
+    }
+    #readdirFail(code = '') {
+        // markENOTDIR and markENOENT also set provisional=0
+        if (code === 'ENOTDIR' || code === 'EPERM') {
+            this.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            this.#markENOENT();
+        }
+        else {
+            this.children().provisional = 0;
+        }
+    }
+    #lstatFail(code = '') {
+        // Windows just raises ENOENT in this case, disable for win CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR') {
+            // already know it has a parent by this point
+            const p = this.parent;
+            p.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            /* c8 ignore stop */
+            this.#markENOENT();
+        }
+    }
+    #readlinkFail(code = '') {
+        let ter = this.#type;
+        ter |= ENOREADLINK;
+        if (code === 'ENOENT')
+            ter |= ENOENT;
+        // windows gets a weird error when you try to readlink a file
+        if (code === 'EINVAL' || code === 'UNKNOWN') {
+            // exists, but not a symlink, we don't know WHAT it is, so remove
+            // all IFMT bits.
+            ter &= IFMT_UNKNOWN;
+        }
+        this.#type = ter;
+        // windows just gets ENOENT in this case.  We do cover the case,
+        // just disabled because it's impossible on Windows CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR' && this.parent) {
+            this.parent.#markENOTDIR();
+        }
+        /* c8 ignore stop */
+    }
+    #readdirAddChild(e, c) {
+        return (this.#readdirMaybePromoteChild(e, c) ||
+            this.#readdirAddNewChild(e, c));
+    }
+    #readdirAddNewChild(e, c) {
+        // alloc new entry at head, so it's never provisional
+        const type = entToType(e);
+        const child = this.newChild(e.name, type, { parent: this });
+        const ifmt = child.#type & IFMT;
+        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
+            child.#type |= ENOTDIR;
+        }
+        c.unshift(child);
+        c.provisional++;
+        return child;
+    }
+    #readdirMaybePromoteChild(e, c) {
+        for (let p = c.provisional; p < c.length; p++) {
+            const pchild = c[p];
+            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
+            if (name !== pchild.#matchName) {
+                continue;
+            }
+            return this.#readdirPromoteChild(e, pchild, p, c);
+        }
+    }
+    #readdirPromoteChild(e, p, index, c) {
+        const v = p.name;
+        // retain any other flags, but set ifmt from dirent
+        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
+        // case sensitivity fixing when we learn the true name.
+        if (v !== e.name)
+            p.name = e.name;
+        // just advance provisional index (potentially off the list),
+        // otherwise we have to splice/pop it out and re-insert at head
+        if (index !== c.provisional) {
+            if (index === c.length - 1)
+                c.pop();
+            else
+                c.splice(index, 1);
+            c.unshift(p);
+        }
+        c.provisional++;
+        return p;
+    }
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    #applyStat(st) {
+        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
+        this.#atime = atime;
+        this.#atimeMs = atimeMs;
+        this.#birthtime = birthtime;
+        this.#birthtimeMs = birthtimeMs;
+        this.#blksize = blksize;
+        this.#blocks = blocks;
+        this.#ctime = ctime;
+        this.#ctimeMs = ctimeMs;
+        this.#dev = dev;
+        this.#gid = gid;
+        this.#ino = ino;
+        this.#mode = mode;
+        this.#mtime = mtime;
+        this.#mtimeMs = mtimeMs;
+        this.#nlink = nlink;
+        this.#rdev = rdev;
+        this.#size = size;
+        this.#uid = uid;
+        const ifmt = entToType(st);
+        // retain any other flags, but set the ifmt
+        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
+        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
+            this.#type |= ENOTDIR;
+        }
+    }
+    #onReaddirCB = [];
+    #readdirCBInFlight = false;
+    #callOnReaddirCB(children) {
+        this.#readdirCBInFlight = false;
+        const cbs = this.#onReaddirCB.slice();
+        this.#onReaddirCB.length = 0;
+        cbs.forEach(cb => cb(null, children));
+    }
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb, allowZalgo = false) {
+        if (!this.canReaddir()) {
+            if (allowZalgo)
+                cb(null, []);
+            else
+                queueMicrotask(() => cb(null, []));
+            return;
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            const c = children.slice(0, children.provisional);
+            if (allowZalgo)
+                cb(null, c);
+            else
+                queueMicrotask(() => cb(null, c));
+            return;
+        }
+        // don't have to worry about zalgo at this point.
+        this.#onReaddirCB.push(cb);
+        if (this.#readdirCBInFlight) {
+            return;
+        }
+        this.#readdirCBInFlight = true;
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
+            if (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            else {
+                // if we didn't get an error, we always get entries.
+                //@ts-ignore
+                for (const e of entries) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            this.#callOnReaddirCB(children.slice(0, children.provisional));
+            return;
+        });
+    }
+    #asyncReaddirInFlight;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async readdir() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        if (this.#asyncReaddirInFlight) {
+            await this.#asyncReaddirInFlight;
+        }
+        else {
+            /* c8 ignore start */
+            let resolve = () => { };
+            /* c8 ignore stop */
+            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
+            try {
+                for (const e of await this.#fs.promises.readdir(fullpath, {
+                    withFileTypes: true,
+                })) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            catch (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            this.#asyncReaddirInFlight = undefined;
+            resolve();
+        }
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        try {
+            for (const e of this.#fs.readdirSync(fullpath, {
+                withFileTypes: true,
+            })) {
+                this.#readdirAddChild(e, children);
+            }
+            this.#readdirSuccess(children);
+        }
+        catch (er) {
+            this.#readdirFail(er.code);
+            children.provisional = 0;
+        }
+        return children.slice(0, children.provisional);
+    }
+    canReaddir() {
+        if (this.#type & ENOCHILD)
+            return false;
+        const ifmt = IFMT & this.#type;
+        // we always set ENOTDIR when setting IFMT, so should be impossible
+        /* c8 ignore start */
+        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
+            return false;
+        }
+        /* c8 ignore stop */
+        return true;
+    }
+    shouldWalk(dirs, walkFilter) {
+        return ((this.#type & IFDIR) === IFDIR &&
+            !(this.#type & ENOCHILD) &&
+            !dirs.has(this) &&
+            (!walkFilter || walkFilter(this)));
+    }
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    async realpath() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = await this.#fs.promises.realpath(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = this.#fs.realpathSync(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd) {
+        if (oldCwd === this)
+            return;
+        oldCwd.isCWD = false;
+        this.isCWD = true;
+        const changed = new Set([]);
+        let rp = [];
+        let p = this;
+        while (p && p.parent) {
+            changed.add(p);
+            p.#relative = rp.join(this.sep);
+            p.#relativePosix = rp.join('/');
+            p = p.parent;
+            rp.push('..');
+        }
+        // now un-memoize parents of old cwd
+        p = oldCwd;
+        while (p && p.parent && !changed.has(p)) {
+            p.#relative = undefined;
+            p.#relativePosix = undefined;
+            p = p.parent;
+        }
+    }
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep = '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep = eitherSep;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return external_node_path_namespaceObject.win32.parse(path).root;
+    }
+    /**
+     * @internal
+     */
+    getRoot(rootPath) {
+        rootPath = uncToDrive(rootPath.toUpperCase());
+        if (rootPath === this.root.name) {
+            return this.root;
+        }
+        // ok, not that one, check if it matches another we know about
+        for (const [compare, root] of Object.entries(this.roots)) {
+            if (this.sameRoot(rootPath, compare)) {
+                return (this.roots[rootPath] = root);
+            }
+        }
+        // otherwise, have to create a new one.
+        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
+    }
+    /**
+     * @internal
+     */
+    sameRoot(rootPath, compare = this.root.name) {
+        // windows can (rarely) have case-sensitive filesystem, but
+        // UNC and drive letters are always case-insensitive, and canonically
+        // represented uppercase.
+        rootPath = rootPath
+            .toUpperCase()
+            .replace(/\//g, '\\')
+            .replace(uncDriveRegexp, '$1\\');
+        return rootPath === compare;
+    }
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep = '/';
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return path.startsWith('/') ? '/' : '';
+    }
+    /**
+     * @internal
+     */
+    getRoot(_rootPath) {
+        return this.root;
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+class PathScurryBase {
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots;
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd;
+    #resolveCache;
+    #resolvePosixCache;
+    #children;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase;
+    #fs;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
+        this.#fs = fsFromOption(fs);
+        if (cwd instanceof URL || cwd.startsWith('file://')) {
+            cwd = (0,external_node_url_namespaceObject.fileURLToPath)(cwd);
+        }
+        // resolve and split root, and then add to the store.
+        // this is the only time we call path.resolve()
+        const cwdPath = pathImpl.resolve(cwd);
+        this.roots = Object.create(null);
+        this.rootPath = this.parseRootPath(cwdPath);
+        this.#resolveCache = new ResolveCache();
+        this.#resolvePosixCache = new ResolveCache();
+        this.#children = new ChildrenCache(childrenCacheSize);
+        const split = cwdPath.substring(this.rootPath.length).split(sep);
+        // resolve('/') leaves '', splits to [''], we don't want that.
+        if (split.length === 1 && !split[0]) {
+            split.pop();
+        }
+        /* c8 ignore start */
+        if (nocase === undefined) {
+            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
+        }
+        /* c8 ignore stop */
+        this.nocase = nocase;
+        this.root = this.newRoot(this.#fs);
+        this.roots[this.rootPath] = this.root;
+        let prev = this.root;
+        let len = split.length - 1;
+        const joinSep = pathImpl.sep;
+        let abs = this.rootPath;
+        let sawFirst = false;
+        for (const part of split) {
+            const l = len--;
+            prev = prev.child(part, {
+                relative: new Array(l).fill('..').join(joinSep),
+                relativePosix: new Array(l).fill('..').join('/'),
+                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
+            });
+            sawFirst = true;
+        }
+        this.cwd = prev;
+    }
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path = this.cwd) {
+        if (typeof path === 'string') {
+            path = this.cwd.resolve(path);
+        }
+        return path.depth();
+    }
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolveCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpath();
+        this.#resolveCache.set(r, result);
+        return result;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolvePosixCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpathPosix();
+        this.#resolvePosixCache.set(r, result);
+        return result;
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relative();
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relativePosix();
+    }
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.name;
+    }
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return (entry.parent || entry).fullpath();
+    }
+    async readdir(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else {
+            const p = await entry.readdir();
+            return withFileTypes ? p : p.map(e => e.name);
+        }
+    }
+    readdirSync(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else if (withFileTypes) {
+            return entry.readdirSync();
+        }
+        else {
+            return entry.readdirSync().map(e => e.name);
+        }
+    }
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstat();
+    }
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstatSync();
+    }
+    async readlink(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.readlink();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    readlinkSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.readlinkSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async realpath(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.realpath();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    realpathSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.realpathSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async walk(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const walk = (dir, cb) => {
+            dirs.add(dir);
+            dir.readdirCB((er, entries) => {
+                /* c8 ignore start */
+                if (er) {
+                    return cb(er);
+                }
+                /* c8 ignore stop */
+                let len = entries.length;
+                if (!len)
+                    return cb();
+                const next = () => {
+                    if (--len === 0) {
+                        cb();
+                    }
+                };
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        results.push(withFileTypes ? e : e.fullpath());
+                    }
+                    if (follow && e.isSymbolicLink()) {
+                        e.realpath()
+                            .then(r => (r?.isUnknown() ? r.lstat() : r))
+                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
+                    }
+                    else {
+                        if (e.shouldWalk(dirs, walkFilter)) {
+                            walk(e, next);
+                        }
+                        else {
+                            next();
+                        }
+                    }
+                }
+            }, true); // zalgooooooo
+        };
+        const start = entry;
+        return new Promise((res, rej) => {
+            walk(start, er => {
+                /* c8 ignore start */
+                if (er)
+                    return rej(er);
+                /* c8 ignore stop */
+                res(results);
+            });
+        });
+    }
+    walkSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    results.push(withFileTypes ? e : e.fullpath());
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+        return results;
+    }
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+    iterate(entry = this.cwd, options = {}) {
+        // iterating async over the stream is significantly more performant,
+        // especially in the warm-cache scenario, because it buffers up directory
+        // entries in the background instead of waiting for a yield for each one.
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            options = entry;
+            entry = this.cwd;
+        }
+        return this.stream(entry, options)[Symbol.asyncIterator]();
+    }
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    *iterateSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        if (!filter || filter(entry)) {
+            yield withFileTypes ? entry : entry.fullpath();
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    yield withFileTypes ? e : e.fullpath();
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+    }
+    stream(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const onReaddir = (er, entries, didRealpaths = false) => {
+                    /* c8 ignore start */
+                    if (er)
+                        return results.emit('error', er);
+                    /* c8 ignore stop */
+                    if (follow && !didRealpaths) {
+                        const promises = [];
+                        for (const e of entries) {
+                            if (e.isSymbolicLink()) {
+                                promises.push(e
+                                    .realpath()
+                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
+                            }
+                        }
+                        if (promises.length) {
+                            Promise.all(promises).then(() => onReaddir(null, entries, true));
+                            return;
+                        }
+                    }
+                    for (const e of entries) {
+                        if (e && (!filter || filter(e))) {
+                            if (!results.write(withFileTypes ? e : e.fullpath())) {
+                                paused = true;
+                            }
+                        }
+                    }
+                    processing--;
+                    for (const e of entries) {
+                        const r = e.realpathCached() || e;
+                        if (r.shouldWalk(dirs, walkFilter)) {
+                            queue.push(r);
+                        }
+                    }
+                    if (paused && !results.flowing) {
+                        results.once('drain', process);
+                    }
+                    else if (!sync) {
+                        process();
+                    }
+                };
+                // zalgo containment
+                let sync = true;
+                dir.readdirCB(onReaddir, true);
+                sync = false;
+            }
+        };
+        process();
+        return results;
+    }
+    streamSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        const dirs = new Set();
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const entries = dir.readdirSync();
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        if (!results.write(withFileTypes ? e : e.fullpath())) {
+                            paused = true;
+                        }
+                    }
+                }
+                processing--;
+                for (const e of entries) {
+                    let r = e;
+                    if (e.isSymbolicLink()) {
+                        if (!(follow && (r = e.realpathSync())))
+                            continue;
+                        if (r.isUnknown())
+                            r.lstatSync();
+                    }
+                    if (r.shouldWalk(dirs, walkFilter)) {
+                        queue.push(r);
+                    }
+                }
+            }
+            if (paused && !results.flowing)
+                results.once('drain', process);
+        };
+        process();
+        return results;
+    }
+    chdir(path = this.cwd) {
+        const oldCwd = this.cwd;
+        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
+        this.cwd[setAsCwd](oldCwd);
+    }
+}
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '\\';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, external_node_path_namespaceObject.win32, '\\', { ...opts, nocase });
+        this.nocase = nocase;
+        for (let p = this.cwd; p; p = p.parent) {
+            p.nocase = this.nocase;
+        }
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(dir) {
+        // if the path starts with a single separator, it's not a UNC, and we'll
+        // just get separator as the root, and driveFromUNC will return \
+        // In that case, mount \ on the root from the cwd.
+        return external_node_path_namespaceObject.win32.parse(dir).root.toUpperCase();
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = false } = opts;
+        super(cwd, external_node_path_namespaceObject.posix, '/', { ...opts, nocase });
+        this.nocase = nocase;
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(_dir) {
+        return '/';
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return p.startsWith('/');
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, { ...opts, nocase });
+    }
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+const Path = process.platform === 'win32' ? PathWin32 : PathPosix;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+const PathScurry = process.platform === 'win32' ? PathScurryWin32
+    : process.platform === 'darwin' ? PathScurryDarwin
+        : PathScurryPosix;
+//# sourceMappingURL=index.js.map
+;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/pattern.js
+// this is just a very light wrapper around 2 arrays with an offset index
+
+const isPatternList = (pl) => pl.length >= 1;
+const isGlobList = (gl) => gl.length >= 1;
+/**
+ * An immutable-ish view on an array of glob parts and their parsed
+ * results
+ */
+class Pattern {
+    #patternList;
+    #globList;
+    #index;
+    length;
+    #platform;
+    #rest;
+    #globString;
+    #isDrive;
+    #isUNC;
+    #isAbsolute;
+    #followGlobstar = true;
+    constructor(patternList, globList, index, platform) {
+        if (!isPatternList(patternList)) {
+            throw new TypeError('empty pattern list');
+        }
+        if (!isGlobList(globList)) {
+            throw new TypeError('empty glob list');
+        }
+        if (globList.length !== patternList.length) {
+            throw new TypeError('mismatched pattern list and glob list lengths');
+        }
+        this.length = patternList.length;
+        if (index < 0 || index >= this.length) {
+            throw new TypeError('index out of range');
+        }
+        this.#patternList = patternList;
+        this.#globList = globList;
+        this.#index = index;
+        this.#platform = platform;
+        // normalize root entries of absolute patterns on initial creation.
+        if (this.#index === 0) {
+            // c: => ['c:/']
+            // C:/ => ['C:/']
+            // C:/x => ['C:/', 'x']
+            // //host/share => ['//host/share/']
+            // //host/share/ => ['//host/share/']
+            // //host/share/x => ['//host/share/', 'x']
+            // /etc => ['/', 'etc']
+            // / => ['/']
+            if (this.isUNC()) {
+                // '' / '' / 'host' / 'share'
+                const [p0, p1, p2, p3, ...prest] = this.#patternList;
+                const [g0, g1, g2, g3, ...grest] = this.#globList;
+                if (prest[0] === '') {
+                    // ends in /
+                    prest.shift();
+                    grest.shift();
+                }
+                const p = [p0, p1, p2, p3, ''].join('/');
+                const g = [g0, g1, g2, g3, ''].join('/');
+                this.#patternList = [p, ...prest];
+                this.#globList = [g, ...grest];
+                this.length = this.#patternList.length;
+            }
+            else if (this.isDrive() || this.isAbsolute()) {
+                const [p1, ...prest] = this.#patternList;
+                const [g1, ...grest] = this.#globList;
+                if (prest[0] === '') {
+                    // ends in /
+                    prest.shift();
+                    grest.shift();
+                }
+                const p = p1 + '/';
+                const g = g1 + '/';
+                this.#patternList = [p, ...prest];
+                this.#globList = [g, ...grest];
+                this.length = this.#patternList.length;
+            }
+        }
+    }
+    /**
+     * The first entry in the parsed list of patterns
+     */
+    pattern() {
+        return this.#patternList[this.#index];
+    }
+    /**
+     * true of if pattern() returns a string
+     */
+    isString() {
+        return typeof this.#patternList[this.#index] === 'string';
+    }
+    /**
+     * true of if pattern() returns GLOBSTAR
+     */
+    isGlobstar() {
+        return this.#patternList[this.#index] === GLOBSTAR;
+    }
+    /**
+     * true if pattern() returns a regexp
+     */
+    isRegExp() {
+        return this.#patternList[this.#index] instanceof RegExp;
+    }
+    /**
+     * The /-joined set of glob parts that make up this pattern
+     */
+    globString() {
+        return (this.#globString =
+            this.#globString ||
+                (this.#index === 0 ?
+                    this.isAbsolute() ?
+                        this.#globList[0] + this.#globList.slice(1).join('/')
+                        : this.#globList.join('/')
+                    : this.#globList.slice(this.#index).join('/')));
+    }
+    /**
+     * true if there are more pattern parts after this one
+     */
+    hasMore() {
+        return this.length > this.#index + 1;
+    }
+    /**
+     * The rest of the pattern after this part, or null if this is the end
+     */
+    rest() {
+        if (this.#rest !== undefined)
+            return this.#rest;
+        if (!this.hasMore())
+            return (this.#rest = null);
+        this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
+        this.#rest.#isAbsolute = this.#isAbsolute;
+        this.#rest.#isUNC = this.#isUNC;
+        this.#rest.#isDrive = this.#isDrive;
+        return this.#rest;
+    }
+    /**
+     * true if the pattern represents a //unc/path/ on windows
+     */
+    isUNC() {
+        const pl = this.#patternList;
+        return this.#isUNC !== undefined ?
+            this.#isUNC
+            : (this.#isUNC =
+                this.#platform === 'win32' &&
+                    this.#index === 0 &&
+                    pl[0] === '' &&
+                    pl[1] === '' &&
+                    typeof pl[2] === 'string' &&
+                    !!pl[2] &&
+                    typeof pl[3] === 'string' &&
+                    !!pl[3]);
+    }
+    // pattern like C:/...
+    // split = ['C:', ...]
+    // XXX: would be nice to handle patterns like `c:*` to test the cwd
+    // in c: for *, but I don't know of a way to even figure out what that
+    // cwd is without actually chdir'ing into it?
+    /**
+     * True if the pattern starts with a drive letter on Windows
+     */
+    isDrive() {
+        const pl = this.#patternList;
+        return this.#isDrive !== undefined ?
+            this.#isDrive
+            : (this.#isDrive =
+                this.#platform === 'win32' &&
+                    this.#index === 0 &&
+                    this.length > 1 &&
+                    typeof pl[0] === 'string' &&
+                    /^[a-z]:$/i.test(pl[0]));
+    }
+    // pattern = '/' or '/...' or '/x/...'
+    // split = ['', ''] or ['', ...] or ['', 'x', ...]
+    // Drive and UNC both considered absolute on windows
+    /**
+     * True if the pattern is rooted on an absolute path
+     */
+    isAbsolute() {
+        const pl = this.#patternList;
+        return this.#isAbsolute !== undefined ?
+            this.#isAbsolute
+            : (this.#isAbsolute =
+                (pl[0] === '' && pl.length > 1) ||
+                    this.isDrive() ||
+                    this.isUNC());
+    }
+    /**
+     * consume the root of the pattern, and return it
+     */
+    root() {
+        const p = this.#patternList[0];
+        return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
+            p
+            : '';
+    }
+    /**
+     * Check to see if the current globstar pattern is allowed to follow
+     * a symbolic link.
+     */
+    checkFollowGlobstar() {
+        return !(this.#index === 0 ||
+            !this.isGlobstar() ||
+            !this.#followGlobstar);
+    }
+    /**
+     * Mark that the current globstar pattern is following a symbolic link
+     */
+    markFollowGlobstar() {
+        if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
+            return false;
+        this.#followGlobstar = false;
+        return true;
+    }
+}
+//# sourceMappingURL=pattern.js.map
+;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/ignore.js
+// give it a pattern, and it'll be able to tell you if
+// a given path should be ignored.
+// Ignoring a path ignores its children if the pattern ends in /**
+// Ignores are always parsed in dot:true mode
+
+
+const ignore_defaultPlatform = (typeof process === 'object' &&
+    process &&
+    typeof process.platform === 'string') ?
+    process.platform
+    : 'linux';
+/**
+ * Class used to process ignored patterns
+ */
+class Ignore {
+    relative;
+    relativeChildren;
+    absolute;
+    absoluteChildren;
+    platform;
+    mmopts;
+    constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = ignore_defaultPlatform, }) {
+        this.relative = [];
+        this.absolute = [];
+        this.relativeChildren = [];
+        this.absoluteChildren = [];
+        this.platform = platform;
+        this.mmopts = {
+            dot: true,
+            nobrace,
+            nocase,
+            noext,
+            noglobstar,
+            optimizationLevel: 2,
+            platform,
+            nocomment: true,
+            nonegate: true,
+        };
+        for (const ign of ignored)
+            this.add(ign);
+    }
+    add(ign) {
+        // this is a little weird, but it gives us a clean set of optimized
+        // minimatch matchers, without getting tripped up if one of them
+        // ends in /** inside a brace section, and it's only inefficient at
+        // the start of the walk, not along it.
+        // It'd be nice if the Pattern class just had a .test() method, but
+        // handling globstars is a bit of a pita, and that code already lives
+        // in minimatch anyway.
+        // Another way would be if maybe Minimatch could take its set/globParts
+        // as an option, and then we could at least just use Pattern to test
+        // for absolute-ness.
+        // Yet another way, Minimatch could take an array of glob strings, and
+        // a cwd option, and do the right thing.
+        const mm = new Minimatch(ign, this.mmopts);
+        for (let i = 0; i < mm.set.length; i++) {
+            const parsed = mm.set[i];
+            const globParts = mm.globParts[i];
+            /* c8 ignore start */
+            if (!parsed || !globParts) {
+                throw new Error('invalid pattern object');
+            }
+            // strip off leading ./ portions
+            // https://github.com/isaacs/node-glob/issues/570
+            while (parsed[0] === '.' && globParts[0] === '.') {
+                parsed.shift();
+                globParts.shift();
+            }
+            /* c8 ignore stop */
+            const p = new Pattern(parsed, globParts, 0, this.platform);
+            const m = new Minimatch(p.globString(), this.mmopts);
+            const children = globParts[globParts.length - 1] === '**';
+            const absolute = p.isAbsolute();
+            if (absolute)
+                this.absolute.push(m);
+            else
+                this.relative.push(m);
+            if (children) {
+                if (absolute)
+                    this.absoluteChildren.push(m);
+                else
+                    this.relativeChildren.push(m);
+            }
+        }
+    }
+    ignored(p) {
+        const fullpath = p.fullpath();
+        const fullpaths = `${fullpath}/`;
+        const relative = p.relative() || '.';
+        const relatives = `${relative}/`;
+        for (const m of this.relative) {
+            if (m.match(relative) || m.match(relatives))
+                return true;
+        }
+        for (const m of this.absolute) {
+            if (m.match(fullpath) || m.match(fullpaths))
+                return true;
+        }
+        return false;
+    }
+    childrenIgnored(p) {
+        const fullpath = p.fullpath() + '/';
+        const relative = (p.relative() || '.') + '/';
+        for (const m of this.relativeChildren) {
+            if (m.match(relative))
+                return true;
+        }
+        for (const m of this.absoluteChildren) {
+            if (m.match(fullpath))
+                return true;
+        }
+        return false;
+    }
+}
+//# sourceMappingURL=ignore.js.map
+;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/processor.js
+// synchronous utility for filtering entries and calculating subwalks
+
+/**
+ * A cache of which patterns have been processed for a given Path
+ */
+class HasWalkedCache {
+    store;
+    constructor(store = new Map()) {
+        this.store = store;
+    }
+    copy() {
+        return new HasWalkedCache(new Map(this.store));
+    }
+    hasWalked(target, pattern) {
+        return this.store.get(target.fullpath())?.has(pattern.globString());
+    }
+    storeWalked(target, pattern) {
+        const fullpath = target.fullpath();
+        const cached = this.store.get(fullpath);
+        if (cached)
+            cached.add(pattern.globString());
+        else
+            this.store.set(fullpath, new Set([pattern.globString()]));
+    }
+}
+/**
+ * A record of which paths have been matched in a given walk step,
+ * and whether they only are considered a match if they are a directory,
+ * and whether their absolute or relative path should be returned.
+ */
+class MatchRecord {
+    store = new Map();
+    add(target, absolute, ifDir) {
+        const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
+        const current = this.store.get(target);
+        this.store.set(target, current === undefined ? n : n & current);
+    }
+    // match, absolute, ifdir
+    entries() {
+        return [...this.store.entries()].map(([path, n]) => [
+            path,
+            !!(n & 2),
+            !!(n & 1),
+        ]);
+    }
+}
+/**
+ * A collection of patterns that must be processed in a subsequent step
+ * for a given path.
+ */
+class SubWalks {
+    store = new Map();
+    add(target, pattern) {
+        if (!target.canReaddir()) {
+            return;
+        }
+        const subs = this.store.get(target);
+        if (subs) {
+            if (!subs.find(p => p.globString() === pattern.globString())) {
+                subs.push(pattern);
+            }
+        }
+        else
+            this.store.set(target, [pattern]);
+    }
+    get(target) {
+        const subs = this.store.get(target);
+        /* c8 ignore start */
+        if (!subs) {
+            throw new Error('attempting to walk unknown path');
+        }
+        /* c8 ignore stop */
+        return subs;
+    }
+    entries() {
+        return this.keys().map(k => [k, this.store.get(k)]);
+    }
+    keys() {
+        return [...this.store.keys()].filter(t => t.canReaddir());
+    }
+}
+/**
+ * The class that processes patterns for a given path.
+ *
+ * Handles child entry filtering, and determining whether a path's
+ * directory contents must be read.
+ */
+class Processor {
+    hasWalkedCache;
+    matches = new MatchRecord();
+    subwalks = new SubWalks();
+    patterns;
+    follow;
+    dot;
+    opts;
+    constructor(opts, hasWalkedCache) {
+        this.opts = opts;
+        this.follow = !!opts.follow;
+        this.dot = !!opts.dot;
+        this.hasWalkedCache =
+            hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();
+    }
+    processPatterns(target, patterns) {
+        this.patterns = patterns;
+        const processingSet = patterns.map(p => [target, p]);
+        // map of paths to the magic-starting subwalks they need to walk
+        // first item in patterns is the filter
+        for (let [t, pattern] of processingSet) {
+            this.hasWalkedCache.storeWalked(t, pattern);
+            const root = pattern.root();
+            const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
+            // start absolute patterns at root
+            if (root) {
+                t = t.resolve(root === '/' && this.opts.root !== undefined ?
+                    this.opts.root
+                    : root);
+                const rest = pattern.rest();
+                if (!rest) {
+                    this.matches.add(t, true, false);
+                    continue;
+                }
+                else {
+                    pattern = rest;
+                }
+            }
+            if (t.isENOENT())
+                continue;
+            let p;
+            let rest;
+            let changed = false;
+            while (typeof (p = pattern.pattern()) === 'string' &&
+                (rest = pattern.rest())) {
+                const c = t.resolve(p);
+                t = c;
+                pattern = rest;
+                changed = true;
+            }
+            p = pattern.pattern();
+            rest = pattern.rest();
+            if (changed) {
+                if (this.hasWalkedCache.hasWalked(t, pattern))
+                    continue;
+                this.hasWalkedCache.storeWalked(t, pattern);
+            }
+            // now we have either a final string for a known entry,
+            // more strings for an unknown entry,
+            // or a pattern starting with magic, mounted on t.
+            if (typeof p === 'string') {
+                // must not be final entry, otherwise we would have
+                // concatenated it earlier.
+                const ifDir = p === '..' || p === '' || p === '.';
+                this.matches.add(t.resolve(p), absolute, ifDir);
+                continue;
+            }
+            else if (p === GLOBSTAR) {
+                // if no rest, match and subwalk pattern
+                // if rest, process rest and subwalk pattern
+                // if it's a symlink, but we didn't get here by way of a
+                // globstar match (meaning it's the first time THIS globstar
+                // has traversed a symlink), then we follow it. Otherwise, stop.
+                if (!t.isSymbolicLink() ||
+                    this.follow ||
+                    pattern.checkFollowGlobstar()) {
+                    this.subwalks.add(t, pattern);
+                }
+                const rp = rest?.pattern();
+                const rrest = rest?.rest();
+                if (!rest || ((rp === '' || rp === '.') && !rrest)) {
+                    // only HAS to be a dir if it ends in **/ or **/.
+                    // but ending in ** will match files as well.
+                    this.matches.add(t, absolute, rp === '' || rp === '.');
+                }
+                else {
+                    if (rp === '..') {
+                        // this would mean you're matching **/.. at the fs root,
+                        // and no thanks, I'm not gonna test that specific case.
+                        /* c8 ignore start */
+                        const tp = t.parent || t;
+                        /* c8 ignore stop */
+                        if (!rrest)
+                            this.matches.add(tp, absolute, true);
+                        else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
+                            this.subwalks.add(tp, rrest);
+                        }
+                    }
+                }
+            }
+            else if (p instanceof RegExp) {
+                this.subwalks.add(t, pattern);
+            }
+        }
+        return this;
+    }
+    subwalkTargets() {
+        return this.subwalks.keys();
+    }
+    child() {
+        return new Processor(this.opts, this.hasWalkedCache);
+    }
+    // return a new Processor containing the subwalks for each
+    // child entry, and a set of matches, and
+    // a hasWalkedCache that's a copy of this one
+    // then we're going to call
+    filterEntries(parent, entries) {
+        const patterns = this.subwalks.get(parent);
+        // put matches and entry walks into the results processor
+        const results = this.child();
+        for (const e of entries) {
+            for (const pattern of patterns) {
+                const absolute = pattern.isAbsolute();
+                const p = pattern.pattern();
+                const rest = pattern.rest();
+                if (p === GLOBSTAR) {
+                    results.testGlobstar(e, pattern, rest, absolute);
+                }
+                else if (p instanceof RegExp) {
+                    results.testRegExp(e, p, rest, absolute);
+                }
+                else {
+                    results.testString(e, p, rest, absolute);
+                }
+            }
+        }
+        return results;
+    }
+    testGlobstar(e, pattern, rest, absolute) {
+        if (this.dot || !e.name.startsWith('.')) {
+            if (!pattern.hasMore()) {
+                this.matches.add(e, absolute, false);
+            }
+            if (e.canReaddir()) {
+                // if we're in follow mode or it's not a symlink, just keep
+                // testing the same pattern. If there's more after the globstar,
+                // then this symlink consumes the globstar. If not, then we can
+                // follow at most ONE symlink along the way, so we mark it, which
+                // also checks to ensure that it wasn't already marked.
+                if (this.follow || !e.isSymbolicLink()) {
+                    this.subwalks.add(e, pattern);
+                }
+                else if (e.isSymbolicLink()) {
+                    if (rest && pattern.checkFollowGlobstar()) {
+                        this.subwalks.add(e, rest);
+                    }
+                    else if (pattern.markFollowGlobstar()) {
+                        this.subwalks.add(e, pattern);
+                    }
+                }
+            }
+        }
+        // if the NEXT thing matches this entry, then also add
+        // the rest.
+        if (rest) {
+            const rp = rest.pattern();
+            if (typeof rp === 'string' &&
+                // dots and empty were handled already
+                rp !== '..' &&
+                rp !== '' &&
+                rp !== '.') {
+                this.testString(e, rp, rest.rest(), absolute);
+            }
+            else if (rp === '..') {
+                /* c8 ignore start */
+                const ep = e.parent || e;
+                /* c8 ignore stop */
+                this.subwalks.add(ep, rest);
+            }
+            else if (rp instanceof RegExp) {
+                this.testRegExp(e, rp, rest.rest(), absolute);
+            }
+        }
+    }
+    testRegExp(e, p, rest, absolute) {
+        if (!p.test(e.name))
+            return;
+        if (!rest) {
+            this.matches.add(e, absolute, false);
+        }
+        else {
+            this.subwalks.add(e, rest);
+        }
+    }
+    testString(e, p, rest, absolute) {
+        // should never happen?
+        if (!e.isNamed(p))
+            return;
+        if (!rest) {
+            this.matches.add(e, absolute, false);
+        }
+        else {
+            this.subwalks.add(e, rest);
+        }
+    }
+}
+//# sourceMappingURL=processor.js.map
+;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/walker.js
+/**
+ * Single-use utility classes to provide functionality to the {@link Glob}
+ * methods.
+ *
+ * @module
+ */
+
+
+
+const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new Ignore([ignore], opts)
+    : Array.isArray(ignore) ? new Ignore(ignore, opts)
+        : ignore;
+/**
+ * basic walking utilities that all the glob walker types use
+ */
+class GlobUtil {
+    path;
+    patterns;
+    opts;
+    seen = new Set();
+    paused = false;
+    aborted = false;
+    #onResume = [];
+    #ignore;
+    #sep;
+    signal;
+    maxDepth;
+    includeChildMatches;
+    constructor(patterns, path, opts) {
+        this.patterns = patterns;
+        this.path = path;
+        this.opts = opts;
+        this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
+        this.includeChildMatches = opts.includeChildMatches !== false;
+        if (opts.ignore || !this.includeChildMatches) {
+            this.#ignore = makeIgnore(opts.ignore ?? [], opts);
+            if (!this.includeChildMatches &&
+                typeof this.#ignore.add !== 'function') {
+                const m = 'cannot ignore child matches, ignore lacks add() method.';
+                throw new Error(m);
+            }
+        }
+        // ignore, always set with maxDepth, but it's optional on the
+        // GlobOptions type
+        /* c8 ignore start */
+        this.maxDepth = opts.maxDepth || Infinity;
+        /* c8 ignore stop */
+        if (opts.signal) {
+            this.signal = opts.signal;
+            this.signal.addEventListener('abort', () => {
+                this.#onResume.length = 0;
+            });
+        }
+    }
+    #ignored(path) {
+        return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
+    }
+    #childrenIgnored(path) {
+        return !!this.#ignore?.childrenIgnored?.(path);
+    }
+    // backpressure mechanism
+    pause() {
+        this.paused = true;
+    }
+    resume() {
+        /* c8 ignore start */
+        if (this.signal?.aborted)
+            return;
+        /* c8 ignore stop */
+        this.paused = false;
+        let fn = undefined;
+        while (!this.paused && (fn = this.#onResume.shift())) {
+            fn();
+        }
+    }
+    onResume(fn) {
+        if (this.signal?.aborted)
+            return;
+        /* c8 ignore start */
+        if (!this.paused) {
+            fn();
+        }
+        else {
+            /* c8 ignore stop */
+            this.#onResume.push(fn);
+        }
+    }
+    // do the requisite realpath/stat checking, and return the path
+    // to add or undefined to filter it out.
+    async matchCheck(e, ifDir) {
+        if (ifDir && this.opts.nodir)
+            return undefined;
+        let rpc;
+        if (this.opts.realpath) {
+            rpc = e.realpathCached() || (await e.realpath());
+            if (!rpc)
+                return undefined;
+            e = rpc;
+        }
+        const needStat = e.isUnknown() || this.opts.stat;
+        const s = needStat ? await e.lstat() : e;
+        if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
+            const target = await s.realpath();
+            /* c8 ignore start */
+            if (target && (target.isUnknown() || this.opts.stat)) {
+                await target.lstat();
+            }
+            /* c8 ignore stop */
+        }
+        return this.matchCheckTest(s, ifDir);
+    }
+    matchCheckTest(e, ifDir) {
+        return (e &&
+            (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
+            (!ifDir || e.canReaddir()) &&
+            (!this.opts.nodir || !e.isDirectory()) &&
+            (!this.opts.nodir ||
+                !this.opts.follow ||
+                !e.isSymbolicLink() ||
+                !e.realpathCached()?.isDirectory()) &&
+            !this.#ignored(e)) ?
+            e
+            : undefined;
+    }
+    matchCheckSync(e, ifDir) {
+        if (ifDir && this.opts.nodir)
+            return undefined;
+        let rpc;
+        if (this.opts.realpath) {
+            rpc = e.realpathCached() || e.realpathSync();
+            if (!rpc)
+                return undefined;
+            e = rpc;
+        }
+        const needStat = e.isUnknown() || this.opts.stat;
+        const s = needStat ? e.lstatSync() : e;
+        if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
+            const target = s.realpathSync();
+            if (target && (target?.isUnknown() || this.opts.stat)) {
+                target.lstatSync();
+            }
+        }
+        return this.matchCheckTest(s, ifDir);
+    }
+    matchFinish(e, absolute) {
+        if (this.#ignored(e))
+            return;
+        // we know we have an ignore if this is false, but TS doesn't
+        if (!this.includeChildMatches && this.#ignore?.add) {
+            const ign = `${e.relativePosix()}/**`;
+            this.#ignore.add(ign);
+        }
+        const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
+        this.seen.add(e);
+        const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
+        // ok, we have what we need!
+        if (this.opts.withFileTypes) {
+            this.matchEmit(e);
+        }
+        else if (abs) {
+            const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();
+            this.matchEmit(abs + mark);
+        }
+        else {
+            const rel = this.opts.posix ? e.relativePosix() : e.relative();
+            const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?
+                '.' + this.#sep
+                : '';
+            this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
+        }
+    }
+    async match(e, absolute, ifDir) {
+        const p = await this.matchCheck(e, ifDir);
+        if (p)
+            this.matchFinish(p, absolute);
+    }
+    matchSync(e, absolute, ifDir) {
+        const p = this.matchCheckSync(e, ifDir);
+        if (p)
+            this.matchFinish(p, absolute);
+    }
+    walkCB(target, patterns, cb) {
+        /* c8 ignore start */
+        if (this.signal?.aborted)
+            cb();
+        /* c8 ignore stop */
+        this.walkCB2(target, patterns, new Processor(this.opts), cb);
+    }
+    walkCB2(target, patterns, processor, cb) {
+        if (this.#childrenIgnored(target))
+            return cb();
+        if (this.signal?.aborted)
+            cb();
+        if (this.paused) {
+            this.onResume(() => this.walkCB2(target, patterns, processor, cb));
+            return;
+        }
+        processor.processPatterns(target, patterns);
+        // done processing.  all of the above is sync, can be abstracted out.
+        // subwalks is a map of paths to the entry filters they need
+        // matches is a map of paths to [absolute, ifDir] tuples.
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            tasks++;
+            this.match(m, absolute, ifDir).then(() => next());
+        }
+        for (const t of processor.subwalkTargets()) {
+            if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
+                continue;
+            }
+            tasks++;
+            const childrenCached = t.readdirCached();
+            if (t.calledReaddir())
+                this.walkCB3(t, childrenCached, processor, next);
+            else {
+                t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
+            }
+        }
+        next();
+    }
+    walkCB3(target, entries, processor, cb) {
+        processor = processor.filterEntries(target, entries);
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            tasks++;
+            this.match(m, absolute, ifDir).then(() => next());
+        }
+        for (const [target, patterns] of processor.subwalks.entries()) {
+            tasks++;
+            this.walkCB2(target, patterns, processor.child(), next);
+        }
+        next();
+    }
+    walkCBSync(target, patterns, cb) {
+        /* c8 ignore start */
+        if (this.signal?.aborted)
+            cb();
+        /* c8 ignore stop */
+        this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
+    }
+    walkCB2Sync(target, patterns, processor, cb) {
+        if (this.#childrenIgnored(target))
+            return cb();
+        if (this.signal?.aborted)
+            cb();
+        if (this.paused) {
+            this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
+            return;
+        }
+        processor.processPatterns(target, patterns);
+        // done processing.  all of the above is sync, can be abstracted out.
+        // subwalks is a map of paths to the entry filters they need
+        // matches is a map of paths to [absolute, ifDir] tuples.
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            this.matchSync(m, absolute, ifDir);
+        }
+        for (const t of processor.subwalkTargets()) {
+            if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
+                continue;
+            }
+            tasks++;
+            const children = t.readdirSync();
+            this.walkCB3Sync(t, children, processor, next);
+        }
+        next();
+    }
+    walkCB3Sync(target, entries, processor, cb) {
+        processor = processor.filterEntries(target, entries);
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            this.matchSync(m, absolute, ifDir);
+        }
+        for (const [target, patterns] of processor.subwalks.entries()) {
+            tasks++;
+            this.walkCB2Sync(target, patterns, processor.child(), next);
+        }
+        next();
+    }
+}
+class GlobWalker extends GlobUtil {
+    matches = new Set();
+    constructor(patterns, path, opts) {
+        super(patterns, path, opts);
+    }
+    matchEmit(e) {
+        this.matches.add(e);
+    }
+    async walk() {
+        if (this.signal?.aborted)
+            throw this.signal.reason;
+        if (this.path.isUnknown()) {
+            await this.path.lstat();
+        }
+        await new Promise((res, rej) => {
+            this.walkCB(this.path, this.patterns, () => {
+                if (this.signal?.aborted) {
+                    rej(this.signal.reason);
+                }
+                else {
+                    res(this.matches);
+                }
+            });
+        });
+        return this.matches;
+    }
+    walkSync() {
+        if (this.signal?.aborted)
+            throw this.signal.reason;
+        if (this.path.isUnknown()) {
+            this.path.lstatSync();
+        }
+        // nothing for the callback to do, because this never pauses
+        this.walkCBSync(this.path, this.patterns, () => {
+            if (this.signal?.aborted)
+                throw this.signal.reason;
+        });
+        return this.matches;
+    }
+}
+class GlobStream extends GlobUtil {
+    results;
+    constructor(patterns, path, opts) {
+        super(patterns, path, opts);
+        this.results = new Minipass({
+            signal: this.signal,
+            objectMode: true,
+        });
+        this.results.on('drain', () => this.resume());
+        this.results.on('resume', () => this.resume());
+    }
+    matchEmit(e) {
+        this.results.write(e);
+        if (!this.results.flowing)
+            this.pause();
+    }
+    stream() {
+        const target = this.path;
+        if (target.isUnknown()) {
+            target.lstat().then(() => {
+                this.walkCB(target, this.patterns, () => this.results.end());
+            });
+        }
+        else {
+            this.walkCB(target, this.patterns, () => this.results.end());
+        }
+        return this.results;
+    }
+    streamSync() {
+        if (this.path.isUnknown()) {
+            this.path.lstatSync();
+        }
+        this.walkCBSync(this.path, this.patterns, () => this.results.end());
+        return this.results;
+    }
+}
+//# sourceMappingURL=walker.js.map
+;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/glob.js
+
+
+
+
+
+// if no process global, just call it linux.
+// so we default to case-sensitive, / separators
+const glob_defaultPlatform = (typeof process === 'object' &&
+    process &&
+    typeof process.platform === 'string') ?
+    process.platform
+    : 'linux';
+/**
+ * An object that can perform glob pattern traversals.
+ */
+class Glob {
+    absolute;
+    cwd;
+    root;
+    dot;
+    dotRelative;
+    follow;
+    ignore;
+    magicalBraces;
+    mark;
+    matchBase;
+    maxDepth;
+    nobrace;
+    nocase;
+    nodir;
+    noext;
+    noglobstar;
+    pattern;
+    platform;
+    realpath;
+    scurry;
+    stat;
+    signal;
+    windowsPathsNoEscape;
+    withFileTypes;
+    includeChildMatches;
+    /**
+     * The options provided to the constructor.
+     */
+    opts;
+    /**
+     * An array of parsed immutable {@link Pattern} objects.
+     */
+    patterns;
+    /**
+     * All options are stored as properties on the `Glob` object.
+     *
+     * See {@link GlobOptions} for full options descriptions.
+     *
+     * Note that a previous `Glob` object can be passed as the
+     * `GlobOptions` to another `Glob` instantiation to re-use settings
+     * and caches with a new pattern.
+     *
+     * Traversal functions can be called multiple times to run the walk
+     * again.
+     */
+    constructor(pattern, opts) {
+        /* c8 ignore start */
+        if (!opts)
+            throw new TypeError('glob options required');
+        /* c8 ignore stop */
+        this.withFileTypes = !!opts.withFileTypes;
+        this.signal = opts.signal;
+        this.follow = !!opts.follow;
+        this.dot = !!opts.dot;
+        this.dotRelative = !!opts.dotRelative;
+        this.nodir = !!opts.nodir;
+        this.mark = !!opts.mark;
+        if (!opts.cwd) {
+            this.cwd = '';
+        }
+        else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
+            opts.cwd = (0,external_node_url_namespaceObject.fileURLToPath)(opts.cwd);
+        }
+        this.cwd = opts.cwd || '';
+        this.root = opts.root;
+        this.magicalBraces = !!opts.magicalBraces;
+        this.nobrace = !!opts.nobrace;
+        this.noext = !!opts.noext;
+        this.realpath = !!opts.realpath;
+        this.absolute = opts.absolute;
+        this.includeChildMatches = opts.includeChildMatches !== false;
+        this.noglobstar = !!opts.noglobstar;
+        this.matchBase = !!opts.matchBase;
+        this.maxDepth =
+            typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
+        this.stat = !!opts.stat;
+        this.ignore = opts.ignore;
+        if (this.withFileTypes && this.absolute !== undefined) {
+            throw new Error('cannot set absolute and withFileTypes:true');
+        }
+        if (typeof pattern === 'string') {
+            pattern = [pattern];
+        }
+        this.windowsPathsNoEscape =
+            !!opts.windowsPathsNoEscape ||
+                opts.allowWindowsEscape ===
+                    false;
+        if (this.windowsPathsNoEscape) {
+            pattern = pattern.map(p => p.replace(/\\/g, '/'));
+        }
+        if (this.matchBase) {
+            if (opts.noglobstar) {
+                throw new TypeError('base matching requires globstar');
+            }
+            pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
+        }
+        this.pattern = pattern;
+        this.platform = opts.platform || glob_defaultPlatform;
+        this.opts = { ...opts, platform: this.platform };
+        if (opts.scurry) {
+            this.scurry = opts.scurry;
+            if (opts.nocase !== undefined &&
+                opts.nocase !== opts.scurry.nocase) {
+                throw new Error('nocase option contradicts provided scurry option');
+            }
+        }
+        else {
+            const Scurry = opts.platform === 'win32' ? PathScurryWin32
+                : opts.platform === 'darwin' ? PathScurryDarwin
+                    : opts.platform ? PathScurryPosix
+                        : PathScurry;
+            this.scurry = new Scurry(this.cwd, {
+                nocase: opts.nocase,
+                fs: opts.fs,
+            });
+        }
+        this.nocase = this.scurry.nocase;
+        // If you do nocase:true on a case-sensitive file system, then
+        // we need to use regexps instead of strings for non-magic
+        // path portions, because statting `aBc` won't return results
+        // for the file `AbC` for example.
+        const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
+        const mmo = {
+            // default nocase based on platform
+            ...opts,
+            dot: this.dot,
+            matchBase: this.matchBase,
+            nobrace: this.nobrace,
+            nocase: this.nocase,
+            nocaseMagicOnly,
+            nocomment: true,
+            noext: this.noext,
+            nonegate: true,
+            optimizationLevel: 2,
+            platform: this.platform,
+            windowsPathsNoEscape: this.windowsPathsNoEscape,
+            debug: !!this.opts.debug,
+        };
+        const mms = this.pattern.map(p => new Minimatch(p, mmo));
+        const [matchSet, globParts] = mms.reduce((set, m) => {
+            set[0].push(...m.set);
+            set[1].push(...m.globParts);
+            return set;
+        }, [[], []]);
+        this.patterns = matchSet.map((set, i) => {
+            const g = globParts[i];
+            /* c8 ignore start */
+            if (!g)
+                throw new Error('invalid pattern object');
+            /* c8 ignore stop */
+            return new Pattern(set, g, 0, this.platform);
+        });
+    }
+    async walk() {
+        // Walkers always return array of Path objects, so we just have to
+        // coerce them into the right shape.  It will have already called
+        // realpath() if the option was set to do so, so we know that's cached.
+        // start out knowing the cwd, at least
+        return [
+            ...(await new GlobWalker(this.patterns, this.scurry.cwd, {
+                ...this.opts,
+                maxDepth: this.maxDepth !== Infinity ?
+                    this.maxDepth + this.scurry.cwd.depth()
+                    : Infinity,
+                platform: this.platform,
+                nocase: this.nocase,
+                includeChildMatches: this.includeChildMatches,
+            }).walk()),
+        ];
+    }
+    walkSync() {
+        return [
+            ...new GlobWalker(this.patterns, this.scurry.cwd, {
+                ...this.opts,
+                maxDepth: this.maxDepth !== Infinity ?
+                    this.maxDepth + this.scurry.cwd.depth()
+                    : Infinity,
+                platform: this.platform,
+                nocase: this.nocase,
+                includeChildMatches: this.includeChildMatches,
+            }).walkSync(),
+        ];
+    }
+    stream() {
+        return new GlobStream(this.patterns, this.scurry.cwd, {
+            ...this.opts,
+            maxDepth: this.maxDepth !== Infinity ?
+                this.maxDepth + this.scurry.cwd.depth()
+                : Infinity,
+            platform: this.platform,
+            nocase: this.nocase,
+            includeChildMatches: this.includeChildMatches,
+        }).stream();
+    }
+    streamSync() {
+        return new GlobStream(this.patterns, this.scurry.cwd, {
+            ...this.opts,
+            maxDepth: this.maxDepth !== Infinity ?
+                this.maxDepth + this.scurry.cwd.depth()
+                : Infinity,
+            platform: this.platform,
+            nocase: this.nocase,
+            includeChildMatches: this.includeChildMatches,
+        }).streamSync();
+    }
+    /**
+     * Default sync iteration function. Returns a Generator that
+     * iterates over the results.
+     */
+    iterateSync() {
+        return this.streamSync()[Symbol.iterator]();
+    }
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    /**
+     * Default async iteration function. Returns an AsyncGenerator that
+     * iterates over the results.
+     */
+    iterate() {
+        return this.stream()[Symbol.asyncIterator]();
+    }
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+}
+//# sourceMappingURL=glob.js.map
+;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/has-magic.js
+
+/**
+ * Return true if the patterns provided contain any magic glob characters,
+ * given the options provided.
+ *
+ * Brace expansion is not considered "magic" unless the `magicalBraces` option
+ * is set, as brace expansion just turns one string into an array of strings.
+ * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
+ * `'xby'` both do not contain any magic glob characters, and it's treated the
+ * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
+ * is in the options, brace expansion _is_ treated as a pattern having magic.
+ */
+const hasMagic = (pattern, options = {}) => {
+    if (!Array.isArray(pattern)) {
+        pattern = [pattern];
+    }
+    for (const p of pattern) {
+        if (new Minimatch(p, options).hasMagic())
+            return true;
+    }
+    return false;
+};
+//# sourceMappingURL=has-magic.js.map
+;// CONCATENATED MODULE: ./node_modules/glob/dist/esm/index.js
+
+
+
+
+
+
+
+function globStreamSync(pattern, options = {}) {
+    return new Glob(pattern, options).streamSync();
+}
+function globStream(pattern, options = {}) {
+    return new Glob(pattern, options).stream();
+}
+function globSync(pattern, options = {}) {
+    return new Glob(pattern, options).walkSync();
+}
+async function glob_(pattern, options = {}) {
+    return new Glob(pattern, options).walk();
+}
+function globIterateSync(pattern, options = {}) {
+    return new Glob(pattern, options).iterateSync();
+}
+function globIterate(pattern, options = {}) {
+    return new Glob(pattern, options).iterate();
+}
+// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
+const streamSync = globStreamSync;
+const stream = Object.assign(globStream, { sync: globStreamSync });
+const iterateSync = globIterateSync;
+const iterate = Object.assign(globIterate, {
+    sync: globIterateSync,
+});
+const sync = Object.assign(globSync, {
+    stream: globStreamSync,
+    iterate: globIterateSync,
+});
+const glob = Object.assign(glob_, {
+    glob: glob_,
+    globSync,
+    sync,
+    globStream,
+    stream,
+    globStreamSync,
+    streamSync,
+    globIterate,
+    iterate,
+    globIterateSync,
+    iterateSync,
+    Glob: Glob,
+    hasMagic: hasMagic,
+    escape: escape_escape,
+    unescape: unescape_unescape,
+});
+glob.glob = glob;
+//# sourceMappingURL=index.js.map
 ;// CONCATENATED MODULE: ./src/check_datapack.ts
-async function checkDatapack(rootDir, version) {
-    console.log(`Checking datapack in directory ${rootDir} for Minecraft version ${version}`);
+
+
+
+
+
+
+
+
+class ActionLogger {
+    error(data, ...args) {
+        core.error(data);
+    }
+    info(data, ...args) {
+        core.info(data);
+    }
+    log(data, ...args) {
+        core.debug(data);
+    }
+    warn(data, ...args) {
+        core.warning(data);
+    }
+}
+class CustomService extends Service {
+    rootDir;
+    options;
+    constructor(rootDir, version, options) {
+        rootDir = external_path_default().resolve(rootDir);
+        core.info(`rootDir = ${rootDir}`);
+        core.info(`version = ${version}`);
+        const fullRootDir = fileUtil.ensureEndingSlash("file://" + rootDir);
+        const config = {
+            env: {
+                gameVersion: version,
+                feature: {
+                    codeActions: false,
+                    colors: false,
+                    completions: false,
+                    documentHighlighting: false,
+                    documentLinks: false,
+                    foldingRanges: false,
+                    formatting: false,
+                    hover: false,
+                    inlayHint: {
+                        enabledNodes: []
+                    },
+                    semanticColoring: false,
+                    selectionRanges: false,
+                    signatures: false
+                }
+            }
+        };
+        super({
+            logger: new ActionLogger(),
+            profilers: new ProfilerFactory(console, [
+                'cache#load',
+                'cache#save',
+                'project#init',
+                'project#ready',
+            ]),
+            project: {
+                cacheRoot: 'file:///tmp/.cache/',
+                defaultConfig: ConfigService.merge(VanillaConfig, config),
+                externals: NodeJsExternals,
+                initializers: [initialize, java_edition_lib_initialize],
+                projectRoots: [fullRootDir],
+            },
+        });
+        this.rootDir = rootDir;
+        this.options = options;
+    }
+    async shutdown() {
+        core.startGroup("Shutdown");
+        await this.project.close();
+        core.endGroup();
+    }
+    listFilesByExtension(extension) {
+        return glob(external_path_default().join(this.rootDir, `**/*.${extension}`));
+    }
+    makeFileUrl(path) {
+        return "file://" + path;
+    }
+    getFileContent(path) {
+        return external_fs_default().readFileSync(path, {
+            encoding: "utf-8"
+        });
+    }
+    getLineAndColumn(pos, content) {
+        const before = content.slice(0, pos);
+        const line = before.split("\n").length;
+        const col = pos - before.lastIndexOf("\n");
+        return { line, col };
+    }
+    getErrorProperties(error, path, content) {
+        const { line: startLine, col: startColumn } = this.getLineAndColumn(error.range.start, content);
+        const { line: endLine, col: endColumn } = this.getLineAndColumn(error.range.end, content);
+        return {
+            file: path,
+            startLine, startColumn,
+            endLine, endColumn
+        };
+    }
+    async checkFile(path, lang) {
+        const url = this.makeFileUrl(path);
+        const content = this.getFileContent(path);
+        this.project.onDidOpen(url, lang, 0, content);
+        const docAndNode = this.project.getClientManaged(url);
+        if (!docAndNode) {
+            core.error(`File ${path} is not loaded`);
+            return false;
+        }
+        const { node } = docAndNode;
+        const errors = FileNode.getErrors(node);
+        if (errors.length !== 0) {
+            const msg = `${errors.length} error${errors.length > 1 ? "s" : ""} in ${path}`;
+            if (this.options.verbose) {
+                core.startGroup(msg);
+                for (const err of errors) {
+                    core.error(err.message, this.getErrorProperties(err, path, content));
+                }
+                core.endGroup();
+            }
+            else {
+                core.error(msg);
+            }
+            return false;
+        }
+        return true;
+    }
+    async checkAllFiles() {
+        const jsonFiles = await this.listFilesByExtension("json");
+        const funcFiles = await this.listFilesByExtension("mcfunction");
+        core.info("Files to check:" + "\n" +
+            `- JSON: ${jsonFiles.length}` + "\n" +
+            `- Function: ${funcFiles.length}`);
+        let success = true;
+        for (const jsonFile of jsonFiles) {
+            if (!this.checkFile(jsonFile, "json")) {
+                success = false;
+                if (!this.options.reportAllErrors) {
+                    return false;
+                }
+            }
+        }
+        for (const funcFile of funcFiles) {
+            if (!this.checkFile(funcFile, "mcfunction")) {
+                success = false;
+                if (!this.options.reportAllErrors) {
+                    return false;
+                }
+            }
+        }
+        return success;
+    }
+}
+async function checkDatapack(rootDir, version, reportAll, verbose) {
+    core.startGroup("Initialization");
+    const service = new CustomService(rootDir, version, {
+        reportAllErrors: reportAll,
+        verbose: verbose
+    });
+    await service.project.ready();
+    core.endGroup();
+    const success = await service.checkAllFiles();
+    if (!success) {
+        core.setFailed("Some files contain errors");
+    }
+    await service.shutdown();
 }
 
 ;// CONCATENATED MODULE: ./src/index.ts
@@ -27437,12 +87663,11 @@ async function checkDatapack(rootDir, version) {
 
 async function run() {
     try {
-        const rootDir = core.getInput("dir");
-        let version = core.getInput("version");
-        if (version === "") {
-            version = "auto";
-        }
-        await checkDatapack(rootDir, version);
+        const rootDir = core.getInput("rootDir");
+        const version = core.getInput("version");
+        const reportAll = core.getBooleanInput("reportAllErrors");
+        const verbose = core.getBooleanInput("verbose");
+        await checkDatapack(rootDir, version, reportAll, verbose);
     }
     catch (error) {
         if (error instanceof Error) {